From 9da511e5a11fc0d773f3a7f8f0db7a7a94badf28 Mon Sep 17 00:00:00 2001 From: Nati Tsegaye Date: Fri, 29 Nov 2024 18:02:58 +0400 Subject: [PATCH] 0.7.32 --- lib/RemoteCalibrator.min.js | 2 +- lib/RemoteCalibrator.min.js.LICENSE.txt | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/RemoteCalibrator.min.js b/lib/RemoteCalibrator.min.js index 9bd3a4f..c64de95 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:()=>i});var s=n(9199);const r=(e,t,{go:n,cancel:r,custom:i},a,o=!0)=>{const l=document.createElement("div");let c,u,h;if(l.className="rc-buttons"+(o?" rc-absolute-buttons":""),l.id="rc-buttons",n&&(c=document.createElement("button"),c.className="rc-button rc-go-button",c.onclick=n,c.innerHTML=s.H.RC_ok[e],l.appendChild(c)),r&&a&&(u=document.createElement("button"),u.className="rc-button rc-cancel-button",u.onclick=r,u.innerHTML=s.H.RC_cancel[e],l.appendChild(u)),i){const{callback:e,content:t}=i;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,c,u,h]},i=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=Number.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(const t of e.children)t.remove();e.remove(),(0,_utils__WEBPACK_IMPORTED_MODULE_2__.nB)(t)},validInput=e=>e.length>0&&!e.includes(" ")&&(!Number.isNaN(e)||!Number.isNaN(e.replace(",","."))),validInputInteger=e=>!!validInput(e)&&(Number.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:()=>i,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 i(e,t="keydown"){document.body.removeEventListener(t,e)}},2646:(e,t,n)=>{"use strict";n.d(t,{G:()=>a,t:()=>r});var s=n(9199);function r(e){const t=Object.keys(s.H.EE_languageNameNative);if(t.includes(e))return i(e);const n=[];t.map((e=>{n.push(e.split("-")[0])}));const r=e.split("-")[0].toLowerCase();return n.includes(r)?i(t[n.indexOf(r)]):i("en-US")}function i(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 a(e){return"1"===s.H.EE_languageUseSpace[e]?" ":""}},477:(e,t,n)=>{"use strict";n.d(t,{l:()=>c});const s="mocha"===n(7786)._;let r,i;if(!s){const e=n(9171);r=e.Synth,i=e.Volume}class a{triggerAttackRelease(){}}const o=s?new a:new r({oscillator:{type:"sine"},envelope:{attack:.001,decay:.001,sustain:1,release:.001}}).connect(new i(-17).toDestination()),l=s?new a:new r({oscillator:{type:"sine"}}).connect(new i(-5).toDestination()),c=(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";n.d(t,{$O:()=>h,$k:()=>x,AU:()=>d,Av:()=>v,DW:()=>m,Ew:()=>p,G8:()=>w,JZ:()=>b,KY:()=>C,Md:()=>a,Nh:()=>y,Sf:()=>l,aS:()=>u,k4:()=>g,ll:()=>f,ln:()=>A,nB:()=>i,yy:()=>o});var s=n(4284),r=(n(8840),n(9199));function i(e,...t){if(e&&"function"==typeof e)return t.length?e(...t):e()}!function(){let e=0;const t=["ms","moz","webkit","o"];for(let e=0;e{};function o(e){return new Promise((t=>setTimeout(t,e)))}async function l(e="en-US",t=null){if(u())return!0;if(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)try{return await c()}catch(n){let i=!1;return t&&(t.disableKeypadHandler=!0),await s.A.fire({html:r.H.EE_FullScreenOk[e],confirmButtonText:"OK",preConfirm:async()=>{i=await c()}}),t&&(t.disableKeypadHandler=!1),i}return!1}const c=async()=>{const e=document.documentElement;return e.requestFullscreen?(await e.requestFullscreen(),!0):e.mozRequestFullScreen?(await e.mozRequestFullScreen(),!0):e.webkitRequestFullscreen?(await e.webkitRequestFullscreen(),!0):!!e.msRequestFullscreen&&(await e.msRequestFullscreen(),!0)};function u(){return null!=document.fullscreenElement||null!=document.webkitFullscreenElement||null!=document.mozFullScreenElement||null!=document.msFullscreenElement}function h(e,t=null,n=!1,s="",r=null,i=null){return`

${e}

${i?"

"+i+"

":""}${t?`

${t}

`:""}`}function d(e,t,n){return en?n:e}function p(e,t,n,s,r){return s+1*(e-t)/(n-t)*(r-s)}function f(e,t,n,s){return Math.sqrt((e-n)**2+(t-s)**2)}function m(e){return e&&!(e&e-1)}function g(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 y(e,t){const n=10**t;return Math.round(e*n)/n}const b=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},w=e=>e.reduce(((e,t)=>e+t))/e.length;function v(e,t,n=1){let s=0,r=0;for(;0===s;)s=Math.random();for(;0===r;)r=Math.random();let i=Math.sqrt(-2*Math.log(s))*Math.cos(2*Math.PI*r);return i=i/10+.5,i>1||i<0?i=v(e,t,n):(i=i**n,i*=t-e,i+=e),i}const A=e=>JSON.parse(JSON.stringify(e));function x(){"activeElement"in document&&document.activeElement.blur()}const C=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}}},7786:(e,t,n)=>{"use strict";n.d(t,{A:()=>w,_:()=>y});var s=n(7503),r=n.n(s),i=n(115),a=n.n(i);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"],c=["blue","bronze","fire","forest","gold","gray","green","navy","purple","red","silver","sky","yellow","neon","black","white","brown","aqua"];function u(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(u(o))+h(u(c))+h(u(l))+e.substring(e.length-3)}var p=n(782),f=n(9043),m=n(2646),g=n(9199);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._initializing=!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,needEasyEyesKeypadBeyondCm: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},this.viewingDistanceAllowedPreciseBool=!0,this.keypadHandler=null}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;const n=e[e.length-1];return t?{value:n.value[t],timestamp:n.timestamp}:n}get version(){return{value:"0.7.31"}}get supportedLanguages(){const e=[];for(const 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&&a()((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=void 0,n={easyEyesKeypadHandler:null}){if(!this._initialized&&!this._initializing){this._initializing=!0;const s=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@latest/src/i18n/phrases.js");Object.assign(g.H,t),e&&Object.assign(g.H,e)})(s.languagePhrasesJSON),s.fullscreen&&!p.Y&&await(0,f.Sf)(this.language.value,this),this._id={value:s.id,timestamp:performance.now(),date:new Date},this._environment(!0),this._displaySize(!0),this._CONST.S.AUTO===s.language?this.newLanguageData=(0,m.t)(this.userLanguage.value):this.newLanguageData=(0,m.t)(s.language),this._lang=this.language.value,this._initializing=!1,this._initialized=!0,n?.easyEyesKeypadHandler&&(this.keypadHandler=n.easyEyesKeypadHandler,this.disableKeypadHandler=!1),(0,f.nB)(t,this._id)}},b.prototype._environment=function(e=!1){if(e||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=async function(e=!0){try{if((0,f.aS)())return!0;this.newFullscreenData={value:(e&&p.Y,await(0,f.Sf)(this.language.value,this)),timestamp:performance.now()},this.isMobile.value&&window.scrollBy(0,1)}catch(e){}return 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(){const 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){const n=this.background.getElementsByClassName("calibration-instruction");for(let e=0;e{"use strict";n.d(t,{Y:()=>s});const s=!1},8840:(e,t,n)=>{"use strict"},9199:(e,t,n)=>{"use strict";n.d(t,{H:()=>r});const s=["en-US","ar","hy","bg","zh-CN","zh-HK","hr","cs","da","nl","en-UK","fi","fr","de","el","he","hi","hu","is","id","it","ja","kn","ko","lt","ms","ml","no","fa","pl","pt","ro","ru","sr","es","sw","sv","tl","tr","ur"],r={};["EE_languageNameEnglish","EE_languageNameNative","EE_languageDirection","EE_languageUseSpace","EE_phraseSource","EE_FullScreenOk","RC_cancel","RC_distanceTracking","RC_distanceTrackingCloseL","RC_distanceTrackingCloseR","RC_distanceTrackingGuide","RC_distanceTrackingIntroEnd","RC_distanceTrackingIntroStart","RC_distanceTrackingMoveCloser","RC_distanceTrackingMoveFurther","RC_rulerUnit","RC_howLong","RC_produceDistanceTitle1","RC_produceDistanceTitle2","RC_produceDistanceTitle","RC_produceDistance","RC_TestDistances","RC_canUsePhoneKeypad","RC_distanceTrackingRedo","RC_distanceTrackingTitle","RC_errorCameraUseDenied","RC_errorNoCamera","RC_gazeTracking","RC_gazeTrackingIntro","RC_gazeTrackingNudge","RC_gazeTrackingTitle","RC_nearPointIntro","RC_nearPointTitle","RC_ok","RC_panelButton","RC_panelIntro","RC_panelTitle","RC_panelTitleNext","RC_panelIntroNext","RC_panelUsesWebcam","RC_panelUsesWebcamPhone","RC_performance","RC_performanceIntro","RC_performanceTitle","RC_privacyCamera","RC_requestCamera","RC_screenSize","RC_screenSizeCredit","RC_screenSizeCreditCard","RC_screenSizeHave","RC_screenSizeIntro","RC_screenSizeTitle","RC_screenSizeUSBA","RC_screenSizeUSBC","RC_starting","RC_viewingBlindSpotCredit","RC_viewingBlindSpotRejected","RC_viewingDistance","RC_viewingDistanceIntroTitle","RC_viewingDistanceIntroLiMethod","RC_viewingDistanceTitle","T_proceed"].map((e=>{r[e]={},s.map((t=>{r[e][t]=""}))}))},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 i=[];for(const t of n){const n=t.name?t.name:t,s=document.createElement("div");s.className="rc-panel-debug-control-task-row",s.id=`rc-debugger-row-${n}`;const a=e._debuggerDefault[n];if(a){r.innerHTML+=`

${n}

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

${t}

\n
`,_wrapValues=(e,t)=>{for(const 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(const 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),i=n(6314),a=n.n(i)()(r());a.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=a},2636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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=a},7271:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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=a},2551:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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=a},8470:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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):where(.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):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.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):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.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):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px hsla(208,8%,47%,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{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-visible{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:0;overflow:auto;padding:1em 1.6em .3em;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,.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,.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.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/_body.scss","webpack://./node_modules/sweetalert2/src/scss/_toasts-body.scss"],names:[],mappings:"AACE,yBAOE,eCNU,CDOV,sJCuOF,CD9OE,qBAAA,CACA,yBAAA,CACA,sBAAA,CACA,kDAAA,CAEA,iBAAA,CADA,WCqPkB,CDjPlB,kBAAA,CAEA,2BACE,aAAA,CAGF,sCAGE,aC2OwB,CD7OxB,eC2OqB,CD1OrB,SC2OsB,CDzOtB,kBAAA,CAGF,wCACE,sBAAA,CAGF,sCAGE,aCuOwB,CDzOxB,UCuOqB,CDtOrB,WCwOwB,CDpO1B,mDACE,aCoO6B,CDjO/B,uCAGE,cCkOyB,CDpOzB,eCkOsB,CDjOt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GF,IACE,yBAAA,CAGF,GACE,yBAAA,CAAA,CAKJ,sCACE,GACE,kBAAA,CAEA,SAAA,CADA,mBACA,CAGF,IACE,kBAAA,CAEA,SAAA,CADA,mBACA,CAGF,IACE,kBAAA,CACA,qBAAA,CAGF,GACE,YAAA,CAEA,SAAA,CADA,kBACA,CAAA,CAIJ,oCACE,GAEE,SAAA,CADA,yBACA,CAGF,GAEE,SAAA,CADA,uBACA,CAAA,CAIJ,gCACE,GACE,sBAAA,CAGF,GACE,uBAAA,CAAA,CAKJ,uCACE,GACE,yBAAA,CAGF,GACE,oBAAA,CAAA,CAKJ,gCACE,GAEE,SAAA,CADA,uBACA,CAGF,IAEE,UAAA,CADA,wBACA,CAGF,IAEE,UAAA,CADA,uBACA,CAGF,IAEE,SAAA,CADA,uBACA,CAGF,GAEE,SAAA,CADA,oBACA,CAAA,CC/LF,4DACE,eAAA,CAGF,uBACE,qBAAA,CAIA,wCACE,sCAAA,CACA,mBAAA,CAEA,qDACE,kBAAA,CAGF,qDACE,kCAAA,CAKN,aACE,4DACE,2BAAA,CAEA,+EACE,YAAA,CAGF,6EACE,yBAAA,CAAA,CCjCJ,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",sourceRoot:""}]);const o=a},663:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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",sourceRoot:""}]);const o=a},290:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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",sourceRoot:""}]);const o=a},2945:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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;text-align:justify}#rc-distance-correct #rc-distance-correct-guide{font-size:3rem;font-weight:500;line-height:300%;text-align:justify}#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,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use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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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AAA,CADA,SACA,CAIJ,8BAEE,YAAA,CADA,OACA,CAKF,kCAME,mCAAA,CAFA,qBAAA,CACA,iBAAA,CAHA,eAAA,CAKA,eAAA,CAJA,aAIA,CAEA,oCACE,aAAA,CAGF,8GAGE,kBAAA,CAGF,qCAEE,0BAAA,CADA,yBACA,CAGF,qCAEE,eAAA,CADA,uBAAA,CAEA,eAAA,CAEA,oBAAA,CADA,iBACA,CAGF,4DACE,wBAAA,CACA,eAAA,CAGF,+DAIE,qBAAA,CAGA,WAAA,CADA,iBAAA,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",sourceRoot:""}]);const o=a},5151:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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",sourceRoot:""}]);const o=a},5319:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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",sourceRoot:""}]);const o=a},4889:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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",sourceRoot:""}]);const o=a},9057:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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=a},9725:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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-trackDistance-check-progessBar-container{background-color:#f3f3f3;bottom:0;height:40px;left:0;position:fixed;width:100%;z-index:999999999999}.calibration-trackDistance-check-progessBar{background-color:#4caf50;height:100%;transition:width .3s ease;width:0}.calibration-trackDistance-check-progessBar-text{color:#000;font-size:30px;left:2%;margin:0;position:absolute;top:1%}.calibration-trackDistance-check-viewingDistance-container{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;line-height:1;max-width:50%;min-width:50%;position:fixed;right:0;top:0;z-index:999999999999}.calibration-trackDistance-check-viewingDistance{font-size:60vh;margin:0;text-align:center}.calibration-trackDistance-check-viewingDistance-units{font-size:30vh;margin:0;text-align:center}.calibration-instruction-left{bottom:0;left:0;margin:auto;right:50%;top:0}.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,sDAME,wBAAyB,CAJzB,QAAS,CAGT,WAAY,CAFZ,MAAO,CAFP,cAAe,CAGf,UAAW,CAGX,oBACF,CAEA,4CAGE,wBAAyB,CAFzB,WAAY,CAGZ,yBAA2B,CAF3B,OAGF,CAEA,iDAKE,UAAW,CACX,cAAe,CAHf,OAAQ,CAIR,QAAS,CANT,iBAAkB,CAClB,MAMF,CACA,2DASE,kBAAmB,CAFnB,YAAa,CACb,qBAAsB,CAFtB,WAAY,CAIZ,sBAAuB,CAEvB,aAAc,CARd,aAAc,CACd,aAAc,CAJd,cAAe,CAEf,OAAQ,CADR,KAAM,CASN,oBAEF,CACA,iDACE,cAAe,CACf,QAAS,CACT,iBACF,CACA,uDACE,cAAe,CACf,QAAS,CACT,iBACF,CAEA,8BAKE,QAAS,CAHT,MAAO,CAIP,WAAY,CAHZ,SAAU,CACV,KAGF,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-trackDistance-check-progessBar-container {\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 40px;\n background-color: #f3f3f3;\n z-index: 999999999999;\n}\n\n.calibration-trackDistance-check-progessBar {\n height: 100%;\n width: 0%;\n background-color: #4caf50;\n transition: width 0.3s ease;\n}\n\n.calibration-trackDistance-check-progessBar-text {\n position: absolute;\n top: 1%;\n left: 2%;\n /* transform: translate(-50%, -80%); */\n color: #000;\n font-size: 30px;\n margin: 0;\n}\n.calibration-trackDistance-check-viewingDistance-container {\n position: fixed;\n top: 0;\n right: 0;\n max-width: 50%;\n min-width: 50%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 999999999999;\n line-height: 1;\n}\n.calibration-trackDistance-check-viewingDistance {\n font-size: 60vh;\n margin: 0;\n text-align: center;\n}\n.calibration-trackDistance-check-viewingDistance-units {\n font-size: 30vh;\n margin: 0;\n text-align: center;\n}\n\n.calibration-instruction-left {\n /* use only the left half of the screen */\n left: 0;\n right: 50%;\n top: 0;\n bottom: 0;\n margin: auto;\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=a},2535:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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}#custom-radio-group{align-items:center;display:flex;flex-direction:row}#custom-radio-group label{display:flex;flex-direction:row;margin-right:25px}#custom-radio-group input{margin-right:5px;width:auto}","",{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,CAEA,oBAGE,kBAAmB,CAFnB,YAAa,CACb,kBAEF,CAEA,0BAEE,YAAa,CACb,kBAAmB,CAFnB,iBAGF,CAGA,0BAEE,gBAAiB,CADjB,UAEF",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\n#custom-radio-group {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n#custom-radio-group label {\n margin-right: 25px;\n display: flex;\n flex-direction: row;\n}\n\n/* input inside the label */\n#custom-radio-group input {\n width: auto;\n margin-right: 5px;\n}\n"],sourceRoot:""}]);const o=a},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,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(s)for(var o=0;o0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),t.push(u))}},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),i="/*# ".concat(r," */");return[t].concat([i]).join("\n")}return[t].join("\n")}},7158:function(e){var t=function(){"use strict";var e,t,n,s,r,i,a,o,l,c,u,h,d,p,f,m,g,y,b,w,v,A,x,C="leader-line",k=1,S=2,E=3,_=4,T={top:k,right:S,bottom:E,left:_},I=1,N=2,O=3,D=4,R=5,M={straight:I,arc:N,fluid:O,magnet:D,grid:R},F="behind",B=C+"-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=[k,S,E,_],G="auto",U={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,ie=!(ne||re||!window.chrome||!window.CSS),ae=!(ne||se||re||ie||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]},ce=(v={}.toString,A={}.hasOwnProperty.toString,x=A.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&&A.call(n)===x)}),ue=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,i,a){var o,l,c,u,h,d,m,g,y,v,A,x,C,k=++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,c=e.Symbol?e.Symbol():"__cachedPathData",u=e.Symbol?e.Symbol():"__cachedNormalizedPathData",h=function(e,t,n,s,r,i,a,o,l,c){function u(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,A,x,C,k,S,E,_=(d=a,Math.PI*d/180),T=[];c?(S=c[0],E=c[1],C=c[2],k=c[3]):(e=(p=u(e,t,-_)).x,t=p.y,1<(y=(m=(e-(n=(f=u(n,s,-_)).x))/2)*m/(r*r)+(g=(t-(s=f.y))/2)*g/(i*i))&&(r*=y=Math.sqrt(y),i*=y),v=(b=r*r)*(w=i*i)-b*g*g-w*m*m,A=b*g*g+w*m*m,C=(x=(o===l?-1:1)*Math.sqrt(Math.abs(v/A)))*r*g/i+(e+n)/2,k=x*-i*m/r+(t+s)/2,S=Math.asin(parseFloat(((t-k)/i).toFixed(9))),E=Math.asin(parseFloat(((s-k)/i).toFixed(9))),e120*Math.PI/180&&(I=E,N=n,O=s,E=l&&S=n.duration&&n.count&&n.loopsLeft<=1)return i=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(i.value,!0,i.timeRatio,i.outputRatio),void(n.framesStart=null);if(s>n.duration){if(r=Math.floor(s/n.duration),n.count){if(r>=n.loopsLeft)return i=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(i.value,!0,i.timeRatio,i.outputRatio),void(n.framesStart=null);n.loopsLeft-=r}n.framesStart+=n.duration*r,s=e-n.framesStart}n.reverse&&(s=n.duration-s),i=n.frames[n.lastFrame=Math.round(s/f)],!1!==n.frameCallback(i.value,!1,i.timeRatio,i.outputRatio)?t=!0:n.framesStart=null}})),t&&(d=m.call(window,Ce))}function ke(e,t){e.framesStart=Date.now(),null!=t&&(e.framesStart-=e.duration*(e.reverse?1-t:t)),e.loopsLeft=e.count,e.lastFrame=null,Ce()}function Se(e,t){var n,s;return typeof e!=typeof t||(n=ce(e)?"obj":Array.isArray(e)?"array":"")!=(ce(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?ce(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,i=e=(e+"").trim();function a(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:k))}))),A.position_path!==x.position_path||A.position_lineStrokeWidth!==x.position_lineStrokeWidth||[0,1].some((function(e){return A.position_plugOverheadSE[e]!==x.position_plugOverheadSE[e]||(i=C[e],a=x.position_socketXYSE[e],i.x!==a.x||i.y!==a.y||i.socketId!==a.socketId)||(n=t[e],s=x.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,i,a}))){switch(e.pathList.baseVal=s=[],e.pathList.animVal=null,A.position_path){case I:s.push([F(C[0]),F(C[1])]);break;case N:d="number"==typeof t[0]&&0j?(A.position_lineStrokeWidth-j)*H:0),e.socketId===k?((i=(e.y-n.y)/2)=t.x:t.dirId===i?e.y>=t.y:e.x<=t.x}function p(e,t){return t.dirId===n||t.dirId===i?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],c[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],c[t]);rZ&&(l[i]-eZ&&(l[i]-es.outlineMax&&(t=s.outlineMax),t*=2*s.outlineBase,A=Xe(b,v.plugOutline_strokeWidthSE,e,t)||A,A=Xe(b,v.plugOutline_inStrokeWidthSE,e,v.plugOutline_colorTraSE[e]?t-oe/(v.line_strokeWidth/le.lineSize)/w.plugSizeSE[e]*2:t/2)||A)})),A)),(n.faces||he.line||he.plug||he.lineOutline||he.plugOutline)&&(he.faces=(k=(x=t).curStats,S=x.aplStats,E=x.events,_=!1,!k.line_altColor&&Xe(x,S,"line_color",C=k.line_color,E.apl_line_color)&&(x.lineFace.style.stroke=C,_=!0),Xe(x,S,"line_strokeWidth",C=k.line_strokeWidth,E.apl_line_strokeWidth)&&(x.lineShape.style.strokeWidth=C+"px",_=!0,(re||se)&&(qe(x,x.lineShape),se&&(qe(x,x.lineFace),qe(x,x.lineMaskCaps)))),Xe(x,S,"lineOutline_enabled",C=k.lineOutline_enabled,E.apl_lineOutline_enabled)&&(x.lineOutlineFace.style.display=C?"inline":"none",_=!0),k.lineOutline_enabled&&(Xe(x,S,"lineOutline_color",C=k.lineOutline_color,E.apl_lineOutline_color)&&(x.lineOutlineFace.style.stroke=C,_=!0),Xe(x,S,"lineOutline_strokeWidth",C=k.lineOutline_strokeWidth,E.apl_lineOutline_strokeWidth)&&(x.lineOutlineMaskShape.style.strokeWidth=C+"px",_=!0,se&&(qe(x,x.lineOutlineMaskCaps),qe(x,x.lineOutlineFace))),Xe(x,S,"lineOutline_inStrokeWidth",C=k.lineOutline_inStrokeWidth,E.apl_lineOutline_inStrokeWidth)&&(x.lineMaskShape.style.strokeWidth=C+"px",_=!0,se&&(qe(x,x.lineOutlineMaskCaps),qe(x,x.lineOutlineFace)))),Xe(x,S,"plug_enabled",C=k.plug_enabled,E.apl_plug_enabled)&&(x.plugsFace.style.display=C?"inline":"none",_=!0),k.plug_enabled&&[0,1].forEach((function(e){var t=k.plug_plugSE[e],n=t!==F?L[V[t]]:null,s=$e(e,n);Xe(x,S.plug_enabledSE,e,C=k.plug_enabledSE[e],E.apl_plug_enabledSE)&&(x.plugsFace.style[s.prop]=C?"url(#"+x.plugMarkerIdSE[e]+")":"none",_=!0),k.plug_enabledSE[e]&&(Xe(x,S.plug_plugSE,e,t,E.apl_plug_plugSE)&&(x.plugFaceSE[e].href.baseVal="#"+n.elmId,He(x,x.plugMarkerSE[e],s.orient,n.bBox,x.svg,x.plugMarkerShapeSE[e],x.plugsFace),_=!0,re&&qe(x,x.plugsFace)),Xe(x,S.plug_colorSE,e,C=k.plug_colorSE[e],E.apl_plug_colorSE)&&(x.plugFaceSE[e].style.fill=C,_=!0,(ie||ae||se)&&!k.line_colorTra&&qe(x,se?x.lineMaskCaps:x.capsMaskLine)),["markerWidth","markerHeight"].forEach((function(t){var n="plug_"+t+"SE";Xe(x,S[n],e,C=k[n][e],E["apl_"+n])&&(x.plugMarkerSE[e][t].baseVal.value=C,_=!0)})),Xe(x,S.plugOutline_enabledSE,e,C=k.plugOutline_enabledSE[e],E.apl_plugOutline_enabledSE)&&(C?(x.plugFaceSE[e].style.mask="url(#"+x.plugMaskIdSE[e]+")",x.plugOutlineFaceSE[e].style.display="inline"):(x.plugFaceSE[e].style.mask="none",x.plugOutlineFaceSE[e].style.display="none"),_=!0),k.plugOutline_enabledSE[e]&&(Xe(x,S.plugOutline_plugSE,e,t,E.apl_plugOutline_plugSE)&&(x.plugOutlineFaceSE[e].href.baseVal=x.plugMaskShapeSE[e].href.baseVal=x.plugOutlineMaskShapeSE[e].href.baseVal="#"+n.elmId,[x.plugMaskSE[e],x.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(x,S.plugOutline_colorSE,e,C=k.plugOutline_colorSE[e],E.apl_plugOutline_colorSE)&&(x.plugOutlineFaceSE[e].style.fill=C,_=!0,se&&(qe(x,x.lineMaskCaps),qe(x,x.lineOutlineMaskCaps))),Xe(x,S.plugOutline_strokeWidthSE,e,C=k.plugOutline_strokeWidthSE[e],E.apl_plugOutline_strokeWidthSE)&&(x.plugOutlineMaskShapeSE[e].style.strokeWidth=C+"px",_=!0),Xe(x,S.plugOutline_inStrokeWidthSE,e,C=k.plugOutline_inStrokeWidthSE[e],E.apl_plugOutline_inStrokeWidthSE)&&(x.plugMaskShapeSE[e].style.strokeWidth=C+"px",_=!0)))})),_)),(n.position||he.line||he.plug)&&(he.position=Qe(t)),(n.path||he.position)&&(he.path=(N=(T=t).curStats,O=T.aplStats,D=T.pathList.animVal||T.pathList.baseVal,R=N.path_edge,M=!1,D&&(R.x1=R.x2=D[0][0].x,R.y1=R.y2=D[0][0].y,N.path_pathData=I=Le(D,(function(e){e.xR.x2&&(R.x2=e.x),e.y>R.y2&&(R.y2=e.y)})),Ve(I,O.path_pathData)&&(T.linePath.setPathData(I),O.path_pathData=I,M=!0,se?(qe(T,T.plugsFace),qe(T,T.lineMaskCaps)):re&&qe(T,T.linePath),T.events.apl_path&&T.events.apl_path.forEach((function(e){e(T,I)})))),M)),he.viewBox=(z=(B=t).curStats,P=B.aplStats,W=z.path_edge,G=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)})),G.x=z.lineMask_x=z.lineOutlineMask_x=z.maskBGRect_x=X.x1,G.y=z.lineMask_y=z.lineOutlineMask_y=z.maskBGRect_y=X.y1,G.width=X.x2-X.x1,G.height=X.y2-X.y1,["x","y","width","height"].forEach((function(e){var t;(t=G[e])!==q[e]&&(j[e]=q[e]=t,H[U[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,ae&&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,ae&&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,ae&&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&&(ce=(te=t).curStats,ue=te.aplStats,Object.keys(e).forEach((function(t){var n=e[t],s=t+"_enabled",r=t+"_options",i=ce[r];Xe(te,ue,s,ne=ce[s])?(ne&&(ue[r]=Ee(i)),n[ne?"init":"remove"](te)):ne&&Se(i,ue[r])&&(n.remove(te),ue[s]=!0,ue[r]=Ee(i),n.init(te))}))),(ie||ae)&&he.line&&!he.path&&qe(t,t.lineShape),ie&&he.plug&&!he.line&&qe(t,t.plugsFace),je(t)}function tt(e,t){return{duration:ue(e.duration)&&0t.x2&&(t.x2=s.x2),s.y2>t.y2&&(t.y2=s.y2),["x","y"].forEach((function(n){var s,a="dropShadow_"+n;r[a]=s=t[n+"1"],Xe(e,i,a,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,i=e.pathList.baseVal,a=Pe(i),o=a.segsLen,l=a.lenAll;s.show_animId&&he.remove(s.show_animId),s.show_animId=he.add((function(e){var t,n,s,r,a=-1;if(0===e)n=[[i[0][0],i[0][0]]];else if(1===e)n=i;else{for(t=l*e,n=[];t>=o[++a];)n.push(i[a]),t-=o[a];t&&(2===(s=i[a]).length?n.push([s[0],Re(s[0],s[1],t/o[a])]):(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){Ge(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(at.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?G:Ee(e)},set:ot(t),enumerable:!0})})),[["path",M],["startSocket",T,"socketSE",0],["endSocket",T,"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(at.prototype,t,{get:function(){var e,i=null!=r?be[this._id].options[s][r]:s?be[this._id].options[s]:be[this._id].options[t];return i?Object.keys(n).some((function(t){return n[t]===i&&(e=t,!0)}))?e:new Error("It's broken"):G},set:ot(t),enumerable:!0})})),Object.keys(e).forEach((function(t){var n=e[t];Object.defineProperty(at.prototype,t,{get:function(){var e,s,r=be[this._id].options[t];return ce(r)?(e=r,s=n.optionsConf.reduce((function(t,n){var s,r=n[0],i=n[1],a=n[2],o=n[3],l=n[4],c=null!=l?e[o][l]:o?e[o]:e[i];return t[i]="id"===r?c?Object.keys(a).some((function(e){return a[e]===c&&(s=e,!0)}))?s:new Error("It's broken"):G:null==c?G:Ee(c),t}),{}),n.anim&&(s.animation=Ee(e.animation)),s):r},set:ot(t),enumerable:!0})})),["startLabel","endLabel","middleLabel"].forEach((function(e,t){Object.defineProperty(at.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})})),at.prototype.setOptions=function(e){return it(be[this._id],e),this},at.prototype.position=function(){return et(be[this._id],{position:!0}),this},at.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]},at.prototype.show=function(e,t){return nt(be[this._id],!0,e,t),this},at.prototype.hide=function(e,t){return nt(be[this._id],!1,e,t),this},i=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)})),Ue((function(){var t=ve[e._id];t&&i(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:Te}],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,i={},a=e.element,o=r.options.anchorSE["start"===t.optionName?1:0];a===o&&(a=o===document.body?new s(n.pointAnchor,[a]):document.body),i[t.optionName]=a,it(r,i)},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 ue(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(!Te(e))throw new Error("`element` must be Element");return e}},areaAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Te},{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,i,a=[];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()),ue(t.size)&&0<=t.size&&(e.size=t.size),t.dash&&(e.dash=!0,ue(t.dash.len)&&0s.right&&(s.right=n),is.bottom&&(s.bottom=i)):s={left:n,right:n,top:i,bottom:i},r?R.pathListRel.push([r,{x:n,y:i}]):R.pathListRel=[],r={x:n,y:i}})),R.pathListRel.push([]),i=R.strokeWidth/2,a=[{x:s.left-i,y:s.top-i},{x:s.right+i,y:s.bottom+i}],R.bBoxRel={left:a[0].x,top:a[0].y,right:a[1].x,bottom:a[1].y,width:a[1].x-a[0].x,height:a[1].y-a[0].y}}B.pathListRel=B.bBoxRel=!0}return(B.pathListRel||B.elementLeft||B.elementTop)&&(R.pathData=Le(R.pathListRel,(function(e){e.x+=t.left,e.y+=t.top}))),Xe(e,M,"strokeWidth",n=R.strokeWidth)&&(e.path.style.strokeWidth=n+"px"),Ve(n=R.pathData,M.pathData)&&(e.path.setPathData(n),M.pathData=n,B.pathData=!0),e.dash&&(!B.pathData&&(!B.strokeWidth||e.dashLen&&e.dashGap)||(R.dashLen=e.dashLen||2*R.strokeWidth,R.dashGap=e.dashGap||R.strokeWidth),B.dash=Xe(e,M,"dashLen",R.dashLen)||B.dash,B.dash=Xe(e,M,"dashGap",R.dashGap)||B.dash,B.dash&&(e.path.style.strokeDasharray=M.dashLen+","+M.dashGap)),I=R.viewBoxBBox,N=M.viewBoxBBox,O=e.svg.viewBox.baseVal,D=e.svg.style,I.x=R.bBoxRel.left+t.left,I.y=R.bBoxRel.top+t.top,I.width=R.bBoxRel.width,I.height=R.bBoxRel.height,["x","y","width","height"].forEach((function(t){(n=I[t])!==N[t]&&(O[t]=N[t]=n,D[U[t]]=n+("x"===t||"y"===t?e.bodyOffset[t]:0)+"px")})),B.strokeWidth||B.pathListRel||B.bBoxRel}},mouseHoverAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Te},{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,i,a,o,l,c,u,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 i,a,o,c,u,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?(a=t.createElementNS(te,"defs"),h.id=s,a.appendChild(h),(c=(i=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(o=i.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(u=c.style).strokeLinejoin="round",{elmPosition:h,styleText:h.style,styleFill:o.style,styleStroke:u,styleShow:i.style,elmsAppend:[a,i]}):(u=h.style,r&&(u.strokeLinejoin="round",u.paintOrder="stroke"),{elmPosition:h,styleText:u,styleFill:u,styleStroke:r?u:null,styleShow:u,elmsAppend:[h]})},getMidPoint:function(e,t){var n,s,r=Pe(e),i=r.segsLen,a=r.lenAll,o=-1,l=a/2+(t||0);if(l<=0)return 2===(n=e[0]).length?Re(n[0],n[1],0):Fe(n[0],n[1],n[2],n[3],0);if(a<=l)return 2===(n=e[e.length-1]).length?Re(n[0],n[1],1):Fe(n[0],n[1],n[2],n[3],1);for(s=[];l>i[++o];)s.push(e[o]),l-=i[o];return 2===(n=e[o]).length?Re(n[0],n[1],l/i[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,i=n.captionLabel.newText(e.text,t.baseWindow.document,t.svg,C+"-captionLabel-"+e._id,e.outlineColor);["elmPosition","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=i[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(i.styleText[t]=e[t])})),i.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),s=i.elmPosition.getBBox(),e.width=s.width,e.height=s.height,e.outlineColor&&(r=10<(r=s.height/9)?10:r<2?2:r,i.styleStroke.strokeWidth=r+"px",i.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),ae&&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),ae&&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||Ge(s,"cur_line_color",e.updateColor),e.refSocketXY?(Ge(s,"apl_position",e.updateSocketXY),e.offset||(Ge(s,"cur_attach_plugSideLenSE",e.updateSocketXY),Ge(s,"cur_line_strokeWidth",e.updateSocketXY))):Ge(s,"apl_path",e.updatePath),Ge(s,"svgShow",e.updateShow),ae&&(Ge(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",it(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",ue(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,i=e.aplStats,a=t.curStats,o=t.pathList.animVal||t.pathList.baseVal;o&&(r.pathData=s=n.pathLabel.getOffsetPathData(o,a.line_strokeWidth/2+e.strokeWidth/2+e.height/4,1.25*e.height),Ve(s,i.pathData)&&(e.elmPath.setPathData(s),i.pathData=s,e.bBox=e.elmPosition.getBBox(),e.updateStartOffset(t)))},e.updateStartOffset=function(t){var n,s,r,i,a=e.curStats,o=e.aplStats,l=t.curStats;a.pathData&&(2===e.semIndex&&!e.lineOffset||(r=a.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+=De(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),i=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,i=(i+=0===e.semIndex?n:-n)<0?0:rt?((r=s.points)[1]=Me(r[0],r[1],-t),s.len=De(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=De(r[0],r[1])):(e.points=null,e.len=0)),e):null})),i.reduce((function(e,t){var n=t.points;return n&&(r&&a(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,i,a,o,c,u,h,d,p=t.createElementNS(te,"defs"),f=p.appendChild(t.createElementNS(te,"path"));return f.id=r=n+"-path",(o=(a=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 a.style),s&&!l?(a.id=i=n+"-text",p.appendChild(a),(h=(c=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+i,(u=c.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+i,(d=h.style).strokeLinejoin="round",{elmPosition:a,elmPath:f,elmOffset:o,styleText:a.style,styleFill:u.style,styleStroke:d,styleShow:c.style,elmsAppend:[p,c]}):(d=a.style,s&&(d.strokeLinejoin="round",d.paintOrder="stroke"),{elmPosition:a,elmPath:f,elmOffset:o,styleText:d,styleFill:d,styleStroke:s?d:null,styleShow:d,elmsAppend:[p,a]})},initSvg:function(e,t){var s,r,i=n.pathLabel.newText(e.text,t.baseWindow.document,C+"-pathLabel-"+e._id,e.outlineColor);["elmPosition","elmPath","elmOffset","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=i[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(i.styleText[t]=e[t])})),i.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),i.elmPath.setPathData([{type:"M",values:[0,100]},{type:"h",values:[100]}]),s=i.elmPosition.getBBox(),i.styleText.textAnchor=["start","end","middle"][e.semIndex],2!==e.semIndex||e.lineOffset||i.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,i.styleStroke.strokeWidth=r+"px",i.styleStroke.stroke=e.outlineColor),e.strokeWidth=r||0,Ke(e.aplStats,n.pathLabel.stats),e.updateColor(t),e.updatePath(t),e.updateStartOffset(t),ae&&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),ae&&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||Ge(s,"cur_line_color",e.updateColor),Ge(s,"cur_line_strokeWidth",e.updatePath),Ge(s,"apl_path",e.updatePath),2===e.semIndex&&!e.lineOffset||Ge(s,"cur_attach_plugBackLenSE",e.updateStartOffset),Ge(s,"svgShow",e.updateShow),ae&&(Ge(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",it(n,s)},remove:function(e){e.boundTargets.length&&e.boundTargets.forEach((function(t){n.pathLabel.unbind(e,t)}))}}},Object.keys(n).forEach((function(e){at[e]=function(){return new s(n[e],Array.prototype.slice.call(arguments))}})),at.positionByWindowResize=!0,window.addEventListener("resize",pe.add((function(){at.positionByWindowResize&&Object.keys(be).forEach((function(e){et(be[e],{position:!0})}))})),!1),at}();e.exports=t},7503:function(e,t,n){var s;e=n.nmd(e),function(){"use strict";var r={function:!0,object:!0},i=r[typeof window]&&window||this,a=r[typeof t]&&t,o=r.object&&e&&!e.nodeType&&e,l=a&&o&&"object"==typeof n.g&&n.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(i=l);var c=Math.pow(2,53)-1,u=/\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<=c)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"==G?"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",G="Windows Phone "+(/\+$/.test(o)?o:o+".x"),M.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(P="IE Mobile",G="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!=(c=n)?typeof c[h]:"number",/^(?:boolean|number|string|undefined)$/.test(d)||"object"==d&&!c[h])y(o=n.runtime)==x?(P="Adobe AIR",G=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"],G="Windows");else if(E&&(R=(o=E.lang.System).getProperty("os.arch"),G=G||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",G||(G=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",R=o.arch,G=o.platform,z=(z=/[\d.]+/.exec(o.version))?z[0]:null));G=G&&m(G)}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?I:T)+(/\d+\+?/.exec(o)||"")),"Fennec"==P||"Firefox"==P&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(G))P="Firefox Mobile";else if("Maxthon"==P&&z)z=z.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(V))"Xbox 360"==V&&(G=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"!=G&&!/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)?(G=((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(G)||"IE"==P&&(G&&!/^Win/.test(G)&&z>5.5||/\bWindows XP\b/.test(G)&&z>8||8==z&&!/\bTrident\b/.test(t)))&&!u.test(o=e.call(g,t.replace(u,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),u.test(P)?(/\bIE\b/.test(o)&&"Mac OS"==G&&(G=null),o="identify"+o):(o="mask"+o,P=D?m(D.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(G=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(G))?(P+=" ",M.unshift("desktop mode"),"zvav"==o?(P+="Mini",z=null):P+="Mobile",G=G.replace(RegExp(" *"+o+"$"),"")):"Safari"==P&&/\bChrome\b/.exec(L&&L[1])?(M.unshift("desktop mode"),P="Chrome Mobile",z=null,/\bOS X\b/.test(G)?(W="Apple",G="iOS 4.3+"):G=null):/\bSRWare Iron\b/.test(P)&&!z&&(z=q("Chrome")),z&&0==z.indexOf(o=/[\d.]+$/.exec(G))&&t.indexOf("/"+o+"-")>-1&&(G=v(G.replace(o,""))),G&&-1!=G.indexOf(P)&&!RegExp(P+" OS").test(G)&&(G=G.replace(RegExp(" *"+b(P)+" *"),"")),L&&!/\b(?:Avant|Nook)\b/.test(P)&&(/Browser|Lunascape|Maxthon/.test(P)||"Safari"!=P&&/^iOS/.test(G)&&/\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),G&&(o=/ ([\d.+]+)$/.exec(G),l=o&&"/"==G.charAt(G.length-o[0].length-1),G={architecture:32,family:o&&!l?G.replace(o[0],""):G,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(R))&&!/\bi686\b/i.test(R)?(G&&(G.architecture=64,G.family=G.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")):G&&/^OS X/.test(G.family)&&"Chrome"==P&&parseFloat(z)>=39&&(G.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=G||{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),G&&P&&(G!=String(G).split(" ")[0]||G!=P.split(" ")[0]&&!V)&&M.push(V?"("+G+")":"on "+G),M.length&&(j.description=M.join(" ")),j}();i.platform=A,void 0===(s=function(){return A}.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 i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var o,l,c,u;if(Array.isArray(e)){if((o=e.length)!=a.length)return!1;for(l=o;0!=l--;)if(!i(e[l],a[l]))return!1;return!0}if(n&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!a.has(l.value[0]))return!1;for(u=e.entries();!(l=u.next()).done;)if(!i(l.value[1],a.get(l.value[0])))return!1;return!0}if(s&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!a.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((o=e.length)!=a.length)return!1;for(l=o;0!=l--;)if(e[l]!==a[l])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof a.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof a.toString)return e.toString()===a.toString();if((o=(c=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(l=o;0!=l--;)if(!Object.prototype.hasOwnProperty.call(a,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!=l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!i(e[c[l]],a[c[l]]))return!1;return!0}return e!=e&&a!=a}e.exports=function(e,t){try{return i(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 i=n.sourceMap;i&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),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=''},4284:(e,t,n)=>{"use strict";function s(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 r(e,t){return e.get(s(e,t))}function i(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}n.d(t,{A:()=>Wn});const a={},o=e=>new Promise((t=>{if(!e)return t();const n=window.scrollX,s=window.scrollY;a.restoreFocusTimeout=setTimeout((()=>{a.previousActiveElement instanceof HTMLElement?(a.previousActiveElement.focus(),a.previousActiveElement=null):document.body&&document.body.focus(),t()}),100),window.scrollTo(n,s)})),l="swal2-",c=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=l+t,e)),{}),u=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=l+t,e)),{}),h=e=>e.charAt(0).toUpperCase()+e.slice(1),d=e=>{},p=[],f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var n;n=`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`,p.includes(n)||(p.push(n),d(n))},m=e=>"function"==typeof e?e():e,g=e=>e&&"function"==typeof e.toPromise,y=e=>g(e)?e.toPromise():Promise.resolve(e),b=e=>e&&Promise.resolve(e)===e,w=()=>document.body.querySelector(`.${c.container}`),v=e=>{const t=w();return t?t.querySelector(e):null},A=e=>v(`.${e}`),x=()=>A(c.popup),C=()=>A(c.icon),k=()=>A(c.title),S=()=>A(c["html-container"]),E=()=>A(c.image),_=()=>A(c["progress-steps"]),T=()=>A(c["validation-message"]),I=()=>v(`.${c.actions} .${c.confirm}`),N=()=>v(`.${c.actions} .${c.cancel}`),O=()=>v(`.${c.actions} .${c.deny}`),D=()=>v(`.${c.loader}`),R=()=>A(c.actions),M=()=>A(c.footer),F=()=>A(c["timer-progress-bar"]),B=()=>A(c.close),z=()=>{const e=x();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return n>s?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(r))].filter((e=>te(e)))},L=()=>W(document.body,c.shown)&&!W(document.body,c["toast-shown"])&&!W(document.body,c["no-backdrop"]),P=()=>{const e=x();return!!e&&W(e,c.toast)},V=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),s=n.querySelector("head");s&&Array.from(s.childNodes).forEach((t=>{e.appendChild(t)}));const r=n.querySelector("body");r&&Array.from(r.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},W=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{if(((e,t)=>{Array.from(e.classList).forEach((n=>{Object.values(c).includes(n)||Object.values(u).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))})(e,t),!t.customClass)return;const s=t.customClass[n];s&&("string"==typeof s||s.forEach?H(e,s):d(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof s}"`))},U=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${c.popup} > .${c[t]}`);case"checkbox":return e.querySelector(`.${c.popup} > .${c.checkbox} input`);case"radio":return e.querySelector(`.${c.popup} > .${c.radio} input:checked`)||e.querySelector(`.${c.popup} > .${c.radio} input:first-child`);case"range":return e.querySelector(`.${c.popup} > .${c.range} input`);default:return e.querySelector(`.${c.popup} > .${c.input}`)}},q=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},j=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},H=(e,t)=>{j(e,t,!0)},$=(e,t)=>{j(e,t,!1)},K=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style.setProperty(t,"number"==typeof n?`${n}px`:n):e.style.removeProperty(t)},Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},Y=e=>{e&&(e.style.display="none")},Q=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((()=>{ee(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},J=(e,t,n,s)=>{const r=e.querySelector(t);r&&r.style.setProperty(n,s)},ee=function(e,t){t?Z(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):Y(e)},te=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),ne=e=>!!(e.scrollHeight>e.clientHeight),se=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||s>0},re=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=F();n&&te(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},ie=`\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,""),ae=()=>{a.currentInstance.resetValidationMessage()},oe=e=>{const t=(()=>{const e=w();return!!e&&(e.remove(),$([document.documentElement,document.body],[c["no-backdrop"],c["toast-shown"],c["has-column"]]),!0)})();if("undefined"==typeof window||"undefined"==typeof document)return;const n=document.createElement("div");n.className=c.container,t&&H(n,c["no-transition"]),V(n,ie);const s="string"==typeof(r=e.target)?document.querySelector(r):r;var r;s.appendChild(n),(e=>{const t=x();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&H(w(),c.rtl)})(s),(()=>{const e=x(),t=K(e,c.input),n=K(e,c.file),s=e.querySelector(`.${c.range} input`),r=e.querySelector(`.${c.range} output`),i=K(e,c.select),a=e.querySelector(`.${c.checkbox} input`),o=K(e,c.textarea);t.oninput=ae,n.onchange=ae,i.onchange=ae,a.onchange=ae,o.oninput=ae,s.oninput=()=>{ae(),r.value=s.value},s.onchange=()=>{ae(),r.value=s.value}})()},le=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?ce(e,t):e&&V(t,e)},ce=(e,t)=>{e.jquery?ue(t,e):V(t,e.toString())},ue=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},he=(e,t)=>{const n=R(),s=D();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?Z(n):Y(n),G(n,t,"actions"),function(e,t,n){const s=I(),r=O(),i=N();if(!s||!r||!i)return;de(s,"confirm",n),de(r,"deny",n),de(i,"cancel",n),function(e,t,n,s){if(!s.buttonsStyling)return void $([e,t,n],c.styled);H([e,t,n],c.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,H(e,c["default-outline"]));s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,H(t,c["default-outline"]));s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,H(n,c["default-outline"]))}(s,r,i,n),n.reverseButtons&&(n.toast?(e.insertBefore(i,s),e.insertBefore(r,s)):(e.insertBefore(i,t),e.insertBefore(r,t),e.insertBefore(s,t)))}(n,s,t),V(s,t.loaderHtml||""),G(s,t,"loader"))};function de(e,t,n){const s=h(t);ee(e,n[`show${s}Button`],"inline-block"),V(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=c[t],G(e,n,`${t}Button`)}const pe=(e,t)=>{const n=w();n&&(!function(e,t){"string"==typeof t?e.style.background=t:t||H([document.documentElement,document.body],c["no-backdrop"])}(n,t.backdrop),function(e,t){if(!t)return;t in c?H(e,c[t]):(d('The "position" parameter is not valid, defaulting to "center"'),H(e,c.center))}(n,t.position),function(e,t){if(!t)return;H(e,c[`grow-${t}`])}(n,t.grow),G(n,t,"container"))};var fe={innerParams:new WeakMap,domCache:new WeakMap};const me=["input","file","range","select","radio","checkbox","textarea"],ge=e=>{if(!e.input)return;if(!Ce[e.input])return Object.keys(Ce).join(" | "),void e.input;const t=Ae(e.input);if(!t)return;const n=Ce[e.input](t,e);Z(t),e.inputAutoFocus&&setTimeout((()=>{q(n)}))},ye=(e,t)=>{const n=x();if(!n)return;const s=U(n,e);if(s){(e=>{for(let t=0;t{if(!e.input)return;const t=Ae(e.input);t&&G(t,e,"input")},we=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},ve=(e,t,n)=>{if(n.inputLabel){const s=document.createElement("label"),r=c["input-label"];s.setAttribute("for",e.id),s.className=r,"object"==typeof n.customClass&&H(s,n.customClass.inputLabel),s.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",s)}},Ae=e=>{const t=x();if(t)return K(t,c[e]||c.input)},xe=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:b(t)||d(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},Ce={};Ce.text=Ce.email=Ce.password=Ce.number=Ce.tel=Ce.url=Ce.search=Ce.date=Ce["datetime-local"]=Ce.time=Ce.week=Ce.month=(e,t)=>(xe(e,t.inputValue),ve(e,e,t),we(e,t),e.type=t.input,e),Ce.file=(e,t)=>(ve(e,e,t),we(e,t),e),Ce.range=(e,t)=>{const n=e.querySelector("input"),s=e.querySelector("output");return xe(n,t.inputValue),n.type=t.input,xe(s,t.inputValue),ve(n,e,t),e},Ce.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");V(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return ve(e,e,t),e},Ce.radio=e=>(e.textContent="",e),Ce.checkbox=(e,t)=>{const n=U(x(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const s=e.querySelector("span");return V(s,t.inputPlaceholder||t.inputLabel),n},Ce.textarea=(e,t)=>{xe(e,t.inputValue),we(e,t),ve(e,e,t);return setTimeout((()=>{if("MutationObserver"in window){const n=parseInt(window.getComputedStyle(x()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const s=e.offsetWidth+(r=e,parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight));var r;s>n?x().style.width=`${s}px`:X(x(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const ke=(e,t)=>{const n=S();n&&(Q(n),G(n,t,"htmlContainer"),t.html?(le(t.html,n),Z(n,"block")):t.text?(n.textContent=t.text,Z(n,"block")):Y(n),((e,t)=>{const n=x();if(!n)return;const s=fe.innerParams.get(e),r=!s||t.input!==s.input;me.forEach((e=>{const s=K(n,c[e]);s&&(ye(e,t.inputAttributes),s.className=c[e],r&&Y(s))})),t.input&&(r&&ge(t),be(t))})(e,t))},Se=(e,t)=>{for(const[n,s]of Object.entries(u))t.icon!==n&&$(e,s);H(e,t.icon&&u[t.icon]),Te(e,t),Ee(),G(e,t,"icon")},Ee=()=>{const e=x();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,s="";if(t.iconHtml)s=Ie(t.iconHtml);else if("success"===t.icon)s='\n
    \n \n
    \n
    \n',n=n.replace(/ style=".*?"/g,"");else if("error"===t.icon)s='\n \n \n \n \n';else if(t.icon){s=Ie({question:"?",warning:"!",info:"i"}[t.icon])}n.trim()!==s.trim()&&V(e,s)},Te=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])J(e,n,"background-color",t.iconColor);J(e,".swal2-success-ring","border-color",t.iconColor)}},Ie=e=>`
    ${e}
    `,Ne=(e,t)=>{const n=t.showClass||{};e.className=`${c.popup} ${te(e)?n.popup:""}`,t.toast?(H([document.documentElement,document.body],c["toast-shown"]),H(e,c.toast)):H(e,c.modal),G(e,t,"popup"),"string"==typeof t.customClass&&H(e,t.customClass),t.icon&&H(e,c[`icon-${t.icon}`])},Oe=e=>{const t=document.createElement("li");return H(t,c["progress-step"]),V(t,e),t},De=e=>{const t=document.createElement("li");return H(t,c["progress-step-line"]),e.progressStepsDistance&&X(t,"width",e.progressStepsDistance),t},Re=(e,t)=>{((e,t)=>{const n=w(),s=x();if(n&&s){if(t.toast){X(n,"width",t.width),s.style.width="100%";const e=D();e&&s.insertBefore(e,C())}else X(s,"width",t.width);X(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),Y(T()),Ne(s,t)}})(0,t),pe(0,t),((e,t)=>{const n=_();if(!n)return;const{progressSteps:s,currentProgressStep:r}=t;s&&0!==s.length&&void 0!==r?(Z(n),n.textContent="",r>=s.length&&d("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach(((e,i)=>{const a=Oe(e);if(n.appendChild(a),i===r&&H(a,c["active-progress-step"]),i!==s.length-1){const e=De(t);n.appendChild(e)}}))):Y(n)})(0,t),((e,t)=>{const n=fe.innerParams.get(e),s=C();if(s){if(n&&t.icon===n.icon)return _e(s,t),void Se(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(u).indexOf(t.icon))return t.icon,void Y(s);Z(s),_e(s,t),Se(s,t),H(s,t.showClass&&t.showClass.icon)}else Y(s)}})(e,t),((e,t)=>{const n=E();n&&(t.imageUrl?(Z(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),X(n,"width",t.imageWidth),X(n,"height",t.imageHeight),n.className=c.image,G(n,t,"image")):Y(n))})(0,t),((e,t)=>{const n=k();n&&(Q(n),ee(n,t.title||t.titleText,"block"),t.title&&le(t.title,n),t.titleText&&(n.innerText=t.titleText),G(n,t,"title"))})(0,t),((e,t)=>{const n=B();n&&(V(n,t.closeButtonHtml||""),G(n,t,"closeButton"),ee(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),ke(e,t),he(0,t),((e,t)=>{const n=M();n&&(Q(n),ee(n,t.footer,"block"),t.footer&&le(t.footer,n),G(n,t,"footer"))})(0,t);const n=x();"function"==typeof t.didRender&&n&&t.didRender(n),a.eventEmitter.emit("didRender",n)},Me=()=>{var e;return null===(e=I())||void 0===e?void 0:e.click()},Fe=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Be=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},ze=(e,t)=>{var n;const s=z();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=x())||void 0===n||n.focus()},Le=["ArrowRight","ArrowDown"],Pe=["ArrowLeft","ArrowUp"],Ve=(e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?We(t,e):"Tab"===t.key?Ge(t):[...Le,...Pe].includes(t.key)?Ue(t.key):"Escape"===t.key&&qe(t,e,n)))},We=(e,t)=>{if(!m(t.allowEnterKey))return;const n=U(x(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;Me(),e.preventDefault()}},Ge=e=>{const t=e.target,n=z();let s=-1;for(let e=0;e{const t=R(),n=I(),s=O(),r=N();if(!(t&&n&&s&&r))return;const i=[n,s,r];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const a=Le.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;if(o){for(let e=0;e{m(t.allowEscapeKey)&&(e.preventDefault(),n(Fe.esc))};var je={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const He=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},$e="undefined"!=typeof window&&!!window.GestureEvent,Ke=()=>{const e=w();if(!e)return;let t;e.ontouchstart=e=>{t=Xe(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},Xe=e=>{const t=e.target,n=w(),s=S();return!(!n||!s)&&(!Ze(e)&&!Ye(e)&&(t===n||!ne(n)&&t instanceof HTMLElement&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&(!ne(s)||!s.contains(t))))},Ze=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Ye=e=>e.touches&&e.touches.length>1;let Qe=null;const Je=e=>{null===Qe&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Qe=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Qe+(()=>{const e=document.createElement("div");e.className=c["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)};function et(e,t,n,s){P()?lt(e,s):(o(n).then((()=>lt(e,s))),Be(a)),$e?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),L()&&(null!==Qe&&(document.body.style.paddingRight=`${Qe}px`,Qe=null),(()=>{if(W(document.body,c.iosfix)){const e=parseInt(document.body.style.top,10);$(document.body,c.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),He()),$([document.documentElement,document.body],[c.shown,c["height-auto"],c["no-backdrop"],c["toast-shown"]])}function tt(e){e=it(e);const t=je.swalPromiseResolve.get(this),n=nt(this);this.isAwaitingPromise?e.isDismissed||(rt(this),t(e)):n&&t(e)}const nt=e=>{const t=x();if(!t)return!1;const n=fe.innerParams.get(e);if(!n||W(t,n.hideClass.popup))return!1;$(t,n.showClass.popup),H(t,n.hideClass.popup);const s=w();return $(s,n.showClass.backdrop),H(s,n.hideClass.backdrop),at(e,t,n),!0};function st(e){const t=je.swalPromiseReject.get(this);rt(this),t&&t(e)}const rt=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,fe.innerParams.get(e)||e._destroy())},it=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),at=(e,t,n)=>{var s;const r=w(),i=se(t);"function"==typeof n.willClose&&n.willClose(t),null===(s=a.eventEmitter)||void 0===s||s.emit("willClose",t),i?ot(e,t,r,n.returnFocus,n.didClose):et(e,r,n.returnFocus,n.didClose)},ot=(e,t,n,s,r)=>{a.swalCloseEventFinishedCallback=et.bind(null,e,n,s,r);const i=function(e){var n;e.target===t&&(null===(n=a.swalCloseEventFinishedCallback)||void 0===n||n.call(a),delete a.swalCloseEventFinishedCallback,t.removeEventListener("animationend",i),t.removeEventListener("transitionend",i))};t.addEventListener("animationend",i),t.addEventListener("transitionend",i)},lt=(e,t)=>{setTimeout((()=>{var n;"function"==typeof t&&t.bind(e.params)(),null===(n=a.eventEmitter)||void 0===n||n.emit("didClose"),e._destroy&&e._destroy()}))},ct=e=>{let t=x();if(t||new Wn,t=x(),!t)return;const n=D();P()?Y(C()):ut(t,e),Z(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},ut=(e,t)=>{const n=R(),s=D();n&&s&&(!t&&te(I())&&(t=I()),Z(n),t&&(Y(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),H([e,n],c.loading))},ht=e=>e.checked?1:0,dt=e=>e.checked?e.value:null,pt=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,ft=(e,t)=>{const n=x();if(!n)return;const s=e=>{"select"===t.input?function(e,t,n){const s=K(e,c.select);if(!s)return;const r=(e,t,s)=>{const r=document.createElement("option");r.value=s,V(r,t),r.selected=yt(s,n.inputValue),e.appendChild(r)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,s.appendChild(e),n.forEach((t=>r(e,t[1],t[0])))}else r(s,n,t)})),s.focus()}(n,gt(e),t):"radio"===t.input&&function(e,t,n){const s=K(e,c.radio);if(!s)return;t.forEach((e=>{const t=e[0],r=e[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=c.radio,i.value=t,yt(t,n.inputValue)&&(i.checked=!0);const o=document.createElement("span");V(o,r),o.className=c.label,a.appendChild(i),a.appendChild(o),s.appendChild(a)}));const r=s.querySelectorAll("input");r.length&&r[0].focus()}(n,gt(e),t)};g(t.inputOptions)||b(t.inputOptions)?(ct(I()),y(t.inputOptions).then((t=>{e.hideLoading(),s(t)}))):"object"==typeof t.inputOptions?s(t.inputOptions):t.inputOptions},mt=(e,t)=>{const n=e.getInput();n&&(Y(n),y(t.inputValue).then((s=>{n.value="number"===t.input?`${parseFloat(s)||0}`:`${s}`,Z(n),n.focus(),e.hideLoading()})).catch((t=>{n.value="",Z(n),n.focus(),e.hideLoading()})))};const gt=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let s=e;"object"==typeof s&&(s=gt(s)),t.push([n,s])})):Object.keys(e).forEach((n=>{let s=e[n];"object"==typeof s&&(s=gt(s)),t.push([n,s])})),t},yt=(e,t)=>!!t&&t.toString()===e.toString(),bt=(e,t)=>{const n=fe.innerParams.get(e);if(!n.input)return void h(t);const s=e.getInput(),r=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return ht(n);case"radio":return dt(n);case"file":return pt(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,n);n.inputValidator?wt(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?vt(e,r):Ct(e,r)},wt=(e,t,n)=>{const s=fe.innerParams.get(e);e.disableInput();Promise.resolve().then((()=>y(s.inputValidator(t,s.validationMessage)))).then((s=>{e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?vt(e,t):Ct(e,t)}))},vt=(e,t)=>{const n=fe.innerParams.get(e||void 0);if(n.showLoaderOnDeny&&ct(O()),n.preDeny){e.isAwaitingPromise=!0;Promise.resolve().then((()=>y(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),rt(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>xt(e||void 0,t)))}else e.close({isDenied:!0,value:t})},At=(e,t)=>{e.close({isConfirmed:!0,value:t})},xt=(e,t)=>{e.rejectPromise(t)},Ct=(e,t)=>{const n=fe.innerParams.get(e||void 0);if(n.showLoaderOnConfirm&&ct(),n.preConfirm){e.resetValidationMessage(),e.isAwaitingPromise=!0;Promise.resolve().then((()=>y(n.preConfirm(t,n.validationMessage)))).then((n=>{te(T())||!1===n?(e.hideLoading(),rt(e)):At(e,void 0===n?t:n)})).catch((t=>xt(e||void 0,t)))}else At(e,t)};function kt(){const e=fe.innerParams.get(this);if(!e)return;const t=fe.domCache.get(this);Y(t.loader),P()?e.icon&&Z(C()):St(t),$([t.popup,t.actions],c.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const St=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Z(t[0],"inline-block"):te(I())||te(O())||te(N())||Y(e.actions)};function Et(){const e=fe.innerParams.get(this),t=fe.domCache.get(this);return t?U(t.popup,e.input):null}function _t(e,t,n){const s=fe.domCache.get(e);t.forEach((e=>{s[e].disabled=n}))}function Tt(e,t){const n=x();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${c.radio}"]`);for(let n=0;nObject.prototype.hasOwnProperty.call(Ft,e),Vt=e=>-1!==Bt.indexOf(e),Wt=e=>zt[e],Gt=e=>{Pt(e)||d(`Unknown parameter "${e}"`)},Ut=e=>{Lt.includes(e)&&d(`The parameter "${e}" is incompatible with toasts`)},qt=e=>{const t=Wt(e);t&&f(e,t)};function jt(e){const t=x(),n=fe.innerParams.get(this);if(!t||W(t,n.hideClass.popup))return void d("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const s=Ht(e),r=Object.assign({},n,s);Re(this,r),fe.innerParams.set(this,r),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Ht=e=>{const t={};return Object.keys(e).forEach((n=>{Vt(n)?t[n]=e[n]:d(`Invalid parameter to update: ${n}`)})),t};function $t(){const e=fe.domCache.get(this),t=fe.innerParams.get(this);t?(e.popup&&a.swalCloseEventFinishedCallback&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),a.eventEmitter.emit("didDestroy"),Kt(this)):Xt(this)}const Kt=e=>{Xt(e),delete e.params,delete a.keydownHandler,delete a.keydownTarget,delete a.currentInstance},Xt=e=>{e.isAwaitingPromise?(Zt(fe,e),e.isAwaitingPromise=!0):(Zt(je,e),Zt(fe,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},Zt=(e,t)=>{for(const n in e)e[n].delete(t)};var Yt=Object.freeze({__proto__:null,_destroy:$t,close:tt,closeModal:tt,closePopup:tt,closeToast:tt,disableButtons:Nt,disableInput:Dt,disableLoading:kt,enableButtons:It,enableInput:Ot,getInput:Et,handleAwaitingPromise:rt,hideLoading:kt,rejectPromise:st,resetValidationMessage:Mt,showValidationMessage:Rt,update:jt});const Qt=(e,t,n)=>{t.popup.onclick=()=>{e&&(Jt(e)||e.timer||e.input)||n(Fe.close)}},Jt=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let en=!1;const tn=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(en=!0)}}},nn=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(en=!0)}}},sn=(e,t,n)=>{t.container.onclick=s=>{en?en=!1:s.target===t.container&&m(e.allowOutsideClick)&&n(Fe.backdrop)}},rn=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const an=()=>{if(a.timeout)return(()=>{const e=F();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`})(),a.timeout.stop()},on=()=>{if(a.timeout){const e=a.timeout.start();return re(e),e}};let ln=!1;const cn={};const un=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in cn){const n=t.getAttribute(e);if(n)return void cn[e].fire({template:n})}};a.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const s=function(){n.removeListener(e,s);for(var r=arguments.length,i=new Array(r),a=0;a1?t-1:0),s=1;s{try{e.apply(this,n)}catch(e){}}))}removeListener(e,t){const n=this._getHandlersByEventName(e),s=n.indexOf(t);s>-1&&n.splice(s,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var hn=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||rn(e[0])?["title","html","icon"].forEach(((n,s)=>{const r=e[s];("string"==typeof r||rn(r))&&(t[n]=r)})):Object.assign(t,e[0]),t},bindClickHandler:function(){cn[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,ln||(document.body.addEventListener("click",un),ln=!0)},clickCancel:()=>{var e;return null===(e=N())||void 0===e?void 0:e.click()},clickConfirm:Me,clickDeny:()=>{var e;return null===(e=O())||void 0===e?void 0:e.click()},enableLoading:ct,fire:function(){for(var e=arguments.length,t=new Array(e),n=0;nA(c["icon-content"]),getImage:E,getInputLabel:()=>A(c["input-label"]),getLoader:D,getPopup:x,getProgressSteps:_,getTimerLeft:()=>a.timeout&&a.timeout.getTimerLeft(),getTimerProgressBar:F,getTitle:k,getValidationMessage:T,increaseTimer:e=>{if(a.timeout){const t=a.timeout.increase(e);return re(t,!0),t}},isDeprecatedParameter:Wt,isLoading:()=>{const e=x();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!(!a.timeout||!a.timeout.isRunning()),isUpdatableParameter:Vt,isValidParameter:Pt,isVisible:()=>te(x()),mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},off:(e,t)=>{e?t?a.eventEmitter.removeListener(e,t):a.eventEmitter.removeAllListeners(e):a.eventEmitter.reset()},on:(e,t)=>{a.eventEmitter.on(e,t)},once:(e,t)=>{a.eventEmitter.once(e,t)},resumeTimer:on,showLoading:ct,stopTimer:an,toggleTimer:()=>{const e=a.timeout;return e&&(e.running?an():on())}});class dn{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const pn=["swal-title","swal-html","swal-footer"],fn=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{xn(e,["name","value"]);const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]="boolean"==typeof Ft[n]?"false"!==s:"object"==typeof Ft[n]?JSON.parse(s):s)})),t},mn=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]=new Function(`return ${s}`)())})),t},gn=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{xn(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t[`${n}ButtonText`]=e.innerHTML,t[`show${h(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label")))})),t},yn=e=>{const t={},n=e.querySelector("swal-image");return n&&(xn(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t},bn=e=>{const t={},n=e.querySelector("swal-icon");return n&&(xn(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},wn=e=>{const t={},n=e.querySelector("swal-input");n&&(xn(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")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((e=>{xn(e,["value"]);const n=e.getAttribute("value");if(!n)return;const s=e.innerHTML;t.inputOptions[n]=s}))),t},vn=(e,t)=>{const n={};for(const s in t){const r=t[s],i=e.querySelector(r);i&&(xn(i,[]),n[r.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},An=e=>{const t=pn.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||d(`Unrecognized element <${n}>`)}))},xn=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&d([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,""+(t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element.")])}))},Cn=e=>{const t=w(),n=x();"function"==typeof e.willOpen&&e.willOpen(n),a.eventEmitter.emit("willOpen",n);const s=window.getComputedStyle(document.body).overflowY;_n(t,n,e),setTimeout((()=>{Sn(t,n)}),10),L()&&(En(t,e.scrollbarPadding,s),(()=>{const e=w();Array.from(document.body.children).forEach((t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))}))})()),P()||a.previousActiveElement||(a.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(n))),a.eventEmitter.emit("didOpen",n),$(t,c["no-transition"])},kn=e=>{const t=x();if(e.target!==t)return;const n=w();t.removeEventListener("animationend",kn),t.removeEventListener("transitionend",kn),n.style.overflowY="auto"},Sn=(e,t)=>{se(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",kn),t.addEventListener("transitionend",kn)):e.style.overflowY="auto"},En=(e,t,n)=>{(()=>{if($e&&!W(document.body,c.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",H(document.body,c.iosfix),Ke()}})(),t&&"hidden"!==n&&Je(n),setTimeout((()=>{e.scrollTop=0}))},_n=(e,t,n)=>{H(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),Z(t,"grid"),setTimeout((()=>{H(t,n.showClass.popup),t.style.removeProperty("opacity")}),10)):Z(t,"grid"),H([document.documentElement,document.body],c.shown),n.heightAuto&&n.backdrop&&!n.toast&&H([document.documentElement,document.body],c["height-auto"])};var Tn={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^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 In(e){!function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=Tn.email),"url"===e.input&&(e.inputValidator=Tn.url))}(e),e.showLoaderOnConfirm&&!e.preConfirm&&d("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"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(d('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
    ")),oe(e)}let Nn;var On=new WeakMap;class Dn{constructor(){if(i(this,On,void 0),"undefined"==typeof window)return;Nn=this;for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if((e=>{!1===e.backdrop&&e.allowOutsideClick&&d('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Gt(t),e.toast&&Ut(t),qt(t)})(Object.assign({},t,e)),a.currentInstance){const e=je.swalPromiseResolve.get(a.currentInstance),{isAwaitingPromise:t}=a.currentInstance;a.currentInstance._destroy(),t||e({isDismissed:!0}),L()&&He()}a.currentInstance=Nn;const n=Mn(e,t);In(n),Object.freeze(n),a.timeout&&(a.timeout.stop(),delete a.timeout),clearTimeout(a.restoreFocusTimeout);const s=Fn(Nn);return Re(Nn,n),fe.innerParams.set(Nn,n),Rn(Nn,s,n)}then(e){return r(On,this).then(e)}finally(e){return r(On,this).finally(e)}}const Rn=(e,t,n)=>new Promise(((s,r)=>{const i=t=>{e.close({isDismissed:!0,dismiss:t})};je.swalPromiseResolve.set(e,s),je.swalPromiseReject.set(e,r),t.confirmButton.onclick=()=>{(e=>{const t=fe.innerParams.get(e);e.disableButtons(),t.input?bt(e,"confirm"):Ct(e,!0)})(e)},t.denyButton.onclick=()=>{(e=>{const t=fe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?bt(e,"deny"):vt(e,!1)})(e)},t.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Fe.cancel)})(e,i)},t.closeButton.onclick=()=>{i(Fe.close)},((e,t,n)=>{e.toast?Qt(e,t,n):(tn(t),nn(t),sn(e,t,n))})(n,t,i),((e,t,n)=>{Be(e),t.toast||(e.keydownHandler=e=>Ve(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:x(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)})(a,n,i),((e,t)=>{"select"===t.input||"radio"===t.input?ft(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(g(t.inputValue)||b(t.inputValue))&&(ct(I()),mt(e,t))})(e,n),Cn(n),Bn(a,n,i),zn(t,n),setTimeout((()=>{t.container.scrollTop=0}))})),Mn=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return An(n),Object.assign(fn(n),mn(n),gn(n),yn(n),bn(n),wn(n),vn(n,pn))})(e),s=Object.assign({},Ft,t,n,e);return s.showClass=Object.assign({},Ft.showClass,s.showClass),s.hideClass=Object.assign({},Ft.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},Fn=e=>{const t={popup:x(),container:w(),actions:R(),confirmButton:I(),denyButton:O(),cancelButton:N(),loader:D(),closeButton:B(),validationMessage:T(),progressSteps:_()};return fe.domCache.set(e,t),t},Bn=(e,t,n)=>{const s=F();Y(s),t.timer&&(e.timeout=new dn((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(Z(s),G(s,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&re(t.timer)}))))},zn=(e,t)=>{if(!t.toast)return m(t.allowEnterKey)?void(Ln(e)||Pn(e,t)||ze(-1,1)):(f("allowEnterKey"),void Vn())},Ln=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&te(e))return e.focus(),!0;return!1},Pn=(e,t)=>t.focusDeny&&te(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&te(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!te(e.confirmButton))&&(e.confirmButton.focus(),!0),Vn=()=>{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)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const 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((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}Dn.prototype.disableButtons=Nt,Dn.prototype.enableButtons=It,Dn.prototype.getInput=Et,Dn.prototype.disableInput=Dt,Dn.prototype.enableInput=Ot,Dn.prototype.hideLoading=kt,Dn.prototype.disableLoading=kt,Dn.prototype.showValidationMessage=Rt,Dn.prototype.resetValidationMessage=Mt,Dn.prototype.close=tt,Dn.prototype.closePopup=tt,Dn.prototype.closeModal=tt,Dn.prototype.closeToast=tt,Dn.prototype.rejectPromise=st,Dn.prototype.update=jt,Dn.prototype._destroy=$t,Object.assign(Dn,hn),Object.keys(Yt).forEach((e=>{Dn[e]=function(){return Nn&&Nn[e]?Nn[e](...arguments):null}})),Dn.DismissReason=Fe,Dn.version="11.14.5";const Wn=Dn;Wn.default=Wn,"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:hsl(0,0%,33%);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):where(.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):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.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):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.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):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{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-visible{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:0;padding:1em 1.6em .3em;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 hsl(0,0%,85%);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:hsl(0,0%,94%);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:rgb(249.95234375,205.965625,167.74765625);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:rgb(156.7033492823,224.2822966507,246.2966507177);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:rgb(200.8064516129,217.9677419355,225.1935483871);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,.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,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.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){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n(t,n){return t.get(e(t,n))}function s(e,n,s){t(e,n),n.set(e,s)}function r(t,n,s){return t.set(e(t,n),s),s}const i=100,a={},o=()=>{a.previousActiveElement instanceof HTMLElement?(a.previousActiveElement.focus(),a.previousActiveElement=null):document.body&&document.body.focus()},l=e=>new Promise((t=>{if(!e)return t();const n=window.scrollX,s=window.scrollY;a.restoreFocusTimeout=setTimeout((()=>{o(),t()}),i),window.scrollTo(n,s)})),c="swal2-",u=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=c+t,e)),{}),h=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=c+t,e)),{}),d=e=>e.charAt(0).toUpperCase()+e.slice(1),p=e=>{},f=e=>{},m=[],g=e=>{m.includes(e)||(m.push(e),p(e))},y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;g(`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`)},b=e=>"function"==typeof e?e():e,w=e=>e&&"function"==typeof e.toPromise,v=e=>w(e)?e.toPromise():Promise.resolve(e),A=e=>e&&Promise.resolve(e)===e,x=()=>document.body.querySelector(`.${u.container}`),C=e=>{const t=x();return t?t.querySelector(e):null},k=e=>C(`.${e}`),S=()=>k(u.popup),E=()=>k(u.icon),_=()=>k(u["icon-content"]),T=()=>k(u.title),I=()=>k(u["html-container"]),N=()=>k(u.image),O=()=>k(u["progress-steps"]),D=()=>k(u["validation-message"]),R=()=>C(`.${u.actions} .${u.confirm}`),M=()=>C(`.${u.actions} .${u.cancel}`),F=()=>C(`.${u.actions} .${u.deny}`),B=()=>k(u["input-label"]),z=()=>C(`.${u.loader}`),L=()=>k(u.actions),P=()=>k(u.footer),V=()=>k(u["timer-progress-bar"]),W=()=>k(u.close),G='\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n',U=()=>{const e=S();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return n>s?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(r))].filter((e=>ce(e)))},q=()=>K(document.body,u.shown)&&!K(document.body,u["toast-shown"])&&!K(document.body,u["no-backdrop"]),j=()=>{const e=S();return!!e&&K(e,u.toast)},H=()=>{const e=S();return!!e&&e.hasAttribute("data-loading")},$=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),s=n.querySelector("head");s&&Array.from(s.childNodes).forEach((t=>{e.appendChild(t)}));const r=n.querySelector("body");r&&Array.from(r.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},K=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{Array.from(e.classList).forEach((n=>{Object.values(u).includes(n)||Object.values(h).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))},Z=(e,t,n)=>{if(X(e,t),!t.customClass)return;const s=t.customClass[n];s&&("string"==typeof s||s.forEach?ee(e,s):p(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof s}"`))},Y=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${u.popup} > .${u[t]}`);case"checkbox":return e.querySelector(`.${u.popup} > .${u.checkbox} input`);case"radio":return e.querySelector(`.${u.popup} > .${u.radio} input:checked`)||e.querySelector(`.${u.popup} > .${u.radio} input:first-child`);case"range":return e.querySelector(`.${u.popup} > .${u.range} input`);default:return e.querySelector(`.${u.popup} > .${u.input}`)}},Q=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},J=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},ee=(e,t)=>{J(e,t,!0)},te=(e,t)=>{J(e,t,!1)},ne=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style.setProperty(t,"number"==typeof n?`${n}px`:n):e.style.removeProperty(t)},re=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},ie=e=>{e&&(e.style.display="none")},ae=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((()=>{le(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},oe=(e,t,n,s)=>{const r=e.querySelector(t);r&&r.style.setProperty(n,s)},le=function(e,t){t?re(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):ie(e)},ce=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),ue=()=>!ce(R())&&!ce(F())&&!ce(M()),he=e=>!!(e.scrollHeight>e.clientHeight),de=e=>{const 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){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=V();n&&ce(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},fe=()=>{const e=V();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`},me=()=>"undefined"==typeof window||"undefined"==typeof document,ge=`\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,""),ye=()=>{const e=x();return!!e&&(e.remove(),te([document.documentElement,document.body],[u["no-backdrop"],u["toast-shown"],u["has-column"]]),!0)},be=()=>{a.currentInstance.resetValidationMessage()},we=()=>{const e=S(),t=ne(e,u.input),n=ne(e,u.file),s=e.querySelector(`.${u.range} input`),r=e.querySelector(`.${u.range} output`),i=ne(e,u.select),a=e.querySelector(`.${u.checkbox} input`),o=ne(e,u.textarea);t.oninput=be,n.onchange=be,i.onchange=be,a.onchange=be,o.oninput=be,s.oninput=()=>{be(),r.value=s.value},s.onchange=()=>{be(),r.value=s.value}},ve=e=>"string"==typeof e?document.querySelector(e):e,Ae=e=>{const t=S();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},xe=e=>{"rtl"===window.getComputedStyle(e).direction&&ee(x(),u.rtl)},Ce=e=>{const t=ye();if(me())return void f("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=u.container,t&&ee(n,u["no-transition"]),$(n,ge);const s=ve(e.target);s.appendChild(n),Ae(e),xe(s),we()},ke=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?Se(e,t):e&&$(t,e)},Se=(e,t)=>{e.jquery?Ee(t,e):$(t,e.toString())},Ee=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},_e=(e,t)=>{const n=L(),s=z();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?re(n):ie(n),Z(n,t,"actions"),Te(n,s,t),$(s,t.loaderHtml||""),Z(s,t,"loader"))};function Te(e,t,n){const s=R(),r=F(),i=M();s&&r&&i&&(Ne(s,"confirm",n),Ne(r,"deny",n),Ne(i,"cancel",n),Ie(s,r,i,n),n.reverseButtons&&(n.toast?(e.insertBefore(i,s),e.insertBefore(r,s)):(e.insertBefore(i,t),e.insertBefore(r,t),e.insertBefore(s,t))))}function Ie(e,t,n,s){s.buttonsStyling?(ee([e,t,n],u.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,ee(e,u["default-outline"])),s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,ee(t,u["default-outline"])),s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,ee(n,u["default-outline"]))):te([e,t,n],u.styled)}function Ne(e,t,n){const s=d(t);le(e,n[`show${s}Button`],"inline-block"),$(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=u[t],Z(e,n,`${t}Button`)}const Oe=(e,t)=>{const n=W();n&&($(n,t.closeButtonHtml||""),Z(n,t,"closeButton"),le(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},De=(e,t)=>{const n=x();n&&(Re(n,t.backdrop),Me(n,t.position),Fe(n,t.grow),Z(n,t,"container"))};function Re(e,t){"string"==typeof t?e.style.background=t:t||ee([document.documentElement,document.body],u["no-backdrop"])}function Me(e,t){t&&(t in u?ee(e,u[t]):(p('The "position" parameter is not valid, defaulting to "center"'),ee(e,u.center)))}function Fe(e,t){t&&ee(e,u[`grow-${t}`])}var Be={innerParams:new WeakMap,domCache:new WeakMap};const ze=["input","file","range","select","radio","checkbox","textarea"],Le=(e,t)=>{const n=S();if(!n)return;const s=Be.innerParams.get(e),r=!s||t.input!==s.input;ze.forEach((e=>{const s=ne(n,u[e]);s&&(We(e,t.inputAttributes),s.className=u[e],r&&ie(s))})),t.input&&(r&&Pe(t),Ge(t))},Pe=e=>{if(!e.input)return;if(!$e[e.input])return void f(`Unexpected type of input! Expected ${Object.keys($e).join(" | ")}, got "${e.input}"`);const t=je(e.input);if(!t)return;const n=$e[e.input](t,e);re(t),e.inputAutoFocus&&setTimeout((()=>{Q(n)}))},Ve=e=>{for(let t=0;t{const n=S();if(!n)return;const s=Y(n,e);if(s){Ve(s);for(const e in t)s.setAttribute(e,t[e])}},Ge=e=>{if(!e.input)return;const t=je(e.input);t&&Z(t,e,"input")},Ue=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},qe=(e,t,n)=>{if(n.inputLabel){const s=document.createElement("label"),r=u["input-label"];s.setAttribute("for",e.id),s.className=r,"object"==typeof n.customClass&&ee(s,n.customClass.inputLabel),s.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",s)}},je=e=>{const t=S();if(t)return ne(t,u[e]||u.input)},He=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:A(t)||p(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},$e={};$e.text=$e.email=$e.password=$e.number=$e.tel=$e.url=$e.search=$e.date=$e["datetime-local"]=$e.time=$e.week=$e.month=(e,t)=>(He(e,t.inputValue),qe(e,e,t),Ue(e,t),e.type=t.input,e),$e.file=(e,t)=>(qe(e,e,t),Ue(e,t),e),$e.range=(e,t)=>{const n=e.querySelector("input"),s=e.querySelector("output");return He(n,t.inputValue),n.type=t.input,He(s,t.inputValue),qe(n,e,t),e},$e.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");$(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return qe(e,e,t),e},$e.radio=e=>(e.textContent="",e),$e.checkbox=(e,t)=>{const n=Y(S(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const s=e.querySelector("span");return $(s,t.inputPlaceholder||t.inputLabel),n},$e.textarea=(e,t)=>{He(e,t.inputValue),Ue(e,t),qe(e,e,t);const n=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);return setTimeout((()=>{if("MutationObserver"in window){const s=parseInt(window.getComputedStyle(S()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const r=e.offsetWidth+n(e);r>s?S().style.width=`${r}px`:se(S(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const Ke=(e,t)=>{const n=I();n&&(ae(n),Z(n,t,"htmlContainer"),t.html?(ke(t.html,n),re(n,"block")):t.text?(n.textContent=t.text,re(n,"block")):ie(n),Le(e,t))},Xe=(e,t)=>{const n=P();n&&(ae(n),le(n,t.footer,"block"),t.footer&&ke(t.footer,n),Z(n,t,"footer"))},Ze=(e,t)=>{const n=Be.innerParams.get(e),s=E();if(s){if(n&&t.icon===n.icon)return tt(s,t),void Ye(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(h).indexOf(t.icon))return f(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void ie(s);re(s),tt(s,t),Ye(s,t),ee(s,t.showClass&&t.showClass.icon)}else ie(s)}},Ye=(e,t)=>{for(const[n,s]of Object.entries(h))t.icon!==n&&te(e,s);ee(e,t.icon&&h[t.icon]),nt(e,t),Qe(),Z(e,t,"icon")},Qe=()=>{const e=S();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e\n \n
      \n
      \n',et='\n \n \n \n \n',tt=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,s="";t.iconHtml?s=st(t.iconHtml):"success"===t.icon?(s=Je,n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?s=et:t.icon&&(s=st({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==s.trim()&&$(e,s)},nt=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])oe(e,n,"background-color",t.iconColor);oe(e,".swal2-success-ring","border-color",t.iconColor)}},st=e=>`
      ${e}
      `,rt=(e,t)=>{const n=N();n&&(t.imageUrl?(re(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),se(n,"width",t.imageWidth),se(n,"height",t.imageHeight),n.className=u.image,Z(n,t,"image")):ie(n))},it=(e,t)=>{const n=x(),s=S();if(n&&s){if(t.toast){se(n,"width",t.width),s.style.width="100%";const e=z();e&&s.insertBefore(e,E())}else se(s,"width",t.width);se(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),ie(D()),at(s,t)}},at=(e,t)=>{const n=t.showClass||{};e.className=`${u.popup} ${ce(e)?n.popup:""}`,t.toast?(ee([document.documentElement,document.body],u["toast-shown"]),ee(e,u.toast)):ee(e,u.modal),Z(e,t,"popup"),"string"==typeof t.customClass&&ee(e,t.customClass),t.icon&&ee(e,u[`icon-${t.icon}`])},ot=(e,t)=>{const n=O();if(!n)return;const{progressSteps:s,currentProgressStep:r}=t;s&&0!==s.length&&void 0!==r?(re(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(((e,i)=>{const a=lt(e);if(n.appendChild(a),i===r&&ee(a,u["active-progress-step"]),i!==s.length-1){const e=ct(t);n.appendChild(e)}}))):ie(n)},lt=e=>{const t=document.createElement("li");return ee(t,u["progress-step"]),$(t,e),t},ct=e=>{const t=document.createElement("li");return ee(t,u["progress-step-line"]),e.progressStepsDistance&&se(t,"width",e.progressStepsDistance),t},ut=(e,t)=>{const n=T();n&&(ae(n),le(n,t.title||t.titleText,"block"),t.title&&ke(t.title,n),t.titleText&&(n.innerText=t.titleText),Z(n,t,"title"))},ht=(e,t)=>{it(e,t),De(e,t),ot(e,t),Ze(e,t),rt(e,t),ut(e,t),Oe(e,t),Ke(e,t),_e(e,t),Xe(e,t);const n=S();"function"==typeof t.didRender&&n&&t.didRender(n),a.eventEmitter.emit("didRender",n)},dt=()=>ce(S()),pt=()=>{var e;return null===(e=R())||void 0===e?void 0:e.click()},ft=()=>{var e;return null===(e=F())||void 0===e?void 0:e.click()},mt=()=>{var e;return null===(e=M())||void 0===e?void 0:e.click()},gt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),yt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},bt=(e,t,n)=>{yt(e),t.toast||(e.keydownHandler=e=>xt(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:S(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},wt=(e,t)=>{var n;const s=U();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=S())||void 0===n||n.focus()},vt=["ArrowRight","ArrowDown"],At=["ArrowLeft","ArrowUp"],xt=(e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Ct(t,e):"Tab"===t.key?kt(t):[...vt,...At].includes(t.key)?St(t.key):"Escape"===t.key&&Et(t,e,n)))},Ct=(e,t)=>{if(!b(t.allowEnterKey))return;const n=Y(S(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;pt(),e.preventDefault()}},kt=e=>{const t=e.target,n=U();let s=-1;for(let e=0;e{const t=L(),n=R(),s=F(),r=M();if(!(t&&n&&s&&r))return;const i=[n,s,r];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const a=vt.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;if(o){for(let e=0;e{b(t.allowEscapeKey)&&(e.preventDefault(),n(gt.esc))};var _t={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Tt=()=>{const e=x();Array.from(document.body.children).forEach((t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))}))},It=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Nt="undefined"!=typeof window&&!!window.GestureEvent,Ot=()=>{if(Nt&&!K(document.body,u.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",ee(document.body,u.iosfix),Dt()}},Dt=()=>{const e=x();if(!e)return;let t;e.ontouchstart=e=>{t=Rt(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},Rt=e=>{const t=e.target,n=x(),s=I();return!(!n||!s||Mt(e)||Ft(e)||t!==n&&(he(n)||!(t instanceof HTMLElement)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||he(s)&&s.contains(t)))},Mt=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Ft=e=>e.touches&&e.touches.length>1,Bt=()=>{if(K(document.body,u.iosfix)){const e=parseInt(document.body.style.top,10);te(document.body,u.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},zt=()=>{const e=document.createElement("div");e.className=u["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t};let Lt=null;const Pt=e=>{null===Lt&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Lt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Lt+zt()}px`)},Vt=()=>{null!==Lt&&(document.body.style.paddingRight=`${Lt}px`,Lt=null)};function Wt(e,t,n,s){j()?Zt(e,s):(l(n).then((()=>Zt(e,s))),yt(a)),Nt?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),q()&&(Vt(),Bt(),It()),Gt()}function Gt(){te([document.documentElement,document.body],[u.shown,u["height-auto"],u["no-backdrop"],u["toast-shown"]])}function Ut(e){e=$t(e);const t=_t.swalPromiseResolve.get(this),n=qt(this);this.isAwaitingPromise?e.isDismissed||(Ht(this),t(e)):n&&t(e)}const qt=e=>{const t=S();if(!t)return!1;const n=Be.innerParams.get(e);if(!n||K(t,n.hideClass.popup))return!1;te(t,n.showClass.popup),ee(t,n.hideClass.popup);const s=x();return te(s,n.showClass.backdrop),ee(s,n.hideClass.backdrop),Kt(e,t,n),!0};function jt(e){const t=_t.swalPromiseReject.get(this);Ht(this),t&&t(e)}const Ht=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,Be.innerParams.get(e)||e._destroy())},$t=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Kt=(e,t,n)=>{var s;const r=x(),i=de(t);"function"==typeof n.willClose&&n.willClose(t),null===(s=a.eventEmitter)||void 0===s||s.emit("willClose",t),i?Xt(e,t,r,n.returnFocus,n.didClose):Wt(e,r,n.returnFocus,n.didClose)},Xt=(e,t,n,s,r)=>{a.swalCloseEventFinishedCallback=Wt.bind(null,e,n,s,r);const i=function(e){var n;e.target===t&&(null===(n=a.swalCloseEventFinishedCallback)||void 0===n||n.call(a),delete a.swalCloseEventFinishedCallback,t.removeEventListener("animationend",i),t.removeEventListener("transitionend",i))};t.addEventListener("animationend",i),t.addEventListener("transitionend",i)},Zt=(e,t)=>{setTimeout((()=>{var n;"function"==typeof t&&t.bind(e.params)(),null===(n=a.eventEmitter)||void 0===n||n.emit("didClose"),e._destroy&&e._destroy()}))},Yt=e=>{let t=S();if(t||new tr,t=S(),!t)return;const n=z();j()?ie(E()):Qt(t,e),re(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},Qt=(e,t)=>{const n=L(),s=z();n&&s&&(!t&&ce(R())&&(t=R()),re(n),t&&(ie(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),ee([e,n],u.loading))},Jt=(e,t)=>{"select"===t.input||"radio"===t.input?rn(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(w(t.inputValue)||A(t.inputValue))&&(Yt(R()),an(e,t))},en=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return tn(n);case"radio":return nn(n);case"file":return sn(n);default:return t.inputAutoTrim?n.value.trim():n.value}},tn=e=>e.checked?1:0,nn=e=>e.checked?e.value:null,sn=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,rn=(e,t)=>{const n=S();if(!n)return;const s=e=>{"select"===t.input?on(n,cn(e),t):"radio"===t.input&&ln(n,cn(e),t)};w(t.inputOptions)||A(t.inputOptions)?(Yt(R()),v(t.inputOptions).then((t=>{e.hideLoading(),s(t)}))):"object"==typeof t.inputOptions?s(t.inputOptions):f("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},an=(e,t)=>{const n=e.getInput();n&&(ie(n),v(t.inputValue).then((s=>{n.value="number"===t.input?`${parseFloat(s)||0}`:`${s}`,re(n),n.focus(),e.hideLoading()})).catch((t=>{f(`Error in inputValue promise: ${t}`),n.value="",re(n),n.focus(),e.hideLoading()})))};function on(e,t,n){const s=ne(e,u.select);if(!s)return;const r=(e,t,s)=>{const r=document.createElement("option");r.value=s,$(r,t),r.selected=un(s,n.inputValue),e.appendChild(r)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,s.appendChild(e),n.forEach((t=>r(e,t[1],t[0])))}else r(s,n,t)})),s.focus()}function ln(e,t,n){const s=ne(e,u.radio);if(!s)return;t.forEach((e=>{const t=e[0],r=e[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=u.radio,i.value=t,un(t,n.inputValue)&&(i.checked=!0);const o=document.createElement("span");$(o,r),o.className=u.label,a.appendChild(i),a.appendChild(o),s.appendChild(a)}));const r=s.querySelectorAll("input");r.length&&r[0].focus()}const cn=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let s=e;"object"==typeof s&&(s=cn(s)),t.push([n,s])})):Object.keys(e).forEach((n=>{let s=e[n];"object"==typeof s&&(s=cn(s)),t.push([n,s])})),t},un=(e,t)=>!!t&&t.toString()===e.toString(),hn=e=>{const t=Be.innerParams.get(e);e.disableButtons(),t.input?fn(e,"confirm"):wn(e,!0)},dn=e=>{const t=Be.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?fn(e,"deny"):gn(e,!1)},pn=(e,t)=>{e.disableButtons(),t(gt.cancel)},fn=(e,t)=>{const n=Be.innerParams.get(e);if(!n.input)return void f(`The "input" parameter is needed to be set when using returnInputValueOn${d(t)}`);const s=e.getInput(),r=en(e,n);n.inputValidator?mn(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?gn(e,r):wn(e,r)},mn=(e,t,n)=>{const s=Be.innerParams.get(e);e.disableInput(),Promise.resolve().then((()=>v(s.inputValidator(t,s.validationMessage)))).then((s=>{e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?gn(e,t):wn(e,t)}))},gn=(e,t)=>{const n=Be.innerParams.get(e||void 0);n.showLoaderOnDeny&&Yt(F()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((()=>v(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),Ht(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>bn(e||void 0,t)))):e.close({isDenied:!0,value:t})},yn=(e,t)=>{e.close({isConfirmed:!0,value:t})},bn=(e,t)=>{e.rejectPromise(t)},wn=(e,t)=>{const n=Be.innerParams.get(e||void 0);n.showLoaderOnConfirm&&Yt(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((()=>v(n.preConfirm(t,n.validationMessage)))).then((n=>{ce(D())||!1===n?(e.hideLoading(),Ht(e)):yn(e,void 0===n?t:n)})).catch((t=>bn(e||void 0,t)))):yn(e,t)};function vn(){const e=Be.innerParams.get(this);if(!e)return;const t=Be.domCache.get(this);ie(t.loader),j()?e.icon&&re(E()):An(t),te([t.popup,t.actions],u.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const An=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?re(t[0],"inline-block"):ue()&&ie(e.actions)};function xn(){const e=Be.innerParams.get(this),t=Be.domCache.get(this);return t?Y(t.popup,e.input):null}function Cn(e,t,n){const s=Be.domCache.get(e);t.forEach((e=>{s[e].disabled=n}))}function kn(e,t){const n=S();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${u.radio}"]`);for(let n=0;nObject.prototype.hasOwnProperty.call(On,e),Bn=e=>-1!==Dn.indexOf(e),zn=e=>Rn[e],Ln=e=>{Fn(e)||p(`Unknown parameter "${e}"`)},Pn=e=>{Mn.includes(e)&&p(`The parameter "${e}" is incompatible with toasts`)},Vn=e=>{const t=zn(e);t&&y(e,t)},Wn=e=>{!1===e.backdrop&&e.allowOutsideClick&&p('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Ln(t),e.toast&&Pn(t),Vn(t)};function Gn(e){const t=S(),n=Be.innerParams.get(this);if(!t||K(t,n.hideClass.popup))return void p("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const s=Un(e),r=Object.assign({},n,s);ht(this,r),Be.innerParams.set(this,r),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Un=e=>{const t={};return Object.keys(e).forEach((n=>{Bn(n)?t[n]=e[n]:p(`Invalid parameter to update: ${n}`)})),t};function qn(){const e=Be.domCache.get(this),t=Be.innerParams.get(this);t?(e.popup&&a.swalCloseEventFinishedCallback&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),a.eventEmitter.emit("didDestroy"),jn(this)):Hn(this)}const jn=e=>{Hn(e),delete e.params,delete a.keydownHandler,delete a.keydownTarget,delete a.currentInstance},Hn=e=>{e.isAwaitingPromise?($n(Be,e),e.isAwaitingPromise=!0):($n(_t,e),$n(Be,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},$n=(e,t)=>{for(const n in e)e[n].delete(t)};var Kn=Object.freeze({__proto__:null,_destroy:qn,close:Ut,closeModal:Ut,closePopup:Ut,closeToast:Ut,disableButtons:En,disableInput:Tn,disableLoading:vn,enableButtons:Sn,enableInput:_n,getInput:xn,handleAwaitingPromise:Ht,hideLoading:vn,rejectPromise:jt,resetValidationMessage:Nn,showValidationMessage:In,update:Gn});const Xn=(e,t,n)=>{e.toast?Zn(e,t,n):(Jn(t),es(t),ts(e,t,n))},Zn=(e,t,n)=>{t.popup.onclick=()=>{e&&(Yn(e)||e.timer||e.input)||n(gt.close)}},Yn=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let Qn=!1;const Jn=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(Qn=!0)}}},es=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(Qn=!0)}}},ts=(e,t,n)=>{t.container.onclick=s=>{Qn?Qn=!1:s.target===t.container&&b(e.allowOutsideClick)&&n(gt.backdrop)}},ns=e=>"object"==typeof e&&e.jquery,ss=e=>e instanceof Element||ns(e),rs=e=>{const t={};return"object"!=typeof e[0]||ss(e[0])?["title","html","icon"].forEach(((n,s)=>{const r=e[s];"string"==typeof r||ss(r)?t[n]=r:void 0!==r&&f(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof r}`)})):Object.assign(t,e[0]),t};function is(){for(var e=arguments.length,t=new Array(e),n=0;na.timeout&&a.timeout.getTimerLeft(),ls=()=>{if(a.timeout)return fe(),a.timeout.stop()},cs=()=>{if(a.timeout){const e=a.timeout.start();return pe(e),e}},us=()=>{const e=a.timeout;return e&&(e.running?ls():cs())},hs=e=>{if(a.timeout){const t=a.timeout.increase(e);return pe(t,!0),t}},ds=()=>!(!a.timeout||!a.timeout.isRunning());let ps=!1;const fs={};function ms(){fs[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,ps||(document.body.addEventListener("click",gs),ps=!0)}const gs=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in fs){const n=t.getAttribute(e);if(n)return void fs[e].fire({template:n})}};class ys{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const s=function(){n.removeListener(e,s);for(var r=arguments.length,i=new Array(r),a=0;a1?t-1:0),s=1;s{try{e.apply(this,n)}catch(e){}}))}removeListener(e,t){const n=this._getHandlersByEventName(e),s=n.indexOf(t);s>-1&&n.splice(s,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}}a.eventEmitter=new ys;const bs=(e,t)=>{a.eventEmitter.on(e,t)},ws=(e,t)=>{a.eventEmitter.once(e,t)},vs=(e,t)=>{e?t?a.eventEmitter.removeListener(e,t):a.eventEmitter.removeAllListeners(e):a.eventEmitter.reset()};var As=Object.freeze({__proto__:null,argsToParams:rs,bindClickHandler:ms,clickCancel:mt,clickConfirm:pt,clickDeny:ft,enableLoading:Yt,fire:is,getActions:L,getCancelButton:M,getCloseButton:W,getConfirmButton:R,getContainer:x,getDenyButton:F,getFocusableElements:U,getFooter:P,getHtmlContainer:I,getIcon:E,getIconContent:_,getImage:N,getInputLabel:B,getLoader:z,getPopup:S,getProgressSteps:O,getTimerLeft:os,getTimerProgressBar:V,getTitle:T,getValidationMessage:D,increaseTimer:hs,isDeprecatedParameter:zn,isLoading:H,isTimerRunning:ds,isUpdatableParameter:Bn,isValidParameter:Fn,isVisible:dt,mixin:as,off:vs,on:bs,once:ws,resumeTimer:cs,showLoading:Yt,stopTimer:ls,toggleTimer:us});class xs{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const Cs=["swal-title","swal-html","swal-footer"],ks=e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return Ds(n),Object.assign(Ss(n),Es(n),_s(n),Ts(n),Is(n),Ns(n),Os(n,Cs))},Ss=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{Rs(e,["name","value"]);const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&("boolean"==typeof On[n]?t[n]="false"!==s:"object"==typeof On[n]?t[n]=JSON.parse(s):t[n]=s)})),t},Es=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]=new Function(`return ${s}`)())})),t},_s=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{Rs(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t[`${n}ButtonText`]=e.innerHTML,t[`show${d(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label")))})),t},Ts=e=>{const t={},n=e.querySelector("swal-image");return n&&(Rs(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t},Is=e=>{const t={},n=e.querySelector("swal-icon");return n&&(Rs(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Ns=e=>{const t={},n=e.querySelector("swal-input");n&&(Rs(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")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((e=>{Rs(e,["value"]);const n=e.getAttribute("value");if(!n)return;const s=e.innerHTML;t.inputOptions[n]=s}))),t},Os=(e,t)=>{const n={};for(const s in t){const r=t[s],i=e.querySelector(r);i&&(Rs(i,[]),n[r.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},Ds=e=>{const t=Cs.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||p(`Unrecognized element <${n}>`)}))},Rs=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&p([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])}))},Ms=10,Fs=e=>{const t=x(),n=S();"function"==typeof e.willOpen&&e.willOpen(n),a.eventEmitter.emit("willOpen",n);const s=window.getComputedStyle(document.body).overflowY;Ps(t,n,e),setTimeout((()=>{zs(t,n)}),Ms),q()&&(Ls(t,e.scrollbarPadding,s),Tt()),j()||a.previousActiveElement||(a.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(n))),a.eventEmitter.emit("didOpen",n),te(t,u["no-transition"])},Bs=e=>{const t=S();if(e.target!==t)return;const n=x();t.removeEventListener("animationend",Bs),t.removeEventListener("transitionend",Bs),n.style.overflowY="auto"},zs=(e,t)=>{de(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",Bs),t.addEventListener("transitionend",Bs)):e.style.overflowY="auto"},Ls=(e,t,n)=>{Ot(),t&&"hidden"!==n&&Pt(n),setTimeout((()=>{e.scrollTop=0}))},Ps=(e,t,n)=>{ee(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),re(t,"grid"),setTimeout((()=>{ee(t,n.showClass.popup),t.style.removeProperty("opacity")}),Ms)):re(t,"grid"),ee([document.documentElement,document.body],u.shown),n.heightAuto&&n.backdrop&&!n.toast&&ee([document.documentElement,document.body],u["height-auto"])};var Vs={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^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 Ws(e){e.inputValidator||("email"===e.input&&(e.inputValidator=Vs.email),"url"===e.input&&(e.inputValidator=Vs.url))}function Gs(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 Us(e){Ws(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"),Gs(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
      ")),Ce(e)}let qs;var js=new WeakMap;class Hs{constructor(){if(s(this,js,void 0),"undefined"==typeof window)return;qs=this;for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(Wn(Object.assign({},t,e)),a.currentInstance){const e=_t.swalPromiseResolve.get(a.currentInstance),{isAwaitingPromise:t}=a.currentInstance;a.currentInstance._destroy(),t||e({isDismissed:!0}),q()&&It()}a.currentInstance=qs;const n=Ks(e,t);Us(n),Object.freeze(n),a.timeout&&(a.timeout.stop(),delete a.timeout),clearTimeout(a.restoreFocusTimeout);const s=Xs(qs);return ht(qs,n),Be.innerParams.set(qs,n),$s(qs,s,n)}then(e){return n(js,this).then(e)}finally(e){return n(js,this).finally(e)}}const $s=(e,t,n)=>new Promise(((s,r)=>{const i=t=>{e.close({isDismissed:!0,dismiss:t})};_t.swalPromiseResolve.set(e,s),_t.swalPromiseReject.set(e,r),t.confirmButton.onclick=()=>{hn(e)},t.denyButton.onclick=()=>{dn(e)},t.cancelButton.onclick=()=>{pn(e,i)},t.closeButton.onclick=()=>{i(gt.close)},Xn(n,t,i),bt(a,n,i),Jt(e,n),Fs(n),Zs(a,n,i),Ys(t,n),setTimeout((()=>{t.container.scrollTop=0}))})),Ks=(e,t)=>{const n=ks(e),s=Object.assign({},On,t,n,e);return s.showClass=Object.assign({},On.showClass,s.showClass),s.hideClass=Object.assign({},On.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},Xs=e=>{const t={popup:S(),container:x(),actions:L(),confirmButton:R(),denyButton:F(),cancelButton:M(),loader:z(),closeButton:W(),validationMessage:D(),progressSteps:O()};return Be.domCache.set(e,t),t},Zs=(e,t,n)=>{const s=V();ie(s),t.timer&&(e.timeout=new xs((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(re(s),Z(s,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&pe(t.timer)}))))},Ys=(e,t)=>{if(!t.toast)return b(t.allowEnterKey)?void(Qs(e)||Js(e,t)||wt(-1,1)):(y("allowEnterKey"),void er())},Qs=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&ce(e))return e.focus(),!0;return!1},Js=(e,t)=>t.focusDeny&&ce(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ce(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ce(e.confirmButton)||(e.confirmButton.focus(),0)),er=()=>{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)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const 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((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}Hs.prototype.disableButtons=En,Hs.prototype.enableButtons=Sn,Hs.prototype.getInput=xn,Hs.prototype.disableInput=Tn,Hs.prototype.enableInput=_n,Hs.prototype.hideLoading=vn,Hs.prototype.disableLoading=vn,Hs.prototype.showValidationMessage=In,Hs.prototype.resetValidationMessage=Nn,Hs.prototype.close=Ut,Hs.prototype.closePopup=Ut,Hs.prototype.closeModal=Ut,Hs.prototype.closeToast=Ut,Hs.prototype.rejectPromise=jt,Hs.prototype.update=Gn,Hs.prototype._destroy=qn,Object.assign(Hs,As),Object.keys(Kn).forEach((e=>{Hs[e]=function(){return qs&&qs[e]?qs[e](...arguments):null}})),Hs.DismissReason=gt,Hs.version="11.14.5";const tr=Hs;return tr.default=tr,tr}(),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:()=>fa,AMSynth:()=>Ha,Abs:()=>Na,Add:()=>Aa,AmplitudeEnvelope:()=>Ua,Analyser:()=>ml,AudioToGain:()=>da,AutoFilter:()=>Do,AutoPanner:()=>Mo,AutoWah:()=>Bo,BaseContext:()=>Kr,BiquadFilter:()=>$a,BitCrusher:()=>Lo,Buffer:()=>Xl,BufferSource:()=>Yl,Buffers:()=>Zl,Channel:()=>Cl,Chebyshev:()=>Vo,Chorus:()=>jo,Clock:()=>zi,Compressor:()=>Il,Context:()=>Xr,Convolver:()=>Fl,CrossFade:()=>Io,DCMeter:()=>wl,Delay:()=>Li,Destination:()=>Vl,Distortion:()=>Ho,Draw:()=>jl,DuoSynth:()=>Ya,EQ3:()=>Ml,Emitter:()=>$r,Envelope:()=>Pa,FFT:()=>bl,FMOscillator:()=>ma,FMSynth:()=>Qa,FatOscillator:()=>ya,FeedbackCombFilter:()=>lo,FeedbackDelay:()=>Ko,Filter:()=>Ka,Follower:()=>Fo,Freeverb:()=>Jo,Frequency:()=>wi,FrequencyClass:()=>gi,FrequencyEnvelope:()=>Xa,FrequencyShifter:()=>Zo,Gain:()=>Ii,GainToAudio:()=>Oa,Gate:()=>Nl,GrainPlayer:()=>Ia,GreaterThan:()=>Fa,GreaterThanZero:()=>Ma,IntervalTimeline:()=>Hi,JCReverb:()=>sl,LFO:()=>ka,Limiter:()=>Ol,Listener:()=>Ul,Loop:()=>go,LowpassCombFilter:()=>uo,Master:()=>Wl,MembraneSynth:()=>to,Merge:()=>Go,MetalSynth:()=>eo,Meter:()=>yl,MidSideCompressor:()=>Dl,MidSideMerge:()=>ul,MidSideSplit:()=>cl,Midi:()=>Gi,MidiClass:()=>Wi,Mono:()=>kl,MonoSynth:()=>Za,MultibandCompressor:()=>Rl,MultibandSplit:()=>Sl,Multiply:()=>pa,Negate:()=>Da,Noise:()=>na,NoiseSynth:()=>no,Offline:()=>Pi,OfflineContext:()=>ei,OmniOscillator:()=>va,OnePoleFilter:()=>co,Oscillator:()=>ca,PWMOscillator:()=>ba,PanVol:()=>xl,Panner:()=>Ro,Panner3D:()=>_l,Param:()=>ki,Part:()=>yo,Pattern:()=>_o,Phaser:()=>ol,PingPongDelay:()=>il,PitchShift:()=>al,Player:()=>_a,Players:()=>Ta,PluckSynth:()=>ho,PolySynth:()=>po,Pow:()=>Ba,PulseOscillator:()=>ga,Recorder:()=>Tl,Reverb:()=>ll,Sampler:()=>fo,Scale:()=>xa,ScaleExp:()=>za,Sequence:()=>To,Signal:()=>Di,Solo:()=>Al,Split:()=>Wo,StateTimeline:()=>Ci,StereoWidener:()=>dl,Subtract:()=>Ra,SyncedSignal:()=>La,Synth:()=>qa,Ticks:()=>qi,TicksClass:()=>Ui,Time:()=>mi,TimeClass:()=>fi,Timeline:()=>Gr,ToneAudioBuffer:()=>Jr,ToneAudioBuffers:()=>Vi,ToneAudioNode:()=>Si,ToneBufferSource:()=>ta,ToneEvent:()=>mo,ToneOscillatorNode:()=>la,Transport:()=>Ll,TransportTime:()=>Ai,TransportTimeClass:()=>vi,Tremolo:()=>pl,Unit:()=>r,UserMedia:()=>aa,Vibrato:()=>fl,Volume:()=>Ki,WaveShaper:()=>ha,Waveform:()=>vl,Zero:()=>Ca,connect:()=>_i,connectSeries:()=>Ei,connectSignal:()=>Ri,context:()=>$l,dbToGain:()=>ai,debug:()=>s,defaultArg:()=>Rr,disconnect:()=>Ti,ftom:()=>ui,gainToDb:()=>oi,getContext:()=>si,getDestination:()=>Gl,getDraw:()=>Hl,getListener:()=>ql,getTransport:()=>Pl,immediate:()=>zl,intervalToFrequencyRatio:()=>li,isArray:()=>yr,isBoolean:()=>gr,isDefined:()=>dr,isFunction:()=>pr,isNote:()=>wr,isNumber:()=>fr,isObject:()=>mr,isString:()=>br,isUndef:()=>hr,loaded:()=>Kl,mtof:()=>di,now:()=>Bl,optionsFromArguments:()=>Dr,setContext:()=>ri,start:()=>ii,supported:()=>sr,version:()=>i});var s={};n.r(s),n.d(s,{assert:()=>rr,assertContextRunning:()=>ar,assertRange:()=>ir,log:()=>cr,setLogger:()=>lr,warn:()=>ur});var r={};n.r(r);const i="14.7.77",a=(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}),c=(e,t,n)=>({duration:n,startTime:t,type:"setValueCurve",values:e}),u=(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]:u(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,A=(e,t,n,{endTime:s,value:r})=>n===r?r:0n+(e-t)/(s-t)*(r-n),C=(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)),k=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&&k(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,i=h(s)?A(t,n,r,s):x(t,n,r,s),l=h(s)?a(i,t,this._currenTime):o(i,t,this._currenTime);this._automationEvents.push(l)}if(void 0!==e&&k(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)),i=n/(r-1)*s,a=e.values.slice(0,r);if(i<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)?a(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];k(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&&k(r)&&(void 0===n||!p(n)||n.insertTime>e))return u(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),i=r[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());n.push(i),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},G=(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},U=(e,t,n,s)=>{const r=W(e,t),i=G(r,(e=>e[0]===n&&e[1]===s));return 0===r.size&&e.delete(t),i},q=e=>W(D,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},ie=e=>W(_,e),ae=e=>W(I,e),oe=(e,t)=>{const{activeInputs:n}=ie(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=ae(e);void 0!==n&&n.activeInputs.forEach((([e])=>oe(e,t)))}se(e)&&$(e)},le=e=>{oe(e.destination,[])},ce=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),ue=e=>"context"in e,he=e=>ue(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 i=e.get(t);void 0===i?e.set(t,new Set([[n,s]])):de(i,[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=G(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)},Ae=e=>W(T,e),xe=e=>W(N,e),Ce=e=>R.has(e),ke=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),i=r.getChannelData(0);i[0]=1,i[1]=1;const a=e.createBufferSource();a.buffer=r,a.loop=!0,a.connect(t).connect(e.destination),a.connect(s),a.disconnect(s),t.onaudioprocess=s=>{const r=s.inputBuffer.getChannelData(0);Array.prototype.some.call(r,(e=>1===e))?n(!0):n(!1),a.stop(),t.onaudioprocess=null,a.disconnect(t),t.disconnect(e.destination)},a.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,Te=e=>{const t=new Map;e.connect=(e=>(n,s=0,r=0)=>{const i=_e(n)?e(n,s,r):e(n,s),a=t.get(n);return void 0===a?t.set(n,[{input:r,output:s}]):a.every((e=>e.input!==r||e.output!==s))&&a.push({input:r,output:s}),i})(e.connect.bind(e)),e.disconnect=(n=>(s,r,i)=>{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!==i||void 0===i)));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)},Ie=(e,t,n,s)=>{const{activeInputs:r,passiveInputs:i}=ae(t),{outputs:a}=ie(e),o=q(e),l=a=>{const o=Ae(e),l=xe(t);if(a){const t=we(i,e,n);pe(r,e,t,!1),s||Ce(e)||o.connect(l,n)}else{const t=((e,t,n)=>G(e,(e=>e[0]===t&&e[1]===n)))(r,e,n);fe(i,t,!1),s||Ce(e)||o.disconnect(l,n)}};return!!de(a,[t,n],(e=>e[0]===t&&e[1]===n),!0)&&(o.add(l),se(e)?pe(r,e,[n,l],!0):fe(i,[e,n,l],!0),!0)},Ne=(e,t,n,s,r)=>{const[i,a]=((e,t,n,s)=>{const{activeInputs:r,passiveInputs:i}=ie(t),a=ye(r[s],e,n);if(null===a)return[U(i,e,n,s)[2],!1];return[a[2],!0]})(e,n,s,r);if(null!==i&&(be(e,i),!a||t||Ce(e)||ve(Ae(e),Ae(n),s,r)),se(n)){const{activeInputs:e}=ie(n);K(n,e)}},Oe=(e,t,n,s)=>{const[r,i]=((e,t,n)=>{const{activeInputs:s,passiveInputs:r}=ae(t),i=ye(s,e,n);if(null===i)return[we(r,e,n)[1],!1];return[i[2],!0]})(e,n,s);null!==r&&(be(e,r),!i||t||Ce(e)||Ae(e).disconnect(xe(n),s))};class De{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 Re={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 i=e.getChannelData(s);if(0===t[n].byteLength)t[n]=i.slice(r,r+128);else{const e=new Float32Array(i.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,c=r.reduce(((e,t)=>e+t),0),u=0===c?null:n.createBuffer(c,o,n.sampleRate);if(void 0===i)throw new Error("Missing the processor constructor.");const h=ie(e),d=await((e,t)=>{const n=W(F,e),s=Ae(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 c=0;c0&&null!==t)for(let e=0;e{Me(t,m,e,l+n,c)}));for(let e=0;e0===h.activeInputs[t].size?[]:e)),t=a(c/n.sampleRate,n.sampleRate,(()=>d.process(e,f,m)));if(null!==u)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,i,a,o,l,c,u)=>{const h=c.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)},it=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)},at=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)},ct=(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},ut=(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 i=e.length-1;i>=0;i-=1)r=t,n=[(s=n)[0]*r[0]-s[1]*r[1],s[0]*r[1]+s[1]*r[0]],n[0]+=e[i];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},At={disableNormalization:!1},xt={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},Ct=()=>new DOMException("","UnknownError"),kt={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:i,set:a}=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,{get:n(i),set:s(a)})},Tt=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(s){if(9!==s.code)throw s;Tt(e,t,n+1e-7)}},It=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},Dt=()=>{try{new DOMException}catch{return!1}return!0},Rt=()=>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,i],a)=>{e(t[r],[n,s,i],(e=>e[0]===n&&e[1]===s),a)})(de),zt=(e=>(t,n,[s,r,i],a)=>{const o=t.get(s);void 0===o?t.set(s,new Set([[r,n,i]])):e(o,[r,n,i],(e=>e[0]===r&&e[1]===n),a)})(de),Lt=(e=>(t,n,s,r)=>e(t[r],(e=>e[0]===n&&e[1]===s)))(G),Pt=new WeakMap,Vt=(e=>t=>{var n;return null!==(n=e.get(t))&&void 0!==n?n:0})(Pt),Wt=(Gt=new Map,Ut=new WeakMap,(e,t)=>{const n=Ut.get(e);if(void 0!==n)return n;const s=Gt.get(e);if(void 0!==s)return s;try{const n=t();return n instanceof Promise?(Gt.set(e,n),n.catch((()=>!1)).then((t=>(Gt.delete(e),Ut.set(e,t),t)))):(Ut.set(e,n),n)}catch{return Ut.set(e,!1),!1}});var Gt,Ut;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})(ie),$t=((e,t,n)=>async(s,r,i)=>{const a=e(s);await Promise.all(a.activeInputs.map(((e,a)=>Array.from(e).map((async([e,o])=>{const l=t(e),c=await l.render(e,r),u=s.context.destination;n(e)||s===u&&n(s)||c.connect(i,o,a)})))).reduce(((e,t)=>[...e,...t]),[]))})(ie,Ht,Ce),Kt=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,fftSize:a.fftSize,maxDecibels:a.maxDecibels,minDecibels:a.minDecibels,smoothingTimeConstant:a.smoothingTimeConstant};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(jt,Ae,$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,i,a,o,l,c,u,h,d,p,f,m)=>class extends c{constructor(t,s,r,i){super(r),this._context=t,this._nativeAudioNode=r;const a=u(t);h(a)&&!0!==n(Se,(()=>Se(a,m)))&&Te(r),T.set(this,r),D.set(this,new Set),"closed"!==t.state&&s&&j(this),e(this,i,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 c=u(this._context),h=f(c);if(d(e)||p(e))throw i();if(ue(e)){const r=Ae(e);try{const t=ge(this._nativeAudioNode,r,n,o),s=ke(this);(h||s)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!s&&ke(e)&&j(e)}catch(e){if(12===e.code)throw i();throw e}if(t(this,e,n,o,h)){const t=l([this],e);Ee(t,s(h))}return e}const m=xe(e);if("playbackRate"===m.name&&1024===m.maxValue)throw a();try{this._nativeAudioNode.connect(m,n),(h||ke(this))&&this._nativeAudioNode.disconnect(m,n)}catch(e){if(12===e.code)throw i();throw e}if(Ie(this,e,n,h)){const t=l([this],e);Ee(t,s(h))}}disconnect(e,t,n){let s;const a=u(this._context),c=f(a);if(void 0===e)s=((e,t)=>{const n=ie(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,c);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw r();s=((e,t,n)=>{const s=ie(e),r=[];for(const i of s.outputs)i[1]===n&&(he(i)?Ne(e,t,...i):Oe(e,t,...i),r.push(i[0]),s.outputs.delete(i));return r})(this,c,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw r();if(ue(e)&&void 0!==n&&(n<0||n>=e.numberOfInputs))throw r();if(s=((e,t,n,s,r)=>{const i=ie(e);return Array.from(i.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),i.outputs.delete(n),n[0])))})(this,c,e,t,n),0===s.length)throw i()}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}=i(m),{outputs:A}=i(f),x=o(f),C=i=>{const o=l(m),c=l(f);if(i){const t=U(v,f,g,y);e(w,f,t,!1),b||h(f)||n(c,o,g,y),d(m)&&j(m)}else{const e=s(w,f,g,y);t(v,y,e,!1),b||h(f)||r(c,o,g,y);const n=a(m);if(0===n)u(m)&&K(m,w);else{const e=p.get(m);void 0!==e&&clearTimeout(e),p.set(m,setTimeout((()=>{u(m)&&K(m,w)}),1e3*n))}}};return!!c(A,[m,g,y],(e=>e[0]===m&&e[1]===g&&e[2]===y),!0)&&(x.add(C),u(f)?e(w,f,[g,y,C],!0):t(v,y,[f,g,C],!0),!0)}})(Bt,zt,ge,Lt,ve,ie,Vt,q,Ae,de,se,Ce,ke),Wt,((e,t,n,s,r,i)=>a=>(o,l)=>{const c=e.get(o);if(void 0===c){if(!a&&i(o)){const e=s(o),{outputs:i}=n(o);for(const n of i)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,c+l)})(R,ve,ie,Ae,xe,se),Q,Xe,yt,((e,t,n,s,r,i,a,o)=>(l,c)=>{const u=t.get(l);if(void 0===u)throw new Error("Missing the expected cycle count.");const h=i(l.context),d=o(h);if(u===c){if(t.delete(l),!d&&a(l)){const t=s(l),{outputs:i}=n(l);for(const n of i)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,u-c)})(ge,R,ie,Ae,xe,Xt,se,Qt),((e,t,n)=>function s(r,i){const a=ue(i)?i:n(e,i);if((e=>"delayTime"in e)(a))return[];if(r[0]===a)return[r];if(r.includes(a))return[];const{outputs:o}=t(a);return Array.from(o).map((e=>s([...r,a],e[0]))).reduce(((e,t)=>e.concat(t)),[])})(Jt,ie,W),en,Xt,nn,sn,rn,Qt,an);var ln;const cn=((e,t,n,s,r,i)=>class extends e{constructor(e,n){const a=r(e),o={...X,...n},l=s(a,o);super(e,!1,l,i(a)?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),un=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,i=0)=>{const a=e(i),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(o),u=s.length;for(let e=a<0?-a:0;e+a{const a=e(i),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(o),u=s.length;for(let e=a<0?-a:0;e+at=>{t.copyFromChannel=(n=>(s,r,i=0)=>{const a=e(i),o=e(r);if(a(s,r,i=0)=>{const a=e(i),o=e(r);if(a{let l=null;return class c{constructor(c){if(null===r)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:u,numberOfChannels:h,sampleRate:d}={...ee,...c};null===l&&(l=new r(1,1,44100));const p=null!==s&&t(i,i)?new s({length:u,numberOfChannels:h,sampleRate:d}):l.createBuffer(h,u,d);if(0===p.numberOfChannels)throw n();return"function"!=typeof p.copyFromChannel?(a(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)===c.prototype||e.has(t)}}})(un,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,i)=>{const a=t(s);await Promise.all(Array.from(a.activeInputs).map((async([t,s])=>{const a=e(t),o=await a.render(t,r);n(t)||o.connect(i,s)})))})(Ht,ae,Ce),wn=(e=>(t,n,s)=>e(n,t,s))(bn),vn=((e,t,n,s,r,i,a,o,l,c,u)=>(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,i)=>{if(n)throw Ke();t.call(e,s,r,i),n=!0}})(e.start)})(p),t(s,(()=>s(h)))||l(p),t(r,(()=>r(h)))||c(p,h),t(i,(()=>i(h)))||it(p),t(a,(()=>a(h)))||u(p,h),t(o,(()=>o(h)))||at(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}),It,Nt,Ot,(e=>{e.start=(t=>(n=0,s=0,r)=>{const i=e.buffer,a=null===i?s:Math.min(i.duration,s);null!==i&&a>i.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,a,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),An=((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})(ae),bn),xn=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null;return{set start(e){a=e},set stop(e){o=e},render(l,c){const u=i.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const h=Z(u,c);if(!h){const e={buffer:u.buffer,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,loop:u.loop,loopEnd:u.loopEnd,loopStart:u.loopStart,playbackRate:u.playbackRate.value};u=t(c,e),null!==a&&u.start(...a),null!==o&&u.stop(o)}return i.set(c,u),h?await e(c,l.playbackRate,u.playbackRate):await s(c,l.playbackRate,u.playbackRate),await r(l,c,u),u})(l,c)}}})(wn,vn,Ae,An,$t),Cn=((e,t,n,s,r,i,a,o,l,c,u,h,d)=>(p,f,m,g=null,y=null)=>{const b=m.value,w=new S(b),v=f?s(w):null,A={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,A.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 A},cancelScheduledValues:e=>(null===v&&w.flush(p.context.currentTime),w.add(i(e)),m.cancelScheduledValues(e),A),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(c(b,n)),m.setValueAtTime(b,n)),w.add(a(e,t)),m.exponentialRampToValueAtTime(e,t),A},linearRampToValueAtTime(e,t){const n=p.context.currentTime;return null===v&&w.flush(n),0===Array.from(w).length&&(w.add(c(b,n)),m.setValueAtTime(b,n)),w.add(o(e,t)),m.linearRampToValueAtTime(e,t),A},setTargetAtTime:(e,t,n)=>(null===v&&w.flush(p.context.currentTime),w.add(l(e,t,n)),m.setTargetAtTime(e,t,n),A),setValueAtTime:(e,t)=>(null===v&&w.flush(p.context.currentTime),w.add(c(e,t)),m.setValueAtTime(e,t),A),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,i=Math.ceil(t*r),a=Math.floor(e*r),o=a-i,l=new Float32Array(o);for(let e=0;e{kn.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,c,tn,Tt);var kn;const Sn=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,s){const o=i(e),l={...re,...s},c=r(o,l),u=a(o),h=u?t():null;super(e,!1,c,h),this._audioBufferSourceNodeRenderer=h,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=c,this._onended=null,this._playbackRate=n(this,u,c.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,xn,Cn,Ke,vn,Xt,Qt,Ft),En=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,n){const s=i(e),l=a(s),c=r(s,n,l);super(e,!1,c,l?t(o):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=c}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 i=n.destination;if(i.channelCount!==s)try{i.channelCount=s}catch{}r&&"explicit"!==i.channelCountMode&&(i.channelCountMode="explicit"),0===i.maxChannelCount&&Object.defineProperty(i,"maxChannelCount",{value:s});const a=e(n,{channelCount:s,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,gain:1});return t(a,"channelCount",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t);try{i.channelCount=t}catch(e){if(t>i.maxChannelCount)throw e}})),t(a,"channelCountMode",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelCountMode=t})),t(a,"channelInterpretation",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelInterpretation=t})),Object.defineProperty(a,"maxChannelCount",{get:()=>i.maxChannelCount}),a.connect(i),a})(pt,_t),Xt,Qt,$t),_n=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const c=Z(l,o);if(!c){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 i.set(o,l),c?(await e(o,a.Q,l.Q),await e(o,a.detune,l.detune),await e(o,a.frequency,l.frequency),await e(o,a.gain,l.gain)):(await s(o,a.Q,l.Q),await s(o,a.detune,l.detune),await s(o,a.frequency,l.frequency),await s(o,a.gain,l.gain)),await r(a,o,l),l})(a,o)}}})(wn,ct,Ae,An,$t),Tn=(e=>(t,n)=>e.set(t,n))(Pt),In=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,s){const l=i(e),c={...Le,...s},u=r(l,c),h=a(l);super(e,!1,u,h?n():null),this._Q=t(this,h,u.Q,ne,te),this._detune=t(this,h,u.detune,1200*Math.log2(ne),-1200*Math.log2(ne)),this._frequency=t(this,h,u.frequency,e.sampleRate/2,0),this._gain=t(this,h,u.gain,40*Math.log10(ne),te),this._nativeBiquadFilterNode=u,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,Cn,_n,Xe,ct,Xt,Qt,Tn),Nn=((e,t)=>(n,s,r)=>{const i=new Set;return n.connect=(r=>(a,o=0,l=0)=>{const c=0===i.size;if(t(a))return r.call(n,a,o,l),e(i,[a,o,l],(e=>e[0]===a&&e[1]===o&&e[2]===l),!0),c&&s(),a;r.call(n,a,o),e(i,[a,o],(e=>e[0]===a&&e[1]===o),!0),c&&s()})(n.connect),n.disconnect=(e=>(s,a,o)=>{const l=i.size>0;if(void 0===s)e.apply(n),i.clear();else if("number"==typeof s){e.call(n,s);for(const e of i)e[1]===s&&i.delete(e)}else{t(s)?e.call(n,s,a,o):e.call(n,s,a);for(const e of i)e[0]!==s||void 0!==a&&e[1]!==a||void 0!==o&&e[2]!==o||i.delete(e)}const c=0===i.size;l&&c&&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),Dn=((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),Rn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(Dn,Ae,$t),Mn=((e,t,n,s,r)=>class extends e{constructor(e,i){const a=s(e),o={...Pe,...i};super(e,!1,n(a,o),r(a)?t():null)}})(on,Rn,Dn,Xt,Qt),Fn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(ut,Ae,$t),Bn=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=s(e),l=i({...Ve,...a});super(e,!1,n(o,l),r(o)?t():null)}})(on,Fn,ut,Xt,Qt,(e=>({...e,channelCount:e.numberOfOutputs}))),zn=((e,t,n,s)=>(r,{offset:i,...a})=>{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}),c=n(r,{...a,gain:i}),u=o.getChannelData(0);u[0]=1,u[1]=1,l.buffer=o,l.loop=!0;const h={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get offset(){return c.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,c),(()=>l.connect(c)),(()=>l.disconnect(c)))})(yn,vn,pt,Nn),Ln=((e,t,n,s,r)=>(i,a)=>{if(void 0===i.createConstantSource)return n(i,a);const o=i.createConstantSource();return nt(o,a),rt(o,a,"offset"),t(s,(()=>s(i)))||it(o),t(r,(()=>r(i)))||at(o),e(i,o),o})(yn,Wt,zn,It,Ot),Pn=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null;return{set start(e){a=e},set stop(e){o=e},render(l,c){const u=i.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const h=Z(u,c);if(!h){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,offset:u.offset.value};u=t(c,e),null!==a&&u.start(a),null!==o&&u.stop(o)}return i.set(c,u),h?await e(c,l.offset,u.offset):await s(c,l.offset,u.offset),await r(l,c,u),u})(l,c)}}})(wn,Ln,Ae,An,$t),Vn=((e,t,n,s,r,i,a)=>class extends e{constructor(e,a){const o=r(e),l={...We,...a},c=s(o,l),u=i(o),h=u?n():null;super(e,!1,c,h),this._constantSourceNodeRenderer=h,this._nativeConstantSourceNode=c,this._offset=t(this,u,c.offset,ne,te),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(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,Cn,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),Gn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=e(i,t)}return s.set(i,a),me(a)?await n(r,i,a.inputs[0]):await n(r,i,a),a})(r,i)}}})(Wn,Ae,$t),Un=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=s(e),l={...Ge,...a},c=n(o,l);super(e,!1,c,r(o)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=c,null!==l.buffer&&i(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,i(this,0)}else this._isBufferNullified=!1,i(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}})(on,Gn,Wn,Xt,Qt,Tn),qn=((e,t,n,s,r)=>i=>{const a=new WeakMap;return{render(o,l){const c=a.get(l);return void 0!==c?Promise.resolve(c):(async(o,l)=>{let c=n(o);const u=Z(c,l);if(!u){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,delayTime:c.delayTime.value,maxDelayTime:i};c=t(l,e)}return a.set(l,c),u?await e(l,o.delayTime,c.delayTime):await s(l,o.delayTime,c.delayTime),await r(o,l,c),c})(o,l)}}})(wn,dt,Ae,An,$t),jn=((e,t,n,s,r,i,a)=>class extends e{constructor(e,o){const l=r(e),c={...qe,...o},u=s(l,c),h=i(l);super(e,!1,u,h?n(c.maxDelayTime):null),this._delayTime=t(this,h,u.delayTime),a(this,c.maxDelayTime)}get delayTime(){return this._delayTime}})(on,Cn,qn,dt,Xt,Qt,Tn),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 i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const c=Z(l,o);if(!c){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 i.set(o,l),c?(await e(o,a.attack,l.attack),await e(o,a.knee,l.knee),await e(o,a.ratio,l.ratio),await e(o,a.release,l.release),await e(o,a.threshold,l.threshold)):(await s(o,a.attack,l.attack),await s(o,a.knee,l.knee),await s(o,a.ratio,l.ratio),await s(o,a.release,l.release),await s(o,a.threshold,l.threshold)),await r(a,o,l),l})(a,o)}}})(wn,Hn,Ae,An,$t),Kn=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,r){const l=i(e),c={...He,...r},u=s(l,c),h=a(l);super(e,!1,u,h?n():null),this._attack=t(this,h,u.attack),this._knee=t(this,h,u.knee),this._nativeDynamicsCompressorNode=u,this._ratio=t(this,h,u.ratio),this._release=t(this,h,u.release),this._threshold=t(this,h,u.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,Cn,$n,Hn,yt,Xt,Qt,Tn),Xn=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const c=Z(l,o);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(o,e)}return i.set(o,l),c?await e(o,a.gain,l.gain):await s(o,a.gain,l.gain),await r(a,o,l),l})(a,o)}}})(wn,pt,Ae,An,$t),Zn=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=r(e),l={...$e,...a},c=s(o,l),u=i(o);super(e,!1,c,u?n():null),this._gain=t(this,u,c.gain,ne,te)}get gain(){return this._gain}})(on,Cn,Xn,pt,Xt,Qt),Yn=((e,t,n,s)=>(r,i,{channelCount:a,channelCountMode:o,channelInterpretation:l,feedback:c,feedforward:u})=>{const h=ot(i,r.sampleRate),d=c instanceof Float64Array?c:new Float64Array(c),p=u instanceof Float64Array?u:new Float64Array(u),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)=>(i,a)=>{const o=new WeakMap;let l=null;const c=async(c,u)=>{let h=null,d=t(c);const p=Z(d,u);if(void 0===u.createIIRFilter?h=e(u,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):p||(d=u.createIIRFilter(a,i)),o.set(u,null===h?d:h),null!==h){if(null===l){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new n(c.context.destination.channelCount,c.context.length,u.sampleRate);l=(async()=>{await s(c,e,e.destination);return((e,t,n,s)=>{const r=n instanceof Float64Array?n:new Float64Array(n),i=s instanceof Float64Array?s:new Float64Array(s),a=r.length,o=i.length,l=Math.min(a,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,i)=>class extends e{constructor(e,a){const o=s(e),l=r(o),c={...Ze,...a},u=t(o,l?null:e.baseLatency,c);super(e,!1,u,l?n(c.feedback,c.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)})})(u),this._nativeIIRFilterNode=u,i(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}})(on,es,Jn,Xt,Qt,Tn),ns=((e,t,n,s,r,i,a,o)=>(l,c)=>{const u=c.listener,{forwardX:h,forwardY:d,forwardZ:p,positionX:f,positionY:m,positionZ:g,upX:y,upY:b,upZ:w}=void 0===u.forwardX?(()=>{const h=new Float32Array(1),d=t(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),p=a(c);let f=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const y=()=>{if(f)return;f=!0;const e=s(c,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[i(e,h,0),i(e,h,1),i(e,h,2),i(e,h,3),i(e,h,4),i(e,h,5)];t.some(((e,t)=>e!==m[t]))&&(u.setOrientation(...t),m=t);const n=[i(e,h,6),i(e,h,7),i(e,h,8)];n.some(((e,t)=>e!==g[t]))&&(u.setPosition(...n),g=n)},d.connect(e)},b=e=>t=>{t!==m[e]&&(m[e]=t,u.setOrientation(...m))},w=e=>t=>{t!==g[e]&&(g[e]=t,u.setPosition(...g))},v=(t,s,i)=>{const a=n(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:s});a.connect(d,0,t),a.start(),Object.defineProperty(a.offset,"defaultValue",{get:()=>s});const u=e({context:l},p,a.offset,ne,te);var h,f,m,g,b,w,v;return o(u,"value",(e=>()=>e.call(u)),(e=>t=>{try{e.call(u,t)}catch(e){if(9!==e.code)throw e}y(),p&&i(t)})),u.cancelAndHoldAtTime=(h=u.cancelAndHoldAtTime,p?()=>{throw r()}:(...e)=>{const t=h.apply(u,e);return y(),t}),u.cancelScheduledValues=(f=u.cancelScheduledValues,p?()=>{throw r()}:(...e)=>{const t=f.apply(u,e);return y(),t}),u.exponentialRampToValueAtTime=(m=u.exponentialRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=m.apply(u,e);return y(),t}),u.linearRampToValueAtTime=(g=u.linearRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=g.apply(u,e);return y(),t}),u.setTargetAtTime=(b=u.setTargetAtTime,p?()=>{throw r()}:(...e)=>{const t=b.apply(u,e);return y(),t}),u.setValueAtTime=(w=u.setValueAtTime,p?()=>{throw r()}:(...e)=>{const t=w.apply(u,e);return y(),t}),u.setValueCurveAtTime=(v=u.setValueCurveAtTime,p?()=>{throw r()}:(...e)=>{const t=v.apply(u,e);return y(),t}),u};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))}})():u;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}}})(Cn,Dn,Ln,gt,yt,St,Qt,_t),ss=new WeakMap,rs=((e,t,n,s,r,i)=>class extends n{constructor(n,i){super(n),this._nativeContext=n,O.set(this,n),s(n)&&r.set(n,new Set),this._destination=new e(this,i),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?i(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),is=((e,t,n,s,r,i)=>(a,o)=>{const l=a.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(a)))||it(l),t(s,(()=>s(a)))||i(l,a),t(r,(()=>r(a)))||at(l),e(a,l),l})(yn,Wt,It,Nt,Ot,Mt),as=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null,l=null;return{set periodicWave(e){a=e},set start(e){o=e},set stop(e){l=e},render(c,u){const h=i.get(u);return void 0!==h?Promise.resolve(h):(async(c,u)=>{let h=n(c);const d=Z(h,u);if(!d){const e={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,detune:h.detune.value,frequency:h.frequency.value,periodicWave:null===a?void 0:a,type:h.type};h=t(u,e),null!==o&&h.start(o),null!==l&&h.stop(l)}return i.set(u,h),d?(await e(u,c.detune,h.detune),await e(u,c.frequency,h.frequency)):(await s(u,c.detune,h.detune),await s(u,c.frequency,h.frequency)),await r(c,u,h),h})(c,u)}}})(wn,is,Ae,An,$t),os=((e,t,n,s,r,i,a)=>class extends e{constructor(e,a){const o=r(e),l={...wt,...a},c=n(o,l),u=i(o),h=u?s():null,d=e.sampleRate/2;super(e,!1,c,h),this._detune=t(this,u,c.detune,153600,-153600),this._frequency=t(this,u,c.frequency,d,-d),this._nativeOscillatorNode=c,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?a(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,Cn,is,as,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),cs=((e,t,n,s,r)=>(i,{curve:a,oversample:o,...l})=>{const c=i.createWaveShaper(),u=i.createWaveShaper();nt(c,l),nt(u,l);const h=n(i,{...l,gain:1}),d=n(i,{...l,gain:-1}),p=n(i,{...l,gain:1}),f=n(i,{...l,gain:-1});let m=null,g=!1,y=null;const b={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){h.channelCount=e,d.channelCount=e,c.channelCount=e,p.channelCount=e,u.channelCount=e,f.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){h.channelCountMode=e,d.channelCountMode=e,c.channelCountMode=e,p.channelCountMode=e,u.channelCountMode=e,f.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){h.channelInterpretation=e,d.channelInterpretation=e,c.channelInterpretation=e,p.channelInterpretation=e,u.channelInterpretation=e,f.channelInterpretation=e},get context(){return c.context},get curve(){return y},set curve(n){if(null!==n&&n.length<2)throw t();if(null===n)c.curve=n,u.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),i=(e+1)/2-1;for(let a=1;ah.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>h.dispatchEvent(e[0]),removeEventListener:(...e)=>h.removeEventListener(e[0],e[1],e[2])};null!==a&&(b.curve=a instanceof Float32Array?a:new Float32Array(a)),o!==b.oversample&&(b.oversample=o);return r(ht(b,p),(()=>{h.connect(c).connect(p),h.connect(d).connect(u).connect(f).connect(p),g=!0,s(y)&&(m=e(i,h))}),(()=>{h.disconnect(c),c.disconnect(p),h.disconnect(d),d.disconnect(u),u.disconnect(f),f.disconnect(p),g=!1,null!==m&&(m(),m=null)}))})(ls,Ke,pt,Et,Nn),us=((e,t,n,s,r,i,a)=>(o,l)=>{const c=o.createWaveShaper();if(null!==i&&"webkitAudioContext"===i.name&&void 0===o.createGain().gain.automationRate)return n(o,l);nt(c,l);const u=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==u&&u.length<2)throw t();tt(c,{curve:u},"curve"),tt(c,l,"oversample");let h=null,d=!1;a(c,"curve",(e=>()=>e.call(c)),(t=>n=>(t.call(c,n),d&&(s(n)&&null===h?h=e(o,c):s(n)||null===h||(h(),h=null)),n)));return r(c,(()=>{d=!0,s(c.curve)&&(h=e(o,c))}),(()=>{d=!1,null!==h&&(h(),h=null)}))})(ls,Ke,cs,Et,Nn,tn,_t),hs=((e,t,n,s,r,i,a,o,l,c)=>(u,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:p,distanceModel:f,maxDistance:m,orientationX:g,orientationY:y,orientationZ:b,panningModel:w,positionX:v,positionY:A,positionZ:x,refDistance:C,rolloffFactor:k,...S})=>{const E=u.createPanner();if(S.channelCount>2)throw a();if("max"===S.channelCountMode)throw a();nt(E,S);const _={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},T=n(u,{..._,channelInterpretation:"speakers",numberOfInputs:6}),I=s(u,{...S,gain:1}),N=s(u,{..._,gain:1}),O=s(u,{..._,gain:0}),D=s(u,{..._,gain:0}),R=s(u,{..._,gain:0}),M=s(u,{..._,gain:0}),F=s(u,{..._,gain:0}),B=r(u,256,6,1),z=i(u,{..._,curve:new Float32Array([1,1]),oversample:"none"});let L=[g,y,b],P=[v,A,x];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(D.gain,"defaultValue",{get:()=>0}),Object.defineProperty(R.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 a();I.channelCount=e,E.channelCount=e},get channelCountMode(){return E.channelCountMode},set channelCountMode(e){if("max"===e)throw a();I.channelCountMode=e,E.channelCountMode=e},get channelInterpretation(){return E.channelInterpretation},set channelInterpretation(e){I.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[I]},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 D.gain},get panningModel(){return E.panningModel},set panningModel(e){E.panningModel=e},get positionX(){return R.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)=>I.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>I.dispatchEvent(e[0]),removeEventListener:(...e)=>I.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),A!==W.positionY.value&&(W.positionY.value=A),x!==W.positionZ.value&&(W.positionZ.value=x),C!==W.refDistance&&(W.refDistance=C),k!==W.rolloffFactor&&(W.rolloffFactor=k),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 c(ht(W,E),(()=>{I.connect(E),e(I,z,0,0),z.connect(N).connect(T,0,0),z.connect(O).connect(T,0,1),z.connect(D).connect(T,0,2),z.connect(R).connect(T,0,3),z.connect(M).connect(T,0,4),z.connect(F).connect(T,0,5),T.connect(B).connect(u.destination)}),(()=>{I.disconnect(E),o(I,z,0,0),z.disconnect(N),N.disconnect(T),z.disconnect(O),O.disconnect(T),z.disconnect(D),D.disconnect(T),z.disconnect(R),R.disconnect(T),z.disconnect(M),M.disconnect(T),z.disconnect(F),F.disconnect(T),T.disconnect(B),B.disconnect(u.destination)}))})(ge,Ke,Dn,pt,gt,us,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,i,a,o,l,c)=>()=>{const u=new WeakMap;let h=null;return{render(d,p){const f=u.get(p);return void 0!==f?Promise.resolve(f):(async(d,p)=>{let f=null,m=i(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(u.set(p,null===f?m:f),null!==f){if(null===h){if(null===a)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new a(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 c(e)})()}const e=await h,i=s(p,{...g,gain:1});await l(d,p,i);const u=[];for(let t=0;te!==m[t]))||n.some(((e,t)=>e!==b[t]))){m=e,b=n;const a=t/p.sampleRate;w.gain.setValueAtTime(0,a),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,a),i.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,Dn,Ln,pt,ds,Ae,Yt,An,$t,Qn),fs=((e,t,n,s,r,i,a)=>class extends e{constructor(e,o){const l=r(e),c={...vt,...o},u=n(l,c),h=i(l);super(e,!1,u,h?s():null),this._nativePannerNode=u,this._orientationX=t(this,h,u.orientationX,ne,te),this._orientationY=t(this,h,u.orientationY,ne,te),this._orientationZ=t(this,h,u.orientationZ,ne,te),this._positionX=t(this,h,u.positionX,ne,te),this._positionY=t(this,h,u.positionY,ne,te),this._positionZ=t(this,h,u.positionZ,ne,te),a(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,Cn,ds,ps,Xt,Qt,Tn),ms=(e=>(t,{disableNormalization:n,imag:s,real:r})=>{const i=s instanceof Float32Array?s:new Float32Array(s),a=r instanceof Float32Array?r:new Float32Array(r),o=t.createPeriodicWave(a,i,{disableNormalization:n});if(Array.from(s).length<2)throw e();return o})(Q),gs=((e,t,n,s)=>class r{constructor(r,i){const a=t(r),o=s({...At,...i}),l=e(a,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,i)=>{const a=16385,o=new Float32Array([1,1]),l=Math.PI/2,c={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...c,oversample:"none"},h=(e,i,h,d,p)=>{if(1===i)return((e,t,r,i)=>{const h=new Float32Array(a),d=new Float32Array(a);for(let e=0;e{const d=new Float32Array(a),p=new Float32Array(a),f=new Float32Array(a),m=new Float32Array(a),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,{...c,gain:0}),w=s(e,{...u,curve:d}),v=n(e,{...c,gain:0}),A=s(e,{...u,curve:p}),x=s(e,{...u,curve:o}),C=n(e,{...c,gain:0}),k=s(e,{...u,curve:f}),S=n(e,{...c,gain:0}),E=s(e,{...u,curve:m});return{connectGraph(){r.connect(y),r.connect(void 0===x.inputs?x:x.inputs[0]),y.connect(b,0),y.connect(v,0),y.connect(C,1),y.connect(S,1),x.connect(i),i.connect(void 0===w.inputs?w:w.inputs[0]),i.connect(void 0===A.inputs?A:A.inputs[0]),i.connect(void 0===k.inputs?k:k.inputs[0]),i.connect(void 0===E.inputs?E:E.inputs[0]),w.connect(b.gain),A.connect(v.gain),k.connect(C.gain),E.connect(S.gain),b.connect(h,0,0),C.connect(h,0,0),v.connect(h,0,1),S.connect(h,0,1)},disconnectGraph(){r.disconnect(y),r.disconnect(void 0===x.inputs?x:x.inputs[0]),y.disconnect(b,0),y.disconnect(v,0),y.disconnect(C,1),y.disconnect(S,1),x.disconnect(i),i.disconnect(void 0===w.inputs?w:w.inputs[0]),i.disconnect(void 0===A.inputs?A:A.inputs[0]),i.disconnect(void 0===k.inputs?k:k.inputs[0]),i.disconnect(void 0===E.inputs?E:E.inputs[0]),w.disconnect(b.gain),A.disconnect(v.gain),k.disconnect(C.gain),E.disconnect(S.gain),b.disconnect(h,0,0),C.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:a,pan:o,...l})=>{if("max"===a)throw r();const c=e(t,{...l,channelCount:1,channelCountMode:a,numberOfInputs:2}),u=n(t,{...l,channelCount:s,channelCountMode:a,gain:1}),d=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:o});let{connectGraph:p,disconnectGraph:f}=h(t,s,u,d,c);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 u.channelCount},set channelCount(e){u.channelCount!==e&&(g&&f(),({connectGraph:p,disconnectGraph:f}=h(t,e,u,d,c)),g&&p()),u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw r();u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[u]},get numberOfInputs(){return u.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get pan(){return d.gain},addEventListener:(...e)=>u.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>u.dispatchEvent(e[0]),removeEventListener:(...e)=>u.removeEventListener(e[0],e[1],e[2])};let g=!1;return i(ht(m,c),(()=>{p(),g=!0}),(()=>{f(),g=!1}))}})(Dn,ut,pt,us,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 i=n.createStereoPanner();return nt(i,s),rt(i,s,"pan"),Object.defineProperty(i,"channelCountMode",{get:()=>r,set:e=>{if(e!==r)throw t()}}),i})(ys,yt),ws=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const c=Z(l,o);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(o,e)}return i.set(o,l),c?await e(o,a.pan,l.pan):await s(o,a.pan,l.pan),me(l)?await r(a,o,l.inputs[0]):await r(a,o,l),l})(a,o)}}})(wn,bs,Ae,An,$t),vs=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=r(e),l={...xt,...a},c=n(o,l),u=i(o);super(e,!1,c,u?s():null),this._pan=t(this,u,c.pan)}get pan(){return this._pan}})(on,Cn,bs,ws,Xt,Qt),As=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=e(i,t)}return s.set(i,a),me(a)?await n(r,i,a.inputs[0]):await n(r,i,a),a})(r,i)}}})(us,Ae,$t),xs=((e,t,n,s,r,i,a)=>class extends e{constructor(e,t){const o=r(e),l={...kt,...t},c=n(o,l);super(e,!0,c,i(o)?s():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=c,a(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,us,As,Xt,Qt,Tn),Cs=(e=>null!==e&&e.isSecureContext)(qt),ks=(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=Cs?((e,t,n,s,r,i,a,o,l,c,u,h,d)=>{let p=0;return(f,m,g={credentials:"omit"})=>{const y=u.get(f);if(void 0!==y&&y.has(m))return Promise.resolve();const b=c.get(f);if(void 0!==b){const e=b.get(m);if(void 0!==e)return e}const w=i(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,i]=L(e,t),c=new Blob([`${r};((AudioWorkletProcessor,registerProcessor)=>{${i}\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"}),u=URL.createObjectURL(c);return w.audioWorklet.addModule(u,g).then((()=>{if(o(w))return w;const e=a(w);return e.audioWorklet.addModule(u,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${s}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(u)))}));return void 0===b?c.set(f,new Map([[m,v]])):b.set(m,v),v.then((()=>{const e=u.get(f);void 0===e?u.set(f,new Set([m])):e.add(m)})).finally((()=>{const e=c.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 i=e.document.createElement("script"),a=new Blob([t],{type:"application/javascript"}),o=URL.createObjectURL(a),l=e.onerror,c=()=>{e.onerror=l,URL.revokeObjectURL(o)};e.onerror=(t,n,r,i,a)=>n===o||n===e.location.href&&1===r&&1===i?(c(),s(a),!1):null!==l?l(t,n,r,i,a):void 0,i.onerror=()=>{c(),s(new SyntaxError)},i.onload=()=>{c(),n()},i.src=o,i.type="module",r.appendChild(i)}})))(qt),ks,(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 i=!1,a=!1;try{await s.audioWorklet.addModule(r);const t=new e(s,"a",{numberOfOutputs:0}),n=s.createOscillator();t.port.onmessage=()=>i=!0,t.onprocessorerror=()=>a=!0,n.connect(t),n.start(0),await s.startRendering(),await new Promise((e=>setTimeout(e)))}catch{}finally{URL.revokeObjectURL(r)}return i&&!a})(an,Yt),qt):void 0,Ts=((e,t)=>n=>e(n)||t(n))(nn,Qt),Is=((e,t,n,s,r,i,a,o,l,c,u)=>(h,d)=>{const p=a(h)?h:i(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=>(Ue(d).catch((()=>{})),t(o,(()=>o(n)))||u(n),e.add(n),n))):new Promise(((t,n)=>{const r=async()=>{try{await Ue(d)}catch{}},i=e=>{n(e),r()};try{p.decodeAudioData(d,(n=>{"function"!=typeof n.copyFromChannel&&(c(n),J(n)),e.add(n),r().then((()=>t(n)))}),(e=>{i(null===e?s():e)}))}catch(e){i(e)}}))})(un,Wt,(()=>new DOMException("","DataCloneError")),(()=>new DOMException("","EncodingError")),new WeakSet,Xt,Ts,Y,Je,fn,mn),Ns=((e,t,n,s,r,i,a,o,l,c,u,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 i(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new a(this,{numberOfOutputs:e})}createConstantSource(){return new o(this)}createConvolver(){return new l(this)}createDelay(e=1){return new u(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 c(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof n&&n(e),e}))}})(_s,cn,gn,Sn,In,Mn,Bn,Vn,Un,Is,jn,Kn,Zn,ts,rs,os,fs,gs,vs,xs),Os=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e),a=t(i,r);if(s(i))throw TypeError();super(e,!0,a,null),this._nativeMediaElementAudioSourceNode=a}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(on,((e,t)=>e.createMediaElementSource(t.mediaElement)),Xt,Qt),Ds=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e);if(s(i))throw new TypeError;const a={...Qe,...r},o=t(i,a);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),Rs=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e),a=t(i,r);if(s(i))throw new TypeError;super(e,!0,a,null),this._nativeMediaStreamAudioSourceNode=a}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]),i=n.createMediaStreamSource(r);if("audio"!==s.kind)throw e();if(t(n))throw new TypeError;return i})(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,i,a,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(!ce(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:i}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===r?512/i:"interactive"===r||void 0===r?256/i:"playback"===r?1024/i:128*Math.max(2,Math.min(128,Math.round(r*i/128)))/i,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 i(this)}createMediaStreamSource(e){return new a(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,Ct,Os,Ds,Rs,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 i=t[s];if(void 0===i)throw e();return _e(n)?i.connect(n,0,r):i.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),Gs=new WeakMap,Us=((e,t)=>n=>t(e,n))(Gs,W),qs=((e,t,n,s,r,i,a,o,l,c,u,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 A=new MessageChannel,x=[],C=[];for(let e=0;evoid 0===e?0:e},maxValue:{get:()=>void 0===t?ne:t},minValue:{get:()=>void 0===n?te:n}}),k.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)),T=r(p,{channelCount:Math.max(1,w),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,w)}),I=[];for(let e=0;e{const n=k[t];return n.connect(S,0,b+t),n.start(0),[e,n.offset]})));S.connect(_);let O=g.channelInterpretation,D=null;const R=0===g.numberOfOutputs?[_]:I,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 x)t.channelInterpretation=e;O=e},get context(){return _.context},get inputs(){return x},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return D},set onprocessorerror(e){"function"==typeof D&&M.removeEventListener("processorerror",D),D="function"==typeof e?e:null,"function"==typeof D&&M.addEventListener("processorerror",D)},get parameters(){return N},get port(){return A.port2},addEventListener:(...e)=>_.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,R),disconnect:c.bind(null,R),dispatchEvent:(...e)=>_.dispatchEvent(e[0]),removeEventListener:(...e)=>_.removeEventListener(e[0],e[1],e[2])},B=new Map;var z,L;A.port1.addEventListener=(z=A.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=>{u(p.currentTime,p.sampleRate,(()=>t(e)))},B.set(t,e[1]))}}return z.call(A.port1,e[0],e[1],e[2])}),A.port1.removeEventListener=(L=A.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(A.port1,e[0],e[1],e[2])});let P=null;Object.defineProperty(A.port1,"onmessage",{get:()=>P,set:e=>{"function"==typeof P&&A.port1.removeEventListener("message",P),P="function"==typeof e?e:null,"function"==typeof P&&(A.port1.addEventListener("message",P),A.port1.start())}}),m.prototype.port=A.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 i=lt(n,s);return r.set(t,i),i})(p,M,m,g);W.then((e=>V=e));const G=Be(g.numberOfInputs,g.channelCount),U=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(T);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=u(p.currentTime+s/p.sampleRate,p.sampleRate,(()=>V.process(e,U,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(T);for(let e=0,t=0;e{j&&(Z(),H()),K=!1}))})(Ps,Q,Ke,Dn,ut,Ln,pt,gt,yt,Ws,ks,Us,Nn),js=((e,t,n,s,r)=>(i,a,o,l,c,u)=>{if(null!==o)try{const t=new o(i,l,u),s=new Map;let a=null;if(Object.defineProperties(t,{channelCount:{get:()=>u.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>a,set:e=>{"function"==typeof a&&t.removeEventListener("processorerror",a),a="function"==typeof e?e:null,"function"==typeof a&&t.addEventListener("processorerror",a)}}}),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!==u.numberOfOutputs){const e=n(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(i.destination);return r(t,(()=>e.disconnect()),(()=>e.connect(i.destination)))}return t}catch(e){if(11===e.code)throw s();throw e}var h,d;if(void 0===c)throw s();return(e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}})(u),t(i,a,c,u)})(Ke,qs,pt,yt,Nn),Hs=((e,t,n,s,r,i,a,o,l,c,u,h,d,p,f,m)=>(g,y,b)=>{const w=new WeakMap;let v=null;return{render(A,x){o(x,A);const C=w.get(x);return void 0!==C?Promise.resolve(C):(async(o,A)=>{let x=u(o),C=null;const k=Z(x,A),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(A,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),i=[];for(let e=0;e{const l=new d(n,128*Math.ceil(o.context.length/128),A.sampleRate),c=[],u=[];for(let e=0;e{const t=i(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(),A,y,S,b,c)}const e=await v,t=n(A,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,u,h]=C;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)})(Gs),Xs=Cs?((e,t,n,s,r,i,a,o,l,c,u,h,d,p)=>class extends t{constructor(t,p,f){var m;const g=o(t),y=l(g),b=u({...Re,...f});d(b);const w=M.get(g),v=null==w?void 0:w.get(p),A=y||"closed"!==g.state?g:null!==(m=a(g))&&void 0!==m?m:g,x=r(A,y?null:t.baseLatency,c,p,v,b);super(t,!0,x,y?s(p,b,v):null);const C=[];x.parameters.forEach(((e,t)=>{const s=n(this,y,e);C.push([t,s])})),this._nativeAudioWorkletNode=x,this._onprocessorerror=null,this._parameters=new De(C),y&&e(g,this);const{activeInputs:k}=i(this);h(x,k)}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,Cn,Hs,js,ie,$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,Ct,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,i,a,o)=>(l,c)=>n(l).render(l,c).then((()=>Promise.all(Array.from(s(c)).map((e=>n(e).render(e,c)))))).then((()=>r(c))).then((n=>("function"!=typeof n.copyFromChannel?(a(n),J(n)):t(i,(()=>i(n)))||o(n),e.add(n),n))))(un,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 i;if("number"==typeof e&&void 0!==n&&void 0!==r)i={length:n,numberOfChannels:e,sampleRate:r};else{if("object"!=typeof e)throw new Error("The given parameters are not valid.");i=e}const{length:a,numberOfChannels:o,sampleRate:l}={...bt,...i},c=s(o,a,l);t(Je,(()=>Je(c)))||c.addEventListener("statechange",(()=>{let e=0;const t=n=>{"running"===this._state&&(e>0?(c.removeEventListener("statechange",t),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):e+=1)};return t})()),super(c,o),this._length=a,this._nativeOfflineAudioContext=c,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))(T,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,i,a,o,l,c,u,h,d,p,f,m)=>{if(e(t,t)&&e(n,n)&&e(r,r)&&e(i,i)&&e(o,o)&&e(l,l)&&e(c,c)&&e(u,u)&&e(h,h)&&e(d,d)&&e(p,p))return(await Promise.all([e(s,s),e(a,a),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),i=URL.createObjectURL(n);let a=!1;try{await r.audioWorklet.addModule(i);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=()=>a=!0,n.connect(t),n.start(0),await r.startRendering(),a=await new Promise((e=>{s.port1.onmessage=({data:t})=>e(1===t),s.port1.postMessage(0)}))}catch{}finally{s.port1.close(),URL.revokeObjectURL(i)}return a})(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),Dt,(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),Rt);function rr(e,t){if(!e)throw new Error(t)}function ir(e,t,n=1/0){if(!(t<=e&&e<=n))throw new RangeError(`Value must be within [${t}, ${n}], got: ${e}`)}function ar(e){e.isOffline||"running"===e.state||ur('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let or=console;function lr(e){or=e}function cr(...e){or.log(...e)}function ur(...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,Ar=vr&&(vr.hasOwnProperty("AudioContext")||vr.hasOwnProperty("webkitAudioContext"));function xr(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function Cr(e,t,n,s){return new(n||(n=Promise))((function(r,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(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(a,o)}l((s=s.apply(e,t||[])).next())}))}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;class kr{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 Tr(e){return Js(e)}function Ir(e){return e instanceof AudioBuffer}function Nr(e,t){return"value"===e||Sr(t)||Er(t)||Ir(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 Dr(e,t,n=[],s){const r={},i=Array.from(t);if(mr(i[0])&&s&&!Reflect.has(i[0],s)){Object.keys(i[0]).some((t=>Reflect.has(e,t)))||(Or(r,{[s]:i[0]}),n.splice(n.indexOf(s),1),i.shift())}if(1===i.length&&mr(i[0]))Or(r,i[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)&&cr(this,...e)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}Fr.version=i;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 Ur=[];function qr(e){Ur.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 Gr,this._timeoutIds=0,this._initialized=!1,this.isOffline=!1,this._workletModules=new Map;const e=Dr(Xr.getDefaults(),arguments,["context"]);e.context?this._context=e.context:this._context=function(e){return new Bs(e)}({latencyHint:e.latencyHint}),this._ticker=new kr(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,Ur.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(Tr(this._context),"Not available if OfflineAudioContext");return this._context.createMediaStreamSource(e)}createMediaElementSource(e){rr(Tr(this._context),"Not available if OfflineAudioContext");return this._context.createMediaElementSource(e)}createMediaStreamDestination(){rr(Tr(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 Cr(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 Cr(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 Tr(this._context)?this._context.resume():Promise.resolve()}close(){return Cr(this,void 0,void 0,(function*(){var e;Tr(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=Dr(Jr.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=e.reverse,this.onload=e.onload,e.url&&Ir(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:si().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 Cr(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=si(),i=r.createBuffer(n,s,r.sampleRate),a=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 Cr(this,void 0,void 0,(function*(){const t=new Jr;return yield t.load(e)}))}static load(e){return Cr(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 si().decodeAudioData(r)}))}static supportsType(e){const t=e.split("."),n=t[t.length-1];return""!==document.createElement("audio").canPlayType("audio/"+n)}static loaded(){return Cr(this,void 0,void 0,(function*(){for(yield Promise.resolve();Jr.downloads.length;)yield Jr.downloads[0]}))}}Jr.baseUrl="",Jr.downloads=[];class ei 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 Cr(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 Cr(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 ti=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 Cr(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 ni=ti;function si(){return ni===ti&&Ar&&ri(new Xr),ni}function ri(e){ni=Tr(e)?new Xr(e):_r(e)?new ei(e):e}function ii(){return ni.resume()}if(vr&&!vr.TONE_SILENCE_LOGGING){let e="v";"dev"===i&&(e="")}function ai(e){return Math.pow(10,e/20)}function oi(e){return Math.log(e)/Math.LN10*20}function li(e){return Math.pow(2,e/12)}let ci=440;function ui(e){return Math.round(hi(e))}function hi(e){return 69+12*Math.log2(e/ci)}function di(e){return ci*Math.pow(2,(e-69)/12)}class pi 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 pi&&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 fi extends pi{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 fi(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 fi(this.context,t[0]).toSeconds();return t.forEach((t=>{const r=new fi(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 ui(this.toFrequency())}_now(){return this.context.now()}}function mi(e,t){return new fi(si(),e,t)}class gi extends fi{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return ci}static set A4(e){!function(e){ci=e}(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(e){return"midi"===this.defaultUnits?e:gi.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method(e,t){const n=yi[e.toLowerCase()]+12*(parseInt(t,10)+1);return"midi"===this.defaultUnits?n:gi.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 gi(this.context,this.valueOf()*li(e))}harmonize(e){return e.map((e=>this.transpose(e)))}toMidi(){return ui(this.valueOf())}toNote(){const e=this.toFrequency(),t=Math.log2(e/gi.A4);let n=Math.round(12*t)+57;const s=Math.floor(n/12);s<0&&(n+=-12*s);return bi[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 di(e)}static ftom(e){return ui(e)}}const yi={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},bi=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];function wi(e,t){return new gi(si(),e,t)}class vi extends fi{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}function Ai(e,t){return new vi(si(),e,t)}class xi extends Fr{constructor(){super();const e=Dr(xi.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=e.context}static getDefaults(){return{context:si()}}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 fi(this.context,e).toSeconds()}toFrequency(e){return new gi(this.context,e).toFrequency()}toTicks(e){return new vi(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 xi?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 xi?this[t].set(e[t]):this[t]=e[t])})),this}}class Ci extends Gr{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 ir(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 i=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 Si extends xi{constructor(){super(...arguments),this.name="ToneAudioNode",this._internalChannels=[]}get numberOfInputs(){return dr(this.input)?Sr(this.input)||this.input instanceof ki?1:this.input.numberOfInputs:0}get numberOfOutputs(){return dr(this.output)?this.output.numberOfOutputs:0}_isAudioNode(e){return dr(e)&&(e instanceof Si||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 _i(this,e,t,n),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return ur("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(e,t=0,n=0){return Ti(this,e,t,n),this}chain(...e){return Ei(this,...e),this}fan(...e){return e.forEach((e=>this.connect(e))),this}dispose(){return super.dispose(),dr(this.input)&&(this.input instanceof Si?this.input.dispose():Er(this.input)&&this.input.disconnect()),dr(this.output)&&(this.output instanceof Si?this.output.dispose():Er(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function Ei(...e){const t=e.shift();e.reduce(((e,t)=>(e instanceof Si?e.connect(t):Er(e)&&_i(e,t),t)),t)}function _i(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 Si||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 Si||t instanceof ki;)dr(t.input)&&(t=t.input);for(;e instanceof Si;)dr(e.output)&&(e=e.output);Sr(t)?e.connect(t,n):e.connect(t,n,s)}function Ti(e,t,n=0,s=0){if(dr(t))for(;t instanceof Si;)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 Ii extends Si{constructor(){super(Dr(Ii.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const e=Dr(Ii.getDefaults(),arguments,["gain","units"]);this.gain=new ki({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(Si.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class Ni extends Si{constructor(e){super(e),this.onended=Qr,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new Ii({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(Si.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 Oi extends Ni{constructor(){super(Dr(Oi.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const e=Dr(Oi.getDefaults(),arguments,["offset"]);_i(this._source,this._gainNode),this.offset=new ki({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(Ni.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 Di extends Si{constructor(){super(Dr(Di.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const e=Dr(Di.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new Oi({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(Si.getDefaults(),{convert:!0,units:"number",value:0})}connect(e,t=0,n=0){return Ri(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 Ri(e,t,n,s){(t instanceof ki||Sr(t)||t instanceof Di&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof Di&&(t.overridden=!0)),_i(e,t,n,s)}class Mi extends ki{constructor(){super(Dr(Mi.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Gr(1/0),this._multiplier=1;const e=Dr(Mi.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(ki.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),i=Math.round(Math.max(1/n,1));for(let e=0;e<=i;e++){const i=n*e+t,a=this._exponentialApproach(r.time,r.value,s,n,i);this.linearRampToValueAtTime(this._toType(a),i)}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),i=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(i,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),i=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(i,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)),i=(t-s.time)/r;for(let e=0;e<=r;e++){const r=i*e+s.time,a=this._exponentialInterpolate(s.time,s.value,t,n,r);this.linearRampToValueAtTime(this._toType(a),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),i=Math.sqrt(Math.pow(s,2)-2*r*(t.ticks-e)),a=(-s+i)/r;return(a>0?a:(-s-i)/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 Fi extends Di{constructor(){super(Dr(Fi.getDefaults(),arguments,["value"])),this.name="TickSignal";const e=Dr(Fi.getDefaults(),arguments,["value"]);this.input=this._param=new Mi({context:this.context,convert:e.convert,multiplier:e.multiplier,param:this._constantSource.offset,units:e.units,value:e.value})}static getDefaults(){return Object.assign(Di.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 Bi extends xi{constructor(){super(Dr(Bi.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new Ci,this._tickOffset=new Gr;const e=Dr(Bi.getDefaults(),arguments,["frequency"]);this.frequency=new Fi({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"},xi.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,i=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&&(i=n.ticks,t=n.time),"started"===r.state&&"started"!==e.state&&(i+=this.frequency.getTicksAtTime(e.time)-this.frequency.getTicksAtTime(t)),r=e})),this._state.remove(s),i}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),i=this.frequency.getTicksAtTime(r)+e-n.ticks;return this.frequency.getTimeOfTick(i)}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 i=Math.max(s.time,e),a=this.frequency.getTicksAtTime(i),o=a-this.frequency.getTicksAtTime(s.time);let l=Math.ceil(o)-o;l=Vr(l,1)?0:l;let c=this.frequency.getTimeOfTick(a+l);for(;c{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(zi);class Li extends Si{constructor(){super(Dr(Li.getDefaults(),arguments,["delayTime","maxDelay"])),this.name="Delay";const e=Dr(Li.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 ki({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(Si.getDefaults(),{delayTime:0,maxDelay:1})}get maxDelay(){return this._maxDelay}dispose(){return super.dispose(),this._delayNode.disconnect(),this.delayTime.dispose(),this}}function Pi(e,t,n=2,s=si().sampleRate){return Cr(this,void 0,void 0,(function*(){const r=si(),i=new ei(n,t,s);ri(i),yield e(i);const a=i.render();ri(r);const o=yield a;return new Jr(o)}))}class Vi extends Fr{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const e=Dr(Vi.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 Wi extends gi{constructor(){super(...arguments),this.name="MidiClass",this.defaultUnits="midi"}_frequencyToUnits(e){return ui(super._frequencyToUnits(e))}_ticksToUnits(e){return ui(super._ticksToUnits(e))}_beatsToUnits(e){return ui(super._beatsToUnits(e))}_secondsToUnits(e){return ui(super._secondsToUnits(e))}toMidi(){return this.valueOf()}toFrequency(){return di(this.toMidi())}transpose(e){return new Wi(this.context,this.toMidi()+e)}}function Gi(e,t){return new Wi(si(),e,t)}class Ui extends vi{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 qi(e,t){return new Ui(si(),e,t)}class ji extends xi{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Gr,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 ji({context:e})})),Hr((e=>{e.draw.dispose()}));class Hi 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 $i(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 $i{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 Ki extends Si{constructor(){super(Dr(Ki.getDefaults(),arguments,["volume"])),this.name="Volume";const e=Dr(Ki.getDefaults(),arguments,["volume"]);this.input=this.output=new Ii({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(Si.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 Xi extends Si{constructor(){super(Dr(Xi.getDefaults(),arguments)),this.name="Destination",this.input=new Ki({context:this.context}),this.output=new Ii({context:this.context}),this.volume=this.input.volume;const e=Dr(Xi.getDefaults(),arguments);Ei(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(Si.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),Ei(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}}qr((e=>{e.destination=new Xi({context:e})})),Hr((e=>{e.destination.dispose()}));class Zi extends Fr{constructor(e){super(),this.name="TimelineValue",this._timeline=new Gr({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 Yi{constructor(e,t){this.id=Yi._eventId++;const n=Object.assign(Yi.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}}Yi._eventId=0;class Qi extends Yi{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(Qi.getDefaults(),t);this.duration=new Ui(e.context,n.duration).valueOf(),this._interval=new Ui(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({},Yi.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 Ui(this.context,this._nextTick).toSeconds()),this._nextTick+=this._interval,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new Ui(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 Ji extends xi{constructor(){super(Dr(Ji.getDefaults(),arguments)),this.name="Transport",this._loop=new Zi(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Gr,this._repeatedEvents=new Hi,this._syncedSignals=[],this._swingAmount=0;const e=Dr(Ji.getDefaults(),arguments);this._ppq=e.ppq,this._clock=new zi({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(xi.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 Ui(this.context,2*this._swingTicks/3).toSeconds()*s}this._timeline.forEachAtTime(t,(t=>t.invoke(e)))}schedule(e,t){const n=new Yi(this,{callback:e,time:new vi(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}scheduleRepeat(e,t,n,s=1/0){const r=new Qi(this,{callback:e,duration:new fi(this.context,s).toTicks(),interval:new fi(this.context,t).toTicks(),time:new vi(this.context,n).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(e,t){const n=new Yi(this,{callback:e,once:!0,time:new vi(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 Ui(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 fi(this.context,this._loopStart,"i").toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new fi(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 Ui(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 Ui(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 Ii(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(Ji),qr((e=>{e.transport=new Ji({context:e})})),Hr((e=>{e.transport.dispose()}));class ea extends Si{constructor(e){super(e),this.input=void 0,this._state=new Ci("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 Ki({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(Si.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(Rr(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 ar(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 ta extends Ni{constructor(){super(Dr(ta.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const e=Dr(ta.getDefaults(),arguments,["url","onload"]);_i(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new ki({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(Ni.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?Rr(t,this.loopStart):Rr(t,0);let i=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(i,e)&&(i=(i-t)%n+t),Vr(i,this.buffer.duration)&&(i=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Pr(i,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,i)),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 na extends ea{constructor(){super(Dr(na.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const e=Dr(na.getDefaults(),arguments,["type"]);this._playbackRate=e.playbackRate,this.type=e.type,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ea.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(e){if(rr(e in ia,"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=ia[this._type];this._source=new ta({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 sa=220500,ra={brown:null,pink:null,white:null},ia={get brown(){if(!ra.brown){const e=[];for(let t=0;t<2;t++){const n=new Float32Array(sa);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);_i(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 Cr(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 oa(e,t){return Cr(this,void 0,void 0,(function*(){const n=t/e.context.sampleRate,s=new ei(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 la extends Ni{constructor(){super(Dr(la.getDefaults(),arguments,["frequency","type"])),this.name="ToneOscillatorNode",this._oscillator=this.context.createOscillator(),this._internalChannels=[this._oscillator];const e=Dr(la.getDefaults(),arguments,["frequency","type"]);_i(this._oscillator,this._gainNode),this.type=e.type,this.frequency=new ki({context:this.context,param:this._oscillator.frequency,units:"frequency",value:e.frequency}),this.detune=new ki({context:this.context,param:this._oscillator.detune,units:"cents",value:e.detune}),Zr(this,["frequency","detune"])}static getDefaults(){return Object.assign(Ni.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 ca extends ea{constructor(){super(Dr(ca.getDefaults(),arguments,["frequency","type"])),this.name="Oscillator",this._oscillator=null;const e=Dr(ca.getDefaults(),arguments,["frequency","type"]);this.frequency=new Di({context:this.context,units:"frequency",value:e.frequency}),Zr(this,"frequency"),this.detune=new Di({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(ea.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:"sine"})}_start(e){const t=this.toSeconds(e),n=new la({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 ca._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=ca._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),ca._periodicWaveCache.push({imag:n,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:t,type:this._type,wave:this._wave}),ca._periodicWaveCache.length>100&&ca._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){ir(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 i=1;if("custom"===e){if(i=this._partials.length+1,this._partialCount=this._partials.length,n=i,0===this._partials.length)return[s,r]}else{const t=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);t?(i=parseInt(t[2],10)+1,this._partialCount=parseInt(t[2],10),e=t[1],i=Math.max(i,2),n=i):this._partialCount=0,this._partials=[]}for(let a=1;a>1&1?-1:1):0,this._partials[a-1]=o;break;case"custom":o=this._partials[a-1];break;default:throw new TypeError("Oscillator: invalid type: "+e)}0!==o?(s[a]=-o*Math.sin(t*a),r[a]=o*Math.cos(t*a)):(s[a]=0,r[a]=0)}return[s,r]}_inverseFFT(e,t,n){let s=0;const r=e.length;for(let i=0;it.includes(e))),"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class da extends ua{constructor(){super(...arguments),this.name="AudioToGain",this._norm=new ha({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 pa extends Di{constructor(){super(Object.assign(Dr(pa.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const e=Dr(pa.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new Ii({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(Di.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class fa extends ea{constructor(){super(Dr(fa.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new da({context:this.context}),this._modulationNode=new Ii({context:this.context});const e=Dr(fa.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ca({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 ca({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pa({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(ca.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 Cr(this,void 0,void 0,(function*(){return oa(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 ma extends ea{constructor(){super(Dr(ma.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new Ii({context:this.context,gain:0});const e=Dr(ma.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ca({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 Di({context:this.context,units:"frequency",value:e.frequency}),this._modulator=new ca({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pa({context:this.context,units:"positive",value:e.harmonicity}),this.modulationIndex=new pa({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(ca.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 Cr(this,void 0,void 0,(function*(){return oa(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 ga extends ea{constructor(){super(Dr(ga.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new Ii({context:this.context,gain:0}),this._thresh=new ha({context:this.context,mapping:e=>e<=0?-1:1});const e=Dr(ga.getDefaults(),arguments,["frequency","width"]);this.width=new Di({context:this.context,units:"audioRange",value:e.width}),this._triangle=new ca({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(ea.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 Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class ya extends ea{constructor(){super(Dr(ya.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const e=Dr(ya.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Di({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Di({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(ca.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(ir(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 Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach((e=>e.dispose())),this}}class ba extends ea{constructor(){super(Dr(ba.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new pa({context:this.context,value:2});const e=Dr(ba.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new ga({context:this.context,frequency:e.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new ca({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(ea.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 Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const wa={am:fa,fat:ya,fm:ma,oscillator:ca,pulse:ga,pwm:ba};class va extends ea{constructor(){super(Dr(va.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const e=Dr(va.getDefaults(),arguments,["frequency","type"]);this.frequency=new Di({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Di({context:this.context,units:"cents",value:e.detune}),Zr(this,["frequency","detune"]),this.set(e)}static getDefaults(){return Object.assign(ca.getDefaults(),ma.getDefaults(),fa.getDefaults(),ya.getDefaults(),ga.getDefaults(),ba.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=wa[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 wa[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 Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class Aa extends Di{constructor(){super(Object.assign(Dr(Aa.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new Ii({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,Ei(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Di.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class xa extends ua{constructor(){super(Object.assign(Dr(xa.getDefaults(),arguments,["min","max"]))),this.name="Scale";const e=Dr(xa.getDefaults(),arguments,["min","max"]);this._mult=this.input=new pa({context:this.context,value:e.max-e.min}),this._add=this.output=new Aa({context:this.context,value:e.min}),this._min=e.min,this._max=e.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(ua.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 Ca extends ua{constructor(){super(Object.assign(Dr(Ca.getDefaults(),arguments))),this.name="Zero",this._gain=new Ii({context:this.context}),this.output=this._gain,this.input=void 0,_i(this.context.getConstant(0),this._gain)}dispose(){return super.dispose(),Ti(this.context.getConstant(0),this._gain),this}}class ka extends Si{constructor(){super(Dr(ka.getDefaults(),arguments,["frequency","min","max"])),this.name="LFO",this._stoppedValue=0,this._units="number",this.convert=!0,this._fromType=ki.prototype._fromType,this._toType=ki.prototype._toType,this._is=ki.prototype._is,this._clampValue=ki.prototype._clampValue;const e=Dr(ka.getDefaults(),arguments,["frequency","min","max"]);this._oscillator=new ca(e),this.frequency=this._oscillator.frequency,this._amplitudeGain=new Ii({context:this.context,gain:e.amplitude,units:"normalRange"}),this.amplitude=this._amplitudeGain.gain,this._stoppedSignal=new Di({context:this.context,units:"audioRange",value:0}),this._zeros=new Ca({context:this.context}),this._a2g=new da({context:this.context}),this._scaler=this.output=new xa({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(ca.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 ki||e instanceof Di)&&(this.convert=e.convert,this.units=e.units),Ri(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 Sa(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){ir(s,e,t),n.set(this,s)}})}}function Ea(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){ir(this.toSeconds(s),e,t),n.set(this,s)}})}}class _a extends ea{constructor(){super(Dr(_a.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const e=Dr(_a.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(ea.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Qr,onerror:Qr,playbackRate:1,reverse:!1})}load(e){return Cr(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?Rr(t,this._loopStart):Rr(t,0);const s=this.toSeconds(t),r=n;n=Rr(n,Math.max(this._buffer.duration-s,0));let i=this.toSeconds(n);i/=this._playbackRate,e=this.toSeconds(e);const a=new ta({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+i),this._state.setStateAtTime("stopped",e+i,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&hr(r)?a.start(e,s):a.start(e,s,i-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&&ir(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&&ir(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}}xr([Ea(0)],_a.prototype,"fadeIn",void 0),xr([Ea(0)],_a.prototype,"fadeOut",void 0);class Ta extends Si{constructor(){super(Dr(Ta.getDefaults(),arguments,["urls","onload"],"urls")),this.name="Players",this.input=void 0,this._players=new Map;const e=Dr(Ta.getDefaults(),arguments,["urls","onload"],"urls");this._volume=this.output=new Ki({context:this.context,volume:e.volume}),this.volume=this._volume.volume,Zr(this,"volume"),this._buffers=new Vi({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(ea.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 _a({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 Ia extends ea{constructor(){super(Dr(Ia.getDefaults(),arguments,["url","onload"])),this.name="GrainPlayer",this._loopStart=0,this._loopEnd=0,this._activeSources=[];const e=Dr(Ia.getDefaults(),arguments,["url","onload"]);this.buffer=new Jr({onload:e.onload,onerror:e.onerror,reverse:e.reverse,url:e.url}),this._clock=new zi({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(ea.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=Rr(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){ir(e,.001),this._playbackRate=e,this.grainSize=this._grainSize}get loopStart(){return this._loopStart}set loopStart(e){this.buffer.loaded&&ir(this.toSeconds(e),0,this.buffer.duration),this._loopStart=this.toSeconds(e)}get loopEnd(){return this._loopEnd}set loopEnd(e){this.buffer.loaded&&ir(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);ir(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 Na extends ua{constructor(){super(...arguments),this.name="Abs",this._abs=new ha({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 Oa extends ua{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new ha({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 Da extends ua{constructor(){super(...arguments),this.name="Negate",this._multiply=new pa({context:this.context,value:-1}),this.input=this._multiply,this.output=this._multiply}dispose(){return super.dispose(),this._multiply.dispose(),this}}class Ra extends Di{constructor(){super(Object.assign(Dr(Ra.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Subtract",this._sum=new Ii({context:this.context}),this.input=this._sum,this.output=this._sum,this._neg=new Da({context:this.context}),this.subtrahend=this._param,Ei(this._constantSource,this._neg,this._sum)}static getDefaults(){return Object.assign(Di.getDefaults(),{value:0})}dispose(){return super.dispose(),this._neg.dispose(),this._sum.dispose(),this}}class Ma extends ua{constructor(){super(Object.assign(Dr(Ma.getDefaults(),arguments))),this.name="GreaterThanZero",this._thresh=this.output=new ha({context:this.context,length:127,mapping:e=>e<=0?0:1}),this._scale=this.input=new pa({context:this.context,value:1e4}),this._scale.connect(this._thresh)}dispose(){return super.dispose(),this._scale.dispose(),this._thresh.dispose(),this}}class Fa extends Di{constructor(){super(Object.assign(Dr(Fa.getDefaults(),arguments,["value"]))),this.name="GreaterThan",this.override=!1;const e=Dr(Fa.getDefaults(),arguments,["value"]);this._subtract=this.input=new Ra({context:this.context,value:e.value}),this._gtz=this.output=new Ma({context:this.context}),this.comparator=this._param=this._subtract.subtrahend,Zr(this,"comparator"),this._subtract.connect(this._gtz)}static getDefaults(){return Object.assign(Di.getDefaults(),{value:0})}dispose(){return super.dispose(),this._gtz.dispose(),this._subtract.dispose(),this.comparator.dispose(),this}}class Ba extends ua{constructor(){super(Object.assign(Dr(Ba.getDefaults(),arguments,["value"]))),this.name="Pow";const e=Dr(Ba.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new ha({context:this.context,mapping:this._expFunc(e.value),length:8192}),this._exponent=e.value}static getDefaults(){return Object.assign(ua.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 za extends xa{constructor(){super(Object.assign(Dr(za.getDefaults(),arguments,["min","max","exponent"]))),this.name="ScaleExp";const e=Dr(za.getDefaults(),arguments,["min","max","exponent"]);this.input=this._exp=new Ba({context:this.context,value:e.exponent}),this._exp.connect(this._mult)}static getDefaults(){return Object.assign(xa.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 La extends Di{constructor(){super(Dr(Di.getDefaults(),arguments,["value","units"])),this.name="SyncedSignal",this.override=!1;const e=Dr(Di.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 Oi({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 vi(this.context,e).toSeconds();return super.getValueAtTime(t)}setValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.setValueAtTime(e,n),this}linearRampToValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.linearRampToValueAtTime(e,n),this}exponentialRampToValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.exponentialRampToValueAtTime(e,n),this}setTargetAtTime(e,t,n){const s=new vi(this.context,t).toSeconds();return super.setTargetAtTime(e,s,n),this}cancelScheduledValues(e){const t=new vi(this.context,e).toSeconds();return super.cancelScheduledValues(t),this}setValueCurveAtTime(e,t,n,s){const r=new vi(this.context,t).toSeconds();return n=this.toSeconds(n),super.setValueCurveAtTime(e,r,n,s),this}cancelAndHoldAtTime(e){const t=new vi(this.context,e).toSeconds();return super.cancelAndHoldAtTime(t),this}setRampPoint(e){const t=new vi(this.context,e).toSeconds();return super.setRampPoint(t),this}exponentialRampTo(e,t,n){const s=new vi(this.context,n).toSeconds();return super.exponentialRampTo(e,t,s),this}linearRampTo(e,t,n){const s=new vi(this.context,n).toSeconds();return super.linearRampTo(e,t,s),this}targetRampTo(e,t,n){const s=new vi(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 Pa extends Si{constructor(){super(Dr(Pa.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Di({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const e=Dr(Pa.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(Si.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 Va)if(Va[n][t]===e)return n;return e}}_setCurve(e,t,n){if(br(n)&&Reflect.has(Va,n)){const s=Va[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),i=this.toSeconds(t);return this.triggerAttack(e,r,s),this.triggerRelease(r+i),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class Ga extends Wa{constructor(){super(Dr(Ga.getDefaults(),arguments));const e=Dr(Ga.getDefaults(),arguments);this.portamento=e.portamento,this.onsilence=e.onsilence}static getDefaults(){return Object.assign(Wa.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 gi?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}}xr([Ea(0)],Ga.prototype,"portamento",void 0);class Ua extends Pa{constructor(){super(Dr(Ua.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new Ii({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 qa extends Ga{constructor(){super(Dr(qa.getDefaults(),arguments)),this.name="Synth";const e=Dr(qa.getDefaults(),arguments);this.oscillator=new va(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 Ua(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(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.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 ja extends Ga{constructor(){super(Dr(ja.getDefaults(),arguments)),this.name="ModulationSynth";const e=Dr(ja.getDefaults(),arguments);this._carrier=new qa({context:this.context,oscillator:e.oscillator,envelope:e.envelope,onsilence:()=>this.onsilence(this),volume:-10}),this._modulator=new qa({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 Di({context:this.context,units:"frequency"}),this.detune=new Di({context:this.context,value:e.detune,units:"cents"}),this.harmonicity=new pa({context:this.context,value:e.harmonicity,minValue:0}),this._modulationNode=new Ii({context:this.context,gain:0}),Zr(this,["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"])}static getDefaults(){return Object.assign(Ga.getDefaults(),{harmonicity:3,oscillator:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.getDefaults()),"frequency","detune"]),{type:"sine"}),envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.01,decay:.01,sustain:1,release:.5}),modulation:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.getDefaults()),"frequency","detune"]),{type:"square"}),modulationEnvelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.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 Ha extends ja{constructor(){super(Dr(Ha.getDefaults(),arguments)),this.name="AMSynth",this._modulationScale=new da({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 $a extends Si{constructor(){super(Dr($a.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const e=Dr($a.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new ki({context:this.context,units:"number",value:e.Q,param:this._filter.Q}),this.frequency=new ki({context:this.context,units:"frequency",value:e.frequency,param:this._filter.frequency}),this.detune=new ki({context:this.context,units:"cents",value:e.detune,param:this._filter.detune}),this.gain=new ki({context:this.context,units:"decibels",convert:!1,value:e.gain,param:this._filter.gain}),this.type=e.type}static getDefaults(){return Object.assign(Si.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 Xa extends Pa{constructor(){super(Dr(Xa.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const e=Dr(Xa.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=e.octaves,this._baseFrequency=this.toFrequency(e.baseFrequency),this._exponent=this.input=new Ba({context:this.context,value:e.exponent}),this._scale=this.output=new xa({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(Pa.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){const t=this.toFrequency(e);ir(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 Za extends Ga{constructor(){super(Dr(Za.getDefaults(),arguments)),this.name="MonoSynth";const e=Dr(Za.getDefaults(),arguments);this.oscillator=new va(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 Ka(Object.assign(e.filter,{context:this.context})),this.filterEnvelope=new Xa(Object.assign(e.filterEnvelope,{context:this.context})),this.envelope=new Ua(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(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(Mr(Ka.getDefaults(),Object.keys(Si.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(Mr(Xa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(Mr(va.getDefaults(),Object.keys(ea.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 Ya extends Ga{constructor(){super(Dr(Ya.getDefaults(),arguments)),this.name="DuoSynth";const e=Dr(Ya.getDefaults(),arguments);this.voice0=new Za(Object.assign(e.voice0,{context:this.context,onsilence:()=>this.onsilence(this)})),this.voice1=new Za(Object.assign(e.voice1,{context:this.context})),this.harmonicity=new pa({context:this.context,units:"positive",value:e.harmonicity}),this._vibrato=new ka({frequency:e.vibratoRate,context:this.context,min:-50,max:50}),this._vibrato.start(),this.vibratoRate=this._vibrato.frequency,this._vibratoGain=new Ii({context:this.context,units:"normalRange",gain:e.vibratoAmount}),this.vibratoAmount=this._vibratoGain.gain,this.frequency=new Di({context:this.context,units:"frequency",value:440}),this.detune=new Di({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(Ga.getDefaults(),{vibratoAmount:.5,vibratoRate:5,harmonicity:1.5,voice0:Or(Mr(Za.getDefaults(),Object.keys(Ga.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}}),voice1:Or(Mr(Za.getDefaults(),Object.keys(Ga.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 Qa extends ja{constructor(){super(Dr(Qa.getDefaults(),arguments)),this.name="FMSynth";const e=Dr(Qa.getDefaults(),arguments);this.modulationIndex=new pa({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(ja.getDefaults(),{modulationIndex:10})}dispose(){return super.dispose(),this.modulationIndex.dispose(),this}}const Ja=[1,1.483,1.932,2.546,2.63,3.897];class eo extends Ga{constructor(){super(Dr(eo.getDefaults(),arguments)),this.name="MetalSynth",this._oscillators=[],this._freqMultipliers=[];const e=Dr(eo.getDefaults(),arguments);this.detune=new Di({context:this.context,units:"cents",value:e.detune}),this.frequency=new Di({context:this.context,units:"frequency"}),this._amplitude=new Ii({context:this.context,gain:0}).connect(this.output),this._highpass=new Ka({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 pa({context:this.context,value:Ja[t]});this._freqMultipliers[t]=s,this.frequency.chain(s,n.frequency),this.detune.connect(n.detune)}this._filterFreqScaler=new xa({context:this.context,max:7e3,min:this.toFrequency(e.resonance)}),this.envelope=new Pa({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(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.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 qa{constructor(){super(Dr(to.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const e=Dr(to.getDefaults(),arguments);this.pitchDecay=e.pitchDecay,this.octaves=e.octaves,Zr(this,["oscillator","envelope"])}static getDefaults(){return Or(Ga.getDefaults(),qa.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 gi?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}}xr([Sa(0)],to.prototype,"octaves",void 0),xr([Ea(0)],to.prototype,"pitchDecay",void 0);class no extends Wa{constructor(){super(Dr(no.getDefaults(),arguments)),this.name="NoiseSynth";const e=Dr(no.getDefaults(),arguments);this.noise=new na(Object.assign({context:this.context},e.noise)),this.envelope=new Ua(Object.assign({context:this.context},e.envelope)),this.noise.chain(this.envelope,this.output)}static getDefaults(){return Object.assign(Wa.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{decay:.1,sustain:0}),noise:Object.assign(Mr(na.getDefaults(),Object.keys(ea.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 io(e,t){const n=`registerProcessor("${e}", ${t})`;so.add(n)}class ao extends Si{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";io(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 ao{constructor(){super(Dr(lo.getDefaults(),arguments,["delayTime","resonance"])),this.name="FeedbackCombFilter";const e=Dr(lo.getDefaults(),arguments,["delayTime","resonance"]);this.input=new Ii({context:this.context}),this.output=new Ii({context:this.context}),this.delayTime=new ki({context:this.context,value:e.delayTime,units:"time",minValue:0,maxValue:1,param:this._dummyParam,swappable:!0}),this.resonance=new ki({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(Si.getDefaults(),{delayTime:.1,resonance:.5})}onReady(e){Ei(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 co extends Si{constructor(){super(Dr(co.getDefaults(),arguments,["frequency","type"])),this.name="OnePoleFilter";const e=Dr(co.getDefaults(),arguments,["frequency","type"]);this._frequency=e.frequency,this._type=e.type,this.input=new Ii({context:this.context}),this.output=new Ii({context:this.context}),this._createFilter()}static getDefaults(){return Object.assign(Si.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 Wi(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 Wi(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+i)}}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 Wa{constructor(){super(Dr(fo.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const e=Dr(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 gi(this.context,n).toMidi();t[s]=e.urls[n]}else fr(s)&&isFinite(s)&&(t[s]=e.urls[s])})),this._buffers=new Vi({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(Wa.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=hi(new gi(this.context,e).toFrequency()),r=Math.round(s),i=s-r,a=this._findClosest(r),o=r-a,l=this._buffers.get(o),c=li(a+i),u=new ta({url:l,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:c}).connect(this.output);u.start(t,0,l.duration/c,n),yr(this._activeSources.get(r))||this._activeSources.set(r,[]),this._activeSources.get(r).push(u),u.onended=()=>{if(this._activeSources&&this._activeSources.has(r)){const e=this._activeSources.get(r),t=e.indexOf(u);-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 gi(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 gi(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}}xr([Ea(0)],fo.prototype,"attack",void 0),xr([Ea(0)],fo.prototype,"release",void 0);class mo extends xi{constructor(){super(Dr(mo.getDefaults(),arguments,["callback","value"])),this.name="ToneEvent",this._state=new Ci("stopped"),this._startOffset=0;const e=Dr(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(xi.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 Ui(this.context,t));const r=new Ui(this.context,this._getLoopDuration());e.id=this.context.transport.scheduleRepeat(this._tick.bind(this),r,new Ui(this.context,n),t)}else e.id=this.context.transport.schedule(this._tick.bind(this),new Ui(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=Rr(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 Ui(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._rescheduleEvents()}get loopStart(){return new Ui(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 xi{constructor(){super(Dr(go.getDefaults(),arguments,["callback","interval"])),this.name="Loop";const e=Dr(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(xi.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(Dr(yo.getDefaults(),arguments,["callback","events"])),this.name="Part",this._state=new Ci("stopped"),this._events=new Set;const e=Dr(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=Rr(t,this._loop?this._loopStart:0),t=this._loop?Rr(t,this._loopStart):Rr(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 Ui(this.context,t))):e.startOffset>=n&&e.start(new Ui(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 vi(this.context,e).toTicks(),s=new Ui(this.context,1).toSeconds(),r=this._events.values();let i=r.next();for(;!i.done;){const e=i.value;if(Math.abs(n-e.startOffset){"started"===t.state?this._startNote(e,t.time,t.offset):e.stop(new Ui(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 Ui(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 Ui(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=Ao(t,e),yield e[t],t--}function*vo(e,t){for(;;)yield*t(e)}function Ao(e,t){return Wr(e,0,t.length-1)}function*xo(e,t){let n=t?0:e.length-1;for(;;)n=Ao(n,e),yield e[n],t?(n++,n>=e.length-1&&(t=!1)):(n--,n<=0&&(t=!0))}function*Co(e){let t=0,n=0;for(;t=0;)t=Ao(t,e),yield e[t],n++,t+=n%2?-2:1}function*So(e){const t=[];for(let n=0;n0;){const n=Ao(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*xo(e,!0);case"downUp":yield*xo(e,!1);case"alternateUp":yield*vo(e,Co);case"alternateDown":yield*vo(e,ko);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(Dr(_o.getDefaults(),arguments,["callback","values","pattern"])),this.name="Pattern";const e=Dr(_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 To extends mo{constructor(){super(Dr(To.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=Dr(To.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 Ui(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 Ui(this.context,r,"i").toSeconds();this._part.add(t,e)}}))}_indexTime(e){return new Ui(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 Io extends Si{constructor(){super(Object.assign(Dr(Io.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new Oa({context:this.context}),this.a=new Ii({context:this.context,gain:0}),this.b=new Ii({context:this.context,gain:0}),this.output=new Ii({context:this.context}),this._internalChannels=[this.a,this.b];const e=Dr(Io.getDefaults(),arguments,["fade"]);this.fade=new Di({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",_i(this._split,this.a.gain,0),_i(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(Si.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 Si{constructor(e){super(e),this.name="Effect",this._dryWet=new Io({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new Ii({context:this.context}),this.effectReturn=new Ii({context:this.context}),this.input=new Ii({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(Si.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 ka({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 Do extends Oo{constructor(){super(Dr(Do.getDefaults(),arguments,["frequency","baseFrequency","octaves"])),this.name="AutoFilter";const e=Dr(Do.getDefaults(),arguments,["frequency","baseFrequency","octaves"]);this.filter=new Ka(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 Ro extends Si{constructor(){super(Object.assign(Dr(Ro.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const e=Dr(Ro.getDefaults(),arguments,["pan"]);this.pan=new ki({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(Si.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}class Mo extends Oo{constructor(){super(Dr(Mo.getDefaults(),arguments,["frequency"])),this.name="AutoPanner";const e=Dr(Mo.getDefaults(),arguments,["frequency"]);this._panner=new Ro({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 Si{constructor(){super(Dr(Fo.getDefaults(),arguments,["smoothing"])),this.name="Follower";const e=Dr(Fo.getDefaults(),arguments,["smoothing"]);this._abs=this.input=new Na({context:this.context}),this._lowpass=this.output=new co({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(Si.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(Dr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"])),this.name="AutoWah";const e=Dr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"]);this._follower=new Fo({context:this.context,smoothing:e.follower}),this._sweepRange=new za({context:this.context,min:0,max:1,exponent:.5}),this._baseFrequency=this.toFrequency(e.baseFrequency),this._octaves=e.octaves,this._inputBoost=new Ii({context:this.context}),this._bandpass=new Ka({context:this.context,rolloff:-48,frequency:0,Q:e.Q}),this._peaking=new Ka({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 oi(1/this._inputBoost.gain.value)}set sensitivity(e){this._inputBoost.gain.value=1/ai(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";io(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(Dr(Lo.getDefaults(),arguments,["bits"])),this.name="BitCrusher";const e=Dr(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 ao{constructor(){super(Dr(Po.getDefaults(),arguments)),this.name="BitCrusherWorklet";const e=Dr(Po.getDefaults(),arguments);this.input=new Ii({context:this.context}),this.output=new Ii({context:this.context}),this.bits=new ki({context:this.context,value:e.bits,units:"positive",minValue:1,maxValue:16,param:this._dummyParam,swappable:!0})}static getDefaults(){return Object.assign(ao.getDefaults(),{bits:12})}_audioWorkletName(){return zo}onReady(e){Ei(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(Dr(Vo.getDefaults(),arguments,["order"])),this.name="Chebyshev";const e=Dr(Vo.getDefaults(),arguments,["order"]);this._shaper=new ha({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 Si{constructor(){super(Dr(Wo.getDefaults(),arguments,["channels"])),this.name="Split";const e=Dr(Wo.getDefaults(),arguments,["channels"]);this._splitter=this.input=this.output=this.context.createChannelSplitter(e.channels),this._internalChannels=[this._splitter]}static getDefaults(){return Object.assign(Si.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._splitter.disconnect(),this}}class Go extends Si{constructor(){super(Dr(Go.getDefaults(),arguments,["channels"])),this.name="Merge";const e=Dr(Go.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(e.channels)}static getDefaults(){return Object.assign(Si.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class Uo extends Si{constructor(e){super(e),this.name="StereoEffect",this.input=new Ii({context:this.context}),this.input.channelCount=2,this.input.channelCountMode="explicit",this._dryWet=this.output=new Io({context:this.context,fade:e.wet}),this.wet=this._dryWet.fade,this._split=new Wo({context:this.context,channels:2}),this._merge=new Go({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),Ei(...e),_i(e[e.length-1],this._merge,0,0)}connectEffectRight(...e){this._split.connect(e[0],1,0),Ei(...e),_i(e[e.length-1],this._merge,0,1)}static getDefaults(){return Object.assign(Si.getDefaults(),{wet:1})}dispose(){return super.dispose(),this._dryWet.dispose(),this._split.dispose(),this._merge.dispose(),this}}class qo extends Uo{constructor(e){super(e),this.feedback=new Di({context:this.context,value:e.feedback,units:"normalRange"}),this._feedbackL=new Ii({context:this.context}),this._feedbackR=new Ii({context:this.context}),this._feedbackSplit=new Wo({context:this.context,channels:2}),this._feedbackMerge=new Go({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(Uo.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(Dr(jo.getDefaults(),arguments,["frequency","delayTime","depth"])),this.name="Chorus";const e=Dr(jo.getDefaults(),arguments,["frequency","delayTime","depth"]);this._depth=e.depth,this._delayTime=e.delayTime/1e3,this._lfoL=new ka({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new ka({context:this.context,frequency:e.frequency,min:0,max:1,phase:180}),this._delayNodeL=new Li({context:this.context}),this._delayNodeR=new Li({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(Dr(Ho.getDefaults(),arguments,["distortion"])),this.name="Distortion";const e=Dr(Ho.getDefaults(),arguments,["distortion"]);this._shaper=new ha({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 Ii({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(Dr(Ko.getDefaults(),arguments,["delayTime","feedback"])),this.name="FeedbackDelay";const e=Dr(Ko.getDefaults(),arguments,["delayTime","feedback"]);this._delayNode=new Li({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 Si{constructor(e){super(e),this.name="PhaseShiftAllpass",this.input=new Ii({context:this.context}),this.output=new Ii({context:this.context}),this.offset90=new Ii({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]),Ei(this.input,...this._bank0,this._oneSampleDelay,this.output),Ei(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(Dr(Zo.getDefaults(),arguments,["frequency"])),this.name="FrequencyShifter";const e=Dr(Zo.getDefaults(),arguments,["frequency"]);this.frequency=new Di({context:this.context,units:"frequency",value:e.frequency,minValue:-this.context.sampleRate/2,maxValue:this.context.sampleRate/2}),this._sine=new la({context:this.context,type:"sine"}),this._cosine=new ca({context:this.context,phase:-90,type:"sine"}),this._sineMultiply=new pa({context:this.context}),this._cosineMultiply=new pa({context:this.context}),this._negate=new Da({context:this.context}),this._add=new Aa({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 Uo{constructor(){super(Dr(Jo.getDefaults(),arguments,["roomSize","dampening"])),this.name="Freeverb",this._combFilters=[],this._allpassFiltersL=[],this._allpassFiltersR=[];const e=Dr(Jo.getDefaults(),arguments,["roomSize","dampening"]);this.roomSize=new Di({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 uo({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 Uo{constructor(){super(Dr(sl.getDefaults(),arguments,["roomSize"])),this.name="JCReverb",this._allpassFilters=[],this._feedbackCombFilters=[];const e=Dr(sl.getDefaults(),arguments,["roomSize"]);this.roomSize=new Di({context:this.context,value:e.roomSize,units:"normalRange"}),this._scaleRoomSize=new xa({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 il extends rl{constructor(){super(Dr(il.getDefaults(),arguments,["delayTime","feedback"])),this.name="PingPongDelay";const e=Dr(il.getDefaults(),arguments,["delayTime","feedback"]);this._leftDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this._rightDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this._rightPreDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this.delayTime=new Di({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 al extends $o{constructor(){super(Dr(al.getDefaults(),arguments,["pitch"])),this.name="PitchShift";const e=Dr(al.getDefaults(),arguments,["pitch"]);this._frequency=new Di({context:this.context}),this._delayA=new Li({maxDelay:1,context:this.context}),this._lfoA=new ka({context:this.context,min:0,max:.1,type:"sawtooth"}).connect(this._delayA.delayTime),this._delayB=new Li({maxDelay:1,context:this.context}),this._lfoB=new ka({context:this.context,min:0,max:.1,type:"sawtooth",phase:180}).connect(this._delayB.delayTime),this._crossFade=new Io({context:this.context}),this._crossFadeLFO=new ka({context:this.context,min:0,max:1,type:"triangle",phase:90}).connect(this._crossFade.fade),this._feedbackDelay=new Li({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=li(e-1)+1):(this._lfoA.min=this._windowSize,this._lfoA.max=0,this._lfoB.min=this._windowSize,this._lfoB.max=0,t=li(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 Uo{constructor(){super(Dr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"])),this.name="Phaser";const e=Dr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"]);this._lfoL=new ka({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new ka({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 Di({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(Uo.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(Dr(ll.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const e=Dr(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){ir(e=this.toSeconds(e),.001),this._decay=e,this.generate()}get preDelay(){return this._preDelay}set preDelay(e){ir(e=this.toSeconds(e),0),this._preDelay=e,this.generate()}generate(){return Cr(this,void 0,void 0,(function*(){const e=this.ready,t=new ei(2,this._decay+this._preDelay,this.context.sampleRate),n=new na({context:t}),s=new na({context:t}),r=new Go({context:t});n.connect(r,0,0),s.connect(r,0,1);const i=new Ii({context:t}).toDestination();r.connect(i),n.start(0),s.start(0),i.gain.setValueAtTime(0,0),i.gain.setValueAtTime(1,this._preDelay),i.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=t.render();return this.ready=a.then(Qr),yield e,this._convolver.buffer=(yield a).get(),this}))}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class cl extends Si{constructor(){super(Dr(cl.getDefaults(),arguments)),this.name="MidSideSplit",this._split=this.input=new Wo({channels:2,context:this.context}),this._midAdd=new Aa({context:this.context}),this.mid=new pa({context:this.context,value:Math.SQRT1_2}),this._sideSubtract=new Ra({context:this.context}),this.side=new pa({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 ul extends Si{constructor(){super(Dr(ul.getDefaults(),arguments)),this.name="MidSideMerge",this.mid=new Ii({context:this.context}),this.side=new Ii({context:this.context}),this._left=new Aa({context:this.context}),this._leftMult=new pa({context:this.context,value:Math.SQRT1_2}),this._right=new Ra({context:this.context}),this._rightMult=new pa({context:this.context,value:Math.SQRT1_2}),this._merge=this.output=new Go({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 ul({context:this.context}),this._midSideSplit=new cl({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(Dr(dl.getDefaults(),arguments,["width"])),this.name="StereoWidener";const e=Dr(dl.getDefaults(),arguments,["width"]);this.width=new Di({context:this.context,value:e.width,units:"normalRange"}),Zr(this,["width"]),this._twoTimesWidthMid=new pa({context:this.context,value:2}),this._twoTimesWidthSide=new pa({context:this.context,value:2}),this._midMult=new pa({context:this.context}),this._twoTimesWidthMid.connect(this._midMult.factor),this.connectEffectMid(this._midMult),this._oneMinusWidth=new Ra({context:this.context}),this._oneMinusWidth.connect(this._twoTimesWidthMid),_i(this.context.getConstant(1),this._oneMinusWidth),this.width.connect(this._oneMinusWidth.subtrahend),this._sideMult=new pa({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 Uo{constructor(){super(Dr(pl.getDefaults(),arguments,["frequency","depth"])),this.name="Tremolo";const e=Dr(pl.getDefaults(),arguments,["frequency","depth"]);this._lfoL=new ka({context:this.context,type:e.type,min:1,max:0}),this._lfoR=new ka({context:this.context,type:e.type,min:1,max:0}),this._amplitudeL=new Ii({context:this.context}),this._amplitudeR=new Ii({context:this.context}),this.frequency=new Di({context:this.context,value:e.frequency,units:"frequency"}),this.depth=new Di({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(Uo.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(Dr(fl.getDefaults(),arguments,["frequency","depth"])),this.name="Vibrato";const e=Dr(fl.getDefaults(),arguments,["frequency","depth"]);this._delayNode=new Li({context:this.context,delayTime:0,maxDelay:e.maxDelay}),this._lfo=new ka({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 Si{constructor(){super(Dr(ml.getDefaults(),arguments,["type","size"])),this.name="Analyser",this._analysers=[],this._buffers=[];const e=Dr(ml.getDefaults(),arguments,["type","size"]);this.input=this.output=this._gain=new Ii({context:this.context}),this._split=new Wo({context:this.context,channels:e.channels}),this.input.connect(this._split),ir(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 Si{constructor(){super(Dr(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(Dr(yl.getDefaults(),arguments,["smoothing"])),this.name="Meter",this._rms=0;const e=Dr(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 ur("'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:oi(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(Dr(bl.getDefaults(),arguments,["size"])),this.name="FFT";const e=Dr(bl.getDefaults(),arguments,["size"]);this.normalRange=e.normalRange,this._analyser.type="fft",this.size=e.size}static getDefaults(){return Object.assign(Si.getDefaults(),{normalRange:!1,size:1024,smoothing:.8})}getValue(){return this._analyser.getValue().map((e=>this.normalRange?ai(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(){Al._soloed.has(this.context)||Al._soloed.set(this.context,new Set),Al._soloed.get(this.context).add(this)}_removeSolo(){Al._soloed.has(this.context)&&Al._soloed.get(this.context).delete(this)}_isSoloed(){return Al._soloed.has(this.context)&&Al._soloed.get(this.context).has(this)}_noSolos(){return!Al._soloed.has(this.context)||Al._soloed.has(this.context)&&0===Al._soloed.get(this.context).size}_updateSolo(){this._isSoloed()||this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),Al._allSolos.get(this.context).delete(this),this._removeSolo(),this}}Al._allSolos=new Map,Al._soloed=new Map;class xl extends Si{constructor(){super(Dr(xl.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const e=Dr(xl.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new Ro({context:this.context,pan:e.pan,channelCount:e.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Ki({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(Si.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 Cl extends Si{constructor(){super(Dr(Cl.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const e=Dr(Cl.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Al({solo:e.solo,context:this.context}),this._panVol=this.output=new xl({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(Si.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 Cl.buses.has(e)||Cl.buses.set(e,new Ii({context:this.context})),Cl.buses.get(e)}send(e,t=0){const n=this._getBus(e),s=new Ii({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}}Cl.buses=new Map;class kl extends Si{constructor(){super(Dr(kl.getDefaults(),arguments)),this.name="Mono",this.input=new Ii({context:this.context}),this._merge=this.output=new Go({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 Si{constructor(){super(Dr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"])),this.name="MultibandSplit",this.input=new Ii({context:this.context}),this.output=void 0,this.low=new Ka({context:this.context,frequency:0,type:"lowpass"}),this._lowMidFilter=new Ka({context:this.context,frequency:0,type:"highpass"}),this.mid=new Ka({context:this.context,frequency:0,type:"lowpass"}),this.high=new Ka({context:this.context,frequency:0,type:"highpass"}),this._internalChannels=[this.low,this.mid,this.high];const e=Dr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"]);this.lowFrequency=new Di({context:this.context,units:"frequency",value:e.lowFrequency}),this.highFrequency=new Di({context:this.context,units:"frequency",value:e.highFrequency}),this.Q=new Di({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(Si.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 Si{constructor(){super(...arguments),this.name="Listener",this.positionX=new ki({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new ki({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new ki({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new ki({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new ki({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new ki({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new ki({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new ki({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new ki({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(Si.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 Si{constructor(){super(Dr(_l.getDefaults(),arguments,["positionX","positionY","positionZ"])),this.name="Panner3D";const e=Dr(_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 ki({context:this.context,param:this._panner.positionX,value:e.positionX}),this.positionY=new ki({context:this.context,param:this._panner.positionY,value:e.positionY}),this.positionZ=new ki({context:this.context,param:this._panner.positionZ,value:e.positionZ}),this.orientationX=new ki({context:this.context,param:this._panner.orientationX,value:e.orientationX}),this.orientationY=new ki({context:this.context,param:this._panner.orientationY,value:e.orientationY}),this.orientationZ=new ki({context:this.context,param:this._panner.orientationZ,value:e.orientationZ})}static getDefaults(){return Object.assign(Si.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 Tl extends Si{constructor(){super(Dr(Tl.getDefaults(),arguments)),this.name="Recorder";const e=Dr(Tl.getDefaults(),arguments);this.input=new Ii({context:this.context}),rr(Tl.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 Si.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 Cr(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 Cr(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 Il extends Si{constructor(){super(Dr(Il.getDefaults(),arguments,["threshold","ratio"])),this.name="Compressor",this._compressor=this.context.createDynamicsCompressor(),this.input=this._compressor,this.output=this._compressor;const e=Dr(Il.getDefaults(),arguments,["threshold","ratio"]);this.threshold=new ki({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 ki({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 ki({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 ki({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 ki({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(Si.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 Si{constructor(){super(Object.assign(Dr(Nl.getDefaults(),arguments,["threshold","smoothing"]))),this.name="Gate";const e=Dr(Nl.getDefaults(),arguments,["threshold","smoothing"]);this._follower=new Fo({context:this.context,smoothing:e.smoothing}),this._gt=new Fa({context:this.context,value:ai(e.threshold)}),this.input=new Ii({context:this.context}),this._gate=this.output=new Ii({context:this.context}),this.input.connect(this._gate),this.input.chain(this._follower,this._gt,this._gate.gain)}static getDefaults(){return Object.assign(Si.getDefaults(),{smoothing:.1,threshold:-40})}get threshold(){return oi(this._gt.value)}set threshold(e){this._gt.value=ai(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 Si{constructor(){super(Object.assign(Dr(Ol.getDefaults(),arguments,["threshold"]))),this.name="Limiter";const e=Dr(Ol.getDefaults(),arguments,["threshold"]);this._compressor=this.input=this.output=new Il({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(Si.getDefaults(),{threshold:-12})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.dispose(),this.threshold.dispose(),this}}class Dl extends Si{constructor(){super(Object.assign(Dr(Dl.getDefaults(),arguments))),this.name="MidSideCompressor";const e=Dr(Dl.getDefaults(),arguments);this._midSideSplit=this.input=new cl({context:this.context}),this._midSideMerge=this.output=new ul({context:this.context}),this.mid=new Il(Object.assign(e.mid,{context:this.context})),this.side=new Il(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(Si.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 Rl extends Si{constructor(){super(Object.assign(Dr(Rl.getDefaults(),arguments))),this.name="MultibandCompressor";const e=Dr(Rl.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 Ii({context:this.context}),this.low=new Il(Object.assign(e.low,{context:this.context})),this.mid=new Il(Object.assign(e.mid,{context:this.context})),this.high=new Il(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(Si.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 Si{constructor(){super(Dr(Ml.getDefaults(),arguments,["low","mid","high"])),this.name="EQ3",this.output=new Ii({context:this.context}),this._internalChannels=[];const e=Dr(Ml.getDefaults(),arguments,["low","mid","high"]);this.input=this._multibandSplit=new Sl({context:this.context,highFrequency:e.highFrequency,lowFrequency:e.lowFrequency}),this._lowGain=new Ii({context:this.context,gain:e.low,units:"decibels"}),this._midGain=new Ii({context:this.context,gain:e.mid,units:"decibels"}),this._highGain=new Ii({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(Si.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 Si{constructor(){super(Dr(Fl.getDefaults(),arguments,["url","onload"])),this.name="Convolver",this._convolver=this.context.createConvolver();const e=Dr(Fl.getDefaults(),arguments,["url","onload"]);this._buffer=new Jr(e.url,(t=>{this.buffer=t,e.onload()})),this.input=new Ii({context:this.context}),this.output=new Ii({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(Si.getDefaults(),{normalize:!0,onload:Qr})}load(e){return Cr(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 si().now()}function zl(){return si().immediate()}const Ll=si().transport;function Pl(){return si().transport}const Vl=si().destination,Wl=si().destination;function Gl(){return si().destination}const Ul=si().listener;function ql(){return si().listener}const jl=si().draw;function Hl(){return si().draw}const $l=si();function Kl(){return Jr.loaded()}const Xl=Jr,Zl=Vi,Yl=ta},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)}})),i("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(" "),i=0;i(t=t||0)&&(t=Math.max(t+s,0));ti)s[n++]=i;else{if(2048>i)s[n++]=i>>6|192;else{if(55296<=i&&57343>=i){if(56319>=i&&r=a){i=1024*(i-55296)+a-56320+65536,s[n++]=i>>18|240,s[n++]=i>>12&63|128,s[n++]=i>>6&63|128,s[n++]=63&i|128;continue}r--}if(t)throw Error("Found an unpaired surrogate");i=65533}s[n++]=i>>12|224,s[n++]=i>>6&63|128}s[n++]=63&i|128}}e=s.subarray(0,n)}return e}var R={},M=null;function F(e,t){void 0===t&&(t=0),z(),t=R[t];for(var n=Array(Math.floor(e.length/3)),s=t[64]||"",r=0,i=0;r>2];a=t[(3&a)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[i++]=c+a+o+l}switch(c=0,l=s,e.length-r){case 2:l=t[(15&(c=e[r+1]))<<2]||s;case 1:e=e[r],n[i]=t[e>>2]+t[(3&e)<<4|c>>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!=a&&(t(i<<4&240|a>>2),64!=o&&t(a<<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(""));R[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}G.prototype.reset=function(){this.g=this.l},G.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)))))},G.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&&U(n,e),e=n):e=new G(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(),i=e.g.g+r;if(e.g.j=i,n(t,e),0!==(n=i-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=i,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=T)||(t=T=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(s,s+n));else{n=s+n;for(var r,i,a,o=[],l=null;s(r=e[s++])?o.push(r):224>r?s>=n?o.push(65533):(i=e[s++],194>r||128!=(192&i)?(s--,o.push(65533)):o.push((31&r)<<6|63&i)):240>r?s>=n-1?o.push(65533):128!=(192&(i=e[s++]))||224===r&&160>i||237===r&&160<=i||128!=(192&(t=e[s++]))?(s--,o.push(65533)):o.push((15&r)<<12|(63&i)<<6|63&t):244>=r?s>=n-2?o.push(65533):128!=(192&(i=e[s++]))||i-144+(r<<28)>>30||128!=(192&(t=e[s++]))||128!=(192&(a=e[s++]))?(s--,o.push(65533)):(r=(7&r)<<18|(63&i)<<12|(63&t)<<6|63&a,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&&Ae(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 xe(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 Ce(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 T=(_=Math.abs(_))>>>0;for(_=Math.floor((_-T)/4294967296),_>>>=0,S&&(_=~_>>>0,4294967295<(T=1+(~T>>>0))&&(T=0,4294967295<++_&&(_=0))),S=W=T,T=_;0>>7|T<<25)>>>0,T>>>=7;E.push(S)}if(_e(C,k),x=re(x),v.call(w,A,x),y.O)for(w=0;w_;_++)S.push(127&T|128),T>>=7;S.push(1)}ie(E,2,ge(k,2)),null!=(S=ge(k,3))&&(S=D(S),$(E.g,26),$(E.g,S.length),se(E,E.g.end()),se(E,S)),null!=(S=ge(k,4))&&(S=D(S),$(E.g,34),$(E.g,S.length),se(E,E.g.end()),se(E,S)),_e(k,E),C=re(C),A.call(v,x,C)}}f=f.data;break e;default:f={}}}switch(u=f,h=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},u),{stream:h,timestamp:s}));break;case"detections":(d=u).stream=h,d.timestamp=s,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+c.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 Ce(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"}}}},ct=[[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]],ut=[[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(ct),l(ut),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 De(this,(function e(){var t=this;return C(e,(function(e){return b(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return De(this,(function t(){var n=this;return C(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",ct),E("FACEMESH_LEFT_EYE",ut),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=[],i=0;i{e.exports=function e(t,n,s){function r(a,o){if(!n[a]){if(!t[a]){if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,(function(e){var n=t[a][1][e];return r(n||e)}),c,c.exports,e,t,n,s)}return n[a].exports}for(var i=void 0,a=0;a=43)}})).catch((function(){return!1}))}function x(e){return"boolean"==typeof m?c.resolve(m):A(e).then((function(e){return m=e}))}function C(e){var t=g[e.name],n={};n.promise=new c((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 k(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 c((function(n,s){if(g[e.name]=g[e.name]||B(),e.db){if(!t)return n(e.db);C(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var i=a.open.apply(a,r);t&&(i.onupgradeneeded=function(t){var n=i.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(f)}catch(e){if("ConstraintError"!==e.name)throw e}}),i.onerror=function(e){e.preventDefault(),s(i.error)},i.onsuccess=function(){var t=i.result;t.onversionchange=function(e){e.target.close()},n(t),k(e)}}))}function _(e){return E(e,!1)}function T(e){return E(e,!0)}function I(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 i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function N(e){return new c((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 D(e){return e&&e.__local_forage_encoded_blob}function R(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){C(e);for(var t=g[e.name],n=t.forages,s=0;s0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return c.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),T(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=R);var i=[];function a(){return c.resolve()}for(var o=0;o>4,u[l++]=(15&s)<<4|r>>2,u[l++]=(3&r)<<6|63&i;return c}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+=ie:"[object Uint16Array]"===n?r+=oe:"[object Int32Array]"===n?r+=ae:"[object Uint32Array]"===n?r+=le:"[object Float32Array]"===n?r+=ce:"[object Float64Array]"===n?r+=ue:t(new Error("Failed to get type for BinaryArray"))),t(r+fe(s))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n=Z+e.type+"~"+fe(this.result);t(Q+te+n)},i.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 i=pe(n);switch(s){case ee:return i;case te:return l([i],{type:t});case ne:return new Int8Array(i);case se:return new Uint8Array(i);case re:return new Uint8ClampedArray(i);case ie:return new Int16Array(i);case oe:return new Uint16Array(i);case ae:return new Int32Array(i);case le:return new Uint32Array(i);case ce:return new Float32Array(i);case ue:return new Float64Array(i);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 c((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,i){e.executeSql(n,s,r,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,o){o.rows.length?i(e,a):be(e,t,(function(){e.executeSql(n,s,r,i)}),i)}),i):i(e,a)}),i)}function Ae(e,t){var n=this;e=d(e);var s=new c((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 u(s,t),s}function xe(e,t){var n=this,s=new c((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 i=s.rows,a=i.length,o=0;o0)return void i(Ce.apply(r,[e,o,n,s-1]));a(t)}}))}))})).catch(a)}));return u(i,n),i}function ke(e,t,n){return Ce.apply(this,[e,t,n,1])}function Se(e,t){var n=this;e=d(e);var s=new c((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 u(s,t),s}function Ee(e){var t=this,n=new c((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 u(n,e),n}function _e(e){var t=this,n=new c((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 u(n,e),n}function Te(e,t){var n=this,s=new c((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 u(s,t),s}function Ie(e){var t=this,n=new c((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=[],i=0;i0}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,c.resolve()):c.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 u(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 u(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,i=localStorage.length,a=1,o=0;o=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):c.reject("Invalid arguments"),u(s,t),s}var $e={_driver:"localStorageWrapper",_initStorage:ze,_support:Re(),iterate:Ve,getItem:Pe,setItem:je,removeItem:qe,clear:Le,length:Ue,key:We,keys:Ge,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={},i={};function a(e,t){var n,s,a;return t?(a=0<=(e>>>=0)&&e<256)&&(s=i[e])?s:(n=l(e,(0|e)<0?-1:0,!0),a&&(i[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(s=r[e])?s:(n=l(e,e<0?-1:0,!1),a&&(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 x}else{if(e<=-f)return C;if(e+1>=f)return A}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=a,n.fromNumber=o,n.fromBits=l;var c=Math.pow;function u(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 u(e.substring(1),t,n).neg();for(var r=o(c(n,8)),i=g,a=0;a>>0:this.low},k.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},k.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((i=l).isZero())return u+a;for(;u.length<6;)u="0"+u;a=""+u+a}},k.getHighBits=function(){return this.high},k.getHighBitsUnsigned=function(){return this.high>>>0},k.getLowBits=function(){return this.low},k.getLowBitsUnsigned=function(){return this.low>>>0},k.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<=0},k.isOdd=function(){return!(1&~this.low)},k.isEven=function(){return!(1&this.low)},k.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)},k.eq=k.equals,k.notEquals=function(e){return!this.eq(e)},k.neq=k.notEquals,k.ne=k.notEquals,k.lessThan=function(e){return this.comp(e)<0},k.lt=k.lessThan,k.lessThanOrEqual=function(e){return this.comp(e)<=0},k.lte=k.lessThanOrEqual,k.le=k.lessThanOrEqual,k.greaterThan=function(e){return this.comp(e)>0},k.gt=k.greaterThan,k.greaterThanOrEqual=function(e){return this.comp(e)>=0},k.gte=k.greaterThanOrEqual,k.ge=k.greaterThanOrEqual,k.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},k.comp=k.compare,k.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(b)},k.neg=k.negate,k.add=function(e){s(e)||(e=h(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,a=e.high>>>16,o=65535&e.high,c=e.low>>>16,u=0,d=0,p=0,f=0;return p+=(f+=i+(65535&e.low))>>>16,d+=(p+=r+c)>>>16,u+=(d+=n+o)>>>16,u+=t+a,l((p&=65535)<<16|(f&=65535),(u&=65535)<<16|(d&=65535),this.unsigned)},k.subtract=function(e){return s(e)||(e=h(e)),this.add(e.neg())},k.sub=k.subtract,k.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(C))return e.isOdd()?C:g;if(e.eq(C))return this.isOdd()?C: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,i=this.low>>>16,a=65535&this.low,c=e.high>>>16,u=65535&e.high,d=e.low>>>16,p=65535&e.low,f=0,y=0,b=0,w=0;return b+=(w+=a*p)>>>16,y+=(b+=i*p)>>>16,b&=65535,y+=(b+=a*d)>>>16,f+=(y+=r*p)>>>16,y&=65535,f+=(y+=i*d)>>>16,y&=65535,f+=(y+=a*u)>>>16,f+=n*p+r*d+i*u+a*c,l((b&=65535)<<16|(w&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},k.mul=k.multiply,k.divide=function(e){if(s(e)||(e=h(e)),e.isZero())throw Error("division by zero");var n,r,i;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;i=y}else{if(this.eq(C))return e.eq(b)||e.eq(v)?C:e.eq(C)?b:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:v:(r=this.sub(e.mul(n)),i=n.add(r.div(e)));if(e.eq(C))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();i=g}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),u=a<=48?1:c(2,a-48),d=o(n),p=d.mul(e);p.isNegative()||p.gt(r);)p=(d=o(n-=u,this.unsigned)).mul(e);d.isZero()&&(d=b),i=i.add(d),r=r.sub(p)}return i},k.div=k.divide,k.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))},k.mod=k.modulo,k.rem=k.modulo,k.not=function(){return l(~this.low,~this.high,this.unsigned)},k.and=function(e){return s(e)||(e=h(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},k.or=function(e){return s(e)||(e=h(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},k.xor=function(e){return s(e)||(e=h(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},k.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)},k.shr=k.shiftRight,k.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)},k.shru=k.shiftRightUnsigned,k.shr_u=k.shiftRightUnsigned,k.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},k.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},k.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},k.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]},k.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[i][a])&&(a=o);for(var l=i;l=i;h--)n[h][u]-=n[h][i]*n[i][u]/n[i][i]}for(var d=s-1;d>=0;d--){for(var p=0,f=d+1;f=0;A--)v+=A>1?y[A]+"x^"+A+" + ":1===A?y[A]+"x + ":y[A];return{string:v,points:w,predict:b,equation:[].concat(s(y)).reverse(),r2:o(i(e,w),t.precision)}}};function c(){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=c()},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),i=n(1119),a=n(147),o=n(6297),l=n(9181),c=n(7529);c.alea=s,c.xor128=r,c.xorwow=i,c.xorshift7=a,c.xor4096=o,c.tychei=l,e.exports=c},1812:function(e,t,n){var s;!function(e,r,i){function a(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 a(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,i){function a(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,i){function a(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,i){function a(e){var t=this;t.next=function(){var e,n,s=t.w,r=t.X,i=t.i;return t.w=s=s+1640531527|0,n=r[i+34&127],e=r[i=i+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=r[i]=n^e,t.i=i,n+(s^s>>>16)|0},function(e,t){var n,s,r,i,a,o=[],l=128;for(t===(0|t)?(s=t,t=null):(t+="\0",s=0,l=Math.max(l,t.length)),r=0,i=-32;i>>15,s^=s<<4,s^=s>>>13,i>=0&&(a=a+1640531527|0,r=0==(n=o[127&i]^=s+a)?r+1:0);for(r>=128&&(o[127&(t&&t.length||0)]=-1),r=127,i=512;i>0;--i)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=a,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 a(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,i){function a(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 a(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,i){function a(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 a(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,i,a){var o,l=256,c=a.pow(l,6),u=a.pow(2,52),h=2*u,d=l-1;function p(e,t,n){var s=[],d=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,b(i)]: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(i)]}}():e,3),s),p=new f(s),w=function(){for(var e=p.g(6),t=c,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),i),(t.pass||n||function(e,t,n,s){return s&&(s.S&&m(s,p),e.state=function(){return m(p,{})}),n?(a.random=e,t):e})(w,d,"global"in t?t.global:this==a,t.state)}function f(e){var t,n=e.length,s=this,r=0,i=s.i=s.j=0,a=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:()=>OH});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{CompositeArrayBuffer:()=>So,browserFiles:()=>wc,browserHTTPRequest:()=>Tc,concatenateArrayBuffers:()=>qo,copyModel:()=>Il,decodeWeights:()=>Fo,decodeWeightsStream:()=>Vo,encodeWeights:()=>Mo,fromMemory:()=>Dc,fromMemorySync:()=>Rc,getLoadHandlers:()=>tl,getModelArtifactsForJSON:()=>Ko,getModelArtifactsForJSONSync:()=>$o,getModelArtifactsInfoForJSON:()=>Xo,getSaveHandlers:()=>el,getWeightSpecs:()=>Zo,http:()=>_c,isHTTPScheme:()=>Sc,listModels:()=>_l,loadWeights:()=>xc,moveModel:()=>Nl,registerLoadRouter:()=>Jo,registerSaveRouter:()=>Qo,removeModel:()=>Tl,weightsLoaderFactory:()=>Cc,withSaveHandler:()=>Mc,withSaveHandlerSync:()=>Fc});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{assertParamsValid:()=>jc,computeFlatOffset:()=>ru,computeOutShape:()=>$c,getNormalizedAxes:()=>Yc,isSliceContinous:()=>su,maskToAxes:()=>Hc,parseSliceParams:()=>iu,sliceInfo:()=>au,startForAxis:()=>tu,startIndicesWithElidedDims:()=>Qc,stopForAxis:()=>nu,stopIndicesWithElidedDims:()=>Jc,stridesForAxis:()=>eu,stridesWithElidedDims:()=>Kc});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{conv2d:()=>vf,depthwiseConv2d:()=>Cf,matMul:()=>kf});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{collectGatherOpShapeInfo:()=>Ig,computeOutShape:()=>Tg,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:()=>Rm,RowPartitionType:()=>_m,SELU_SCALE:()=>Um,SELU_SCALEALPHA:()=>Gm,applyActivation:()=>bf,assertAndGetBroadcastShape:()=>cc,assertAxesAreInnerMostDims:()=>Rh,assertParamsConsistent:()=>Sm,assignToTypedArray:()=>tg,axesAreInnerMostDims:()=>Ih,calculateShapes:()=>$p,checkEinsumDimSizes:()=>ug,checkPadOnDimRoundingMode:()=>Mu,combineLocations:()=>Nh,combineRaggedTensorToTensorShapes:()=>Im,complexWithEvenIndex:()=>Qm,complexWithOddIndex:()=>Jm,computeConv2DInfo:()=>Cu,computeConv3DInfo:()=>ku,computeDefaultPad:()=>Su,computeDilation2DInfo:()=>vu,computeOptimalWindowSize:()=>Mm,computeOutAndReduceShapes:()=>Oh,computeOutShape:()=>Em,computePool2DInfo:()=>Au,computePool3DInfo:()=>xu,convertConv2DDataFormat:()=>Ru,decodeEinsumEquation:()=>lg,eitherStridesOrDilationsAreOne:()=>Ou,expandShapeToKeepDim:()=>Dh,exponent:()=>sg,exponents:()=>ng,fromStringArrayToUint8:()=>Og,fromUint8ToStringArray:()=>Ng,getAxesPermutation:()=>Mh,getBroadcastDims:()=>oc,getComplexWithIndex:()=>eg,getEinsumComputePath:()=>hg,getEinsumPermutation:()=>cg,getFusedBiasGradient:()=>yf,getFusedDyActivation:()=>gf,getImageCenter:()=>Fm,getInnerMostAxes:()=>Bh,getPermuted:()=>zm,getRaggedRank:()=>Om,getReductionAxes:()=>lc,getReshaped:()=>Bm,getReshapedPermuted:()=>Lm,getRowPartitionTypesHelper:()=>Nm,getSliceBeginCoords:()=>Pm,getSliceSize:()=>Vm,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>mg,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>gg,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>yg,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>vg,getSparseReshapeInputOutputMismatchErrorMessage:()=>xg,getSparseReshapeInputOutputMultipleErrorMessage:()=>Ag,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>bg,getSparseReshapeNegativeOutputDimErrorMessage:()=>wg,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>Eg,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>Cg,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>kg,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>Sg,getUndoAxesPermutation:()=>Fh,isIdentityPermutation:()=>dg,log:()=>Ui,mergeRealAndImagArrays:()=>Zm,prepareAndValidate:()=>Wm,prepareSplitSize:()=>fg,segment_util:()=>s,shouldFuse:()=>wf,slice_util:()=>t,splitRealAndImagArrays:()=>Ym,stridesOrDilationsArePositive:()=>Du,tupleValuesAreOne:()=>Nu,upcastType:()=>Xa,validateDefaultValueShape:()=>Dm,validateInput:()=>Hp,validateUpdateShape:()=>jp,warn:()=>Gi});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{json:()=>YC});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{json:()=>QC});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{json:()=>JC});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{json:()=>ek});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{json:()=>tk});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{json:()=>nk});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{json:()=>sk});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{json:()=>rk});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{json:()=>ik});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{json:()=>ak});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{json:()=>ok});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{json:()=>lk});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{json:()=>ck});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{json:()=>uk});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{json:()=>hk});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{json:()=>dk});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{json:()=>pk});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{json:()=>fk});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{json:()=>mk});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{OP_SCOPE_SUFFIX:()=>wo,abs:()=>ac,acos:()=>lu,acosh:()=>cu,add:()=>Pl,addN:()=>uu,all:()=>hu,any:()=>du,argMax:()=>pu,argMin:()=>fu,asin:()=>mu,asinh:()=>gu,atan:()=>yu,atan2:()=>bu,atanh:()=>wu,avgPool:()=>Bu,avgPool3d:()=>zu,basicLSTMCell:()=>Uu,batchNorm:()=>ju,batchNorm2d:()=>Hu,batchNorm3d:()=>$u,batchNorm4d:()=>Ku,batchToSpaceND:()=>qu,bincount:()=>Xu,bitwiseAnd:()=>Zu,booleanMaskAsync:()=>rf,broadcastArgs:()=>Yu,broadcastTo:()=>Qu,buffer:()=>Fl,cast:()=>Bl,ceil:()=>Ju,clipByValue:()=>eh,clone:()=>zl,complex:()=>Ao,concat:()=>Lu,concat1d:()=>th,concat2d:()=>nh,concat3d:()=>sh,concat4d:()=>rh,conv1d:()=>ah,conv2d:()=>ih,conv2dTranspose:()=>lh,conv3d:()=>ch,conv3dTranspose:()=>hh,cos:()=>dh,cosh:()=>ph,cosineWindow:()=>pf,cumprod:()=>fh,cumsum:()=>mh,denseBincount:()=>gh,depthToSpace:()=>yh,depthwiseConv2d:()=>bh,diag:()=>wh,dilation2d:()=>vh,div:()=>Wl,divNoNan:()=>Ch,dot:()=>kh,dropout:()=>hf,einsum:()=>Sh,elu:()=>Eh,enclosingPowerOfTwo:()=>df,ensureShape:()=>_h,equal:()=>Ah,erf:()=>Th,euclideanNorm:()=>Gh,exp:()=>Uh,expandDims:()=>qh,expm1:()=>jh,eye:()=>$h,fft:()=>Ip,fill:()=>tc,floor:()=>Kh,floorDiv:()=>Vl,fused:()=>n,gather:()=>Xh,gatherND:()=>uf,greater:()=>Zh,greaterEqual:()=>Yh,ifft:()=>Np,imag:()=>Qh,image:()=>ym,inTopKAsync:()=>ff,irfft:()=>Op,isFinite:()=>Jh,isInf:()=>ed,isNaN:()=>td,leakyRelu:()=>nd,less:()=>sd,lessEqual:()=>rd,linalg:()=>bm,linspace:()=>id,localResponseNormalization:()=>ad,log:()=>od,log1p:()=>ld,logSigmoid:()=>hd,logSoftmax:()=>dd,logSumExp:()=>pd,logicalAnd:()=>fd,logicalNot:()=>md,logicalOr:()=>gd,logicalXor:()=>yd,losses:()=>wm,lowerBound:()=>vd,matMul:()=>Pu,max:()=>zh,maxPool:()=>Ad,maxPool3d:()=>xd,maxPoolWithArgmax:()=>Cd,maximum:()=>uc,mean:()=>kd,meshgrid:()=>_d,min:()=>Lh,minimum:()=>Td,mirrorPad:()=>Id,mod:()=>Nd,moments:()=>Od,movingAverage:()=>of,mul:()=>Gl,multiRNNCell:()=>Dd,multinomial:()=>Rd,neg:()=>cd,norm:()=>Wh,notEqual:()=>Md,oneHot:()=>Fd,ones:()=>Ed,onesLike:()=>Bd,op:()=>vo,outerProduct:()=>zd,pad:()=>Ld,pad1d:()=>Pd,pad2d:()=>Vd,pad3d:()=>Wd,pad4d:()=>Gd,pool:()=>qd,pow:()=>sc,prelu:()=>jd,print:()=>Ll,prod:()=>Hd,raggedGather:()=>$d,raggedRange:()=>Kd,raggedTensorToTensor:()=>Xd,rand:()=>Zd,randomGamma:()=>tp,randomNormal:()=>np,randomStandardNormal:()=>sp,randomUniform:()=>rp,randomUniformInt:()=>ip,range:()=>ap,real:()=>op,reciprocal:()=>lp,relu:()=>cp,relu6:()=>up,reshape:()=>Fu,reverse:()=>hp,reverse1d:()=>dp,reverse2d:()=>pp,reverse3d:()=>fp,reverse4d:()=>mp,rfft:()=>Rp,round:()=>gp,rsqrt:()=>yp,scalar:()=>$l,scatterND:()=>lf,searchSorted:()=>wd,selu:()=>bp,separableConv2d:()=>wp,setdiff1dAsync:()=>vp,sigmoid:()=>Vu,sign:()=>Ap,signal:()=>gm,sin:()=>xp,sinh:()=>Cp,slice:()=>Wu,slice1d:()=>kp,slice2d:()=>Sp,slice3d:()=>Ep,slice4d:()=>_p,softmax:()=>Tp,softplus:()=>ud,spaceToBatchND:()=>Ud,sparse:()=>vm,sparseToDense:()=>cf,spectral:()=>mm,split:()=>Dp,sqrt:()=>Ul,square:()=>ql,squaredDifference:()=>Mp,squeeze:()=>Fp,stack:()=>Bp,step:()=>zp,stridedSlice:()=>Lp,string:()=>Am,sub:()=>rc,sum:()=>Ph,tan:()=>Pp,tanh:()=>Gu,tensor:()=>Co,tensor1d:()=>Vp,tensor2d:()=>Wp,tensor3d:()=>Bc,tensor4d:()=>Gp,tensor5d:()=>Up,tensor6d:()=>qp,tensorScatterUpdate:()=>Kp,tile:()=>Hh,topk:()=>Xp,transpose:()=>af,truncatedNormal:()=>Zp,unique:()=>Yp,unsortedSegmentSum:()=>Qp,unstack:()=>Jp,upperBound:()=>ef,variable:()=>tf,where:()=>xh,whereAsync:()=>sf,zeros:()=>Sd,zerosLike:()=>jl});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{mx:()=>gE,XI:()=>l_,Nk:()=>c_,f6:()=>h_,ct:()=>hE,YG:()=>m_,hH:()=>A_,z3:()=>iT,sG:()=>gT,uM:()=>AT,vS:()=>LT,qB:()=>HT,GG:()=>KT,lg:()=>JT,rq:()=>ZT,cu:()=>dI,WR:()=>cI,GE:()=>mI,px:()=>yI,jC:()=>DI,He:()=>FI,hE:()=>jI,BF:()=>Y_,Dk:()=>tN,cl:()=>cN,_B:()=>xN,ub:()=>_N,_f:()=>NN,Ku:()=>BN,qy:()=>LN,Zy:()=>ZN,bu:()=>JN,zv:()=>nE,dH:()=>SE,HS:()=>r_,yH:()=>wO,l3:()=>AO,z9:()=>CO,x6:()=>TO,_m:()=>FO,eW:()=>VO,GK:()=>UO,SP:()=>HO,yr:()=>KO,dl:()=>_T,Dw:()=>JO,xT:()=>nD,_X:()=>DE,wz:()=>oD});var E=__webpack_require__(7786),_=__webpack_require__(9043);E.A.prototype._CONST=Object.freeze({N:{VIDEO_W:{DESKTOP:208,MOBILE:144},VIDEO_MARGIN:"10px",VIDEO_MARGIN_BOTTOM:"40px",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 T=__webpack_require__(115),I=__webpack_require__.n(T),N=__webpack_require__(3389),O=__webpack_require__.n(N),D=__webpack_require__(402),R=__webpack_require__.n(D),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),G=__webpack_require__(9199);const U=(e,t,n=null,s=!0,r=["return"],i=null)=>{if(!t)return()=>{};const a=((e,t)=>e?(e.event_handlers.current.push(t),()=>{e.event_handlers.current=e.event_handlers.current.filter((e=>e!==t))}):()=>{})(t,(o=>{if(r.includes(o.name)){if(t.all_keys.current=[],i&&i.disableKeypadHandler)return;e&&e.click(),n&&n(),s&&a()}}));return a};E.A.prototype._displaySize=function(e=!1){if(!e&&!this.checkInitialized())return;const t={value:{displayWidthPx:screen.width,displayHeightPx:screen.height,windowWidthPx:window.innerWidth,windowHeightPx:window.innerHeight},timestamp:performance.now()};this.displayData.length&&I()(t.value,this.displayData[this.displayData.length-1].value)||(this.newDisplayData=t)};const q={card:O(),arrow:R(),usba:F(),usbc:z()},j={card:3.375,usba:.787402,usbc:.787402};E.A.prototype.screenSize=function(e={},t=void 0){if(!this.checkInitialized())return;(0,_.$k)();const n=Object.assign({fullscreen:!1,repeatTesting:1,decimalPlace:1,defaultObject:"card",headline:`🖥️ ${G.H.RC_screenSizeTitle[this.L]}`,description:G.H.RC_screenSizeIntro[this.L],check:!1,checkCallback:null},e);this.getFullscreen(n.fullscreen),["usba","usbc","card"].includes(n.defaultObject)||(n.defaultObject="card"),n.description+=`

      ${G.H.RC_screenSizeHave[this.L].replace("xxx",``)}`,this._addBackground(),this._addBackgroundText(n.headline,n.description),this._addCreditOnBackground(G.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),i=(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",u.setAttribute("fill",e._CONST.COLOR.ORANGE);const s=()=>{r.style.cursor="grab",u.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)}},a=e=>{i(e,"mouse")},o=e=>{i(e,"touch")};document.addEventListener("mousedown",a,!1),document.addEventListener("touchstart",o,!1);const l=K(["card","arrow","usba","usbc"],t);let c=n.defaultObject;document.getElementById("matching-obj").addEventListener("change",(e=>{X(e.target.value,l,d),c=e.target.value})),X("card",l);const u=document.getElementById("size-arrow-fill");u.setAttribute("fill",e._CONST.COLOR.LIGHT_GREY);const h={width:l.arrow.getBoundingClientRect().width,height:l.arrow.getBoundingClientRect().height},d=()=>{H(e,r,l.card,l.arrow,h),$(r,l.usba),$(r,l.usbc)};d();const p=()=>{P(r),d()},f=new ResizeObserver((()=>{d(),L(r,t),Y(l,r)}));f.observe(t);const m=U(null,e.keypadHandler,(()=>{y()}),!1,["return","space"],e),g=()=>{document.removeEventListener("mousedown",a,!1),document.removeEventListener("touchstart",o,!1),document.removeEventListener("input",p,!1),f.unobserve(t),e._removeBackground(),m(),(0,V.l)(b)},y=()=>{const t=(l[c].getBoundingClientRect().width||Number.parseInt(l[c].style.width))/j[c],r=n.decimalPlace,i=Z(t,r);e.newScreenData=i,g(),n.check?e._checkScreenSize(s,i,n.checkCallback):(0,_.nB)(s,i)};r.addEventListener("input",p,!1);const b=(0,V.m)({Escape:g,Enter:y," ":y});(0,W.F)(e.L,e.background,{go:y,cancel:g},e.params.showCancelButton),X(c,l,d)}(this,this.background,n,t)};const H=(e,t,n,s,r)=>{const i=(t.offsetWidth-30)*(t.value/100)*(window.innerWidth<480?2:1)+15;n.style.width=`${i}px`;const a=n.getBoundingClientRect();0!==a.width&&(s.style.left=`${a.left+i}px`,s.style.top=`${a.top+e.background.scrollTop+(.63*i-r.height)/2}px`)},$=(e,t)=>{t.style.width=`${(0,_.Ew)(e.value**1.5,0,1e3,50,400)}px`},K=(e,t)=>{const n=document.getElementsByClassName("size-obj");for(;n.length;)n[0].parentNode.removeChild(n[0]);const s={};for(const n of e){let e=document.createElement("div");t.appendChild(e),e.outerHTML=q[n],e=document.getElementById(`size-${n}`),e.setAttribute("preserveAspectRatio","none"),e.style.visibility="hidden",s[n]=e}return Y(s,document.querySelector("#rc-size-slider")),s},X=(e,t,n)=>{for(const n in t)t[n].style.visibility=n===e?"visible":"hidden";t.arrow.style.visibility="hidden",(0,_.nB)(n)},Z=(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},Y=(e,t)=>{for(const n in e)e[n].style.top=`${t.getBoundingClientRect().top+50}px`};var Q=__webpack_require__(4284);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]}__webpack_require__(8840);const ie=(e,{showIcon:t})=>({icon:t?"info":void 0,allowEscapeKey:!1,allowOutsideClick:!1,showConfirmButton:!0,confirmButtonText:G.H.T_proceed[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 ae;"mocha"!==E._&&(ae=__webpack_require__(477).l);function oe(e,t,n=!1,s=void 0){const r=t.control;let i=e._CONST.N.PPI_DONT_USE;e.screenPpi&&(i=e.screenPpi.value);let a=!0,o=[],l=0;const c=document.createElement("div");c.innerHTML='',e.background.appendChild(c),e._constructFloatInstructionElement("blind-spot-instruction",G.H.RC_distanceTrackingCloseL[e.L]),e._addCreditOnBackground(G.H.RC_viewingBlindSpotCredit[e.L]);const u=document.querySelector("#blind-spot-canvas"),h=u.getContext("2d"),d=document.getElementById("blind-spot-instruction");let p="left";e._setFloatInstructionElementPos(p,16);let f,m=te(p,u.width);const g=()=>{u.width=window.innerWidth,u.height=window.innerHeight,u.style.width=`${u.width}px`,u.style.height=`${u.height}px`,m=te(p,u.width),f=re(p,m,u.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,A="left"===p?1:-1,x=U(null,e.keypadHandler,(()=>{k()}),!1,["return"],e);const C=(t=!0)=>{a=!1,r&&function(e,t){document.getElementById(e).removeEventListener("mousedown",t),document.getElementById(e).removeEventListener("touchstart",t)}("blind-spot-canvas",z),y.unobserve(e.background),e._removeBackground(),!e._trackingSetupFinishedStatus.distance&&t&&(e._trackingSetupFinishedStatus.distance=!0,e.gazeTracker.checkInitialized("distance",!1)&&e.endDistance()),(0,V.l)(M),(0,V.l)(F,"keyup")},k=async()=>{if("mocha"!==E._&&ae(),l+=1,o.push({dist:(0,_.Nh)(le(b,m,i),t.decimalPlace),v:A,closedEyeSide:p,crossX:m,circleX:b,ppi:i,timestamp:performance.now()}),2===Math.floor(l/t.repeatTesting))if(function(e){const t=[],n=[];for(const 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={value:(0,_.Nh)((0,_.JZ)(ce(o)),t.decimalPlace),timestamp:performance.now(),method:e._CONST.VIEW_METHOD.B,raw:{...o}};let i;e.newViewingDistanceData=r,i=n?"trackDistance":"measureDistance",C(!1),x(),t.calibrateTrackDistanceCheckBool?await e._checkDistance(s,r,i,t.checkCallback,t.calibrateTrackDistanceCheckCm,t.callbackStatic):(0,_.nB)(s,r)}else{l=0;const t=o[0];R(t.v,t.closedEyeSide,t.crossX),o=[],Q.A.fire({...ie(e,{showIcon:!1}),icon:void 0,html:G.H.RC_viewingBlindSpotRejected[e.L],allowEnterKey:!0})}else l%t.repeatTesting==0?(x(),x=U(null,e.keypadHandler,(()=>{k()}),!1,["return"],e),"left"===p?(p="right",d.innerHTML=G.H.RC_distanceTrackingCloseR[e.L]):(p="left",d.innerHTML=G.H.RC_distanceTrackingCloseL[e.L]),e._setFloatInstructionElementPos(p,16),R(1,p,te(p,u.width),!1,!0)):(A=-A,D(p,f))};let S=!1,T=null;const I=t=>{S||(N(),S=!0,v=e._CONST.COLOR.RED,T=setInterval((()=>{"ArrowLeft"===t.key?(b-=10,O()):"ArrowRight"===t.key&&(b+=10,O())}),30))},N=()=>{S=!1,v=e._CONST.COLOR.DARK_RED,T&&(clearInterval(T),T=null)},O=()=>{w=(0,_.AU)(b,...f),b=w},D=(e,t)=>{const n=t["left"===e?0:1],s=Math.abs(t[1]-t[0])/4;let 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,i=!0)=>{A=t,p=n,m=s,f=re(p,m,u.width),r&&(d.innerHTML="left"===p?G.H.RC_distanceTrackingCloseL[e.L]:G.H.RC_distanceTrackingCloseR[e.L],e._setFloatInstructionElementPos(p,16)),i&&(b=f["left"===p?0:1],D(n,f))},M=(0,V.m)({Escape:t.showCancelButton?C:void 0,Enter:k," ":k,ArrowLeft:r?I:_.Md,ArrowRight:r?I:_.Md}),F=(0,V.m)({ArrowLeft:r?N:_.Md,ArrowRight:r?N:_.Md},"keyup");(0,W.F)(e.L,e.background,{go:k,cancel:t.showCancelButton?C:void 0,custom:{callback:()=>{Q.A.fire({...ie(e,{showIcon:!1}),icon:void 0,html:G.H.RC_viewingDistanceIntroLiMethod[e.L],allowEnterKey:!0})},content:G.H.RC_viewingDistanceIntroTitle[e.L]}},e.params.showCancelButton);const B={x:null,circleX:null},z=t=>{const n=!!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),i=b,a=u.height/2,o=s,l=r,(0,_.ll)(i,a,o,l)>1){B.x=s,B.circleX=b;const r=document.getElementById("blind-spot-canvas");v=e._CONST.COLOR.RED,r.classList.replace("cursor-grab","cursor-grabbing");const i=e=>{let s;t.preventDefault(),e.preventDefault(),s=n?e.touches[0].clientX:e.clientX,b=B.circleX+s-B.x,b=(0,_.AU)(b,...re(p,m,u.width))};n?document.addEventListener("touchmove",i):document.addEventListener("mousemove",i);const a=()=>{n?(document.removeEventListener("touchend",a),document.removeEventListener("touchmove",i)):(document.removeEventListener("mouseup",a),document.removeEventListener("mousemove",i)),B.x=null,B.circleX=null,v=e._CONST.COLOR.DARK_RED,r.classList.replace("cursor-grabbing","cursor-grab")};n?document.addEventListener("touchend",a):document.addEventListener("mouseup",a)}var i,a,o,l};r&&function(e,t){document.getElementById(e).addEventListener("mousedown",t),document.getElementById(e).addEventListener("touchstart",t)}("blind-spot-canvas",z);const L=performance.now();let P=L;const q=()=>{h.clearRect(0,0,u.width,u.height),ne(h,m,u.height/2),P=performance.now(),function(e,t,n,s,r,i,a=!0){t.beginPath(),t.arc(n,s,se>>1,0,2*Math.PI),t.closePath(),t.fillStyle=a?r%125<63?i:"#fff":i,t.fill()}(0,h,b,u.height/2,Math.round(P-L),v,t.sparkle),r||(b+=5*A,O()),a?requestAnimationFrame(q):h.clearRect(0,0,u.width,u.height)};requestAnimationFrame(q)}function le(e,t,n){return Math.abs(t-e)/n/(s=15,Math.tan(s*Math.PI/180))/.3937;var s}function ce(e){const t=[];for(const n of e)t.push(n.dist);return t}function ue(e,t={framerate:60,break:!1}){let n=0,s=0,r=0;const i=1e3/t.framerate,a=()=>{t.break||requestAnimationFrame(a),n=performance.now(),r=n-s,r>i&&(s=n-r%i,e())};requestAnimationFrame(a)}E.A.prototype.measureDistance=function(e={},t=void 0){if(!this.checkInitialized())return;let n;(0,_.$k)(),n=(e.control,G.H.RC_viewingDistanceIntroLiMethod[this.L]);const s=Object.assign({fullscreen:!1,repeatTesting:1,sparkle:!0,decimalPlace:1,control:!0,headline:`📏 ${G.H.RC_viewingDistanceTitle[this.L]}`,description:n,check:!1,checkCallback:!1,showCancelButton:!0},e);this.getFullscreen(s.fullscreen),this._addBackground(),this._replaceBackground((0,_.$O)(s.headline,null,!0,"")),oe(this,s,!1,t)};var he=__webpack_require__(2646);const de=async e=>{if(navigator.permissions?.query)return navigator.permissions.query({name:"camera"}).then((async t=>{if("prompt"===t.state)return await Q.A.fire({...ie(e,{showIcon:!1}),icon:void 0,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAFACAYAAAAszc0KAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAG9jSURBVHgB7b17sGTXVea5b95bVSpJpVfJjypkIzRYtizT3QgZcDvC2KYnosc2MDN0B9gYeoDBDmJiCAIb5q8Z7Oie+YMAzzAdMQwYHBOEZUFDu8e26I6gAZvpoQ3Y2DTYlmUbWS+XZFepJFWV6l2VnSuv1tXKdb+19j6ZeTNP3vp+EffmOfvs5zlnn/2dtR9n7fjx48MyI8PhZhRra2vb3DLEf+RP3G181h2F1X3768NkcUduUVo2jA+blauFKP82XWUwGIx/L1++vC0M2pdfCZOdd5SWL3MURuPX/Nh0rZ/a+c+uf0scUXgUnycLV8tnVBdq94xPw16j1vvVl8GGV7eM1vqIypCdl67+M7J4UTqoTKz/rP8+7xbWf5wn1v/nzxNK3x5flfq/Nk8B6EEnAj0UWuLycVi/UVzowsmJio63UHvotOQZPRBR/MhPludaeaIHcpRWDZT3Wvmy8qB8KV3ui1p5Wu+XKP7s/Ovx6IEU3fso71GaXcoUxRGFzepn9oDvEq+Nw/vL4rBuPh+Rn+y8sf6z/re4+/hZ/1n/ffq6XQvXu/o/bwtgVsAog9M8fDwtYaObZZY458ms5RdaboAoLArftdKgB96ymUfF32lqjdK0jVaXtHeibizqXM/rITmt33nA+r8zsP63pc36P73febCM+j8oUyIR6Z9PHD1EvLsNb918mFp4LZSPz/7aG6O1XIJYC30a3k+2HeUjcrfWyVo83l3CavjIr43fh5VtFN66tZTP+kflyUDx++N+25/X6HiL/5qf1rxPk65eAx+HdfdxCv64DYvSQe7ZfYPKpOmiMGgbhc/KNOzw/ED1PzvvtWvry+jTqJXVlzvLB0oPH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uflj09zH08SH/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:`${G.H.RC_requestCamera[e.L]}
      ${G.H.RC_privacyCamera[e.L]}`})})).catch((e=>{}))},pe={video:!1};E.A.prototype.trackDistance=async function(e={},t=void 0,n=void 0){if(!this.checkInitialized())return;let s;(0,_.$k)(),!1===this.gazeTracker.webgazer.getTracker().modelLoaded&&this.gazeTracker.webgazer.getTracker().loadModel(),s=(void 0!==e.control&&e.control,G.H.RC_viewingDistanceIntroLiMethod[this.L]);const r=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:`📏 ${G.H.RC_distanceTrackingTitle[this.L]}`,description:G.H.RC_distanceTrackingIntroStart[this.L]+(0,he.G)(this.L)+s+(0,he.G)(this.L)+G.H.RC_distanceTrackingIntroEnd[this.L],check:!1,checkCallback:null,showCancelButton:!0,callbackStatic:t},e);try{this.viewingDistanceAllowedPreciseBool=e.viewingDistanceAllowedPreciseBool}catch(e){this.viewingDistanceAllowedPreciseBool=!1}if(this.getFullscreen(r.fullscreen),this.gazeTracker.checkInitialized("distance"))return this.gazeTracker._toFixedN=r.decimalPlace,this.showNearPoint(r.showNearPoint),this.showVideo(r.showVideo),void this.showFaceOverlay(r.showFaceOverlay);this._addBackground(),this._constructFloatInstructionElement("gaze-system-instruction",G.H.RC_starting[this.L]),await de(this);const i=(e,n=!0)=>{this.showVideo(pe.video),pe.video=!1,this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(a),n&&(0,_.nB)(t,e),ye.current=e},a=this.gazeTracker.webgazer.params.showGazeDot,o=async()=>{this._addBackground(),this._replaceBackground((0,_.$O)(r.headline,null,!0,"")),this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(!1),oe(this,r,!0,i)};ge.pipWidthPx=r.pipWidthPx,ge.decimalPlace=r.decimalPlace,ge.framerate=r.framerate,ge.nearPoint=r.nearPoint,ge.showNearPoint=r.showNearPoint,ge.desiredDistanceCm=r.desiredDistanceCm,ge.desiredDistanceTolerance=r.desiredDistanceTolerance,ge.desiredDistanceMonitor=r.desiredDistanceMonitor,ge.desiredDistanceMonitorCancelable=r.desiredDistanceMonitorCancelable,ge.desiredDistanceMonitorAllowRecalibrate=r.desiredDistanceMonitorAllowRecalibrate,pe.video=r.showVideo,this.gazeTracker._init({toFixedN:1,showVideo:!0,showFaceOverlay:r.showFaceOverlay},"distance"),this._trackingSetupFinishedStatus.distance=!1;const l={options:r,callbackStatic:t,callbackTrack:n};r.nearPoint?fe(this,(()=>this._measurePD({},o)),n,l):fe(this,o,n,l)},E.A.prototype.setViewingDistanceAllowedPreciseBool=function(e=!0){this.viewingDistanceAllowedPreciseBool=e};const fe=async(e,t,n,s)=>{await e.gazeTracker.webgazer.getTracker().loadModel(),e.gazeTracker.beginVideo({pipWidthPx:ge.pipWidthPx},(()=>{e._removeFloatInstructionElement(),(0,_.nB)(t),Ee(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=null,we=null,ve=null;const Ae={framerate:20,break:!0};let xe=null,Ce=!1,ke=0,Se=1;const Ee=async(e,t,n,s)=>{(0,_.yy)(1e3).then((async()=>{let r;ke=0,Se=1;const i=await e.gazeTracker.webgazer.getTracker().model,a=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"})),Ce=!1;const{desiredDistanceCm:o,desiredDistanceTolerance:l,desiredDistanceMonitor:c,desiredDistanceMonitorCancelable:u,desiredDistanceMonitorAllowRecalibrate:h}=t;e._distanceTrackNudging.distanceCorrectEnabled=!0,e._distanceTrackNudging.distanceDesired=o,e._distanceTrackNudging.distanceAllowedRatio=l,ve=async()=>{we||(we=document.getElementById("webgazerVideoCanvas"));const l=performance.now();if(r=await i.estimateFaces(we),r.length){e._trackingVideoFrameTimestamps.distance+=l;const i=r[0].keypoints;if(5===Se){if(ke+=me(i[133],i[362]),ke/=5,e._trackingVideoFrameTimestamps.distance/=5,null!==ye.current){if(!be){const t=Te(a),n=Math.sqrt(ye.current.value**2-t**2);ye.current.value=n,be=ke*ye.current.value,!0!==s.options.calibrateTrackDistanceCheckBool&&e._removeBackground(),e._trackingSetupFinishedStatus.distance=!0,Ce=!0}const r=performance.now(),l=Math.round(r-e._trackingVideoFrameTimestamps.distance),d={value:(0,_.Nh)(be/ke,t.decimalPlace),timestamp:r,method:e._CONST.VIEW_METHOD.F,latencyMs:l};let p;e.newViewingDistanceData=d,(Ce||c)&&(o&&e.nudgeDistance(u,h,s),Ce=!1),t.nearPoint&&(p=_e(e,t,we,i,ke,r,a,l)),n&&"function"==typeof n&&(e.gazeTracker.defaultDistanceTrackCallback=n,n({value:{viewingDistanceCm:d.value,nearPointCm:p?p.value:[null,null],latencyMs:l},timestamp:r,method:e._CONST.VIEW_METHOD.F}))}ke=0,Se=1,e._trackingVideoFrameTimestamps.distance=0}else ke+=me(i[133],i[362]),++Se}},Ae.break=!1,Ae.framerate=5*t.framerate,ue(ve,Ae)}))},_e=(e,t,n,s,r,i,a,o)=>{const 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}));const c={value:{x:(0,_.Nh)(l[0],t.decimalPlace),y:(0,_.Nh)(l[1]+screen.height/2*2.54/a,t.decimalPlace),latencyMs:o},timestamp:i};e.newNearPointData=c;if(t.showNearPoint){const e=c.value.x*a/2.54,t=c.value.y*a/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 c};E.A.prototype.pauseDistance=function(){return this.gazeTracker.checkInitialized("distance",!0)&&!this._trackingPaused.distance?(Ae.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?(Ae.break=!1,xe&&(xe.style.display="block"),ke=0,Se=1,this._trackingVideoFrameTimestamps.distance=0,ue(ve,Ae),this._trackingPaused.distance=!1,this.resumeNudger(),this):null},E.A.prototype.endDistance=function(e=!1,t=!0){return this.gazeTracker.checkInitialized("distance",!0)?(Ae.break=!0,Ae.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,ve=null,Ce=!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)||!Ae.break)return;const t=e||this.gazeTracker.defaultDistanceTrackCallback,n=document.querySelector("#webgazerVideoFeed"),s=await this.gazeTracker.webgazer.getTracker().model,r=performance.now(),i=await s.estimateFaces(n);if(i.length){const e=i[0].scaledMesh,s=me(e[133],e[362]),a=performance.now(),o=a-r;this.newViewingDistanceData={value:(0,_.Nh)(be/s,ge.decimalPlace),timestamp:a,method:this._CONST.VIEW_METHOD.F,latencyMs:o};const l=this.newViewingDistanceData;let c;return ge.nearPoint&&(c=_e(this,ge,n,e,s,a,this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE,o)),(0,_.nB)(t,{value:{viewingDistanceCm:l.value,nearPointCm:c?c.value:null,latencyMs:o},timestamp:a,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 Te=e=>2.54*(window.screen.height/2/e);E.A.prototype.nudgeDistance=function(e,t,n){if(this.checkInitialized()&&this._distanceTrackNudging.distanceDesired){if(this.viewingDistanceCm&&this.viewingDistanceCm.method===this._CONST.VIEW_METHOD.F){if(!Ie(this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired,this._distanceTrackNudging.distanceAllowedRatio)){const s=()=>{this._removeNudger(),clearInterval(this._distanceTrackNudging.distanceCorrecting),this._distanceTrackNudging.distanceCorrecting=null,(0,V.l)(i)},r=async()=>{this.endDistance(),this._addBackground(),await(0,_.yy)(2e3),this.trackDistance(n.options,n.callbackStatic,n.callbackTrack)},i=(0,V.m)(e?{Escape:this.endNudger}:{});if(null===this._distanceTrackNudging.distanceCorrecting&&this._distanceTrackNudging.distanceCorrectEnabled){const[n,a,o,l]=Ne(this);let c=e?{cancel:()=>{this.endNudger()}}:{};t&&(c={...c,custom:{callback:r,content:G.H.RC_distanceTrackingRedo[this.L]}}),(e||t)&&(0,W.F)(this.L,this.nudger,c,this.params.showCancelButton);const u=()=>{n.innerHTML=Oe(this,this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired),a.innerHTML=this.viewingDistanceAllowedPreciseBool?this.viewingDistanceCm.value.toFixed(1):Math.round(this.viewingDistanceCm.value),o.innerHTML=Math.round(this._distanceTrackNudging.distanceDesired),this._distanceTrackNudging.needEasyEyesKeypadBeyondCm&&this._distanceTrackNudging.distanceDesired>this._distanceTrackNudging.needEasyEyesKeypadBeyondCm?l.innerHTML=` ${G.H.RC_canUsePhoneKeypad[this.L]}`:l.innerHTML=""};u(),this._distanceTrackNudging.distanceCorrecting=setInterval((()=>{u(),Ie(this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired,this._distanceTrackNudging.distanceAllowedRatio)&&(s(),(0,V.l)(i))}),200)}else this._distanceTrackNudging.distanceCorrecting&&!this._distanceTrackNudging.distanceCorrectEnabled&&s();return!1}return!0}return!1}};const Ie=(e,t,n)=>{if(!De(n))return!1;const s=t*n,r=t/n;return e<=Math.max(s,r)&&e>=Math.min(s,r)},Ne=e=>(e._addNudger(`
      \n

      \n

      ${G.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"),document.querySelector("#rc-can-use-keypad")]),Oe=(e,t,n)=>t>=n?G.H.RC_distanceTrackingMoveCloser[e.L]:G.H.RC_distanceTrackingMoveFurther[e.L],De=e=>!Number.isNaN(e)&&(e>0&&1!==e);E.A.prototype.setDistanceDesired=function(e,t=null,n=null){return this._distanceTrackNudging.distanceDesired=e,n&&(this._distanceTrackNudging.needEasyEyesKeypadBeyondCm=n),t&&De(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(){const 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){const i=setInterval((()=>{const a=document.getElementById("webgazerVideoContainer");a&&(clearInterval(i),a.style.height=t/Number.parseInt(a.style.width)*Number.parseInt(a.style.height)+"px",a.style.width=`${t}px`,a.style.opacity=n,s.setVideoViewerSize(Number.parseInt(a.style.width),Number.parseInt(a.style.height)),Me(e,a),setTimeout((()=>{e.videoOpacity(),e.isMobile.value?a.style.transition="right 0.5s, top 0.5s, width 0.5s, height 0.5s, border-radius 0.5s":a.style.transition="left 0.5s, bottom 0.5s, width 0.5s, height 0.5s, border-radius 0.5s",(0,_.nB)(r)}),700))}),100)}function Me(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_BOTTOM)}const Fe={video:!1,videoWidth:0,videoHeight:0,opacity:1,gaze:!1,faceOverlay:!1},Be=.9;E.A.prototype._measurePD=async function(e={},t=void 0){if(!this.checkInitialized())return;(0,_.$k)();const n=Object.assign({fullscreen:!1,headline:`👁️ ${G.H.RC_nearPointTitle[this.L]}`,description:G.H.RC_nearPointIntro[this.L],shortDescription:G.H.RC_nearPointIntro[this.L]},e);this.getFullscreen(n.fullscreen),await(0,_.yy)(1e3),this._replaceBackground(),this._replaceBackground((0,_.$O)(n.headline,n.shortDescription,!0));const s=this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE,[r,i]=ze(this),[a,o]=Ve(this,s,r,i),l=(e=!0)=>{a.removeEventListener("mousedown",o),this._removeBackground(),this.showVideo(Fe.video),this.showGazer(Fe.gaze),this.showFaceOverlay(Fe.faceOverlay),this.gazeTracker.webgazer.showFaceFeedbackBox(!0),Object.assign(document.querySelector("#webgazerVideoContainer").style,{height:Fe.videoHeight,width:Fe.videoWidth,opacity:Fe.opacity,borderRadius:"5px"}),Me(this,document.querySelector("#webgazerVideoContainer")),Object.assign(document.querySelector("#webgazerVideoFeed").style,{height:Fe.videoHeight,width:Fe.videoWidth,top:"unset",transform:"scale(-1, 1)",transformOrigin:"unset"}),Fe.video=!1,Fe.videoWidth=0,Fe.videoHeight=0,Fe.opacity=1,Fe.gaze=!1,Fe.faceOverlay=!1,!this._trackingSetupFinishedStatus.distance&&e&&(this._trackingSetupFinishedStatus.distance=!0,this.endDistance()),(0,V.l)(u)},c=()=>{if(-100!==Pe){const e={value:2.54*Pe/s,timestamp:performance.now()};return this.newPDData=e,l(!1),(0,_.nB)(t,e)}},u=(0,V.m)({Escape:l,Enter:c," ":c});(0,W.F)(this.L,this.background,{go:c,cancel:l},this.params.showCancelButton),setTimeout((()=>{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CUeUJBodc4AJRC8q8plX9RHCMD1svJg0EIJUmcO2PqXzZue+rl16vKSoxn/39nE9KqgqMETAAAAABJRU5ErkJggg==",imageWidth:480,imageAlt:"Measurement Instruction",html:n.description})}),700)};const ze=e=>{const t=document.querySelector("#webgazerVideoFeed");if(t)return Le(e,t,document.querySelector("#webgazerVideoCanvas"),document.querySelector("#webgazerVideoContainer"))},Le=(e,t,n,s,r=null)=>{const i=.3*window.innerWidth/Number.parseInt(t.style.width)*Number.parseInt(t.style.height);Fe.videoWidth=s.style.width,Fe.videoHeight=s.style.height,Fe.opacity=s.style.opacity;const a={height:`${Math.round(i)}px`,width:`${Math.round(window.innerWidth*Be)}px`,opacity:1,borderRadius:"15px"};Object.assign(s.style,a),e.isMobile.value?Object.assign(s.style,{right:`${Math.round(.5*window.innerWidth*.09999999999999998)}px`,top:`${Math.round(.5*(window.innerHeight-i))}px`}):Object.assign(s.style,{left:`${Math.round(.5*window.innerWidth*.09999999999999998)}px`,bottom:`${Math.round(.5*(window.innerHeight-i))}px`});const o={height:`${Math.round(i*Be/.3)}px`,width:`${Math.round(window.innerWidth*Be)}px`,top:`${Math.round(.6000000000000001*-i)}px`,transform:"scale(-2, 2)",transformOrigin:"center"};return Object.assign(t.style,o),Fe.video=e.gazeTracker.webgazer.params.showVideo,Fe.gaze=e.gazeTracker.webgazer.params.showGazeDot,Fe.faceOverlay=e.gazeTracker.webgazer.params.showFaceOverlay,Fe.video||e.showVideo(!0),Fe.gaze&&e.showGazer(!1),Fe.faceOverlay&&e.showFaceOverlay(!1),e.gazeTracker.webgazer.showFaceFeedbackBox(!1),[window.innerWidth*Be,i]};let Pe=-100;const Ve=(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 i=document.createElement("div");i.id="rc-ruler-scales",r.appendChild(i);const a=2.54*(r.clientWidth-60)/t;for(let n=0;n<=10*(0,_.Nh)(a,1);n++){const 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,i.appendChild(s),n%10==0){const t=document.createElement("p");t.className="rc-ruler-scale-text",t.style.left=r,t.innerHTML=n/10,i.appendChild(t),0===n&&(t.style.color=e._CONST.COLOR.DARK_RED)}}let o=document.createElement("div");i.appendChild(o),o.outerHTML=R(),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=>{Pe=e.offsetX-30,o.style.left=`${Pe}px`;const t=e=>{Pe=e.offsetX-30,o.style.left=`${Pe}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 We(e){return We="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},We(e)}var Ge=/^\s+/,Ue=/\s+$/;function qe(e,t){if(t=t||{},(e=e||"")instanceof qe)return e;if(!(this instanceof qe))return new qe(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,s=null,r=null,i=null,a=!1,o=!1;"string"==typeof e&&(e=function(e){e=e.replace(Ge,"").replace(Ue,"").toLowerCase();var t,n=!1;if(ot[e])e=ot[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=vt.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=vt.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=vt.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=vt.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=vt.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=vt.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=vt.hex8.exec(e))return{r:dt(t[1]),g:dt(t[2]),b:dt(t[3]),a:gt(t[4]),format:n?"name":"hex8"};if(t=vt.hex6.exec(e))return{r:dt(t[1]),g:dt(t[2]),b:dt(t[3]),format:n?"name":"hex"};if(t=vt.hex4.exec(e))return{r:dt(t[1]+""+t[1]),g:dt(t[2]+""+t[2]),b:dt(t[3]+""+t[3]),a:gt(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=vt.hex3.exec(e))return{r:dt(t[1]+""+t[1]),g:dt(t[2]+""+t[2]),b:dt(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==We(e)&&(At(e.r)&&At(e.g)&&At(e.b)?(l=e.r,c=e.g,u=e.b,t={r:255*ut(l,255),g:255*ut(c,255),b:255*ut(u,255)},a=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):At(e.h)&&At(e.s)&&At(e.v)?(s=ft(e.s),r=ft(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,i=n*(1-t),a=n*(1-r*t),o=n*(1-(1-r)*t),l=s%6,c=[n,a,i,i,o,n][l],u=[o,n,n,a,i,i][l],h=[i,i,o,n,n,a][l];return{r:255*c,g:255*u,b:255*h}}(e.h,s,r),a=!0,o="hsv"):At(e.h)&&At(e.s)&&At(e.l)&&(s=ft(e.s),i=ft(e.l),t=function(e,t,n){var s,r,i;function a(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=i=n;else{var o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;s=a(l,o,e+1/3),r=a(l,o,e),i=a(l,o,e-1/3)}return{r:255*s,g:255*r,b:255*i}}(e.h,s,i),a=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a));var l,c,u;return n=ct(n),{ok:a,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 je(e,t,n){e=ut(e,255),t=ut(t,255),n=ut(n,255);var s,r,i=Math.max(e,t,n),a=Math.min(e,t,n),o=(i+a)/2;if(i==a)s=r=0;else{var l=i-a;switch(r=o>.5?l/(2-i-a):l/(i+a),i){case e:s=(t-n)/l+(t>1)+720)%360;--t;)s.h=(s.h+r)%360,i.push(qe(s));return i}function at(e,t){t=t||6;for(var n=qe(e).toHsv(),s=n.h,r=n.s,i=n.v,a=[],o=1/t;t--;)a.push(qe({h:s,s:r,v:i})),i=(i+o)%1;return a}qe.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=ct(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=He(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=He(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=je(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString: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.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return $e(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 i=[pt(Math.round(e).toString(16)),pt(Math.round(t).toString(16)),pt(Math.round(n).toString(16)),pt(mt(s))];if(r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.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)&&(lt[$e(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+Ke(this._r,this._g,this._b,this._a),n=t,s=this._gradientType?"GradientType = 1, ":"";if(e){var r=qe(e);n="#"+Ke(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 qe(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(Qe,arguments)},brighten:function(){return this._applyModification(Je,arguments)},darken:function(){return this._applyModification(et,arguments)},desaturate:function(){return this._applyModification(Xe,arguments)},saturate:function(){return this._applyModification(Ze,arguments)},greyscale:function(){return this._applyModification(Ye,arguments)},spin:function(){return this._applyModification(tt,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(it,arguments)},complement:function(){return this._applyCombination(nt,arguments)},monochromatic:function(){return this._applyCombination(at,arguments)},splitcomplement:function(){return this._applyCombination(rt,arguments)},triad:function(){return this._applyCombination(st,[3])},tetrad:function(){return this._applyCombination(st,[4])}},qe.fromRatio=function(e,t){if("object"==We(e)){var n={};for(var s in e)e.hasOwnProperty(s)&&(n[s]="a"===s?e[s]:ft(e[s]));e=n}return qe(e,t)},qe.equals=function(e,t){return!(!e||!t)&&qe(e).toRgbString()==qe(t).toRgbString()},qe.random=function(){return qe.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},qe.mix=function(e,t,n){n=0===n?0:n||50;var s=qe(e).toRgb(),r=qe(t).toRgb(),i=n/100;return qe({r:(r.r-s.r)*i+s.r,g:(r.g-s.g)*i+s.g,b:(r.b-s.b)*i+s.b,a:(r.a-s.a)*i+s.a})},qe.readability=function(e,t){var n=qe(e),s=qe(t);return(Math.max(n.getLuminance(),s.getLuminance())+.05)/(Math.min(n.getLuminance(),s.getLuminance())+.05)},qe.isReadable=function(e,t,n){var s,r,i=qe.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=i>=4.5;break;case"AAlarge":r=i>=3;break;case"AAAsmall":r=i>=7}return r},qe.mostReadable=function(e,t,n){var s,r,i,a,o=null,l=0;r=(n=n||{}).includeFallbackColors,i=n.level,a=n.size;for(var c=0;cl&&(l=s,o=qe(t[c]));return qe.isReadable(e,o,{level:i,size:a})||!r?o:(n.includeFallbackColors=!1,qe.mostReadable(e,["#fff","#000"],n))};var ot=qe.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"},lt=qe.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(ot);function ct(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 ht(e){return Math.min(1,Math.max(0,e))}function dt(e){return parseInt(e,16)}function pt(e){return 1==e.length?"0"+e:""+e}function ft(e){return e<=1&&(e=100*e+"%"),e}function mt(e){return Math.round(255*parseFloat(e)).toString(16)}function gt(e){return dt(e)/255}var yt,bt,wt,vt=(bt="[\\s|\\(]+("+(yt="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+yt+")[,|\\s]+("+yt+")\\s*\\)?",wt="[\\s|\\(]+("+yt+")[,|\\s]+("+yt+")[,|\\s]+("+yt+")[,|\\s]+("+yt+")\\s*\\)?",{CSS_UNIT:new RegExp(yt),rgb:new RegExp("rgb"+bt),rgba:new RegExp("rgba"+wt),hsl:new RegExp("hsl"+bt),hsla:new RegExp("hsla"+wt),hsv:new RegExp("hsv"+bt),hsva:new RegExp("hsva"+wt),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 At(e){return!!vt.CSS_UNIT.exec(e)}var xt=__webpack_require__(782);const Ct=e=>e/2.54,kt={video:!1,gazer:!1};function St(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",G.H.RC_starting[e.L])}E.A.prototype.calibrateGaze=function(e={},t=void 0){if(!this.gazeTracker.checkInitialized("gaze",!0))return;(0,_.$k)();const n=Object.assign({greedyLearner:!1,calibrationCount:1,headline:`👀 ${G.H.RC_gazeTrackingTitle[this.L]}`,description:G.H.RC_gazeTrackingIntro[this.L]},e);n.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=n.greedyLearner,St(this,n);const s=Et(this,n,(()=>{this._removeBackground(),(0,V.l)(r),(0,_.nB)(t,{timestamp:performance.now()})})),r=(0,V.m)({Escape:()=>{s.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)(r)}})};const Et=(e,t,n)=>(e._removeFloatInstructionElement(),new _t(e,document.body,t,kt,n));class _t{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 i=document.createElement("div"),a=document.createElement("div");this.div.className="rc-crosshair",this.div.id="rc-crosshair",i.className="rc-crosshair-component rc-crosshair-vertical",a.className="rc-crosshair-component rc-crosshair-horizontal",a.style.height=i.style.width=`${ee}px`,a.style.width=i.style.height=`${J}px`,this.div.style.background=e.params.backgroundColor;const o=qe(e.params.backgroundColor).toRgb();this.div.style.background=`rgba(${o.r}, ${o.g}, ${o.b}, 0.75)`,this.div.appendChild(i),this.div.appendChild(a),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}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));const e=document.querySelectorAll(".leader-line");e&&e.map((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:i,bottom:a}=this.div.getBoundingClientRect(),o=(s+i)/2,l=(r+a)/2;return t>=o-5&&t<=o+5&&n>=l-5&&n<=l+5}_randomOrder(){this.order=[];for(const e of[0,1,2])for(const 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,i=this.RC.viewingDistanceCm?this.RC.viewingDistanceCm.value:this.RC._CONST.N.VIEW_DIST_DONT_USE,Ct(r)*i*Math.tan(s*(Math.PI/180)));var s,r,i;return t?Math.min(n,t):n}}E.A.prototype.trackGaze=async function(e={},t=null,n=null){if(!this.checkInitialized())return;(0,_.$k)(),!1===this.gazeTracker.webgazer.getTracker().modelLoaded&&this.gazeTracker.webgazer.getTracker().loadModel();const s=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:`👀 ${G.H.RC_gazeTrackingTitle[this.L]}`,description:G.H.RC_gazeTrackingIntro[this.L]},e);if(this.getFullscreen(s.fullscreen),this.gazeTracker.checkInitialized("gaze"))return this.gazeTracker._toFixedN=s.decimalPlace,this.showGazer(s.showGazer),this.showVideo(s.showVideo),this.showFaceOverlay(s.showFaceOverlay),this.gazeTracker.attachNewCallback(n),void(this.gazeTracker.defaultGazeCallback=n);this._addBackground(),await de(this),this.gazeTracker._init({greedyLearner:s.greedyLearner,framerate:s.framerate,toFixedN:s.decimalPlace,showVideo:s.showVideo,showFaceOverlay:s.showFaceOverlay,showGazer:s.showGazer},"gaze"),St(this,s);const r={pipWidthPx:s.pipWidthPx},i={greedyLearner:s.greedyLearner,calibrationCount:s.calibrationCount,headline:s.headline,description:s.description};this.gazeTracker.begin(r,(()=>{this._trackingSetupFinishedStatus.gaze=!1,this.calibrateGaze(i,a)}));const a=e=>{(0,_.nB)(t,e),this.gazeTracker.webgazer.params.greedyLearner||this.gazeTracker.stopLearning({click:!0,move:!0});return s.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;const n=Object.assign({wait:0,frames:5},e),s=t||this.gazeTracker.defaultGazeCallback;return await this.gazeTracker.getGazeNow(n,s)},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,t){const n=Object.assign({click:!0,move:!0},t);e?this.gazeTracker.startLearning(n):this.gazeTracker.stopLearning(n)},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 Tt=__webpack_require__(7158),It=__webpack_require__.n(Tt);const Nt={gazer:!1,gazeLearning:!1,gazePaused:!1},Ot={current:null};E.A.prototype.nudgeGaze=function(e={},t=void 0){if(!this.checkInitialized()||!this.gazeTracker.checkInitialized("gaze",!0))return;const n=Object.assign({showOffset:!0},e);if(this._gazeTrackNudging.isCorrectingGaze)return;this._gazeTrackNudging.isCorrectingGaze=!0;let s=document.getElementById("gaze-nudger");s||(s=document.createElement("div"),s.id="gaze-nudger",s.className=`gaze-nudger rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(s),s.style.background=this.params.backgroundColor);const r=`

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

      `;s.innerHTML+=r;const i=Dt(this,s,t);if(this._nudger.gazeElement=s,n.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),Ot.current=new(It())(It().pointAnchor(e,{x:"50%",y:"50%"}),It().pointAnchor(i,{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"}Nt.gazePaused=this._trackingPaused.gaze,Nt.gazer=this.gazeTracker.webgazer.params.showGazeDot,Nt.gazeLearning=this.gazeTracker._learning,Nt.gazePaused&&this.resumeGaze(),Nt.gazer||this.showGazer(!0),Nt.gazeLearning||this.gazeLearning(!0,{click:!0,move:!1})};const Dt=(e,t,n)=>new _t(e,t,{greedyLearner:!1,calibrationCount:1,nudge:!0},Nt,(()=>{t.remove(),t=null,e._nudgerElement=null,document.body.classList.remove("lock-view"),Nt.gazePaused&&e.pauseGaze(),Nt.gazePaused=!1,Ot.current&&(Ot.current.remove(),Ot.current=null),e._gazeTrackNudging.isCorrectingGaze=!1,(0,_.nB)(n)}));var Rt=__webpack_require__(4948),Mt=__webpack_require__.n(Rt);let Ft=!1;E.A.prototype.getGazeAccuracy=function(e={},t=void 0,n=void 0){if(!this.checkInitialized())return!1;(0,_.$k)();const s=this.screenPpi,r=this.viewingDistanceCm;if(!s||!r)return!1;const i=Object.assign({backgroundColor:"#eee",thresholdDeg:10,decimalPlace:3},e);this._addBackground();const a=document.createElement("div");a.innerHTML='',this.background.appendChild(a);const o=document.querySelector("#gaze-accuracy-canvas"),l=o.getContext("2d"),c=()=>{o.width=window.innerWidth,o.height=window.innerHeight,o.style.width=`${o.width}px`,o.style.height=`${o.height}px`},u=new ResizeObserver((()=>{c()}));return u.observe(this.background),c(),Mt().fire({...ie(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((()=>{Ft=!0,Bt(o,l,i),this.gazeTracker.startStoringPoints(),(0,_.yy)(5e3).then((()=>{Ft=!1,this.gazeTracker.stopStoringPoints();const e=this.gazeTracker.webgazer.getStoredPoints(),a=zt({x:o.width/2,y:o.height/2},e,s.value,r.value);this.newGazeAccuracyData={value:(0,_.Nh)(a,i.decimalPlace),timestamp:performance.now()},a{const s=()=>{t.fillStyle=n.backgroundColor,t.fillRect(0,0,e.width,e.height),ne(t,e.width/2,e.height/2),Ft&&requestAnimationFrame(s)};requestAnimationFrame(s)},zt=(e,t,n,s)=>{let r=0;for(let i=0;i0;)n=Math.random()*t|0,t--,qt(e,t,n)}function Gt(e,t,n){return Math.max(e,Math.min(t,n))}function Ut(e){return e%2==0?e:e+1}function qt(e,t,n){const s=e[t];e[t]=e[n],e[n]=s}function jt(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function Ht(e,t,n=""){jt(Xt(e,t),(()=>n+` Shapes ${e} and ${t} must match`))}function $t(e){jt(null!=e,(()=>"The input to the tensor constructor must be a non-null value."))}function Kt(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n0),n,s){return new Promise(((r,i)=>{let a=0;const o=()=>{if(e())return void r();a++;const l=t(a);null!=n&&a>=n?i():null!=s?s(o,l):setTimeout(o,l)};o()}))}function en(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 tn(e,t){const n=t.length;return jt((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}`)),jt(e.every((e=>Zt(e))),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function nn(e,t){const n=[],s=[],r=null!=t&&Array.isArray(t)&&0===t.length,i=null==t||r?null:tn(t,e).sort();let a=0;for(let t=0;tt)&&1===e[t]&&(n.push(e[t]),s.push(t)),i[a]<=t&&a++}1!==e[t]&&(n.push(e[t]),s.push(t))}return{newShape:n,keptDims:s}}function sn(e,t){return rn(e,t)}function rn(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 an(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function on(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 ln(e){return"string"==typeof e||e instanceof String}function cn(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":cn(e)?"float32":ln(e)?"string":"boolean"==typeof e?"bool":"float32"}function hn(e){return!!(e&&e.constructor&&e.call&&e.apply)}function dn(e,t){for(let n=t;n=0;--s)n[s]=n[s+1]*e[s+1];return n}function fn(e,t,n,s=!1){const r=new Array;if(1===t.length){const i=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 fn(0,e,t,n)}function gn(e,t){const n=yn(e,t);for(let e=0;ee*t),1);if(null==t||"float32"===t)return mn(e,new Float32Array(n));if("int32"===t)return mn(e,new Int32Array(n));if("bool"===t)return mn(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function wn(e){e.forEach((t=>{jt(Number.isInteger(t)&&t>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`))}))}function vn(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 Sn(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 En(){return Tn}let _n,Tn=null;function In(){if(null==_n){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}_n=e}return _n}function Nn(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 On="Abs",Dn="Acos",Rn="Acosh",Mn="Add",Fn="AddN",Bn="All",zn="Any",Ln="ArgMax",Pn="ArgMin",Vn="Asin",Wn="Asinh",Gn="Atan",Un="Atanh",qn="Atan2",jn="AvgPool",Hn="AvgPoolGrad",$n="AvgPool3D",Kn="AvgPool3DGrad",Xn="BatchMatMul",Zn="BatchToSpaceND",Yn="Bincount",Qn="BitwiseAnd",Jn="BroadcastArgs",es="Cast",ts="Ceil",ns="ClipByValue",ss="Complex",rs="ComplexAbs",is="Concat",as="Conv2D",os="Conv2DBackpropFilter",ls="Conv2DBackpropInput",cs="Conv3D",us="Conv3DBackpropFilterV2",hs="Conv3DBackpropInputV2",ds="Cos",ps="Cosh",fs="Cumprod",ms="Cumsum",gs="CropAndResize",ys="DenseBincount",bs="DepthToSpace",ws="DepthwiseConv2dNative",vs="DepthwiseConv2dNativeBackpropFilter",As="DepthwiseConv2dNativeBackpropInput",xs="Diag",Cs="Dilation2D",ks="Dilation2DBackpropInput",Ss="Dilation2DBackpropFilter",Es="Draw",_s="RealDiv",Ts="Einsum",Is="Elu",Ns="EluGrad",Os="Erf",Ds="Equal",Rs="Exp",Ms="ExpandDims",Fs="Expm1",Bs="FFT",zs="Fill",Ls="FlipLeftRight",Ps="Floor",Vs="FloorDiv",Ws="FusedBatchNorm",Gs="GatherV2",Us="GatherNd",qs="Greater",js="GreaterEqual",Hs="Identity",$s="IFFT",Ks="Imag",Xs="IsFinite",Zs="IsInf",Ys="IsNan",Qs="LeakyRelu",Js="Less",er="LessEqual",tr="LinSpace",nr="Log",sr="Log1p",rr="LogicalAnd",ir="LogicalNot",ar="LogicalOr",or="LRN",lr="LRNGrad",cr="Max",ur="Maximum",hr="MaxPool",dr="MaxPoolGrad",pr="MaxPool3D",fr="MaxPool3DGrad",mr="MaxPoolWithArgmax",gr="Mean",yr="Min",br="Minimum",wr="MirrorPad",vr="Mod",Ar="Multinomial",xr="Multiply",Cr="Neg",kr="NotEqual",Sr="NonMaxSuppressionV3",Er="NonMaxSuppressionV4",_r="NonMaxSuppressionV5",Tr="OnesLike",Ir="OneHot",Nr="Pack",Or="PadV2",Dr="Pow",Rr="Prelu",Mr="Prod",Fr="RaggedGather",Br="RaggedRange",zr="RaggedTensorToTensor",Lr="Range",Pr="Real",Vr="Reciprocal",Wr="Relu",Gr="Reshape",Ur="ResizeNearestNeighbor",qr="ResizeNearestNeighborGrad",jr="ResizeBilinear",Hr="ResizeBilinearGrad",$r="Relu6",Kr="Reverse",Xr="Round",Zr="Rsqrt",Yr="ScatterNd",Qr="TensorScatterUpdate",Jr="SearchSorted",ei="Select",ti="Selu",ni="Slice",si="Sin",ri="Sinh",ii="Sign",ai="Sigmoid",oi="Softplus",li="Sqrt",ci="Sum",ui="SpaceToBatchND",hi="SplitV",di="Softmax",pi="SparseFillEmptyRows",fi="SparseReshape",mi="SparseSegmentMean",gi="SparseSegmentSum",yi="SparseToDense",bi="SquaredDifference",wi="Square",vi="StaticRegexReplace",Ai="StridedSlice",xi="StringNGrams",Ci="StringSplit",ki="StringToHashBucketFast",Si="Sub",Ei="Tan",_i="Tanh",Ti="Tile",Ii="TopK",Ni="Transform",Oi="Transpose",Di="Unique",Ri="Unpack",Mi="UnsortedSegmentSum",Fi="ZerosLike",Bi="Step",zi="FromPixels",Li="RotateWithOffset",Pi="_FusedMatMul",Vi="FusedConv2D",Wi="FusedDepthwiseConv2D";function Gi(...e){!En().getBool("IS_TEST")&&En().getBool("PROD")}function Ui(...e){!En().getBool("IS_TEST")&&En().getBool("PROD")}const qi=Nn("kernelRegistry",(()=>new Map)),ji=Nn("gradRegistry",(()=>new Map));function Hi(e,t){const n=Yi(e,t);return qi.get(n)}function $i(e){return ji.get(e)}function Ki(e){const t=qi.entries(),n=[];for(;;){const{done:s,value:r}=t.next();if(s)break;const[i,a]=r,[o]=i.split("_");o===e&&n.push(a)}return n}function Xi(e){const{kernelName:t,backendName:n}=e,s=Yi(t,n);qi.has(s)&&Gi(),qi.set(s,e)}function Zi(e){const{kernelName:t}=e;ji.has(t)&&En().getBool("DEBUG")&&Gi(),ji.set(t,e)}function Yi(e,t){return`${t}_${e}`}function Qi(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}var Ji=__webpack_require__(3122);const ea=__webpack_require__.n(Ji)()||Ji;function ta(e){return ea.fromString(e,!0,16)}const na=ta("c3a5c85c97cb3127"),sa=ta("b492b66fbe98f273"),ra=ta("9ae16a3b2f90404f");function ia(e){return e.xor(e.shru(47))}function aa(e,t,n){const s=e.slice(t,t+n);return ea.fromBytes(Array.from(s),!0,!0)}function oa(e,t){return aa(e,t,8)}function la(e,t){return aa(e,t,4)}function ca(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function ua(e,t,n=ta("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 ha(e,t,n,s){return function(e,t,n,s,r,i){r=r.add(e),i=ca(i.add(r).add(s),21);const a=r;return r=(r=r.add(t)).add(n),i=i.add(ca(r,44)),[r.add(s),i.add(a)]}(oa(e,t),oa(e,t+8),oa(e,t+16),oa(e,t+24),n,s)}function da(e,t=e.length){const n=ea.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=ra.add(2*t),s=oa(e,0).add(ra),r=oa(e,t-8);return ua(ca(r,37).mul(n).add(s),ca(s,25).add(r).mul(n),n)}if(t>=4){const n=ra.add(2*t);return ua(la(e,0).shl(3).add(t),la(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),s=t+(e[t-1]<<2);return ia(ra.mul(n).xor(na.mul(s))).mul(ra)}return ra}(e,t):function(e,t=e.length){const n=ra.add(2*t),s=oa(e,0).mul(sa),r=oa(e,8),i=oa(e,t-8).mul(n),a=oa(e,t-16).mul(ra);return ua(ca(s.add(r),43).add(ca(i,30)).add(a),s.add(ca(r.add(ra),18)).add(i),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=ra.add(2*t),s=oa(e,0).mul(ra),r=oa(e,8),i=oa(e,t-8).mul(n),a=oa(e,t-16).mul(ra),o=ca(s.add(r),43).add(ca(i,30)).add(a),l=ua(o,s.add(ca(r.add(ra),18)).add(i),n),c=oa(e,16).mul(n),u=oa(e,24),h=o.add(oa(e,t-32)).mul(n),d=l.add(oa(e,t-24)).mul(n);return ua(ca(c.add(u),43).add(ca(h,30)).add(d),c.add(ca(u.add(s),18)).add(h),n)}(e,t);let s=n,r=n.mul(sa).add(113),i=ia(r.mul(ra).add(113)).mul(ra),a=[ea.UZERO,ea.UZERO],o=[ea.UZERO,ea.UZERO];s=s.mul(ra).add(oa(e,0));let l=0;const c=64*(t-1>>6),u=c+(t-1&63)-63;do{s=ca(s.add(r).add(a[0]).add(oa(e,l+8)),37).mul(sa),r=ca(r.add(a[1]).add(oa(e,l+48)),42).mul(sa),s=s.xor(o[1]),r=r.add(a[0]).add(oa(e,l+40)),i=ca(i.add(o[0]),33).mul(sa),a=ha(e,l,a[1].mul(sa),s.add(o[0])),o=ha(e,l+32,i.add(o[1]),r.add(oa(e,l+16))),[i,s]=[s,i],l+=64}while(l!==c);const h=sa.add(i.and(255).shl(1));return l=u,o[0]=o[0].add(t-1&63),a[0]=a[0].add(o[0]),o[0]=o[0].add(a[0]),s=ca(s.add(r).add(a[0]).add(oa(e,l+8)),37).mul(h),r=ca(r.add(a[1]).add(oa(e,l+48)),42).mul(h),s=s.xor(o[1].mul(9)),r=r.add(a[0].mul(9).add(oa(e,l+40))),i=ca(i.add(o[0]),33).mul(h),a=ha(e,l,a[1].mul(h),s.add(o[0])),o=ha(e,l+32,i.add(o[1]),r.add(oa(e,l+16))),[i,s]=[s,i],ua(ua(a[0],o[0],h).add(ia(r).mul(na)).add(i),ua(a[1],o[1],h).add(s),h)}function pa(e,t){return"string"===t?ga(e):fa([e],t)}function fa(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=wa(e)),En().getBool("DEBUG")&&function(e,t){for(let n=0;n{s=n()};let i;const a=ma();if(this.backendTimer.timerAvailable())i=this.backendTimer.time(r);else{r();for(const e of s)e.dataSync();i=Promise.resolve({kernelMs:ma()-a})}if(En().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t{Aa(t,n.dtype,e)}))}return{kernelName:e,outputs:s,inputs:t,timeMs:i.then((e=>e.kernelMs)),extraInfo:i.then((e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""))}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:s,inputs:r,extraInfo:i}=e;n.forEach((e=>{Promise.all([e.data(),s,i]).then((n=>{this.logger.logKernelProfile(t,e,n[0],n[1],r,n[2])}))}))}}function Aa(e,t,n){if("float32"!==t)return!1;for(let t=0;t0?s:""} `}}}}const Ca=20,ka=3,Sa=7;function Ea(e,t,n,s){const r=pn(t),i=function(e,t,n,s){const r=Kt(t),i=s[s.length-1],a=new Array(i).fill(0),o=t.length,l="complex64"===n?Na(e):e;if(o>1)for(let e=0;e" "+e)).join("\n")),l.join("\n")}function _a(e,t,n){let s;return s=Array.isArray(e)?`${parseFloat(e[0].toFixed(Sa))} + ${parseFloat(e[1].toFixed(Sa))}j`:ln(e)?`'${e}'`:"bool"===n?Ta(e):parseFloat(e.toFixed(Sa)).toString(),Qt(s,t)}function Ta(e){return 0===e?"false":"true"}function Ia(e,t,n,s,r,i=!0){const a="complex64"===n?2:1,o=t[0],l=t.length;if(0===l){if("complex64"===n){return[_a(Na(e)[0],0,n)]}return"bool"===n?[Ta(e[0])]:[e[0].toString()]}if(1===l){if(o>Ca){const t=ka*a;let s=Array.from(e.slice(0,t)),i=Array.from(e.slice((o-ka)*a,o*a));return"complex64"===n&&(s=Na(s),i=Na(i)),["["+s.map(((e,t)=>_a(e,r[t],n))).join(", ")+", ..., "+i.map(((e,t)=>_a(e,r[o-ka+t],n))).join(", ")+"]"]}return["["+("complex64"===n?Na(e):Array.from(e)).map(((e,t)=>_a(e,r[t],n))).join(", ")+"]"]}const c=t.slice(1),u=s.slice(1),h=s[0]*a,d=[];if(o>Ca){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||rn(t,this.size),this.strides=pn(e)}set(e,...t){0===t.length&&(t=[0]),jt(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;tya(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(),Da().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=Da().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>ya(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 Da().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),Da().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Ra.print(this,e)}clone(){return this.throwIfDisposed(),Ra.clone(this)}toString(e=!1){return Ea(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Ra.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),Da().makeVariable(this,e,t,n)}}function Ba(){return Nn("Tensor",(()=>Fa))}Object.defineProperty(Fa,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),Ba();class za extends Fa{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(!Xt(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);Da().disposeTensor(this),this.dataId=e.dataId,Da().incRef(this,null)}dispose(){Da().disposeVariable(this),this.isDisposedInternal=!0}}var La,Pa,Va,Wa,Ga,Ua,qa,ja,Ha,$a;Object.defineProperty(za,Symbol.hasInstance,{value:e=>e instanceof Fa&&null!=e.assign&&e.assign instanceof Function}),(Pa=La||(La={})).R0="R0",Pa.R1="R1",Pa.R2="R2",Pa.R3="R3",Pa.R4="R4",Pa.R5="R5",Pa.R6="R6",(Wa=Va||(Va={})).float32="float32",Wa.int32="int32",Wa.bool="int32",Wa.complex64="complex64",(Ua=Ga||(Ga={})).float32="float32",Ua.int32="int32",Ua.bool="bool",Ua.complex64="complex64",(ja=qa||(qa={})).float32="float32",ja.int32="float32",ja.bool="float32",ja.complex64="complex64",($a=Ha||(Ha={})).float32="complex64",$a.int32="complex64",$a.bool="complex64",$a.complex64="complex64";const Ka={float32:qa,int32:Va,bool:Ga,complex64:Ha};function Xa(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return Ka[e][t]}function Za(e){return Xa(e,"int32")}function Ya(e){return null!=e&&"object"==typeof e&&"texture"in e&&e.texture instanceof WebGLTexture}function Qa(e){return"undefined"!=typeof GPUBuffer&&null!=e&&"object"==typeof e&&"buffer"in e&&e.buffer instanceof GPUBuffer}function Ja(e,t){if(e.dtype===t.dtype)return[e,t];const n=Xa(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function eo(e,t){return t.some((t=>t.id===e.id))}function to(e){const t=[];return no(e,t,new Set),t}function no(e,t,n){if(null==e)return;if(e instanceof Fa)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),no(s,t,n))}}function so(e){return null!=e.kernelName}class ro{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 io{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new ro}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){Ki(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 Pt||"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 io.nextTensorId++}nextVariableId(){return io.nextVariableId++}clone(e){const t=oo.runKernel(Hs,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(e=>({x:()=>{const t={x:e},n={dtype:"float32"};return oo.runKernel(es,t,n)}})),[],{}),t}runKernel(e,t,n){null==this.backendName&&this.backend;if(!(null!=Hi(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 i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],a=s-t-r-i;if(a>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${a} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const s=this.isTapeOn(),r=this.state.numBytes,i=this.state.numTensors;let a,o;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=so(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(so(e)){const{kernelName:t,inputs:r,attrs:i}=e;null==this.backendName&&this.backend;const l=Hi(t,this.backendName);jt(null!=l,(()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`)),a=()=>{const e=this.backend.numDataIds();o=l.kernelFunc({inputs:r,attrs:i,backend:this.backend});const a=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,a);const c=a.map((e=>null!=e.rank?e:this.makeTensorFromTensorInfo(e)));if(s){const e=this.getTensorsForGradient(t,r,c);n=this.saveTensorsForBackwardMode(e)}return c}}else{const{forwardFunc:t}=e,r=e=>{s&&(n=e.map((e=>this.keep(this.clone(e)))))};a=()=>{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:c,attrs:u}=e,h=so(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,c,(()=>a())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs):t=a()})),s&&this.addTapeNode(l,c,t,h,n,u),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-i,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map((e=>null!=c[e]?c[e].shape:null)),outputShapes:t.map((e=>e.shape)),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){return e.map((e=>this.keep(this.clone(e))))}getTensorsForGradient(e,t,n){const s=$i(e);if(null!=s){const e=s.inputsToSave||[],r=s.outputsToSave||[];let i;s.saveAllInputs?(jt(Array.isArray(t),(()=>"saveAllInputs is true, expected inputs to be an array.")),i=Object.keys(t).map((e=>t[e]))):i=e.map((e=>t[e]));const a=n.filter(((e,t)=>r[t]));return i.concat(a)}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&&ln(e[0])&&(r=e.map((e=>ga(e))));const i=s.write(r,t,n),a=new Fa(t,n,i,this.nextTensorId());if(this.trackTensor(a,s),"string"===n){const e=this.state.tensorInfo.get(i),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 a}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,i=new Fa(s,r,n,this.nextTensorId());return this.trackTensor(i,t),i}makeVariable(e,t=!0,n,s){n=n||this.nextVariableId().toString(),null!=s&&s!==e.dtype&&(e=e.cast(s));const r=new za(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*on(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 za||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*on(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,i){const a={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},o=$i(e);null!=o&&(s=o.gradFunc),null!=s&&(a.gradient=e=>(e=e.map(((e,t)=>{if(null==e){const e=n[t],s=yn(e.size,e.dtype);return this.makeTensor(s,e.shape,e.dtype)}return e})),s(e.length>1?e:e[0],r,i))),this.state.activeTape.push(a)}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=to(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(jt(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)));jt(r instanceof Fa,(()=>"The result y returned by f() must be a tensor."));const i=function(e,t,n){const s={},r={};for(let e=0;es[e.id]=!0)),o=!0,r[i.id]=!0;break}if(o)break}}const i={};i[n.id]=!0;const a={};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=gn(Kt(e),"float32");return oo.makeTensor(t,e,"float32")}(r.shape):n,function(e,t,n,s){for(let r=t.length-1;r>=0;r--){const i=t[r],a=[];if(i.outputs.forEach((t=>{const n=e[t.id];null!=n?a.push(n):a.push(null)})),null==i.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${i.kernelName}.`);const o=i.gradient(a);for(const t in i.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 ${i.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${r.dtype}'`);const a=i.inputs[t];if(!Xt(r.shape,a.shape))throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input '${t}' has shape '${r.shape}', which does not match the shape of the input '${a.shape}'`);if(null==e[a.id])e[a.id]=r;else{const t=e[a.id];e[a.id]=s(t,r),t.dispose()}}}}(e,i,(e=>this.tidy(e)),lo);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 jt(hn(e),(()=>"The f passed in customGrad(f) must be a function.")),(...t)=>{let n;jt(t.every((e=>e instanceof Fa)),(()=>"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),jt(n.value instanceof Fa,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),jt(hn(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),i=Array.isArray(r)?r:[r];jt(i.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(...).")),jt(i.every((e=>e instanceof Fa)),(()=>"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 a={};return i.forEach(((e,t)=>{a[t]=()=>e})),a},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=ma(),n=await this.backend.time(e);return n.wallMs=ma()-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 ro;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 ao(){const e=In();if(null==e._tfengine){const t=new kn(e);e._tfengine=new io(t)}var t;return t=e._tfengine.ENV,Tn=t,Da=()=>e._tfengine,e._tfengine}io.nextTensorId=0,io.nextVariableId=0;const oo=ao();function lo(e,t){const n={a:e,b:t};return oo.runKernel(Mn,n)}let co;function uo(e){if(void 0!==co)return co;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 ho(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}const po=En();function fo(e,t){let n=e;if(ba(e))return"string"===t?[]:[e.length];if(Ya(e)){const t=e.channels||"RGBA";return[e.height,e.width*t.length]}if(Qa(e))return[e.buffer.size/(null==t?4:on(t))];if(!Array.isArray(e))return[];const s=[];for(;Array.isArray(n)||ba(n)&&"string"!==t;)s.push(n.length),n=n[0];return Array.isArray(e)&&En().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&mo(e,s,[]),s}function mo(e,t,n){if(n=n||[],!Array.isArray(e)&&!ba(e))return void jt(0===t.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`));jt(t.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`)),jt(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),go(s,r,t,n),null==e||!ba(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 i=fo(e,r);ba(e)||Array.isArray(e)||(e=[e]);const a="string"!==r?fa(e,r):wa(e,[],!0);return oo.makeTensor(a,i,r)}function bo(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)=>yo(e,`${t}[${r}]`,n,s)))}po.registerFlag("DEBUG",(()=>!1),(e=>{})),po.registerFlag("IS_BROWSER",(()=>ho())),po.registerFlag("IS_NODE",(()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node)),po.registerFlag("IS_CHROME",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))),po.registerFlag("IS_SAFARI",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor))),po.registerFlag("PROD",(()=>!1)),po.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(()=>po.getBool("DEBUG"))),po.registerFlag("DEPRECATION_WARNINGS_ENABLED",(()=>!0)),po.registerFlag("IS_TEST",(()=>!1)),po.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(()=>po.getBool("DEBUG"))),po.registerFlag("WRAP_TO_IMAGEBITMAP",(()=>!1)),po.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",(()=>!1)),po.registerFlag("USE_SETTIMEOUTCUSTOM",(()=>!1));const wo="__op";function vo(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+=wo;const r=(...e)=>{oo.startScope(n);try{const t=s(...e);return xn(t),oo.endScope(t),t}catch(e){throw oo.endScope(null),e}};return Object.defineProperty(r,"name",{value:n,configurable:!0}),r}const Ao=vo({complex_:function(e,t){const n=yo(e,"real","complex"),s=yo(t,"imag","complex");Ht(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 oo.runKernel(ss,r)}});function xo(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(Qa(e)||Ya(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 oo.backend.createTensorFromGPUData(e,t||n,s)}if(!ba(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){wn(t);const e=Kt(t),s=Kt(n);jt(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 ba(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==s?fa(e,s):wa(e,[],!0),oo.makeTensor(e,t,s)}function Co(e,t,n){return xo(e,t,fo(e,n),n)}const ko={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};class So{static join(e){return new So(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,null==e)return;if(e instanceof Array||(e=[e]),0===(e=e.map((e=>ba(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,i=t(e[r]);if(0===i)return r;i<0?s=r:n=r+1}return-1}(this.shards,t);return-1===n?-1:(this.previousShardIndex=n,this.previousShardIndex)}}function Eo(){return oo}function _o(){return oo.memory()}function To(e,t){return oo.tidy(e,t)}function Io(e){to(e).forEach((e=>e.dispose()))}function No(e){return oo.keep(e)}function Oo(e,t,n=1){return oo.registerBackend(e,t,n)}function Do(){return oo.backend}Ma=function(e){En().getBool("DEPRECATION_WARNINGS_ENABLED")};const Ro=4;async function Mo(e,t){const n=[],s=[],r=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);for(let i=0;i{const t=await o.bytes(),n=t.reduce(((e,t)=>e+t.length),0)+Ro*t.length,s=new Uint8Array(n);let r=0;for(let e=0;en.slice(r+e,r+t)));s[e.name]=Lo(e,n.slice(r,r+t)),r+=t}return s}function Bo(e,t){const n=Kt(e.shape);let s;if("quantization"in e){const t=e.quantization;s=ko[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),i=new Uint32Array(r);for(let r=0;r>10]+(1023&a)]+t[a>>10];i[r]=o}return new Float32Array(r)}}();a=e(c)}}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.`);a=new Int32Array(c.length);for(let e=0;e(r=await Po(s,r,t),r.slice(e,t))));r=await Po(s,r,t);const i=r.slice(0,t);r=r.slice(t);const a=Lo(e,i);if(n[e.name]=a,"webgpu"===oo.backendName){const e=Do();"uploadToGPU"in e&&Kt(a.shape)>=En().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&e.uploadToGPU(a.dataId)}}return n}function Wo(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 Go="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function Uo(e){return Go?Buffer.byteLength(e,"utf8"):new Blob([e]).size}function qo(e){return So.join(e)}function jo(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function Ho(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 $o(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 Ko(e,t){let n,s;return null!=e.weightsManifest&&([n,s]=await t(e.weightsManifest)),$o(e,n,s)}function Xo(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:Uo(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:Uo(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:new So(e.weightData).byteLength}}function Zo(e){const t=[];for(const n of e)t.push(...n.weights);return t}class Yo{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==Yo.instance&&(Yo.instance=new Yo),Yo.instance}static registerSaveRouter(e){Yo.getInstance().saveRouters.push(e)}static registerLoadRouter(e){Yo.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return Yo.getHandlers(e,"save")}static getLoadHandlers(e,t){return Yo.getHandlers(e,"load",t)}static getHandlers(e,t,n){const s=[];return("load"===t?Yo.getInstance().loadRouters:Yo.getInstance().saveRouters).forEach((t=>{const r=t(e,n);null!==r&&s.push(r)})),s}}const Qo=e=>Yo.registerSaveRouter(e),Jo=e=>Yo.registerLoadRouter(e),el=e=>Yo.getSaveHandlers(e),tl=(e,t)=>Yo.getLoadHandlers(e,t),nl="tensorflowjs",sl="models_store",rl="model_info_store";function il(){if(!En().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 al(e){const t=e.result;t.createObjectStore(sl,{keyPath:"modelPath"}),t.createObjectStore(rl,{keyPath:"modelPath"})}class ol{constructor(e){if(this.indexedDB=il(),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(nl,1);s.onupgradeneeded=()=>al(s),s.onsuccess=()=>{const r=s.result;if(null==t){const t=r.transaction(sl,"readonly"),s=t.objectStore(sl).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=So.join(t.weightData);const s=Xo(t),i=r.transaction(rl,"readwrite");let a,o,l=i.objectStore(rl);try{a=l.put({modelPath:this.modelPath,modelArtifactsInfo:s})}catch(e){return n(e)}a.onsuccess=()=>{o=r.transaction(sl,"readwrite");const a=o.objectStore(sl);let c;try{c=a.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:s})}catch(e){return n(e)}c.onsuccess=()=>e({modelArtifactsInfo:s}),c.onerror=e=>{l=i.objectStore(rl);const t=l.delete(this.modelPath);t.onsuccess=()=>(r.close(),n(c.error)),t.onerror=e=>(r.close(),n(c.error))}},a.onerror=e=>(r.close(),n(a.error)),i.oncomplete=()=>{null==o?r.close():o.oncomplete=()=>r.close()}}},s.onerror=e=>n(s.error)}))}}ol.URL_SCHEME="indexeddb://";const ll=e=>{return En().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(ol.URL_SCHEME)?(t=e.slice(ol.URL_SCHEME.length),new ol(t)):null;var t};Yo.registerSaveRouter(ll),Yo.registerLoadRouter(ll);class cl{constructor(){this.indexedDB=il()}async listModels(){return new Promise(((e,t)=>{const n=this.indexedDB.open(nl,1);n.onupgradeneeded=()=>al(n),n.onsuccess=()=>{const s=n.result,r=s.transaction(rl,"readonly"),i=r.objectStore(rl).getAll();i.onsuccess=()=>{const t={};for(const e of i.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},i.onerror=e=>(s.close(),t(i.error)),r.oncomplete=()=>s.close()},n.onerror=e=>t(n.error)}))}async removeModel(e){var t;return e=(t=e).startsWith(ol.URL_SCHEME)?t.slice(ol.URL_SCHEME.length):t,new Promise(((t,n)=>{const s=this.indexedDB.open(nl,1);s.onupgradeneeded=()=>al(s),s.onsuccess=()=>{const r=s.result,i=r.transaction(rl,"readwrite"),a=i.objectStore(rl),o=a.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=a.delete(e),i=()=>{l=r.transaction(sl,"readwrite");const s=l.objectStore(sl).delete(e);s.onsuccess=()=>t(o.result.modelArtifactsInfo),s.onerror=e=>n(o.error)};s.onsuccess=i,s.onerror=e=>(i(),r.close(),n(o.error))}},o.onerror=e=>(r.close(),n(o.error)),i.oncomplete=()=>{null==l?r.close():l.oncomplete=()=>r.close()}},s.onerror=e=>n(s.error)}))}}const ul="/",hl="tensorflowjs_models",dl="info",pl="model_topology",fl="weight_specs",ml="weight_data",gl="model_metadata";function yl(e){return{info:[hl,e,dl].join(ul),topology:[hl,e,pl].join(ul),weightSpecs:[hl,e,fl].join(ul),weightData:[hl,e,ml].join(ul),modelMetadata:[hl,e,gl].join(ul)}}function bl(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function wl(e){const t=e.split(ul);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(ul)}class vl{constructor(e){if(!En().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=yl(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=Xo(e),r=So.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(Go)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let n="";for(let e=0,s=t.length;e{return En().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(vl.URL_SCHEME)?(t=e.slice(vl.URL_SCHEME.length),new vl(t)):null;var t};Yo.registerSaveRouter(Al),Yo.registerLoadRouter(Al);class xl{constructor(){jt(En().getBool("IS_BROWSER"),(()=>"Current environment is not a web browser")),jt("undefined"==typeof window||void 0!==window.localStorage,(()=>"Current browser does not appear to support localStorage")),this.LS=window.localStorage}async listModels(){const e={},t=hl+ul,n=ul+dl;for(let s=0;s"scheme must not be undefined or null.")),e.endsWith(Cl)&&(e=e.slice(0,e.indexOf(Cl))),jt(e.length>0,(()=>"scheme must not be an empty string."));const n=kl.getInstance();jt(null==n.managers[e],(()=>`A model store manager is already registered for scheme '${e}'.`)),n.managers[e]=t}static getManager(e){const t=kl.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(kl.getInstance().managers)}}function Sl(e){if(-1===e.indexOf(Cl))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${kl.getSchemes().join(",")}`);return{scheme:e.split(Cl)[0],path:e.split(Cl)[1]}}async function El(e,t,n=!1){jt(e!==t,(()=>`Old path and new path are the same: '${e}'`));const s=Yo.getLoadHandlers(e);jt(s.length>0,(()=>`Copying failed because no load handler is found for source URL ${e}.`)),jt(s.length<2,(()=>`Copying failed because more than one (${s.length}) load handlers for source URL ${e}.`));const r=s[0],i=Yo.getSaveHandlers(t);jt(i.length>0,(()=>`Copying failed because no save handler is found for destination URL ${t}.`)),jt(i.length<2,(()=>`Copying failed because more than one (${s.length}) save handlers for destination URL ${t}.`));const a=i[0],o=Sl(e).scheme,l=Sl(e).path,c=o===Sl(e).scheme,u=await r.load();n&&c&&await kl.getManager(o).removeModel(l);const h=await a.save(u);return n&&!c&&await kl.getManager(o).removeModel(l),h.modelArtifactsInfo}async function _l(){const e=kl.getSchemes(),t={};for(const n of e){const e=await kl.getManager(n).listModels();for(const s in e){t[n+Cl+s]=e[s]}}return t}async function Tl(e){const t=Sl(e);return kl.getManager(t.scheme).removeModel(t.path)}async function Il(e,t){return El(e,t,!1)}async function Nl(e,t){return El(e,t,!0)}class Ol{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&&En().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 Qi(e)}}if(En().get("IS_BROWSER")){En().setPlatform("browser",new Ol);try{kl.registerManager(vl.URL_SCHEME,new xl)}catch(e){}try{kl.registerManager(ol.URL_SCHEME,new cl)}catch(e){}}const Dl=()=>__webpack_require__(8273);let Rl;class Ml{constructor(){this.util=__webpack_require__(9830),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=En().global.fetch?En().global.fetch(e,t):(null==Rl&&(Rl=Dl()),Rl(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 Fl(e,t="float32",n){return t=t||"float32",wn(e),new Oa(e,t,n)}En().get("IS_NODE")&&!En().get("IS_BROWSER")&&En().setPlatform("node",new Ml);const Bl=vo({cast_:function(e,t){const n=yo(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 oo.runKernel(es,s,r)}});const zl=vo({clone_:function(e){const t={x:yo(e,"x","clone","string_or_numeric")};return oo.runKernel(Hs,t)}});function Ll(e,t=!1){}ao();Ra={buffer:Fl,cast:Bl,clone:zl,print:Ll};const Pl=vo({add_:function(e,t){let n=yo(e,"a","add"),s=yo(t,"b","add");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(Mn,r)}});const Vl=vo({floorDiv_:function(e,t){let n=yo(e,"a","floorDiv"),s=yo(t,"b","floorDiv");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(Vs,r)}});const Wl=vo({div_:function(e,t){let n=yo(e,"a","div"),s=yo(t,"b","div");if([n,s]=Ja(n,s),"int32"===n.dtype&&"int32"===s.dtype)return Vl(n,s);const r={a:n,b:s};return oo.runKernel(_s,r,{})}});const Gl=vo({mul_:function(e,t){let n=yo(e,"a","mul"),s=yo(t,"b","mul");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(xr,r)}});const Ul=vo({sqrt_:function(e){const t={x:yo(e,"x","sqrt","float32")};return oo.runKernel(li,t)}});const ql=vo({square_:function(e){const t=yo(e,"x","square");return oo.runKernel("Square",{x:t},{})}});const jl=vo({zerosLike_:function(e){const t={x:yo(e,"x","zerosLike")};return oo.runKernel(Fi,t)}});function Hl(e){return oo.customGrad(e)}function $l(e,t){if((ba(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&&ba(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return xo(e,[],[],t)}const Kl=new Map,Xl=new Map;class Zl{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class Yl{constructor(){this.classNameMap={}}static getMap(){return null==Yl.instance&&(Yl.instance=new Yl),Yl.instance}static register(e){Yl.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Ql(e,t,n){jt(null!=e.className,(()=>"Class being registered does not have the static className property defined.")),jt("string"==typeof e.className,(()=>"className is required to be a string, but got type "+typeof e.className)),jt(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 Yl.register(e),Kl.set(s,e),Xl.set(e,s),e}class Jl extends Zl{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 Io(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){jt(hn(e),(()=>"The f passed in variableGrads(f) must be a function")),jt(null==t||Array.isArray(t)&&t.every((e=>e instanceof za)),(()=>"The varList passed in variableGrads(f, varList) must be an array of variables"));const n=null!=t;if(!n){t=[];for(const e in oo.registeredVariables)t.push(oo.registeredVariables[e])}const s=n?t.filter((e=>!e.trainable)):null,r=t.length;jt((t=t.filter((e=>e.trainable))).length>0,(()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${r} variables is trainable.`));const{value:i,grads:a}=oo.gradients(e,t,null,!0);jt(a.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().")),jt(0===i.rank,(()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`));const o={};return t.forEach(((e,t)=>{null!=a[t]&&(o[e.name]=a[t])})),null!=s&&s.forEach((e=>o[e.name]=null)),{value:i,grads:o}}(e,t)}dispose(){null!=this.iterations_&&Io(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:$l(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(Jl,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});class ec extends Jl{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=oo.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=oo.registeredVariables[t],r=!1;null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:To((()=>jl(s).variable(r)))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:To((()=>jl(s).variable(r)))});const i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const a=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;To((()=>{const e=Pl(Gl(a,this.rho),Gl(ql(i),1-this.rho)),t=Gl(Wl(Ul(Pl(o,this.epsilon)),Ul(Pl(a,this.epsilon))),i),n=Pl(Gl(o,this.rho),Gl(ql(t),1-this.rho));a.assign(e),o.assign(n);const r=Pl(Gl(t,-this.learningRate),s);s.assign(r)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(Io(this.accumulatedGrads.map((e=>e.variable))),Io(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 tc(e,t,n){wn(e);const s={shape:e,value:t,dtype:n=n||un(t)};return oo.runKernel(zs,{},s)}class nc extends Jl{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=oo.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:To((()=>tc(s.shape,this.initialAccumulatorValue).variable(e)))}}const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const i=this.accumulatedGrads[n].variable;To((()=>{const e=Pl(i,ql(r));i.assign(e);const t=Pl(Gl(Wl(r,Ul(Pl(e,oo.backend.epsilon()))),-this.learningRate),s);s.assign(t)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&Io(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 sc=vo({pow_:function(e,t){let n=yo(e,"base","pow"),s=yo(t,"exp","pow");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(Dr,r)}});const rc=vo({sub_:function(e,t){let n=yo(e,"a","sub"),s=yo(t,"b","sub");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(Si,r)}});class ic extends Jl{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=[],To((()=>{this.accBeta1=$l(t).variable(),this.accBeta2=$l(n).variable()})),null==s&&(this.epsilon=oo.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);To((()=>{const n=rc(1,this.accBeta1),s=rc(1,this.accBeta2);t.forEach(((t,r)=>{const i=oo.registeredVariables[t],a=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:To((()=>jl(i).variable(a)))}),null==this.accumulatedSecondMoment[r]&&(this.accumulatedSecondMoment[r]={originalName:`${t}/v`,variable:To((()=>jl(i).variable(a)))});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,c=this.accumulatedSecondMoment[r].variable,u=Pl(Gl(l,this.beta1),Gl(o,1-this.beta1)),h=Pl(Gl(c,this.beta2),Gl(ql(o),1-this.beta2)),d=Wl(u,n),p=Wl(h,s);l.assign(u),c.assign(h);const f=Pl(Gl(Wl(d,Pl(Ul(p),this.epsilon)),-this.learningRate),i);i.assign(f)})),this.accBeta1.assign(Gl(this.accBeta1,this.beta1)),this.accBeta2.assign(Gl(this.accBeta2,this.beta2))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Io(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedSecondMoment&&Io(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),To((()=>{this.accBeta1.assign(sc(this.beta1,this.iterations_+1)),this.accBeta2.assign(sc(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 ac=vo({abs_:function(e){const t=yo(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return oo.runKernel(rs,e)}{const e={x:t};return oo.runKernel(On,e)}}});function oc(e,t){const n=e.length,s=[];for(let r=0;r1&&1===a&&s.unshift(i)}return s}function lc(e,t){const n=[];for(let s=0;s1)&&n.unshift(i)}return n}function cc(e,t){const n=Math.max(e.length,t.length),s=new Array(n);for(let r=0;r{this.iteration=$l(0).variable(),this.accBeta1=$l(t).variable()})),null==s&&(this.epsilon=oo.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);To((()=>{const n=rc(1,this.accBeta1),s=Wl(-this.learningRate,Pl(Gl(this.iteration,this.decay),1));t.forEach(((t,r)=>{const i=oo.registeredVariables[t],a=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:jl(i).variable(a)}),null==this.accumulatedWeightedInfNorm[r]&&(this.accumulatedWeightedInfNorm[r]={originalName:`${t}/v`,variable:jl(i).variable(a)});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,c=this.accumulatedWeightedInfNorm[r].variable,u=Pl(Gl(l,this.beta1),Gl(o,1-this.beta1)),h=Gl(c,this.beta2),d=ac(o),p=uc(h,d);l.assign(u),c.assign(p);const f=Pl(Gl(Wl(s,n),Wl(u,Pl(p,this.epsilon))),i);i.assign(f)})),this.iteration.assign(Pl(this.iteration,1)),this.accBeta1.assign(Gl(this.accBeta1,this.beta1))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Io(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedWeightedInfNorm&&Io(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 dc extends Jl{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=oo.registeredVariables[t];To((()=>{const e=Pl(Gl(this.c,s),r);r.assign(e)}))})),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=No($l(-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 pc extends dc{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=$l(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=oo.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:To((()=>jl(s).variable(e)))}}const r=this.accumulations[n].variable,i=Array.isArray(e)?e[n].tensor:e[t];null!=i&&To((()=>{let e;const t=Pl(Gl(this.m,r),i);e=this.useNesterov?Pl(Gl(this.c,Pl(i,Gl(t,this.m))),s):Pl(Gl(this.c,t),s),r.assign(t),s.assign(e)}))})),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&Io(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 fc extends Jl{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=oo.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=oo.registeredVariables[t],r=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:To((()=>jl(s).variable(r)))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:To((()=>jl(s).variable(r)))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:To((()=>jl(s).variable(r)))});const i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const a=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;To((()=>{const e=Pl(Gl(a,this.decay),Gl(ql(i),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,r=Pl(Gl(t,this.decay),Gl(i,1-this.decay)),l=Wl(Gl(i,this.learningRate),Ul(rc(e,Pl(ql(r),this.epsilon)))),c=Pl(Gl(o,this.momentum),l);a.assign(e),t.assign(r),o.assign(c);const u=rc(s,c);s.assign(u)}else{const e=Pl(Gl(a,this.decay),Gl(ql(i),1-this.decay)),t=Pl(Gl(o,this.momentum),Wl(Gl(i,this.learningRate),Ul(Pl(e,this.epsilon))));a.assign(e),o.assign(t);const n=rc(s,t);s.assign(n)}}))})),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&Io(this.accumulatedMeanSquares.map((e=>e.variable))),null!=this.accumulatedMeanGrads&&this.centered&&Io(this.accumulatedMeanGrads.map((e=>e.variable))),null!=this.accumulatedMoments&&Io(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 mc=[ec,nc,ic,hc,pc,fc,dc];function gc(e){return new Promise((e=>setTimeout(e))).then(e)}class yc{constructor(e){if(!En().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(yc.URL_SCHEME)&&(e=e.slice(yc.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=So.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=Ho(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 gc((()=>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 gc((()=>e.dispatchEvent(new MouseEvent("click"))))}return{modelArtifactsInfo:Xo(e)}}}}yc.URL_SCHEME="downloads://";class bc{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 i=Ko(s,(e=>this.loadWeights(e)));e(i)},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=>jo(e.name))),s={};for(const r of e)r.paths.forEach((e=>{const r=jo(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 wc(e){return new bc(e)}function vc(e,t,n,s){!function(e){jt(null!=e&&Array.isArray(e)&&e.length>0,(()=>"promises must be a none empty array"))}(e),function(e,t){jt(e>=0&&e<=1,(()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`)),jt(t>=0&&t<=1,(()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`)),jt(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((i=>(i.then((i=>{const a=n+ ++r/e.length*(s-n);return t(a),i})),i))))}async function Ac(e,t){null==t&&(t={});const n=null==t.fetchFunc?En().platform.fetch:t.fetchFunc,s=e.map((e=>n(e,t.requestInit,{isBinary:!0}))),r=(null==t.onProgress?await Promise.all(s):await vc(s,t.onProgress,0,.5)).map((e=>e.arrayBuffer()));return null==t.onProgress?await Promise.all(r):await vc(r,t.onProgress,.5,1)}async function xc(e,t="",n,s){return Cc((e=>Ac(e,{requestInit:s})))(e,t,n)}function Cc(e){return async(t,n="",s)=>{const r=t.map((()=>!1)),i={},a=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,c=ko[l]*Kt(e.shape),u=()=>{r[t]=!0,null==i[t]&&(i[t]=[]),i[t].push({manifestEntry:e,groupOffset:n,sizeBytes:c})};null!=s?s.forEach(((t,n)=>{t===e.name&&(u(),a[n]=!0)})):u(),o.push(e.name),n+=c}))})),!a.every((e=>e))){const e=s.filter(((e,t)=>!a[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)),[]),c=[];l.forEach((e=>{t[e].paths.forEach((e=>{const t=n+(n.endsWith("/")?"":"/")+e;c.push(t)}))}));const u=await e(c),h={};let d=0;return l.forEach((e=>{const n=t[e].paths.length,s=new So(u.slice(d,d+n));i[e].forEach((e=>{const t=Fo(s.slice(e.groupOffset,e.groupOffset+e.sizeBytes),[e.manifestEntry]);for(const e in t)h[e]=t[e]})),d+=n})),h}}Yo.registerSaveRouter((e=>En().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(yc.URL_SCHEME)?function(e="model"){return new yc(e)}(e.slice(yc.URL_SCHEME.length)):null));class kc{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(jt("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=En().platform.fetch,jt(null!=e&&e.length>0,(()=>"URL path for http must not be null, undefined or empty.")),Array.isArray(e)&&jt(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=Ho(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=So.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:Xo(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 Ko(await this.loadModelJSON(),(e=>this.loadWeights(e)))}async loadStream(){const e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),n=Zo(e.weightsManifest);return Object.assign(Object.assign({},e),{weightSpecs:n,getWeightStream:()=>function(e,t){var n;const s=null==t.fetchFunc?En().platform.fetch:t.fetchFunc;let r,i=0;return null===(n=t.onProgress)||void 0===n||n.call(t,0),new ReadableStream({pull:async n=>{for(var a;it?e.substring(n):"";return[s+"/",r]}(t),r=this.weightPathPrefix||n,i=[],a=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?a.push(this.weightUrlConverter(e)):i.push(r+e+s);return this.weightUrlConverter&&i.push(...await Promise.all(a)),i}async loadWeights(e){const t=await this.getWeightUrls(e);return[Zo(e),await Ac(t,this.loadOptions)]}}function Sc(e){return null!=e.match(kc.URL_SCHEME_REGEX)}kc.URL_SCHEME_REGEX=/^https?:\/\//;const Ec=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every((e=>Sc(e))):Sc(e),n)return _c(e,t)}return null};function _c(e,t){return new kc(e,t)}function Tc(e,t){return _c(e,t)}Yo.registerSaveRouter(Ec),Yo.registerLoadRouter(Ec);class Ic{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class Nc{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class Oc{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function Dc(e,t,n,s){return new Oc(Rc(...arguments))}function Rc(e,t,n,s){if(1===arguments.length){const t=null!=e.modelTopology||null!=e.weightSpecs;return new Ic(t?e:{modelTopology:e})}return new Ic({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:s})}function Mc(e){return new Nc(e)}function Fc(e){return new Nc(e)}function Bc(e,t,n){if($t(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const s=fo(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 xo(e,t,s,n)}let zc,Lc=!1;function Pc(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,i=!1,a=!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)i=!0;else if(null!=e.getContext)a=!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!=Hi(zi,oo.backendName)){const n={pixels:e},s={numChannels:t};return oo.runKernel(zi,n,s)}const[l,c]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height];let u,h;if(a)u=e.getContext("2d").getImageData(0,0,l,c).data;else if(s||n)u=e.data;else if(i||r||o){if(null==zc)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.");zc=new OffscreenCanvas(1,1).getContext("2d")}else zc=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});zc.canvas.width=l,zc.canvas.height=c,zc.drawImage(e,0,0,l,c),u=zc.getImageData(0,0,l,c).data}if(4===t)h=new Int32Array(u);else{const e=l*c;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 Wc(e,t){let n=yo(e,"img","toPixels");if(!(e instanceof Fa)){const e=n;n=Bl(e,"int32"),e.dispose()}Vc(n);const[s,r]=n.shape.slice(0,2),i=2===n.rank?1:n.shape[2],a=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===i?(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(!Lc){null!=Hi(Es,oo.backendName)&&(Lc=!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 Gc=vo({fromPixels_:Pc}),Uc=-2,qc=-1;function jc(e,t,n){const s=e.shape.length;jt(s===t.length,(()=>`Error in slice${s}D: Length of begin ${t} must match the rank of the array (${s}).`)),jt(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 Hc(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function $c(e,t,n){const s=[];for(let r=0;r0){const l=t[0],c=n+1;u=Qc(a,l,c,s,e),h=Jc(o,l,c,r,e),d=Kc(i,l,c,e)}else for(let t=0;t-1)i[r]=0;else{const a=Xc(t,n,r);let o=s[a];e&1<-1)i[r]=Number.MAX_SAFE_INTEGER;else{const a=Xc(t,n,r);let o=s[a];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const l=s[r];return a<0&&(a+=l),a=Gt(0,a,l-1),a}function nu(e,t,n,s,r,i){let a=t[r];const o=n[r]||1;(e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const l=s[r];return a<0&&(a+=l),a=o>0?Gt(0,a,l):Gt(-1,a,l-1),a}function su(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 ru(e,t){let n=e.length>0?e[e.length-1]:1;for(let s=0;s{jt(-1!==e,(()=>"slice() does not support negative begin indexing."))})),i=null==n?new Array(r).fill(-1):"number"==typeof n?[n,...new Array(r-1).fill(-1)]:n.lengtht>=0?t:(jt(-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,i]}function au(e,t,n,s,r,i,a,o,l){let c;if(null==s?(c=new Array(t.length),c.fill(1)):c=s,null!=a&&a&a-1)throw new Error("Multiple ellipses in slice is not allowed.");let u=!1;const h={dims:c.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:n.slice(),strides:c.slice(),beginMask:r,endMask:i,ellipsisMask:a,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 a=!!(d.beginMask&1<=s)throw Error(`slice index ${d.begin[t]} of dimension ${t} out of bounds.`)}else d.begin[t]=ou(d.begin[t],0,d.strides[t],s,r,i),d.end[t]=ou(d.end[t],1,d.strides[t],s,r,i);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]&&a,f=f&&(0===t&&1===d.strides[t]||a);let o,l=!1;if(d.beginValid&&d.endValid?(o=d.end[t]-d.begin[t],l=!0):n?(o=1,l=!0):a&&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===Uc&&y.push(1)}return{finalShapeSparse:y.filter(((e,t)=>d.finalShapeGatherIndices[t]!==Uc)),finalShape:y,isIdentity:p,sliceDim0:f,isSimpleSlice:m,begin:d.begin,end:d.end,strides:d.strides}}function ou(e,t,n,s,r,i){if(r[t])return n>0?i[t]:i[t+1&1];{const t=e<0?s+e:e;return ti[1]?i[1]:t}}const lu=vo({acos_:function(e){const t={x:yo(e,"x","acos")};return oo.runKernel(Dn,t)}});const cu=vo({acosh_:function(e){const t={x:yo(e,"x","acosh")};return oo.runKernel(Rn,t)}});const uu=vo({addN_:function(e){jt(Array.isArray(e),(()=>"The argument passed to tf.addN() must be a list of tensors")),jt(e.length>=1,(()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`));const t=e.map(((e,t)=>yo(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(!Xt(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));const s=t;return oo.runKernel(Fn,s)}});const hu=vo({all_:function(e,t=null,n=!1){const s={x:yo(e,"x","all","bool")},r={axis:t,keepDims:n};return oo.runKernel(Bn,s,r)}});const du=vo({any_:function(e,t=null,n=!1){const s={x:yo(e,"x","any","bool")},r={axis:t,keepDims:n};return oo.runKernel(zn,s,r)}});const pu=vo({argMax_:function(e,t=0){const n={x:yo(e,"x","argMax")},s={axis:t};return oo.runKernel(Ln,n,s)}});const fu=vo({argMin_:function(e,t=0){const n={x:yo(e,"x","argMin")},s={axis:t};return oo.runKernel(Pn,n,s)}});const mu=vo({asin_:function(e){const t={x:yo(e,"x","asin")};return oo.runKernel(Vn,t)}});const gu=vo({asinh_:function(e){const t={x:yo(e,"x","asinh")};return oo.runKernel(Wn,t)}});const yu=vo({atan_:function(e){const t={x:yo(e,"x","atan")};return oo.runKernel(Gn,t)}});const bu=vo({atan2_:function(e,t){let n=yo(e,"a","atan2"),s=yo(t,"b","atan2");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(qn,r)}});const wu=vo({atanh_:function(e){const t={x:yo(e,"x","atanh")};return oo.runKernel(Un,t)}});function vu(e,t,n,s,r="NHWC",i){return Cu(e,[...t,e[3]],n,i,s,null,null,Ru(r))}function Au(e,t,n,s,r,i,a="channelsLast"){const[o,l]=Eu(t);let c;if("channelsLast"===a)c=[o,l,e[3],e[3]];else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);c=[o,l,e[1],e[1]]}return Cu(e,c,n,s,r,i,!1,a)}function xu(e,t,n,s,r,i,a="NDHWC"){const[o,l,c]=_u(t);let u,h;if("NDHWC"===a)h="channelsLast",u=[o,l,c,e[4],e[4]];else{if("NCDHW"!==a)throw new Error(`Unknown dataFormat ${a}`);h="channelsFirst",u=[o,l,c,e[1],e[1]]}return ku(e,u,n,s,r,!1,h,i)}function Cu(e,t,n,s,r,i,a=!1,o="channelsLast"){let[l,c,u,h]=[-1,-1,-1,-1];if("channelsLast"===o)[l,c,u,h]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,h,c,u]=e}const[d,p,,f]=t,[m,g]=Eu(n),[y,b]=Eu(s),w=Tu(d,y),v=Tu(p,b),{padInfo:A,outHeight:x,outWidth:C}=function(e,t,n,s,r,i,a,o,l){let c,u,h;if("number"==typeof e){c={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const r=function(e,t,n,s,r){null==s&&(s=Su(e,t,n));const i=e[0],a=e[1],o=Iu((i-t+2*s)/n+1,r),l=Iu((a-t+2*s)/n+1,r);return[o,l]}([t,n],i,s,e,o);u=r[0],h=r[1]}else if("same"===e){u=Math.ceil(t/s),h=Math.ceil(n/r);const e=Math.max(0,(u-1)*s+i-t),o=Math.max(0,(h-1)*r+a-n),l=Math.floor(e/2),d=e-l,p=Math.floor(o/2);c={top:l,bottom:d,left:p,right:o-p,type:"SAME"}}else if("valid"===e)c={top:0,bottom:0,left:0,right:0,type:"VALID"},u=Math.ceil((t-i+1)/s),h=Math.ceil((n-a+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];c={top:d,bottom:p,left:f,right:m,type:0===d&&0===p&&0===f&&0===m?"VALID":"EXPLICIT"},u=Iu((t-i+d+p)/s+1,o),h=Iu((n-a+f+m)/r+1,o)}}return{padInfo:c,outHeight:u,outWidth:h}}(r,c,u,m,g,w,v,i,o),k=a?f*h:f;let S;return"channelsFirst"===o?S=[l,k,x,C]:"channelsLast"===o&&(S=[l,x,C,k]),{batchSize:l,dataFormat:o,inHeight:c,inWidth:u,inChannels:h,outHeight:x,outWidth:C,outChannels:k,padInfo:A,strideHeight:m,strideWidth:g,filterHeight:d,filterWidth:p,effectiveFilterHeight:w,effectiveFilterWidth:v,dilationHeight:y,dilationWidth:b,inShape:e,outShape:S,filterShape:t}}function ku(e,t,n,s,r,i=!1,a="channelsLast",o){let[l,c,u,h,d]=[-1,-1,-1,-1,-1];if("channelsLast"===a)[l,c,u,h,d]=e;else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);[l,d,c,u,h]=e}const[p,f,m,,g]=t,[y,b,w]=_u(n),[v,A,x]=_u(s),C=Tu(p,v),k=Tu(f,A),S=Tu(m,x),{padInfo:E,outDepth:_,outHeight:T,outWidth:I}=function(e,t,n,s,r,i,a,o,l,c,u){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,i){null==r&&(r=Su(e,t[0],s[0]));const a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*r>=t[n]&&(a[n]=Iu((e[n]-t[n]+2*r)/s[n]+1,i));return a}([t,n,s,1],[o,l,c],1,[r,i,a],e,u);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/i),f=Math.ceil(s/a);const e=(d-1)*r+o-t,u=(p-1)*i+l-n,m=(f-1)*a+c-s,g=Math.floor(e/2),y=e-g,b=Math.floor(u/2),w=u-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,c,u,h,y,b,w,C,k,S,o),N=i?g*d:g;let O;return"channelsFirst"===a?O=[l,N,_,T,I]:"channelsLast"===a&&(O=[l,_,T,I,N]),{batchSize:l,dataFormat:a,inDepth:c,inHeight:u,inWidth:h,inChannels:d,outDepth:_,outHeight:T,outWidth:I,outChannels:N,padInfo:E,strideDepth:y,strideHeight:b,strideWidth:w,filterDepth:p,filterHeight:f,filterWidth:m,effectiveFilterDepth:C,effectiveFilterHeight:k,effectiveFilterWidth:S,dilationDepth:v,dilationHeight:A,dilationWidth:x,inShape:e,outShape:O,filterShape:t}}function Su(e,t,n,s=1){const r=Tu(t,s);return Math.floor((e[0]*(n-1)-n+r)/2)}function Eu(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function _u(e){return"number"==typeof e?[e,e,e]:e}function Tu(e,t){return t<=1?e:e+(e-1)*(t-1)}function Iu(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 Nu(e){const[t,n,s]=Eu(e);return 1===t&&1===n&&1===s}function Ou(e,t){return Nu(e)||Nu(t)}function Du(e){return Eu(e).every((e=>e>0))}function Ru(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function Mu(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)jt(Zt(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=>{jt(Zt(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`))}))}))}}}const Fu=vo({reshape_:function(e,t){const n={x:yo(e,"x","reshape","string_or_numeric")},s={shape:t};return oo.runKernel(Gr,n,s)}});const Bu=vo({avgPool_:function(e,t,n,s,r){const i=yo(e,"x","avgPool","float32");jt(Ou(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let a=i,o=!1;3===i.rank&&(o=!0,a=Fu(i,[1,i.shape[0],i.shape[1],i.shape[2]])),jt(4===a.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${a.rank}.`)),Mu("avgPool",s,r);const l={x:a},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r};let u=oo.runKernel(jn,l,c);return u=Bl(u,i.dtype),o?Fu(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const zu=vo({avgPool3d_:function(e,t,n,s,r,i="NDHWC"){const a=yo(e,"x","avgPool3d","float32");let o=a,l=!1;4===a.rank&&(l=!0,o=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),jt(5===o.rank,(()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`)),jt("NDHWC"===i,(()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`)),jt("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}'`)),Mu("avgPool3d",s,r);const c={x:o},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:i};let h=oo.runKernel($n,c,u);return h=Bl(h,o.dtype),l?Fu(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const Lu=vo({concat_:function(e,t=0){jt(e.length>=1,(()=>"Pass at least one tensor to concat"));const n=bo(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 zl(n[0]);const s=n,r={axis:t};return oo.runKernel(is,s,r)}});const Pu=vo({matMul_:function(e,t,n=!1,s=!1){let r=yo(e,"a","matMul"),i=yo(t,"b","matMul");[r,i]=Ja(r,i);const a={a:r,b:i},o={transposeA:n,transposeB:s};return oo.runKernel(Xn,a,o)}});const Vu=vo({sigmoid_:function(e){const t={x:yo(e,"x","sigmoid","float32")};return oo.runKernel(ai,t)}});const Wu=vo({slice_:function(e,t,n){const s=yo(e,"x","slice","string_or_numeric");if(0===s.rank)throw new Error("Slicing scalar is not possible");const r={x:s},i={begin:t,size:n};return oo.runKernel(ni,r,i)}});const Gu=vo({tanh_:function(e){const t={x:yo(e,"x","tanh","float32")};return oo.runKernel(_i,t)}});const Uu=vo({basicLSTMCell_:function(e,t,n,s,r,i){const a=yo(e,"forgetBias","basicLSTMCell"),o=yo(t,"lstmKernel","basicLSTMCell"),l=yo(n,"lstmBias","basicLSTMCell"),c=yo(s,"data","basicLSTMCell"),u=yo(r,"c","basicLSTMCell"),h=yo(i,"h","basicLSTMCell"),d=Lu([c,h],1),p=Pu(d,o),f=Pl(p,l),m=f.shape[0],g=f.shape[1]/4,y=[m,g],b=Wu(f,[0,0],y),w=Wu(f,[0,g],y),v=Wu(f,[0,2*g],y),A=Wu(f,[0,3*g],y),x=Pl(Gl(Vu(b),Gu(w)),Gl(u,Vu(Pl(a,v))));return[x,Gl(Gu(x),Vu(A))]}});const qu=vo({batchToSpaceND_:function(e,t,n){const s=yo(e,"x","batchToSpaceND"),r=t.reduce(((e,t)=>e*t));jt(s.rank>=1+t.length,(()=>`input rank is ${s.rank} but should be > than blockShape.length ${t.length}`)),jt(n.length===t.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`)),jt(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 i={x:s},a={blockShape:t,crops:n};return oo.runKernel(Zn,i,a)}});const ju=vo({batchNorm_:function(e,t,n,s,r,i){null==i&&(i=.001);const a=yo(e,"x","batchNorm"),o=yo(t,"mean","batchNorm"),l=yo(n,"variance","batchNorm");let c,u;null!=r&&(c=yo(r,"scale","batchNorm")),null!=s&&(u=yo(s,"offset","batchNorm")),jt(o.rank===l.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),jt(null==u||o.rank===u.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),jt(null==c||o.rank===c.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?Fu(e,[1,1,1,e.size]):2===e.rank?Fu(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?Fu(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(a),scale:c,offset:u,mean:o,variance:l},d={varianceEpsilon:i},p=oo.runKernel(Ws,h,d);return Fu(p,a.shape)}});const Hu=vo({batchNorm2d_:function(e,t,n,s,r,i){const a=yo(e,"x","batchNorm"),o=yo(t,"mean","batchNorm"),l=yo(n,"variance","batchNorm");let c,u;return null!=r&&(c=yo(r,"scale","batchNorm")),null!=s&&(u=yo(s,"offset","batchNorm")),jt(2===a.rank,(()=>`Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`)),jt(2===o.rank||1===o.rank,(()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`)),jt(2===l.rank||1===l.rank,(()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`)),null!=c&&jt(2===c.rank||1===c.rank,(()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${c.rank}.`)),null!=u&&jt(2===u.rank||1===u.rank,(()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${u.rank}.`)),ju(a,o,l,u,c,i)}});const $u=vo({batchNorm3d_:function(e,t,n,s,r,i){const a=yo(e,"x","batchNorm"),o=yo(t,"mean","batchNorm"),l=yo(n,"variance","batchNorm");let c,u;return null!=r&&(c=yo(r,"scale","batchNorm")),null!=s&&(u=yo(s,"offset","batchNorm")),jt(3===a.rank,(()=>`Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`)),jt(3===o.rank||1===o.rank,(()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`)),jt(3===l.rank||1===l.rank,(()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`)),null!=c&&jt(3===c.rank||1===c.rank,(()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${c.rank}.`)),null!=u&&jt(3===u.rank||1===u.rank,(()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${u.rank}.`)),ju(a,o,l,u,c,i)}});const Ku=vo({batchNorm4d_:function(e,t,n,s,r,i){const a=yo(e,"x","batchNorm"),o=yo(t,"mean","batchNorm"),l=yo(n,"variance","batchNorm");let c,u;return null!=r&&(c=yo(r,"scale","batchNorm")),null!=s&&(u=yo(s,"offset","batchNorm")),jt(4===a.rank,(()=>`Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`)),jt(4===o.rank||1===o.rank,(()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`)),jt(4===l.rank||1===l.rank,(()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`)),null!=c&&jt(4===c.rank||1===c.rank,(()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${c.rank}.`)),null!=u&&jt(4===u.rank||1===u.rank,(()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${u.rank}.`)),ju(a,o,l,u,c,i)}});const Xu=vo({bincount_:function(e,t,n){const s=yo(e,"x","bincount"),r=yo(t,"weights","bincount");jt("int32"===s.dtype,(()=>`Error in bincount: input dtype must be int32, but got ${s.dtype}`)),jt(n>=0,(()=>`size must be non-negative, but got ${n}.`)),jt(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 i={x:s,weights:r},a={size:n};return oo.runKernel(Yn,i,a)}});const Zu=vo({bitwiseAnd_:function(e,t){const n=yo(e,"x","bitwiseAnd"),s=yo(t,"y","bitwiseAnd");if(!Xt(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 oo.runKernel(Qn,r)}});const Yu=vo({broadcastArgs_:function(e,t){const n=yo(e,"s0","broadcastArgs","int32"),s=yo(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 oo.runKernel(Jn,r)}});const Qu=vo({broadcastTo_:function(e,t){let n=yo(e,"broadcastTo","x");const s=n.shape;if(wn(t),t.lengthn.rank){const e=n.shape.slice();for(;e.length=0;e--)if(r[e]===t[e])i[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${s}] cannot be broadcast to [${t}].`);if(0===i.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return zl(n);const a={x:n},o={reps:i};return oo.runKernel(Ti,a,o)}});const Ju=vo({ceil_:function(e){const t={x:yo(e,"x","ceil","float32")};return oo.runKernel(ts,t)}});const eh=vo({clipByValue_:function(e,t,n){const s=yo(e,"x","clipByValue");if(jt(t<=n,(()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`)),t===n)return tc(s.shape,t,s.dtype);const r={x:s},i={clipValueMin:t,clipValueMax:n};return oo.runKernel(ns,r,i)}});const th=vo({concat1d_:function(e){return Lu(e,0)}});const nh=vo({concat2d_:function(e,t){return Lu(e,t)}});const sh=vo({concat3d_:function(e,t){return Lu(e,t)}});const rh=vo({concat4d_:function(e,t){return Lu(e,t)}});const ih=vo({conv2d_:function(e,t,n,s,r="NHWC",i=[1,1],a){const o=yo(e,"x","conv2d","float32"),l=yo(t,"filter","conv2d","float32");let c=o,u=!1;3===o.rank&&(u=!0,c=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2]])),jt(4===c.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${c.rank}.`)),jt(4===l.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`)),Mu("conv2d",s,a);const h="NHWC"===r?c.shape[3]:c.shape[1];jt(h===l.shape[2],(()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${l.shape[2]}.`)),jt(Ou(n,i),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),jt(Du(i),(()=>"Error in conv2D: Dilated rates should be larger than 0.")),jt(Du(n),(()=>"Error in conv2D: Strides should be larger than 0."));const d={x:c,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a},f=oo.runKernel(as,d,p);return u?Fu(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const ah=vo({conv1d_:function(e,t,n,s,r="NWC",i=1,a){const o=yo(e,"x","conv1d"),l=yo(t,"filter","conv1d");let c=o,u=!1;2===o.rank&&(u=!0,c=Fu(o,[1,o.shape[0],o.shape[1]])),jt(3===c.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`)),jt(3===l.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`)),Mu("conv1d",s,a),jt(c.shape[2]===l.shape[1],(()=>`Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${l.shape[1]}.`)),jt(Ou(n,i),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${i}'`)),jt(Du(i),(()=>"Error in conv1D: Dilated rates should be larger than 0.")),jt(Du(n),(()=>"Error in conv1D: Stride should be larger than 0.")),jt("NWC"===r,(()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`));const h=Fu(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=Fu(c,[c.shape[0],1,c.shape[1],c.shape[2]]),p=ih(d,h,[1,n],s,"NHWC",[1,i],a);return Fu(p,u?[p.shape[2],p.shape[3]]:[p.shape[0],p.shape[2],p.shape[3]])}});const oh=vo({conv2DBackpropInput_:function(e,t,n,s,r,i="NHWC",a){jt(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let o=e,l=t,c=!1;3===t.rank&&(c=!0,l=Fu(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),jt(4===o.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`)),jt(4===l.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`)),jt(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const u="NHWC"===i?o[3]:o[1],h="NHWC"===i?l.shape[3]:l.shape[1];jt(u===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[2]}.`)),jt(h===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[3]}.`)),Mu("conv2dDerInput",r,a);const d={dy:l,filter:n},p={strides:s,pad:r,dataFormat:i,dimRoundingMode:a,inputShape:o},f=oo.runKernel(ls,d,p);return c?Fu(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const lh=vo({conv2dTranspose_:function(e,t,n,s,r,i){const a=yo(e,"x","conv2dTranspose"),o=yo(t,"filter","conv2dTranspose");return oh(n,a,o,s,r,"NHWC",i)}});const ch=vo({conv3d_:function(e,t,n,s,r="NDHWC",i=[1,1,1]){const a=yo(e,"x","conv3d"),o=yo(t,"filter","conv3d");let l=a,c=!1;4===a.rank&&(c=!0,l=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),jt(5===l.rank,(()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`)),jt(5===o.rank,(()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`)),jt(l.shape[4]===o.shape[3],(()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`)),jt(Ou(n,i),(()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),jt("NDHWC"===r,(()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`)),jt(Du(i),(()=>"Error in conv3D: Dilated rates should be larger than 0.")),jt(Du(n),(()=>"Error in conv3D: Strides should be larger than 0."));const u={x:l,filter:o},h={strides:n,pad:s,dataFormat:r,dilations:i},d=oo.runKernel(cs,u,h);return c?Fu(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const uh=vo({conv3DBackpropInput_:function(e,t,n,s,r){jt(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let i=e,a=t,o=!1;4===t.rank&&(o=!0,a=Fu(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),i=[1,e[0],e[1],e[2],e[3]]);const l=i[4],c=a.shape[4];jt(5===i.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${i.length}.`)),jt(5===a.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`)),jt(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),jt(l===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`)),jt(c===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${c}) must match output depth for filter ${n.shape[4]}.`));const u={dy:a,filter:n},h={pad:r,strides:s,inputShape:i},d=oo.runKernel(hs,u,h);return o?Fu(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const hh=vo({conv3dTranspose_:function(e,t,n,s,r){const i=yo(e,"x","conv3dTranspose"),a=yo(t,"filter","conv3dTranspose");return uh(n,i,a,s,r)}});const dh=vo({cos_:function(e){const t={x:yo(e,"x","cos","float32")};return oo.runKernel(ds,t)}});const ph=vo({cosh_:function(e){const t={x:yo(e,"x","cosh","float32")};return oo.runKernel(ps,t)}});const fh=vo({cumprod_:function(e,t=0,n=!1,s=!1){const r={x:yo(e,"x","cumprod")},i={axis:t,exclusive:n,reverse:s};return oo.runKernel(fs,r,i)}});const mh=vo({cumsum_:function(e,t=0,n=!1,s=!1){const r={x:yo(e,"x","cumsum")},i={axis:t,exclusive:n,reverse:s};return oo.runKernel(ms,r,i)}});const gh=vo({denseBincount_:function(e,t,n,s=!1){const r=yo(e,"x","denseBincount"),i=yo(t,"weights","denseBincount");jt("int32"===r.dtype,(()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`)),jt(r.rank<=2,(()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`)),jt(n>=0,(()=>`size must be non-negative, but got ${n}.`)),jt(i.size===r.size||0===i.size,(()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${i.shape}.`));const a={x:r,weights:i},o={size:n,binaryOutput:s};return oo.runKernel(ys,a,o)}});const yh=vo({depthToSpace_:function(e,t,n="NHWC"){const s=yo(e,"x","depthToSpace","float32"),r="NHWC"===n?s.shape[1]:s.shape[2],i="NHWC"===n?s.shape[2]:s.shape[3],a="NHWC"===n?s.shape[3]:s.shape[1];jt(t>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`)),jt(r*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${r} and ${t} for depthToSpace with input shape\n ${s.shape}`)),jt(i*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${i} and ${t} for depthToSpace with input shape\n ${s.shape}`)),jt(a%(t*t)==0,(()=>`Dimension size must be evenly divisible by ${t*t} but is ${a} for depthToSpace with input shape ${s.shape}`));const o={x:s},l={blockSize:t,dataFormat:n};return oo.runKernel(bs,o,l)}});const bh=vo({depthwiseConv2d_:function(e,t,n,s,r="NHWC",i=[1,1],a){const o=yo(e,"x","depthwiseConv2d","float32"),l=yo(t,"filter","depthwiseConv2d","float32");let c=o,u=!1;3===o.rank&&(u=!0,c=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2]])),jt(4===c.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${c.rank}.`)),jt(4===l.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`));const h="NHWC"===r?c.shape[3]:c.shape[1];jt(h===l.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${h}) must match the inChannels dimension in filter ${l.shape[2]}.`)),Mu("depthwiseConv2d",s,a);const d={x:c,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a},f=oo.runKernel(ws,d,p);return u?Fu(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const wh=vo({diag_:function(e){const t={x:yo(e,"x","diag")};return oo.runKernel(xs,t)}});const vh=vo({dilation2d_:function(e,t,n,s,r=[1,1],i="NHWC"){const a=yo(e,"x","dilation2d"),o=yo(t,"filter","dilation2d");jt(3===a.rank||4===a.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`)),jt(3===o.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`)),jt("NHWC"===i,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${i}`));let l=a,c=!1;3===a.rank&&(l=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2]]),c=!0),jt(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 u={x:l,filter:o},h={strides:n,pad:s,dilations:r},d=oo.runKernel(Cs,u,h);return c?Fu(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});const Ah=vo({equal_:function(e,t){let n=yo(e,"a","equal","string_or_numeric"),s=yo(t,"b","equal","string_or_numeric");[n,s]=Ja(n,s),cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(Ds,r)}});const xh=vo({where_:function(e,t,n){const s=yo(t,"a","where"),r=yo(n,"b","where"),i=yo(e,"condition","where","bool"),a=cc(cc(i.shape,s.shape),r.shape),o={condition:Qu(i,a),t:Qu(s,a),e:Qu(r,a)};return oo.runKernel(ei,o)}});const Ch=vo({divNoNan_:function(e,t){let n=yo(e,"a","div"),s=yo(t,"b","div");[n,s]=Ja(n,s);const r=Wl(n,s),i=jl(r),a=Ah(s,i);return xh(a,i,r)}});const kh=vo({dot_:function(e,t){const n=yo(e,"t1","dot"),s=yo(t,"t2","dot");jt(!(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],i=1===s.rank?s.size:s.shape[0];if(jt(r===i,(()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${i}.`)),1===n.rank&&1===s.rank){const e=Fu(n,[1,-1]),t=Fu(s,[-1,1]),r=Pu(e,t);return Fu(r,[])}if(1===n.rank&&2===s.rank){const e=Fu(n,[1,-1]),t=Fu(s,[s.shape[0],s.shape[1]]),r=Pu(e,t);return Fu(r,[r.size])}if(2===n.rank&&1===s.rank){const e=Fu(s,[-1,1]),t=Pu(n,e);return Fu(t,[t.size])}{const e=Fu(s,[s.shape[0],s.shape[1]]);return Pu(n,e)}}});const Sh=vo({einsum_:function(e,...t){const n=t.map(((e,t)=>yo(e,`tensors${t}`,"einsum"))),s={equation:e};return oo.runKernel(Ts,n,s)}});const Eh=vo({elu_:function(e){const t={x:yo(e,"x","elu","float32")};return oo.runKernel(Is,t)}});const _h=vo({ensureShape_:function(e,t){const n=yo(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=Bl(t,"float32"));const n={x:t};return oo.runKernel(Os,n)}});function Ih(e,t){for(let n=0;ne[t]))]}function Dh(e,t){return Nh(e,t.map((e=>1)),t)}function Rh(e,t,n){jt(Ih(t,n),(()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`))}function Mh(e,t){if(Ih(e,t))return null;const n=[];for(let s=0;sn.push(e))),n}function Fh(e){return e.map(((e,t)=>[t,e])).sort(((e,t)=>e[1]-t[1])).map((e=>e[0]))}function Bh(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 oo.runKernel(Ms,s,r)}});const jh=vo({expm1_:function(e){const t={x:yo(e,"x","expm1")};return oo.runKernel(Fs,t)}});const Hh=vo({tile_:function(e,t){const n=yo(e,"x","tile","string_or_numeric");jt(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 oo.runKernel(Ti,s,r)}});const $h=vo({eye_:function(e,t,n,s="float32"){null==t&&(t=e);const r=Fl([e,t],s),i=e<=t?e:t;for(let e=0;e`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${i.rank}.`)),jt(Zt(t),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`));let a=i,o=!1;3===i.rank&&(o=!0,a=Fu(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const l={x:a},c={depthRadius:t,bias:n,alpha:s,beta:r},u=oo.runKernel(or,l,c);return o?Fu(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const od=vo({log_:function(e){const t={x:yo(e,"x","log","float32")};return oo.runKernel(nr,t)}});const ld=vo({log1p_:function(e){const t={x:yo(e,"x","log1p")};return oo.runKernel(sr,t)}});const cd=vo({neg_:function(e){const t={x:yo(e,"x","neg")};return oo.runKernel(Cr,t)}});const ud=vo({softplus_:function(e){const t={x:yo(e,"x","softplus")};return oo.runKernel(oi,t)}});const hd=vo({logSigmoid_:function(e){const t=yo(e,"x","logSigmoid");return Hl((e=>({value:cd(ud(cd(e))),gradFunc:t=>Gl(t,Vu(cd(e)))})))(t)}});const dd=vo({logSoftmax_:function(e,t=-1){const n=yo(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}`);return Hl(((e,n)=>{const s=zh(e,t,!0),r=rc(e,s),i=rc(Bl(r,"float32"),od(Ph(Uh(r),t,!0)));n([i]);return{value:i,gradFunc:(e,n)=>{const[s]=n,r=Uh(s);return rc(e,Gl(Ph(e,t,!0),r))}}}))(n)}});const pd=vo({logSumExp_:function(e,t=null,n=!1){const s=yo(e,"x","logSumExp"),r=tn(t,s.shape),i=zh(s,r,!0),a=rc(s,i),o=Uh(a),l=Ph(o,r),c=od(l),u=Pl(Fu(i,c.shape),c);if(n){const e=Dh(u.shape,r);return Fu(u,e)}return u}});const fd=vo({logicalAnd_:function(e,t){const n=yo(e,"a","logicalAnd","bool"),s=yo(t,"b","logicalAnd","bool");cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(rr,r)}});const md=vo({logicalNot_:function(e){const t={x:yo(e,"x","logicalNot","bool")};return oo.runKernel(ir,t)}});const gd=vo({logicalOr_:function(e,t){const n=yo(e,"a","logicalOr","bool"),s=yo(t,"b","logicalOr","bool");cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(ar,r)}});const yd=vo({logicalXor_:function(e,t){const n=yo(e,"a","logicalXor","bool"),s=yo(t,"b","logicalXor","bool");return cc(n.shape,s.shape),fd(gd(e,t),md(fd(e,t)))}}),bd=2147483648;const wd=vo({searchSorted_:function(e,t,n="left"){const s=yo(e,"sortedSequence","searchSorted"),r=yo(t,"values","searchSorted"),i=s.shape[s.shape.length-1],a=r.shape[r.shape.length-1],o=Fu(s,[-1,i]),l=Fu(r,[-1,a]);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(Kt(l.shape)>=bd)throw new Error("values tensor size must less than 2147483648");if(o.shape[1]>=bd)throw new Error(`trailing dim_size must less than 2147483648 for int32 output type, was ${o.shape[1]}`);const c={sortedSequence:o,values:l},u={side:n};return oo.runKernel(Jr,c,u)}});function vd(e,t){return wd(e,t,"left")}const Ad=vo({maxPool_:function(e,t,n,s,r){const i=yo(e,"x","maxPool");let a=i,o=!1;3===i.rank&&(o=!0,a=Fu(i,[1,i.shape[0],i.shape[1],i.shape[2]])),jt(4===a.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${a.rank}.`)),jt(Ou(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),Mu("maxPool",s,r);const l={x:a},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r},u=oo.runKernel(hr,l,c);return o?Fu(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const xd=vo({maxPool3d_:function(e,t=[1,1,1],n,s,r,i="NDHWC"){const a=yo(e,"x","maxPool3d");let o=a,l=!1;4===a.rank&&(l=!0,o=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),jt(5===o.rank,(()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`)),jt("NDHWC"===i,(()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`)),Mu("maxPool3d",s,r);const c={x:o},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:i},h=oo.runKernel(pr,c,u);return l?Fu(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const Cd=vo({maxPoolWithArgmax_:function(e,t,n,s,r=!1){const i={x:yo(e,"x","maxPoolWithArgmax")},a={filterSize:t,strides:n,pad:s,includeBatchInIndex:r},o=oo.runKernel(mr,i,a);return{result:o[0],indexes:o[1]}}});const kd=vo({mean_:function(e,t=null,n=!1){const s={x:yo(e,"x","mean")},r={axis:t,keepDims:n};return oo.runKernel(gr,s,r)}});function Sd(e,t="float32"){if(wn(e),"complex64"===t){const t=Sd(e,"float32"),n=Sd(e,"float32");return Ao(t,n)}const n=yn(Kt(e),t);return oo.makeTensor(n,e,t)}function Ed(e,t="float32"){if(wn(e),"complex64"===t){const t=Ed(e,"float32"),n=Sd(e,"float32");return Ao(t,n)}const n=gn(Kt(e),t);return oo.makeTensor(n,e,t)}function _d(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=yo(e,"x","meshgrid",e instanceof Fa?e.dtype:"float32");if(void 0===t)return[s];let r=yo(t,"y","meshgrid",t instanceof Fa?t.dtype:"float32");const i=Kt(s.shape),a=Kt(r.shape);return"xy"===n?(s=Fu(s,[1,-1]),r=Fu(r,[-1,1]),[Pu(Ed([a,1],s.dtype),s),Pu(r,Ed([1,i],r.dtype))]):(s=Fu(s,[-1,1]),r=Fu(r,[1,-1]),[Pu(s,Ed([1,a],s.dtype)),Pu(Ed([i,1],r.dtype),r)])}const Td=vo({minimum_:function(e,t){let n=yo(e,"a","minimum"),s=yo(t,"b","minimum");[n,s]=Ja(n,s),"bool"===n.dtype&&(n=Bl(n,"int32"),s=Bl(s,"int32")),cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(br,r)}});const Id=vo({mirrorPad_:function(e,t,n){jt("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const s=yo(e,"x","mirrorPad");if(0===s.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");jt(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.")),jt(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 i={paddings:t,mode:n},a={x:s};return oo.runKernel(wr,a,i)}});const Nd=vo({mod_:function(e,t){let n=yo(e,"a","mod"),s=yo(t,"b","mod");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(vr,r)}});const Od=vo({moments_:function(e,t=null,n=!1){const s=tn(t,(e=yo(e,"x","moments")).shape),r=kd(e,s,n);let i=r.shape;n||(i=Dh(r.shape,s));const a=ql(rc(Bl(e,"float32"),Fu(r,i)));return{mean:r,variance:kd(a,s,n)}}});const Dd=vo({multiRNNCell_:function(e,t,n,s){const r=yo(t,"data","multiRNNCell"),i=bo(n,"c","multiRNNCell"),a=bo(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 ${a}`);n=n||Math.random();const o={logits:1===a?Fu(r,[1,-1]):r},l={numSamples:t,seed:n,normalized:s},c=oo.runKernel(Ar,o,l);return 1===a?Fu(c,[c.size]):c}});const Md=vo({notEqual_:function(e,t){let n=yo(e,"a","notEqual","string_or_numeric"),s=yo(t,"b","notEqual","string_or_numeric");[n,s]=Ja(n,s),cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(kr,r)}});const Fd=vo({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 i={indices:yo(e,"indices","oneHot","int32")},a={dtype:r,depth:t,onValue:n,offValue:s};return oo.runKernel(Ir,i,a)}});const Bd=vo({onesLike_:function(e){const t={x:yo(e,"x","onesLike")};return oo.runKernel(Tr,t)}});const zd=vo({outerProduct_:function(e,t){const n=yo(e,"v1","outerProduct"),s=yo(t,"v2","outerProduct");jt(1===n.rank&&1===s.rank,(()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${s.rank}.`));const r=Fu(n,[-1,1]),i=Fu(s,[1,-1]);return Pu(r,i)}});const Ld=vo({pad_:function(e,t,n=0){const s=yo(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},i={x:s};return oo.runKernel(Or,i,r)}});const Pd=vo({pad1d_:function(e,t,n=0){return jt(2===t.length,(()=>"Invalid number of paddings. Must be length of 2.")),Ld(e,[t],n)}});const Vd=vo({pad2d_:function(e,t,n=0){return jt(2===t.length&&2===t[0].length&&2===t[1].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Ld(e,t,n)}});const Wd=vo({pad3d_:function(e,t,n=0){return jt(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.")),Ld(e,t,n)}});const Gd=vo({pad4d_:function(e,t,n=0){return jt(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.")),Ld(e,t,n)}});const Ud=vo({spaceToBatchND_:function(e,t,n){const s=yo(e,"x","spaceToBatchND");jt(s.rank>=1+t.length,(()=>`input rank ${s.rank} should be > than [blockShape] ${t.length}`)),jt(n.length===t.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`)),jt(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},i={blockShape:t,paddings:n};return oo.runKernel(ui,r,i)}});const qd=vo({pool_:function(e,t,n,s,r,i,a){null==r&&(r=[1,1]),null==i&&(i=1),0===s&&(s="valid");const o=yo(e,"x","maxPool");let l=o,c=!1;3===o.rank&&(c=!0,l=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2]])),jt(Ou(i,r),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${i} and dilations '${r}'`));const u=Au(l.shape,t,i,r,s),h=[u.dilationHeight,u.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))),i=s.map(((e,t)=>e-r[t]));return s.map(((e,t)=>[r[t],i[t]]))}([u.filterHeight,u.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])),i=e.concat(s,r),a=t.map(((e,t)=>(e-i[t]%e)%e)),o=r.map(((e,t)=>e+a[t])),l=t.map(((e,t)=>[s[t],o[t]])),c=t.map(((e,t)=>[0,a[t]]));return[l,c]}([u.inHeight,u.inWidth],h,d),g=p?s:"valid",y=p?l:Ud(l,h,f),b=("avg"===n?()=>Bu(y,t,i,g,a):()=>Ad(y,t,i,g,a))(),w=p?b:qu(b,h,m);return c?Fu(w,[w.shape[1],w.shape[2],w.shape[3]]):w}});const jd=vo({prelu_:function(e,t){const n={x:yo(e,"x","prelu"),alpha:yo(t,"alpha","prelu")};return oo.runKernel(Rr,n)}});const Hd=vo({prod_:function(e,t=null,n=!1){let s=yo(e,"x","prod");"bool"===s.dtype&&(s=Bl(s,"int32"));const r={x:s},i={axis:t,keepDims:n};return oo.runKernel(Mr,r,i)}});const $d=vo({raggedGather_:function(e,t,n,s){const r={paramsNestedSplits:e.map(((e,t)=>yo(e,`tensors${t}`,"raggedGather","int32"))),paramsDenseValues:yo(t,"paramsDenseValues","raggedGather"),indices:yo(n,"indices","raggedGather","int32")},i={outputRaggedRank:s},a=oo.runKernel(Fr,r,i);return{outputNestedSplits:a.slice(0,a.length-1),outputDenseValues:a[a.length-1]}}});const Kd=vo({raggedRange_:function(e,t,n){const s=yo(e,"starts","raggedRange"),r={starts:s,limits:yo(t,"limits","raggedRange",s.dtype),deltas:yo(n,"deltas","raggedRange",s.dtype)},i=oo.runKernel(Br,r);return{rtNestedSplits:i[0],rtDenseValues:i[1]}}});const Xd=vo({raggedTensorToTensor_:function(e,t,n,s,r){const i=yo(e,"shape","raggedTensorToTensor","int32"),a=yo(t,"values","raggedTensorToTensor"),o={shape:i,values:a,defaultValue:yo(n,"defaultValue","raggedTensorToTensor",a.dtype),rowPartitionTensors:s.map(((e,t)=>yo(e,`tensors${t}`,"raggedTensorToTensor","int32")))},l={rowPartitionTypes:r};return oo.runKernel(zr,o,l)}});const Zd=vo({rand_:function(e,t,n){wn(e);const s=Kt(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===i);const a=Math.sqrt(-2*Math.log(i)/i);e=this.mean+this.stdDev*s*a,t=this.mean+this.stdDev*r*a,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 Jd{constructor(e,t,n,s){this.alpha=e,this.beta=1/t,this.dtype=n;const r=s||Math.random();this.randu=Yd.alea(r.toString()),this.randn=new Qd(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,i;for(;;){do{s=this.randn.nextValue(),i=1+this.c*s}while(i<=0);if(i*=i*i,e=s*s,t=1-.331*e*e,n=.5*e+this.d*(1-i+Math.log(i)),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=Yd.alea(s)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const tp=vo({randomGamma_:function(e,t,n=1,s="float32",r){if(wn(e),null==n&&(n=1),null==s&&(s="float32"),"float32"!==s&&"int32"!==s)throw new Error(`Unsupported data type ${s}`);const i=new Jd(t,n,s,r),a=Fl(e,s);for(let e=0;e`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`)),hp(t,0)}});const pp=vo({reverse2d_:function(e,t){const n=yo(e,"x","reverse");return jt(2===n.rank,(()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`)),hp(n,t)}});const fp=vo({reverse3d_:function(e,t){const n=yo(e,"x","reverse");return jt(3===n.rank,(()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`)),hp(n,t)}});const mp=vo({reverse4d_:function(e,t){const n=yo(e,"x","reverse");return jt(4===n.rank,(()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`)),hp(n,t)}});const gp=vo({round_:function(e){const t={x:yo(e,"x","round")};return oo.runKernel(Xr,t)}});const yp=vo({rsqrt_:function(e){const t={x:yo(e,"x","rsqrt","float32")};return oo.runKernel(Zr,t)}});const bp=vo({selu_:function(e){const t={x:yo(e,"x","selu")};return oo.runKernel(ti,t)}});const wp=vo({separableConv2d_:function(e,t,n,s,r,i=[1,1],a="NHWC"){const o=yo(e,"x","separableConv2d"),l=yo(t,"depthwiseFilter","separableConv2d"),c=yo(n,"pointwiseFilter","separableConv2d");let u=o,h=!1;if(3===o.rank&&(h=!0,u=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2]])),"NCHW"===a)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");jt(4===u.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${u.rank}.`)),jt(4===l.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`)),jt(4===c.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`)),jt(1===c.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${c.shape[0]}.`)),jt(1===c.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${c.shape[1]}.`));const d=l.shape[2],p=l.shape[3];jt(c.shape[2]===d*p,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*p}, but got ${c.shape[2]}.`));const f=bh(u,l,s,r,a,i),m=ih(f,c,1,"valid",a);return h?Fu(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const vp=async function(e,t){const n=yo(e,"x","setdiff1d"),s=yo(t,"y","setdiff1d");jt(n.dtype===s.dtype,(()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${s.dtype}).`)),jt(1===n.rank,(()=>`x should be 1D tensor, but got x (${n.shape}).`)),jt(1===s.rank,(()=>`y should be 1D tensor, but got y (${s.shape}).`));const r=await n.data(),i=await s.data(),a=new Set(i);let o=0;for(let e=0;e`slice1d expects a rank-1 tensor, but got a rank-${s.rank} tensor`)),Wu(s,[t],[n])}});const Sp=vo({slice2d_:function(e,t,n){const s=yo(e,"x","slice2d");return jt(2===s.rank,(()=>`slice2d expects a rank-2 tensor, but got a rank-${s.rank} tensor`)),Wu(s,t,n)}});const Ep=vo({slice3d_:function(e,t,n){const s=yo(e,"x","slice3d");return jt(3===s.rank,(()=>`slice3d expects a rank-3 tensor, but got a rank-${s.rank} tensor`)),Wu(s,t,n)}});const _p=vo({slice4d_:function(e,t,n){const s=yo(e,"x","slice4d");return jt(4===s.rank,(()=>`slice4d expects a rank-4 tensor, but got a rank-${s.rank} tensor`)),Wu(s,t,n)}});const Tp=vo({softmax_:function(e,t=-1){const n=yo(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 oo.runKernel(di,s,r)}});const Ip=vo({fft_:function(e){jt("complex64"===e.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`));const t={input:e};return oo.runKernel(Bs,t)}});const Np=vo({ifft_:function(e){jt("complex64"===e.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`));const t={input:e};return oo.runKernel($s,t)}});const Op=vo({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let s;if(t<=2){const r=Fu(e,[n,t]);s=Np(r)}else{const r=[n,2*(t-1)],i=Fu(op(e),[n,t]),a=Fu(Qh(e),[n,t]),o=hp(Wu(i,[0,1],[n,t-2]),1),l=Gl(hp(Wu(a,[0,1],[n,t-2]),1),$l(-1)),c=Lu([i,o],1),u=Lu([a,l],1),h=Fu(Ao(c,u),[r[0],r[1]]);s=Np(h)}if(s=op(s),3===e.rank&&0!==e.shape[0]){const t=s,n=e.shape[0];s=Fu(s,[n,s.shape[0]/n,s.shape[1]]),t.dispose()}return s}});const Dp=vo({split_:function(e,t,n=0){const s={x:yo(e,"x","split")},r={numOrSizeSplits:t,axis:n};return oo.runKernel(hi,s,r)}});const Rp=vo({rfft_:function(e,t){jt("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)),i=e.shape.map((e=>e));i[e.shape.length-1]=t,r=Wu(e,s,i),n=t}else if(null!=t&&t>n){const s=e.shape.map((e=>e));s[e.shape.length-1]=t-n,r=Lu([e,Sd(s)],e.shape.length-1),n=t}else r=e;const i=jl(r),a=Fu(Ao(r,i),[s,n]),o=Ip(a),l=Math.floor(n/2)+1,c=op(o),u=Qh(o),h=Dp(c,[l,n-l],c.shape.length-1),d=Dp(u,[l,n-l],u.shape.length-1),p=r.shape.slice();return p[r.shape.length-1]=l,Fu(Ao(h[0],d[0]),p)}});const Mp=vo({squaredDifference_:function(e,t){let n=yo(e,"a","squaredDifference"),s=yo(t,"b","squaredDifference");[n,s]=Ja(n,s),cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(bi,r,{})}});const Fp=vo({squeeze_:function(e,t){const n=yo(e,"x","squeeze","string_or_numeric");return Fu(n,nn(n.shape,t).newShape)}});const Bp=vo({stack_:function(e,t=0){const n=bo(e,"tensors","stack","string_or_numeric");jt(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&jt(t<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const s=n,r={axis:t};return oo.runKernel(Nr,s,r)}});const zp=vo({step_:function(e,t=0){const n={x:yo(e,"x","step")},s={alpha:t};return oo.runKernel(Bi,n,s)}});const Lp=vo({stridedSlice_:function(e,t,n,s,r=0,i=0,a=0,o=0,l=0){const c={x:yo(e,"x","stridedSlice","string_or_numeric")},u={begin:t,end:n,strides:s,beginMask:r,endMask:i,ellipsisMask:a,newAxisMask:o,shrinkAxisMask:l};return oo.runKernel(Ai,c,u)}});const Pp=vo({tan_:function(e){const t={x:yo(e,"x","tan","float32")};return oo.runKernel(Ei,t)}});function Vp(e,t){$t(e);const n=fo(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return xo(e,null,n,t)}function Wp(e,t,n){if($t(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const s=fo(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 xo(e,t,s,n)}function Gp(e,t,n){if($t(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const s=fo(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 xo(e,t,s,n)}function Up(e,t,n){if($t(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const s=fo(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 xo(e,t,s,n)}function qp(e,t,n){if($t(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const s=fo(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 xo(e,t=t||s,s,n)}function jp(e,t,n){const s=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,i=`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,i=n.length;let a=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 i={x:s},a={k:t,sorted:n},[o,l]=oo.runKernel(Ii,i,a);return{values:o,indices:l}}});const Zp=vo({truncatedNormal_:function(e,t=0,n=1,s,r){if(wn(e),null!=s&&"bool"===s)throw new Error("Unsupported data type $ { dtype }");const i=new Qd(t,n,s,!0,r),a=Fl(e,s);for(let e=0;e0,(()=>"The input tensor must be at least 1D"));const s={x:n},r={axis:t},[i,a]=oo.runKernel(Di,s,r);return{values:i,indices:a}}});const Qp=vo({unsortedSegmentSum_:function(e,t,n){const s=yo(e,"x","unsortedSegmentSum"),r=yo(t,"segmentIds","unsortedSegmentSum","int32");jt(Zt(n),(()=>"numSegments must be of dtype int"));const i={x:s,segmentIds:r},a={numSegments:n};return oo.runKernel(Mi,i,a)}});const Jp=vo({unstack_:function(e,t=0){const n=yo(e,"x","unstack","string_or_numeric");jt(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`));const s={value:n},r={axis:t};return oo.runKernel(Ri,s,r)}});function ef(e,t){return wd(e,t,"right")}function tf(e,t=!0,n,s){return oo.makeVariable(e,t,n,s)}function nf(e,t){const n=[];for(let e=0;e0,(()=>"mask cannot be scalar")),Ht(o.slice(i,i+a),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let e=i;et)).reverse()),jt(s.rank===t.length,(()=>`Error in transpose: rank of input ${s.rank} must match length of perm ${t}.`)),t.forEach((e=>{jt(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},i={perm:t};return"complex64"===s.dtype?To((()=>{let e=op(s),t=Qh(s);return e=oo.runKernel(Oi,{x:e},i),t=oo.runKernel(Oi,{x:t},i),n&&(t=cd(t)),Ao(e,t)})):oo.runKernel(Oi,r,i)}});const of=vo({movingAverage_:function(e,t,n,s,r=!0){const i=yo(e,"v","movingAverage"),a=yo(t,"x","movingAverage"),o=yo(n,"decay","movingAverage");var l,c;c=a,jt((l=i).dtype===c.dtype,(()=>`The dtypes of the first(${l.dtype}) and second(${c.dtype}) input must match`)),jt(Xt(i.shape,a.shape),(()=>"Shape mismatch in v and x"));const u=$l(1),h=rc(u,o);let d=Gl(rc(a,i),h);if(r){jt(null!=s,(()=>"When using zeroDebias: true, step is required."));const e=yo(s,"step","movingAverage");d=Wl(d,rc(u,sc(o,e)))}return Pl(i,d)}});const lf=vo({scatterND_:function(e,t,n){wn(n);const s=yo(e,"indices","scatterND","int32"),r=yo(t,"updates","scatterND");Hp(r,s,n);const i={indices:s,updates:r},a={shape:n};return oo.runKernel(Yr,i,a)}});const cf=vo({sparseToDense_:function(e,t,n,s=0){wn(n);const r=yo(e,"sparseIndices","sparseToDense","int32"),i=yo(t,"sparseValues","sparseToDense","string_or_numeric"),a=yo(s,"defaultValue","sparseToDense",i.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,i=e.rank>1?e.shape[1]:1;if(n.length!==i)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${i}.`);const a=t.size;if(0!==t.rank&&(1!==t.rank||a!==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,i,n,a);const o={sparseIndices:r,sparseValues:i,defaultValue:a},l={outputShape:n};return oo.runKernel(yi,o,l)}});const uf=vo({gatherND_:function(e,t){const n=yo(t,"indices","gatherND","int32"),s={params:yo(e,"x","gatherND","string_or_numeric"),indices:n};return oo.runKernel(Us,s)}});const hf=vo({dropout_:function(e,t,n,s){const r=yo(e,"x","dropout");if(jt("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.`)),jt(t>=0&&t<1,(()=>`rate must be a float in the range [0, 1), but got ${t}.`)),0===t)return e instanceof Fa?r.clone():r;const i=function(e,t){if(null==t)return e.shape.slice();if(Xt(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}`)),jt(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}`)),Ht(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 i=s.shape[s.shape.length-1];jt(n>0&&n<=i,(()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${i}), but got ${n}`));const a=await s.data(),o=await r.data(),[l,c]=[a.length/i,i],u=sn("bool",l);for(let e=0;et.value-e.value)),u[e]=0;for(let t=0;t`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`)),jt(4===l.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`)),jt(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const c="NHWC"===i?o.shape[3]:o.shape[1],u="NHWC"===i?l.shape[3]:l.shape[1];jt(c===n[2],(()=>`Error in conv2dDerFilter: depth of input ${c}) must match input depth in filter (${n[2]}.`)),jt(u===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${u}) must match output depth for filter (${n[3]}).`)),Mu("conv2dDerFilter",r,a);const h={x:o,dy:l},d={strides:s,pad:r,dataFormat:i,dimRoundingMode:a,filterShape:n};return oo.runKernel(os,h,d)}});function gf(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Gl(e,zp(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function yf(e,t){let n=t;const s=lc(e.shape,t.shape);return s.length>0&&(n=Ph(n,s)),Fu(n,e.shape)}function bf(e,t,n,s){if("linear"===t)return e;if("relu"===t)return cp(e);if("elu"===t)return Eh(e);if("relu6"===t)return up(e);if("prelu"===t)return jd(e,n);if("leakyrelu"===t)return nd(e,s);if("sigmoid"===t)return Vu(e);throw new Error(`Unknown fused activation ${t}.`)}const wf=(e,t)=>!(e>0)||"linear"===t;const vf=vo({fusedConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:o,activation:l="linear",preluActivationWeights:c,leakyreluAlpha:u}){if(l=l||"linear",!1===wf(oo.state.gradientDepth,l)){jt("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=ih(e,t,n,s,r,i,a);return null!=o&&(h=Pl(h,o)),bf(h,l,c,u)}const h=yo(e,"x","conv2d","float32"),d=yo(t,"filter","conv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=Fu(h,[1,h.shape[0],h.shape[1],h.shape[2]])),jt(4===p.rank,(()=>`Error in fused conv2d: input must be rank 4, but got rank ${p.rank}.`)),jt(4===d.rank,(()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`)),Mu("fused conv2d",s,a);const m="NHWC"===r?p.shape[3]:p.shape[1];jt(d.shape[2]===m,(()=>`Error in conv2d: depth of input (${m}) must match input depth for filter ${d.shape[2]}.`)),jt(Ou(n,i),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`));const g=Cu(p.shape,d.shape,n,i,s,a);let y,b;if(null!=o&&(y=yo(o,"bias","fused conv2d"),[y]=Ja(y,h),"NHWC"===r?cc(g.outShape,y.shape):(jt(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}.`)),jt(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!=c){const e=c.shape;if(jt(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)jt(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{cc(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=yo(c,"prelu weights","fused conv2d")}const w=(e,t)=>{jt("NHWC"===r,(()=>`Error in gradient of fused conv2D: got dataFormat of ${r} but only NHWC is currently supported.`));const[a,o,c,u]=t,h=gf(e,c,l);jt(Nu(i),(()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`));const d=[oh(o.shape,h,a,n,s),mf(o,h,a.shape,n,s)];if(null!=u){const e=yf(u,h);d.push(e)}return d},v={x:p,filter:d,bias:y,preluActivationWeights:b},A={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:u};if(null==o){const e=Hl(((e,t,n)=>{let s=oo.runKernel(Vi,v,A);return n([t,e,s]),f&&(s=Fu(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:w}}));return e(p,d)}{const e=Hl(((e,t,n,s)=>{let r=oo.runKernel(Vi,v,A);return s([t,e,r,n]),f&&(r=Fu(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:w}}));return e(p,d,y)}}});const Af=vo({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,s,r,i=[1,1],a){let o=e;3===e.rank&&(o=Fu(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=Fu(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const c={x:o,dy:l},u={strides:s,pad:r,dimRoundingMode:a,dilations:i,filterShape:n};return oo.runKernel(vs,c,u)}});const xf=vo({depthwiseConv2dNativeBackpropInput_:function(e,t,n,s,r,i=[1,1],a){let o=t,l=!1;3===t.rank&&(l=!0,o=Fu(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const c={dy:o,filter:n},u={strides:s,pad:r,dimRoundingMode:a,dilations:i,inputShape:e},h=oo.runKernel(As,c,u);return l?Fu(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const Cf=vo({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:o,activation:l="linear",preluActivationWeights:c,leakyreluAlpha:u}){if(!1===wf(oo.state.gradientDepth,l)){let h=bh(e,t,n,s,r,i,a);return null!=o&&(h=Pl(h,o)),bf(h,l,c,u)}const h=yo(e,"x","depthwiseConv2d","float32"),d=yo(t,"filter","depthwiseConv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=Fu(h,[1,h.shape[0],h.shape[1],h.shape[2]])),jt(4===p.rank,(()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${p.rank}.`)),jt(4===d.rank,(()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`)),jt(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==i&&(i=[1,1]),jt(Ou(n,i),(()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),Mu("fused depthwiseConv2d",s,a);const m=Cu(p.shape,d.shape,n,i,s,a,!0);let g,y;null!=o&&(g=yo(o,"bias","fused conv2d"),[g]=Ja(g,h),cc(m.outShape,g.shape)),null!=c&&(y=yo(c,"prelu weights","fused depthwiseConv2d"));const b=(e,t)=>{jt(Nu(i),(()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${i}'`));const[r,o,c,u]=t,h=gf(e,c,l),d=xf(o.shape,h,r,n,s,i,a),p=Af(o,h,r.shape,n,s,i,a);if(null!=u){return[d,p,yf(g,h)]}return[d,p]},w={x:p,filter:d,bias:g,preluActivationWeights:y},v={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:u};if(null==o){const e=Hl(((e,t,n)=>{let s=oo.runKernel(Wi,w,v);return n([t,e,s]),f&&(s=Fu(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:b}}));return e(p,d)}{const e=Hl(((e,t,n,s)=>{let r=oo.runKernel(Wi,w,v);return s([t,e,r,n]),f&&(r=Fu(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:b}}));return e(p,d,g)}}});const kf=vo({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:s=!1,bias:r,activation:i="linear",preluActivationWeights:a,leakyreluAlpha:o=.2}){if(!1===wf(oo.state.gradientDepth,i)){let l=Pu(e,t,n,s);return null!=r&&(l=Pl(l,r)),bf(l,i,a,o)}let l=yo(e,"a","fused matMul"),c=yo(t,"b","fused matMul");[l,c]=Ja(l,c);const u=n?l.shape[l.rank-2]:l.shape[l.rank-1],h=s?c.shape[c.rank-1]:c.shape[c.rank-2],d=n?l.shape[l.rank-1]:l.shape[l.rank-2],p=s?c.shape[c.rank-2]:c.shape[c.rank-1],f=l.shape.slice(0,-2),m=c.shape.slice(0,-2),g=Kt(f),y=Kt(m);jt(u===h,(()=>`Error in fused matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${l.shape} and ${c.shape} and transposeA=${n} and transposeB=${s} must match.`));const b=cc(l.shape.slice(0,-2),c.shape.slice(0,-2)).concat([d,p]),w=Fu(l,n?[g,u,d]:[g,d,u]),v=Fu(c,s?[y,p,h]:[y,h,p]);let A,x;null!=r&&(A=yo(r,"bias","fused matMul"),[A]=Ja(A,l),cc(b,A.shape)),null!=a&&(x=yo(a,"prelu weights","fused matMul"));const C=(e,t)=>{const[a,o,l,c]=t,u=gf(Fu(e,l.shape),l,i);let h,d;if(n||s?!n&&s?(h=Pu(u,o,!1,!1),d=Pu(u,a,!0,!1)):n&&!s?(h=Pu(o,u,!1,!0),d=Pu(a,u,!1,!1)):(h=Pu(o,u,!0,!0),d=Pu(u,a,!0,!0)):(h=Pu(u,o,!1,!0),d=Pu(a,u,!0,!1)),null!=r){return[h,d,yf(c,u)]}return[h,d]},k={a:w,b:v,bias:A,preluActivationWeights:x},S={transposeA:n,transposeB:s,activation:i,leakyreluAlpha:o};if(null==r){const e=Hl(((e,t,n)=>{const s=oo.runKernel(Pi,k,S);return n([e,t,s]),{value:Fu(s,b),gradFunc:C}}));return e(w,v)}{const e=Hl(((e,t,n,s)=>{const r=oo.runKernel(Pi,k,S);return s([e,t,r,n]),{value:Fu(r,b),gradFunc:C}}));return e(w,v,A)}}});const Sf=vo({hammingWindow_:function(e){return pf(e,.54,.46)}});const Ef=vo({hannWindow_:function(e){return pf(e,.5,.5)}});const _f=vo({frame_:function(e,t,n,s=!1,r=0){let i=0;const a=[];for(;i+t<=e.size;)a.push(Wu(e,i,t)),i+=n;if(s)for(;i`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`)),jt(2===o.rank&&4===o.shape[1],(()=>`Error in cropAndResize: boxes must be have size [${c},4] but had shape ${o.shape}.`)),jt(1===l.rank&&l.shape[0]===c,(()=>`Error in cropAndResize: boxInd must be have size [${c}] but had shape ${o.shape}.`)),jt(2===s.length,(()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${s.length}.`)),jt(s[0]>=1&&s[1]>=1,(()=>`cropSize must be atleast [1,1], but was ${s}`)),jt("bilinear"===r||"nearest"===r,(()=>`method must be bilinear or nearest, but was ${r}`));const u={image:a,boxes:o,boxInd:l},h={method:r,extrapolationValue:i,cropSize:s};return oo.runKernel(gs,u,h)}});const Nf=vo({flipLeftRight_:function(e){const t=yo(e,"image","flipLeftRight","float32");jt(4===t.rank,(()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`));const n={image:t};return oo.runKernel(Ls,n,{})}});const Of=vo({grayscaleToRGB_:function(e){const t=yo(e,"image","grayscaleToRGB"),n=t.rank-1,s=t.shape[n];jt(t.rank>=2,(()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`)),jt(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,Hh(t,r)}});const Df=vo({rgbToGrayscale_:function(e){const t=yo(e,"image","RGBToGrayscale"),n=t.rank-1,s=t.shape[n];jt(t.rank>=2,(()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`)),jt(3===s,(()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${s}.`));const r=t.dtype,i=Bl(t,"float32"),a=Vp([.2989,.587,.114]);let o;switch(t.rank){case 2:o=Sh("ij,j->i",i,a);break;case 3:o=Sh("ijk,k->ij",i,a);break;case 4:o=Sh("ijkl,l->ijk",i,a);break;case 5:o=Sh("ijklm,m->ijkl",i,a);break;case 6:o=Sh("ijklmn,n->ijklm",i,a);break;default:throw new Error("Not a valid tensor rank.")}return o=qh(o,-1),Bl(o,r)}});const Rf=vo({rotateWithOffset_:function(e,t,n=0,s=.5){const r=yo(e,"image","rotateWithOffset","float32");jt(4===r.rank,(()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`));const i={image:r},a={radians:t,fillValue:n,center:s};return oo.runKernel(Li,i,a)}});function Mf(e,t,n,s,r,i){null==s&&(s=.5),null==r&&(r=Number.NEGATIVE_INFINITY),null==i&&(i=0);const a=e.shape[0];return n=Math.min(n,a),jt(0<=s&&s<=1,(()=>`iouThreshold must be in [0, 1], but was '${s}'`)),jt(2===e.rank,(()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`)),jt(4===e.shape[1],(()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`)),jt(1===t.rank,(()=>"scores must be a 1D tensor")),jt(t.shape[0]===a,(()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${t.shape[0]}`)),jt(0<=i&&i<=1,(()=>`softNmsSigma must be in [0, 1], but was '${i}'`)),{maxOutputSize:n,iouThreshold:s,scoreThreshold:r,softNmsSigma:i}}const Ff=vo({nonMaxSuppression_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const i=yo(e,"boxes","nonMaxSuppression","float32"),a=yo(t,"scores","nonMaxSuppression","float32"),o=Mf(i,a,n,s,r),l={maxOutputSize:n=o.maxOutputSize,iouThreshold:s=o.iouThreshold,scoreThreshold:r=o.scoreThreshold};return oo.runKernel(Sr,{boxes:i,scores:a},l)}});function Bf(e,t,n){const s=function(e,t,n){return function(e,t,n){let s=0,r=e.length,i=0,a=!1;for(;s>>1);const o=n(t,e[i]);o>0?s=i+1:(r=i,a=!o)}return a?s:-s-1}(e,t,n||zf)}(e,t,n),r=s<0?-(s+1):s;e.splice(r,0,t)}function zf(e,t){return e>t?1:er&&c.push({score:t[e],boxIndex:e,suppressBeginIndex:0});c.sort(qf);const u=i>0?-.5/i:0,h=[],d=[];for(;h.length0;){const t=c.pop(),{score:n,boxIndex:i,suppressBeginIndex:a}=t;if(n=a;--n){const a=Gf(e,i,h[n]);if(a>=s){o=!0;break}if(t.score=t.score*Uf(s,u,a),t.score<=r)break}t.suppressBeginIndex=h.length,o||(t.score===n?(h.push(i),d.push(t.score)):t.score>r&&Bf(c,t,qf))}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 a&&(m.selectedScores=d),l&&(m.validOutputs=p),m}function Gf(e,t,n){const s=e.subarray(4*t,4*t+4),r=e.subarray(4*n,4*n+4),i=Math.min(s[0],s[2]),a=Math.min(s[1],s[3]),o=Math.max(s[0],s[2]),l=Math.max(s[1],s[3]),c=Math.min(r[0],r[2]),u=Math.min(r[1],r[3]),h=Math.max(r[0],r[2]),d=Math.max(r[1],r[3]),p=(o-i)*(l-a),f=(h-c)*(d-u);if(p<=0||f<=0)return 0;const m=Math.max(i,c),g=Math.max(a,u),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 Uf(e,t,n){const s=Math.exp(t*n*n);return n<=e?s:0}function qf(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const jf=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const i=yo(e,"boxes","nonMaxSuppressionAsync"),a=yo(t,"scores","nonMaxSuppressionAsync"),o=Mf(i,a,n,s,r);n=o.maxOutputSize,s=o.iouThreshold,r=o.scoreThreshold;const l=await Promise.all([i.data(),a.data()]),c=l[0],u=l[1],{selectedIndices:h}=Lf(c,u,n,s,r);return i!==e&&i.dispose(),a!==t&&a.dispose(),Vp(h,"int32")};const Hf=vo({nonMaxSuppressionWithScore_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=0){const a=yo(e,"boxes","nonMaxSuppression"),o=yo(t,"scores","nonMaxSuppression"),l=Mf(a,o,n,s,r,i),c={boxes:a,scores:o},u={maxOutputSize:n=l.maxOutputSize,iouThreshold:s=l.iouThreshold,scoreThreshold:r=l.scoreThreshold,softNmsSigma:i=l.softNmsSigma},h=oo.runKernel(_r,c,u);return{selectedIndices:h[0],selectedScores:h[1]}}});const $f=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=0){const a=yo(e,"boxes","nonMaxSuppressionAsync"),o=yo(t,"scores","nonMaxSuppressionAsync"),l=Mf(a,o,n,s,r,i);n=l.maxOutputSize,s=l.iouThreshold,r=l.scoreThreshold,i=l.softNmsSigma;const c=await Promise.all([a.data(),o.data()]),u=c[0],h=c[1],{selectedIndices:d,selectedScores:p}=Vf(u,h,n,s,r,i);return a!==e&&a.dispose(),o!==t&&o.dispose(),{selectedIndices:Vp(d,"int32"),selectedScores:Vp(p)}};const Kf=vo({nonMaxSuppressionPadded_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=!1){const a=yo(e,"boxes","nonMaxSuppression"),o=yo(t,"scores","nonMaxSuppression"),l=Mf(a,o,n,s,r,null),c={boxes:a,scores:o},u={maxOutputSize:l.maxOutputSize,iouThreshold:l.iouThreshold,scoreThreshold:l.scoreThreshold,padToMaxOutputSize:i},h=oo.runKernel(Er,c,u);return{selectedIndices:h[0],validOutputs:h[1]}}});const Xf=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=!1){const a=yo(e,"boxes","nonMaxSuppressionAsync"),o=yo(t,"scores","nonMaxSuppressionAsync"),l=Mf(a,o,n,s,r,null),c=l.maxOutputSize,u=l.iouThreshold,h=l.scoreThreshold,[d,p]=await Promise.all([a.data(),o.data()]),{selectedIndices:f,validOutputs:m}=Pf(d,p,c,u,h,i);return a!==e&&a.dispose(),o!==t&&o.dispose(),{selectedIndices:Vp(f,"int32"),validOutputs:$l(m,"int32")}};const Zf=vo({resizeBilinear_:function(e,t,n=!1,s=!1){const r=yo(e,"images","resizeBilinear");jt(3===r.rank||4===r.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`)),jt(2===t.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`)),jt(!1===s||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let i=r,a=!1;3===r.rank&&(a=!0,i=Fu(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:i},l={alignCorners:n,halfPixelCenters:s,size:t},c=oo.runKernel(jr,o,l);return a?Fu(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Yf=vo({resizeNearestNeighbor_:function(e,t,n=!1,s=!1){const r=yo(e,"images","resizeNearestNeighbor");jt(3===r.rank||4===r.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`)),jt(2===t.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`)),jt("float32"===r.dtype||"int32"===r.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),jt(!1===s||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let i=r,a=!1;3===r.rank&&(a=!0,i=Fu(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:i},l={alignCorners:n,halfPixelCenters:s,size:t},c=oo.runKernel(Ur,o,l);return a?Fu(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Qf=vo({threshold_:function(e,t="binary",n=!1,s=.5){const r=yo(e,"image","threshold"),i=r.shape[0]*r.shape[1];let a,o,l,c,u=Gl(Vp([s]),255);if(jt(3===r.rank,(()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`)),jt(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]}.`)),jt("int32"===r.dtype||"float32"===r.dtype,(()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`)),jt("otsu"===t||"binary"===t,(()=>`Method must be binary or otsu, but was ${t}`)),3===r.shape[2]){[a,o,l]=Dp(r,[1,1,1],-1);const e=Gl(a,.2989),t=Gl(o,.587),n=Gl(l,.114);c=Pl(Pl(e,t),n)}else c=e;if("otsu"===t){u=function(e,t){let n,s,r,i,a,o,l=Vp([-1]),c=Vp([0]),u=Vp([0]);for(let h=0;h`Error in transform: image must be rank 4,but got rank ${a.rank}.`)),jt(2===o.rank&&(o.shape[0]===a.shape[0]||1===o.shape[0])&&8===o.shape[1],(()=>"Error in transform: Input transform should be batch x 8 or 1 x 8")),jt(null==i||2===i.length,(()=>`Error in transform: outputShape must be [height, width] or null, but got ${i}.`));const l={image:a,transforms:o},c={interpolation:n,fillMode:s,fillValue:r,outputShape:i};return oo.runKernel(Ni,l,c)}});const em=vo({bandPart_:function(e,t,n){const s=yo(e,"a","bandPart");jt(s.rank>=2,(()=>`bandPart(): Rank must be at least 2, got ${s.rank}.`));const r=s.shape,[i,a]=s.shape.slice(-2);let o,l;"number"==typeof t?(jt(t%1==0,(()=>`bandPart(): numLower must be an integer, got ${t}.`)),jt(t<=i,(()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${i}).`)),o=yo(t<0?i:t,"numLower","bandPart")):(jt("int32"===t.dtype,(()=>"bandPart(): numLower's dtype must be an int32.")),o=xh(sd(t,0),i,Td(t,i))),"number"==typeof n?(jt(n%1==0,(()=>`bandPart(): numUpper must be an integer, got ${n}.`)),jt(n<=a,(()=>`bandPart(): numUpper (${n}) must not be greater than the number of columns (${a}).`)),l=yo(n<0?a:n,"numUpper","bandPart")):(jt("int32"===n.dtype,(()=>"bandPart(): numUpper's dtype must be an int32.")),l=xh(sd(n,0),a,Td(n,a)));const c=Fu(ap(0,i,1,"int32"),[-1,1]),u=ap(0,a,1,"int32"),h=rc(c,u),d=fd(rd(h,o),Yh(h,cd(l))),p=Sd([i,a],s.dtype);return Fu(Bp(Jp(Fu(s,[-1,i,a])).map((e=>xh(d,e,p)))),r)}});const tm=vo({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,jt(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=Dp(e,e.shape[0],0).map((e=>Fp(e,[0])));jt(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{jt(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=$h(n),i=zl(e);const a=Wp([[1]],[1,1]);let o=zl(a);const l=n>=s?s:n;for(let e=0;e{const t=Wu(i,[e,e],[n-e,1]),l=Wh(t),c=Wu(i,[e,e],[1,1]),u=xh(Zh(c,0),Wp([[-1]]),Wp([[1]])),h=rc(c,Gl(u,l)),d=Wl(t,h);o=1===d.shape[0]?zl(a):Lu([a,Wu(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);const p=cd(Wl(Pu(u,h),l)),f=Wu(i,[e,0],[n-e,s]),m=Gl(p,o),g=af(o);if(0===e)i=rc(f,Pu(m,Pu(g,f)));else{const t=rc(f,Pu(m,Pu(g,f)));i=Lu([Wu(i,[0,0],[e,s]),t],0)}const y=af(m),b=Wu(r,[0,e],[n,r.shape[1]-e]);if(0===e)r=rc(b,Pu(Pu(b,o),y));else{const t=rc(b,Pu(Pu(b,o),y));r=Lu([Wu(r,[0,0],[n,e]),t],1)}return[o,i,r]})),Io([t,l,c])}return!t&&n>s&&(r=Wu(r,[0,0],[n,s]),i=Wu(i,[0,0],[s,s])),[r,i]}))}const sm=vo({qr_:function(e,t=!1){if(jt(e.rank>=2,(()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`)),2===e.rank)return nm(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce(((e,t)=>e*t)),s=Jp(Fu(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],i=[];s.forEach((e=>{const[n,s]=nm(e,t);r.push(n),i.push(s)}));return[Fu(Bp(r,0),e.shape),Fu(Bp(i,0),e.shape)]}}});var rm,im;(im=rm||(rm={}))[im.NONE=0]="NONE",im[im.MEAN=1]="MEAN",im[im.SUM=2]="SUM",im[im.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS";const am=vo({computeWeightedLoss_:function(e,t,n=rm.SUM_BY_NONZERO_WEIGHTS){const s=yo(e,"losses","computeWeightedLoss");let r=null;null!=t&&(r=yo(t,"weights","computeWeightedLoss"));const i=null==r?s:Gl(s,r);if(n===rm.NONE)return i;if(n===rm.SUM)return Ph(i);if(n===rm.MEAN){if(null==r)return kd(i);{const e=s.size/r.size,t=Wl(Ph(i),Ph(r));return e>1?Wl(t,$l(e)):t}}if(n===rm.SUM_BY_NONZERO_WEIGHTS){if(null==r)return Wl(Ph(i),$l(s.size));{const e=Gl(r,Ed(s.shape)),t=Bl(Ph(Md(e,$l(0))),"float32");return Wl(Ph(i),t)}}throw Error(`Unknown reduction: ${n}`)}});const om=vo({absoluteDifference_:function(e,t,n,s=rm.SUM_BY_NONZERO_WEIGHTS){const r=yo(e,"labels","absoluteDifference"),i=yo(t,"predictions","absoluteDifference");let a=null;null!=n&&(a=yo(n,"weights","absoluteDifference")),Ht(r.shape,i.shape,"Error in absoluteDifference: ");const o=ac(rc(r,i));return am(o,a,s)}});const lm=vo({cosineDistance_:function(e,t,n,s,r=rm.SUM_BY_NONZERO_WEIGHTS){const i=yo(e,"labels","cosineDistance"),a=yo(t,"predictions","cosineDistance");let o=null;null!=s&&(o=yo(s,"weights","cosineDistance")),Ht(i.shape,a.shape,"Error in cosineDistance: ");const l=$l(1),c=rc(l,Ph(Gl(i,a),n,!0));return am(c,o,r)}});const cm=vo({hingeLoss_:function(e,t,n,s=rm.SUM_BY_NONZERO_WEIGHTS){let r=yo(e,"labels","hingeLoss");const i=yo(t,"predictions","hingeLoss");let a=null;null!=n&&(a=yo(n,"weights","hingeLoss")),Ht(r.shape,i.shape,"Error in hingeLoss: ");const o=$l(1);r=rc(Gl($l(2),r),o);const l=cp(rc(o,Gl(r,i)));return am(l,a,s)}});const um=vo({huberLoss_:function(e,t,n,s=1,r=rm.SUM_BY_NONZERO_WEIGHTS){const i=yo(e,"labels","huberLoss"),a=yo(t,"predictions","huberLoss");let o=null;null!=n&&(o=yo(n,"weights","huberLoss")),Ht(i.shape,a.shape,"Error in huberLoss: ");const l=$l(s),c=ac(rc(a,i)),u=Td(c,l),h=rc(c,u),d=Pl(Gl($l(.5),ql(u)),Gl(l,h));return am(d,o,r)}});const hm=vo({logLoss_:function(e,t,n,s=1e-7,r=rm.SUM_BY_NONZERO_WEIGHTS){const i=yo(e,"labels","logLoss"),a=yo(t,"predictions","logLoss");let o=null;null!=n&&(o=yo(n,"weights","logLoss")),Ht(i.shape,a.shape,"Error in logLoss: ");const l=$l(1),c=$l(s),u=cd(Gl(i,od(Pl(a,c)))),h=Gl(rc(l,i),od(Pl(rc(l,a),c))),d=rc(u,h);return am(d,o,r)}});const dm=vo({meanSquaredError_:function(e,t,n,s=rm.SUM_BY_NONZERO_WEIGHTS){const r=yo(e,"labels","meanSquaredError"),i=yo(t,"predictions","meanSquaredError");let a=null;null!=n&&(a=yo(n,"weights","meanSquaredError")),Ht(r.shape,i.shape,"Error in meanSquaredError: ");const o=Mp(r,i);return am(o,a,s)}});const pm=vo({sigmoidCrossEntropy_:function(e,t,n,s=0,r=rm.SUM_BY_NONZERO_WEIGHTS){let i=yo(e,"multiClassLabels","sigmoidCrossEntropy");const a=yo(t,"logits","sigmoidCrossEntropy");let o=null;if(null!=n&&(o=yo(n,"weights","sigmoidCrossEntropy")),Ht(i.shape,a.shape,"Error in sigmoidCrossEntropy: "),s>0){const e=$l(s),t=$l(1),n=$l(.5);i=Pl(Gl(i,rc(t,e)),Gl(n,e))}const l=function(e,t){const n=yo(e,"labels","sigmoidCrossEntropyWithLogits"),s=yo(t,"logits","sigmoidCrossEntropyWithLogits");Ht(n.shape,s.shape,"Error in sigmoidCrossEntropyWithLogits: ");const r=cp(s),i=Gl(s,n),a=ld(Uh(cd(ac(s))));return Pl(rc(r,i),a)}(i,a);return am(l,o,r)}});const fm=vo({softmaxCrossEntropy_:function(e,t,n,s=0,r=rm.SUM_BY_NONZERO_WEIGHTS){let i=yo(e,"onehotLabels","softmaxCrossEntropy");const a=yo(t,"logits","softmaxCrossEntropy");let o=null;if(null!=n&&(o=yo(n,"weights","softmaxCrossEntropy")),Ht(i.shape,a.shape,"Error in softmaxCrossEntropy: "),s>0){const e=$l(s),t=$l(1),n=$l(i.shape[1]);i=Pl(Gl(i,rc(t,e)),Wl(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=Hl(((e,t,s)=>{const r=pd(t,[n],!0),i=rc(Bl(t,"float32"),r);s([e,i]);const a=cd(Gl(i,e));return{value:Ph(a,[n]),gradFunc:(e,t)=>{const[s,r]=t,i=Dh(e.shape,[n]);return[Gl(Fu(e,i),rc(Bl(s,"float32"),Uh(r))),Gl(Fu(e,i),rc(Uh(r),Bl(s,"float32")))]}}}));return s(e,t)}(i,a);return am(l,o,r)}});const mm={fft:Ip,ifft:Np,rfft:Rp,irfft:Op},gm={hammingWindow:Sf,hannWindow:Ef,frame:_f,stft:Tf},ym={flipLeftRight:Nf,grayscaleToRGB:Of,resizeNearestNeighbor:Yf,resizeBilinear:Zf,rgbToGrayscale:Df,rotateWithOffset:Rf,cropAndResize:If,nonMaxSuppression:Ff,nonMaxSuppressionAsync:jf,nonMaxSuppressionWithScore:Hf,nonMaxSuppressionWithScoreAsync:$f,nonMaxSuppressionPadded:Kf,nonMaxSuppressionPaddedAsync:Xf,threshold:Qf,transform:Jf},bm={bandPart:em,gramSchmidt:tm,qr:sm},wm={absoluteDifference:om,computeWeightedLoss:am,cosineDistance:lm,hingeLoss:cm,huberLoss:um,logLoss:hm,meanSquaredError:dm,sigmoidCrossEntropy:pm,softmaxCrossEntropy:fm},vm={sparseFillEmptyRows:vo({sparseFillEmptyRows_:function(e,t,n,s){const r=yo(e,"indices","sparseFillEmptyRows","int32"),i=yo(t,"values","sparseFillEmptyRows"),a=yo(n,"denseShape","sparseFillEmptyRows","int32"),o=yo(s,"defaultValue","sparseFillEmptyRows",i.dtype);if(2!==r.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==i.rank)throw new Error(`Values should be Tensor1D but received shape ${i.shape}`);if(1!==a.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(0!==o.rank)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);const l={indices:r,values:i,denseShape:a,defaultValue:o},c=oo.runKernel(pi,l);return{outputIndices:c[0],outputValues:c[1],emptyRowIndicator:c[2],reverseIndexMap:c[3]}}}),sparseReshape:vo({sparseReshape_:function(e,t,n){const s=yo(e,"inputIndices","sparseReshape","int32"),r=yo(t,"inputShape","sparseReshape","int32"),i=yo(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!==i.rank)throw new Error(`New shape should be Tensor1D but received shape ${i.shape}`);const a={inputIndices:s,inputShape:r,newShape:i},o=oo.runKernel(fi,a);return{outputIndices:o[0],outputShape:o[1]}}}),sparseSegmentMean:vo({sparseSegmentMean_:function(e,t,n){const s=yo(e,"data","sparseSegmentMean"),r=yo(t,"indices","sparseSegmentMean","int32"),i=yo(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!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${i.shape}`);const a={data:s,indices:r,segmentIds:i};return oo.runKernel(mi,a)}}),sparseSegmentSum:vo({sparseSegmentSum_:function(e,t,n){const s=yo(e,"data","sparseSegmentSum"),r=yo(t,"indices","sparseSegmentSum","int32"),i=yo(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!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${i.shape}`);const a={data:s,indices:r,segmentIds:i};return oo.runKernel(gi,a)}})},Am={stringNGrams:vo({stringNGrams_:function(e,t,n,s,r,i,a,o){const l=yo(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 c=yo(t,"dataSplits","stringNGrams");if("int32"!==c.dtype)throw new Error("Data splits must be of datatype int32");const u={separator:n,nGramWidths:s,leftPad:r,rightPad:i,padWidth:a,preserveShortSequences:o},h={data:l,dataSplits:c},d=oo.runKernel(xi,h,u);return{nGrams:d[0],nGramsSplits:d[1]}}}),stringSplit:vo({stringSplit_:function(e,t,n=!0){const s=yo(e,"input","stringSplit","string"),r=yo(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 i={skipEmpty:n},a={input:s,delimiter:r},o=oo.runKernel(Ci,a,i);return{indices:o[0],values:o[1],shape:o[2]}}}),stringToHashBucketFast:vo({stringToHashBucketFast_:function(e,t){const n=yo(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 oo.runKernel(ki,r,s)}}),staticRegexReplace:vo({staticRegexReplace_:function(e,t,n,s=!0){const r=yo(e,"input","staticRegexReplace","string"),i={pattern:t,rewrite:n,replaceGlobal:s};return oo.runKernel(vi,{x:r},i)}})};const xm=class{static sgd(e){return new dc(e)}static momentum(e,t,n=!1){return new pc(e,t,n)}static rmsprop(e,t=.9,n=0,s=null,r=!1){return new fc(e,t,n,s,r)}static adam(e=.001,t=.9,n=.999,s=null){return new ic(e,t,n,s)}static adadelta(e=.001,t=.95,n=null){return new ec(e,t,n)}static adamax(e=.002,t=.9,n=.999,s=null,r=0){return new hc(e,t,n,s,r)}static adagrad(e,t=.1){return new nc(e,t)}},Cm="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function km(){return new Promise((e=>Cm((()=>e()))))}function Sm(e,t){const n=e[0].length;e.forEach(((e,t)=>{jt(e.length===n,(()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`))})),jt(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 i=0;i`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 Em(e,t){const n=e[0].slice();for(let s=1;s=0)if(o>=0){if(o!==i)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${r+e}] = ${i} but shape[${r+e}] = ${o}`)}else s[a]=i}return s}function Nm(e){const t={FIRST_DIM_SIZE:_m.FIRST_DIM_SIZE,VALUE_ROWIDS:_m.VALUE_ROWIDS,ROW_LENGTHS:_m.ROW_LENGTHS,ROW_SPLITS:_m.ROW_SPLITS,ROW_LIMITS:_m.ROW_LIMITS,ROW_STARTS:_m.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]===_m.FIRST_DIM_SIZE?e.length-1:e.length}function Dm(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}`)}}(Tm=_m||(_m={}))[Tm.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",Tm[Tm.VALUE_ROWIDS=1]="VALUE_ROWIDS",Tm[Tm.ROW_LENGTHS=2]="ROW_LENGTHS",Tm[Tm.ROW_SPLITS=3]="ROW_SPLITS",Tm[Tm.ROW_LIMITS=4]="ROW_LIMITS",Tm[Tm.ROW_STARTS=5]="ROW_STARTS";const Rm=30;function Mm(e){return e<=Rm?e:dn(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===Kt(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const r=t.shape,i=r[r.length-1];let a=1;for(let e=0;ee/c)),1].slice(0,i);return[l,a,c,u]}const Gm=1.7580993408473768,Um=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,ag=",",og="...";function lg(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(ig,"").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);jt(-1===s.indexOf(og),(()=>`The ellipsis notation ("${og}") is not supported yet.`));const i=s.split(ag),a=i.length;if(t!==a)throw new Error(`Expected ${a} input tensors, received ${t}`);if(a>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 ug(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{jt(t.reduce(((e,t)=>(-1===t&&(e+=1),e)),0)<=1,(()=>"There should be only one negative value in split array."));const r=t.indexOf(-1);if(-1!==r){const s=t.reduce(((e,t)=>t>0?e+t:e));t[r]=e.shape[n]-s}jt(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 Ag(e,t){return`Input to reshape is a SparseTensor with ${Kt(e)}\n dense values, but the requested shape requires a multiple of ${Kt(t)}. inputShape=${e} outputShape= ${t}`}function xg(e,t){return`Input to reshape is a tensor with ${Kt(e)} dense values, but the requested shape has ${Kt(t)}. inputShape=${e} outputShape=${t}`}function Cg(){return"segment ids must be >= 0"}function kg(){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<=Rm?(n=e,s=!0):n=dn(e,Math.floor(Math.sqrt(e)));!s;)n>t||n===e?s=!0:n=dn(e,n+1);return n}function Tg(e,t,n){const s=[],r=e.length;for(let i=0;ir))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${s}`);if(s<0&&(s+=r),s>i)throw new Error(`batchDims (${s}) must be less than rank(x) (\n ${i}).`);if(nya(e)))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function Og(e){return e.map((e=>ga(e)))}!function(){for(const e of mc)Ql(e)}();const Dg={kernelName:On,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,zp(Bl(n,"float32"),-1))}}},Rg={kernelName:Dn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=ql(Bl(n,"float32")),s=Ul(rc($l(1),t));return cd(Wl(e,s))}}}},Mg={kernelName:Rn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Ul(rc(ql(Bl(n,"float32")),1));return Wl(e,t)}}}},Fg={kernelName:Mn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{let t=e;const s=lc(n.shape,r);return s.length>0&&(t=Ph(t,s)),Fu(t,n.shape)},b:()=>{let t=e;const n=lc(s.shape,r);return n.length>0&&(t=Ph(t,n)),Fu(t,s.shape)}}}},Bg={kernelName:Fn,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach(((t,s)=>{n[s]=()=>e.clone()})),n}},zg={kernelName:Ln,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>jl(n)}}},Lg={kernelName:Pn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>jl(n)}}},Pg={kernelName:Vn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,Ul(rc($l(1),ql(Bl(n,"float32")))))}}},Vg={kernelName:Wn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Ul(Pl($l(1),ql(Bl(n,"float32"))));return Wl(e,t)}}}},Wg={kernelName:qn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{const t=Pl(ql(n),ql(s));let i=Gl(e,Wl(s,t));const a=lc(n.shape,r);return a.length>0&&(i=Ph(i,a)),Fu(i,n.shape)},b:()=>{const t=Pl(ql(n),ql(s));let i=cd(Gl(e,Wl(n,t)));const a=lc(s.shape,r);return a.length>0&&(i=Ph(i,a)),Fu(i,s.shape)}}}},Gg={kernelName:Gn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,Pl(ql(Bl(n,"float32")),1))}}},Ug={kernelName:Un,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,rc($l(1),ql(Bl(n,"float32"))))}}};const qg=vo({avgPool3dGrad_:function(e,t,n,s,r,i){const a=yo(e,"dy","avgPool3dGrad"),o=yo(t,"input","avgPool3dGrad");let l=a,c=o,u=!1;4===o.rank&&(u=!0,l=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]]),c=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),jt(5===l.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`)),jt(5===c.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${c.rank}.`)),Mu("avgPool3dGrad",r,i);const h={dy:l,input:c},d={filterSize:n,strides:s,pad:r,dimRoundingMode:i},p=oo.runKernel(Kn,h,d);return u?Fu(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),jg={kernelName:$n,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:i,pad:a,dimRoundingMode:o}=n;return{x:()=>qg(e,s,r,i,a,o)}}};const Hg=vo({avgPoolGrad_:function(e,t,n,s,r){const i=yo(e,"dy","avgPoolGrad"),a=yo(t,"input","avgPoolGrad");jt(a.rank===i.rank,(()=>`Rank of input (${a.rank}) does not match rank of dy (${i.rank})`));let o=a,l=i,c=!1;3===a.rank&&(c=!0,o=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2]]),l=Fu(i,[1,i.shape[0],i.shape[1],i.shape[2]])),jt(4===l.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),jt(4===o.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`));const u={dy:l,input:o},h={filterSize:n,strides:s,pad:r},d=oo.runKernel(Hn,u,h);return c?Fu(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),$g={kernelName:jn,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:i,pad:a}=n;return{x:()=>Hg(e,s,r,i,a)}}},Kg={kernelName:Xn,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[s,r]=t,{transposeA:i,transposeB:a}=n;return i||a?!i&&a?{a:()=>Pu(e,r,!1,!1),b:()=>Pu(e,s,!0,!1)}:i&&!a?{a:()=>Pu(r,e,!1,!0),b:()=>Pu(s,e,!1,!1)}:{a:()=>Pu(r,e,!0,!0),b:()=>Pu(e,s,!0,!0)}:{a:()=>Pu(e,r,!1,!0),b:()=>Pu(s,e,!0,!1)}}},Xg={kernelName:Zn,gradFunc:(e,t,n)=>{const{blockShape:s,crops:r}=n;return{x:()=>Ud(e,s,r)}}},Zg={kernelName:"BroadcastTo",gradFunc:(e,t,n)=>{const s=n,r=s.inputShape,i=s.shape,a=Array.from(i);for(let e=r.length-1;e>=0;e--)if(r[e]===i[e])a[e]=1;else if(1!==r[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${i}].`);const o=[];for(let e=0;e1&&o.push(e);return{x:()=>Ph(e,o,!0)}}},Yg={kernelName:es,gradFunc:e=>({x:()=>e.clone()})},Qg={kernelName:ts,gradFunc:e=>({x:()=>jl(e)})},Jg={kernelName:ns,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{clipValueMin:r,clipValueMax:i}=n;return{x:()=>xh(fd(Yh(s,r),rd(s,i)),e,jl(e))}}},ey={kernelName:rs,inputsToSave:["x"],gradFunc:Dg.gradFunc},ty={kernelName:is,saveAllInputs:!0,gradFunc:(e,t,n)=>{const s=t.map((e=>e.shape)),{axis:r}=n,i=tn(r,t[0].shape)[0],a=s.map((e=>e[i]));return Dp(e,a,i).map((e=>()=>e))}},ny={kernelName:as,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{dilations:i,strides:a,pad:o,dataFormat:l}=n;return jt(Nu(i),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`)),{x:()=>oh(s.shape,e,r,a,o,l),filter:()=>mf(s,e,r.shape,a,o,l)}}},sy={kernelName:ls,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{strides:i,pad:a,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>ih(e,r,i,a,o,1,l),filter:()=>mf(e,s,r.shape,i,a,o,l)}}};const ry=vo({conv3DBackpropFilter_:function(e,t,n,s,r){let i=e;4===e.rank&&(i=Fu(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let a=t;4===a.rank&&(a=Fu(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),jt(5===i.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${i.shape}.`)),jt(5===a.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${a.shape}.`)),jt(5===n.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`)),jt(i.shape[4]===n[3],(()=>`Error in conv3dDerFilter: depth of input ${i.shape[4]}) must match input depth in filter (${n[3]}.`)),jt(a.shape[4]===n[4],(()=>`Error in conv3dDerFilter: depth of dy (${a.shape[4]}) must match output depth for filter (${n[4]}).`));const o={x:i,dy:a},l={strides:s,pad:r,filterShape:n};return oo.runKernel(us,o,l)}}),iy={kernelName:cs,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:i}=n;jt(Nu(s),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`));const[a,o]=t;return{x:()=>uh(a.shape,e,o,r,i),filter:()=>ry(a,e,o.shape,r,i)}}},ay={kernelName:ds,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(cd(xp(Bl(n,"float32"))),e)}}},oy={kernelName:ps,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(Cp(Bl(n,"float32")),e)}}},ly={kernelName:ms,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r,exclusive:i,reverse:a}=n;return{x:()=>{const t=Mh([r],s.rank);let n=mh(e,r,i,!a);return null!=t&&(n=af(n,t)),n}}}},cy={kernelName:ws,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:i,dimRoundingMode:a}=n,o=null==s?[1,1]:s;jt(Nu(o),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`));const[l,c]=t;return jt(4===l.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`)),jt(4===c.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${c.rank}.`)),jt(l.shape[3]===c.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`)),jt(Ou(r,o),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${o}'.`)),Mu("depthwiseConv2d",i,a),{x:()=>xf(l.shape,e,c,r,i,o,a),filter:()=>Af(l,e,c.shape,r,i,o,a)}}},uy={kernelName:Cs,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,i={x:s,filter:r,dy:e},a={x:s,filter:r,dy:e};return{x:()=>oo.runKernel(ks,i,n),filter:()=>oo.runKernel(Ss,a,n)}}},hy={kernelName:Is,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,s={dy:e,y:n};return{x:()=>oo.runKernel(Ns,s)}}},dy={kernelName:Os,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Gl(Uh(cd(ql(n))),2/Math.sqrt(Math.PI));return{x:()=>Gl(e,s)}}},py={kernelName:Rs,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,n)}}},fy={kernelName:Ms,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>Fu(e,n.shape)}}},my={kernelName:Fs,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,Uh(n))}}},gy={kernelName:Ps,gradFunc:e=>({x:()=>jl(e)})},yy={kernelName:Vs,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{const t=Wl(e,Bl(s,"float32")),i=lc(n.shape,r);return i.length>0?Fu(Ph(t,i),n.shape):t},b:()=>{let t=Gl(e,Bl(n,"float32"));const i=lc(s.shape,r);i.length>0&&(t=Fu(Ph(t,i),s.shape));const a=ql(s);return cd(Wl(t,Bl(a,"float32")))}}}},by={kernelName:Ws,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:s}=n,[r,i,a,o]=t,l=null==o?$l(1):o,c=lc(i.shape,r.shape),u=[];if(1===i.rank){for(let e=0;e1===i.rank?Fu(Gl(Gl(e,Hh(Fu(p,[1,1,1,i.shape[0]]),u)),l),r.shape):Fu(Gl(Gl(e,p),l),r.shape),mean:()=>{let e=Gl(Gl(p,$l(-1)),d);return 1===i.rank&&(e=Ph(e,c)),Fu(e,i.shape)},variance:()=>{let e=Gl(Gl(f,h),d);return 1===i.rank&&(e=Ph(e,c)),Fu(e,i.shape)},scale:()=>{const t=Gl(h,p);let n=Gl(e,t);return 1===i.rank&&(n=Ph(n,c)),Fu(n,i.shape)},offset:()=>{let t=e;return 1===i.rank&&(t=Ph(t,c)),Fu(t,i.shape)}}}},wy={kernelName:Gs,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{const[s,r]=t,{axis:i,batchDims:a}=n,o=tn(i,s.shape)[0],l=(e,t,n)=>()=>{const s=e.shape,r=t.size,a=s.slice(0,o),l=a.length,c=s.slice(i,s.length).slice(1),u=c.length,h=vy(0,l),d=vy(l+1,l+1+u),p=Ay([a,[r],c]),f=Fu(n,p),m=Fu(t,[r]),g=Ay([[l],h,d]),y=af(f,g);let b=Qp(y,m,e.shape[o]);const w=Fh(g);return b=af(b,w),b};if(1===a){const t=s.shape[0],n=s.split(t,0);return{x:()=>{const t=Bp(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:()=>jl(n),b:()=>jl(s)}}},Cy={kernelName:Hs,gradFunc:e=>({x:()=>Bl(e,"float32")})},ky={kernelName:Xs,gradFunc:e=>({x:()=>jl(e)})},Sy={kernelName:Zs,gradFunc:e=>({x:()=>jl(e)})},Ey={kernelName:Ys,gradFunc:e=>({x:()=>jl(e)})},_y={kernelName:Qs,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{alpha:r}=n,i=Zh(s,0);return{x:()=>xh(i,e,Gl(e,r))}}},Ty={kernelName:sr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,Pl(n,1))}}},Iy={kernelName:nr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,Bl(n,"float32"))}}},Ny={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;return{logits:()=>{const t=Uh(s);return rc(e,Gl(Ph(e,r,!0),t))}}}};const Oy=vo({localResponseNormalizationBackprop_:function(e,t,n,s=5,r=1,i=1,a=.5){const o={x:e,y:t,dy:n},l={depthRadius:s,bias:r,alpha:i,beta:a};return oo.runKernel(lr,o,l)}}),Dy={kernelName:or,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{depthRadius:i,bias:a,alpha:o,beta:l}=n;return{x:()=>Oy(s,r,e,i,a,o,l)}}};function Ry(e,t,n,s){return t.rankGl(e,Bl(Ah(n,t),e.dtype))}}const My={kernelName:cr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{reductionIndices:r}=s,i=t[0],a=Ry(e,t[1],i,tn(r,i.shape));return{x:()=>a.x()}}},Fy={kernelName:ur,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Gl(e,Bl(Yh(n,s),"float32")),b:()=>Gl(e,Bl(sd(n,s),"float32"))}}};const By=vo({maxPool3dGrad_:function(e,t,n,s,r,i,a){const o=yo(e,"dy","maxPool3dGrad"),l=yo(t,"input","maxPool3dGrad"),c=yo(n,"output","maxPool3dGrad");let u=o,h=l,d=c,p=!1;4===l.rank&&(p=!0,u=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),h=Fu(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=Fu(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]])),jt(5===u.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${u.rank}.`)),jt(5===h.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${h.rank}.`)),jt(5===d.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${d.rank}.`)),Mu("maxPool3dGrad",i,a);const f={dy:u,input:h,output:d},m={filterSize:s,strides:r,pad:i,dimRoundingMode:a},g=oo.runKernel(fr,f,m);return p?Fu(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),zy={kernelName:pr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=n;return{x:()=>By(e,s,r,i,a,o,l)}}};const Ly=vo({maxPoolGrad_:function(e,t,n,s,r,i,a){const o=yo(e,"dy","maxPoolGrad"),l=yo(t,"input","maxPoolGrad"),c=yo(n,"output","maxPoolGrad");jt(l.rank===o.rank,(()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`)),jt(4===o.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`)),jt(4===l.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`)),Mu("maxPoolGrad",i,a);const u={dy:o,input:l,output:c},h={filterSize:s,strides:r,pad:i,dimRoundingMode:a};return oo.runKernel(dr,u,h)}}),Py={kernelName:Nr,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:s}=n;return Jp(e,s).map((e=>()=>e))}},Vy={kernelName:Or,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,i=r.map((e=>e[0]));return{x:()=>Wu(e,i,s.shape)}}};function Wy(e,t,n){const s=e.shape.length,r=s-n.length,i=Mh(n,s);let a=e;null!=i&&(a=af(e,i));const o=a.shape.slice(),l=o.splice(s-n.length,n.length).reduce(((e,t)=>e*t),1);o.push(l);let c=function(e,t,n){const s=e.shape.slice();s[n]=1;const r=Fu(t,s),i=fh(e,n,!0,!1),a=fh(e,n,!0,!0),o=Gl(i,a);return Gl(r,o)}(a.reshape(o),t,r);if(c=c.reshape(a.shape),null!=i){const e=Fh(i);c=af(c,e)}return c}const Gy={kernelName:ui,gradFunc:(e,t,n)=>{const{blockShape:s,paddings:r}=n;return{x:()=>qu(e,s,r)}}},Uy={kernelName:hi,gradFunc:(e,t,n)=>{const{axis:s}=n;return{x:()=>Lu(e,s)}}};const qy=[Dg,Rg,Mg,Fg,Bg,zg,Lg,Pg,Vg,Wg,Gg,Ug,jg,$g,Kg,Xg,Zg,Yg,Qg,Jg,ey,ty,sy,ny,iy,ay,oy,ly,cy,uy,{kernelName:_s,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{const t=Wl(e,Bl(s,"float32")),i=lc(n.shape,r);return i.length>0?Fu(Ph(t,i),n.shape):t},b:()=>{let t=Gl(e,Bl(n,"float32"));const i=lc(s.shape,r);i.length>0&&(t=Fu(Ph(t,i),s.shape));const a=ql(s);return cd(Wl(t,Bl(a,"float32")))}}}},hy,dy,py,fy,my,yy,gy,by,wy,xy,Cy,ky,Sy,Ey,_y,Ty,Iy,Ny,Dy,My,My,Fy,zy,{kernelName:hr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:i,strides:a,pad:o}=n;return{x:()=>Ly(e,s,r,i,a,o)}}},{kernelName:gr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n,i=tn(r,s.shape),a=Kt(Oh(s.shape,i)[1]);return{x:()=>{const t=s.shape.slice();i.forEach((e=>{t[e]=1}));const n=Fu(e,t);return Wl(Gl(n,Ed(s.shape,"float32")),a)}}}},{kernelName:yr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{axis:r}=s,[i,a]=t,o=Ry(e,a,i,tn(r,i.shape));return{x:()=>o.x()}}},{kernelName:br,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Gl(e,Bl(rd(n,s),"float32")),b:()=>Gl(e,Bl(Zh(n,s),"float32"))}}},{kernelName:wr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,i=r.map((e=>e[0]));return{x:()=>Wu(e,i,s.shape)}}},{kernelName:vr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{const t=lc(n.shape,r);return t.length>0?Fu(Ph(e,t),n.shape):e},b:()=>{const t=Gl(e,cd(Kh(Wl(n,s)))),i=lc(s.shape,r);return i.length>0?Fu(Ph(t,i),s.shape):t}}}},{kernelName:xr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{const t=Gl(e,Bl(s,"float32")),i=lc(n.shape,r);return i.length>0?Fu(Ph(t,i),n.shape):t},b:()=>{const t=Gl(e,Bl(n,"float32")),i=lc(s.shape,r);return i.length>0?Fu(Ph(t,i),s.shape):t}}}},{kernelName:Cr,gradFunc:e=>({x:()=>cd(e)})},{kernelName:Ir,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>Sd(n.shape,"float32")}}},{kernelName:Tr,gradFunc:e=>({x:()=>jl(e)})},Py,Vy,Vy,{kernelName:Dr,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,s,r]=t,i=n,a=s,o=cc(i.shape,a.shape);return{a:()=>{const t=Bl(a,"float32");let n=Gl(e,Gl(t,sc(i,rc(t,$l(1)))));const s=lc(i.shape,o);return s.length>0&&(n=Ph(n,s)),Fu(n,i.shape)},b:()=>{const t=Zh(i,0),n=xh(t,od(i),jl(i));let s=Gl(e,Gl(r,n));const l=lc(a.shape,o);return l.length>0&&(s=Ph(s,l)),Fu(s,a.shape)}}}},{kernelName:Rr,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,s]=t,r=Zh(n,0);return{x:()=>xh(r,e,Gl(e,s)),alpha:()=>{let t=xh(r,jl(e),Gl(e,n));const i=lc(s.shape,e.shape);return i.length>0&&(t=Ph(t,i)),Fu(t,s.shape)}}}},{kernelName:Mr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;let i=[];return i=null==r?s.shape.map(((e,t)=>t)):"number"==typeof r?[r]:r,{x:()=>Wy(s,e,i)}}},{kernelName:Vr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,cd(ql(n)))}}},{kernelName:$r,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Gl(rd(n,6),zp(n));return{x:()=>Gl(e,Bl(s,"float32"))}}},{kernelName:Wr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,Bl(zp(n),"float32"))}}},{kernelName:Gr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fu(e,n.shape)}}},{kernelName:jr,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>oo.runKernel(Hr,r,n)}}},{kernelName:Ur,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>oo.runKernel(qr,r,n)}}},{kernelName:Kr,gradFunc:(e,t,n)=>{const{dims:s}=n,r=tn(s,e.shape);return{x:()=>hp(e,r)}}},{kernelName:Xr,gradFunc:e=>({x:()=>jl(e)})},{kernelName:Zr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>cd(Wl(e,Gl(sc(n,1.5),2)))}}},{kernelName:ei,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>Bl(jl(n),"float32"),t:()=>Gl(e,Bl(n,e.dtype)),e:()=>Gl(e,Bl(md(n),e.dtype))}}},{kernelName:ti,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Zh(n,$l(0)),s=$l(Gm),r=$l(Um),i=Gl(e,r),a=Gl(Gl(e,s),Uh(Bl(n,"float32")));return xh(t,i,a)}}}},{kernelName:ai,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,Gl(n,rc($l(1),n)))}}},{kernelName:ii,gradFunc:e=>({x:()=>jl(e)})},{kernelName:si,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(dh(Bl(n,"float32")),e)}}},{kernelName:ri,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(ph(Bl(n,"float32")),e)}}},{kernelName:ni,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{begin:r,size:i}=n,a=s.shape,[o,l]=iu(s,r,i),c=[];for(let t=0;tLd(e,c)}}},{kernelName:di,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{dim:r}=n,i=Gl(e,s);return{logits:()=>rc(i,Gl(Ph(i,[r],true),s))}}},{kernelName:oi,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,Vu(n))}}},Gy,Gy,Uy,Uy,{kernelName:li,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,Gl(Ul(Bl(n,"float32")),2))}}},{kernelName:bi,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=$l(2);return{a:()=>Gl(e,Gl(r,rc(n,s))),b:()=>Gl(e,Gl(r,rc(s,n)))}}},{kernelName:wi,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,Gl(Bl(n,"float32"),2))}}},{kernelName:Bi,gradFunc:e=>({x:()=>jl(e)})},{kernelName:Si,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{let t=e;const s=lc(n.shape,r);return s.length>0&&(t=Ph(t,s)),Fu(t,n.shape)},b:()=>{let t=e;const n=lc(s.shape,r);return n.length>0&&(t=Ph(t,n)),Fu(cd(t),s.shape)}}}},{kernelName:ci,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,r=s.shape.slice(),{axis:i}=n;tn(i,s.shape).forEach((e=>{r[e]=1}));const a=Fu(e,r),o=Gl(a,Ed(s.shape,"float32"));return{x:()=>o}}},{kernelName:Ei,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,ql(dh(n)))}}},{kernelName:_i,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(rc($l(1),ql(n)),e)}}},{kernelName:Ti,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{reps:r}=n;return{x:()=>{let t=jl(s);if(1===s.rank)for(let n=0;n{const s=n,{perm:r}=s,i=Fh(r);return{x:()=>af(e,i)}}},{kernelName:Ri,gradFunc:(e,t,n)=>{const s=n,{axis:r}=s;return{value:()=>Bp(e,r)}}},{kernelName:Mi,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>function(e,t){const n=uc(t,jl(t)),s=Xh(e,n);let r=Yh(t,$l(0,"int32"));const i=s.rank-r.rank;for(let e=0;e({x:()=>jl(e)})}];for(const e of qy)Zi(e);Ba().prototype.abs=function(){return this.throwIfDisposed(),ac(this)},Ba().prototype.acos=function(){return this.throwIfDisposed(),lu(this)},Ba().prototype.acosh=function(){return this.throwIfDisposed(),cu(this)},Ba().prototype.add=function(e){return this.throwIfDisposed(),Pl(this,e)},Ba().prototype.all=function(e,t){return this.throwIfDisposed(),hu(this,e,t)},Ba().prototype.any=function(e,t){return this.throwIfDisposed(),du(this,e,t)},Ba().prototype.argMax=function(e){return this.throwIfDisposed(),pu(this,e)},Ba().prototype.argMin=function(e){return this.throwIfDisposed(),fu(this,e)},Ba().prototype.asScalar=function(){return this.throwIfDisposed(),jt(1===this.size,(()=>"The array must have only 1 element.")),Fu(this,[])},Ba().prototype.asType=function(e){return this.throwIfDisposed(),Bl(this,e)},Ba().prototype.as1D=function(){return this.throwIfDisposed(),Fu(this,[this.size])},Ba().prototype.as2D=function(e,t){return this.throwIfDisposed(),Fu(this,[e,t])},Ba().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),Fu(this,[e,t,n])},Ba().prototype.as4D=function(e,t,n,s){return this.throwIfDisposed(),Fu(this,[e,t,n,s])},Ba().prototype.as5D=function(e,t,n,s,r){return this.throwIfDisposed(),Fu(this,[e,t,n,s,r])},Ba().prototype.asin=function(){return this.throwIfDisposed(),mu(this)},Ba().prototype.asinh=function(){return this.throwIfDisposed(),gu(this)},Ba().prototype.atan=function(){return this.throwIfDisposed(),yu(this)},Ba().prototype.atan2=function(e){return this.throwIfDisposed(),bu(this,e)},Ba().prototype.atanh=function(){return this.throwIfDisposed(),wu(this)},Ba().prototype.avgPool=function(e,t,n,s){return this.throwIfDisposed(),Bu(this,e,t,n,s)},Ba().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),qu(this,e,t)},Ba().prototype.batchNorm=function(e,t,n,s,r){return this.throwIfDisposed(),ju(this,e,t,n,s,r)},Ba().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Qu(this,e)},Ba().prototype.cast=function(e){return this.throwIfDisposed(),Bl(this,e)},Ba().prototype.ceil=function(){return this.throwIfDisposed(),Ju(this)},Ba().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),eh(this,e,t)},Ba().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Fa&&(e=[e]),Lu([this,...e],t)},Ba().prototype.conv1d=function(e,t,n,s,r,i){return this.throwIfDisposed(),ah(this,e,t,n,s,r,i)},Ba().prototype.conv2dTranspose=function(e,t,n,s,r){return this.throwIfDisposed(),lh(this,e,t,n,s,r)},Ba().prototype.conv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),ih(this,e,t,n,s,r,i)},Ba().prototype.cos=function(){return this.throwIfDisposed(),dh(this)},Ba().prototype.cosh=function(){return this.throwIfDisposed(),ph(this)},Ba().prototype.cumprod=function(e,t,n){return this.throwIfDisposed(),fh(this,e,t,n)},Ba().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),mh(this,e,t,n)},Ba().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),yh(this,e,t)},Ba().prototype.depthwiseConv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),bh(this,e,t,n,s,r,i)},Ba().prototype.dilation2d=function(e,t,n,s,r){return this.throwIfDisposed(),vh(this,e,t,n,s,r)},Ba().prototype.divNoNan=function(e){return this.throwIfDisposed(),Ch(this,e)},Ba().prototype.div=function(e){return this.throwIfDisposed(),Wl(this,e)},Ba().prototype.dot=function(e){return this.throwIfDisposed(),kh(this,e)},Ba().prototype.elu=function(){return this.throwIfDisposed(),Eh(this)},Ba().prototype.equal=function(e){return this.throwIfDisposed(),Ah(this,e)},Ba().prototype.erf=function(){return this.throwIfDisposed(),Th(this)},Ba().prototype.euclideanNorm=function(e,t){return this.throwIfDisposed(),Gh(this,e,t)},Ba().prototype.exp=function(){return this.throwIfDisposed(),Uh(this)},Ba().prototype.expandDims=function(e){return this.throwIfDisposed(),qh(this,e)},Ba().prototype.expm1=function(){return this.throwIfDisposed(),jh(this)},Ba().prototype.fft=function(){return this.throwIfDisposed(),Ip(this)},Ba().prototype.flatten=function(){return this.throwIfDisposed(),Fu(this,[this.size])},Ba().prototype.floor=function(){return this.throwIfDisposed(),Kh(this)},Ba().prototype.floorDiv=function(e){return this.throwIfDisposed(),Vl(this,e)},Ba().prototype.gather=function(e,t,n){return this.throwIfDisposed(),Xh(this,e,t,n)},Ba().prototype.greaterEqual=function(e){return this.throwIfDisposed(),Yh(this,e)},Ba().prototype.greater=function(e){return this.throwIfDisposed(),Zh(this,e)},Ba().prototype.ifft=function(){return this.throwIfDisposed(),Np(this)},Ba().prototype.irfft=function(){return this.throwIfDisposed(),Op(this)},Ba().prototype.isFinite=function(){return this.throwIfDisposed(),Jh(this)},Ba().prototype.isInf=function(){return this.throwIfDisposed(),ed(this)},Ba().prototype.isNaN=function(){return this.throwIfDisposed(),td(this)},Ba().prototype.leakyRelu=function(e){return this.throwIfDisposed(),nd(this,e)},Ba().prototype.lessEqual=function(e){return this.throwIfDisposed(),rd(this,e)},Ba().prototype.less=function(e){return this.throwIfDisposed(),sd(this,e)},Ba().prototype.localResponseNormalization=function(e,t,n,s){return this.throwIfDisposed(),ad(this,e,t,n,s)},Ba().prototype.logSigmoid=function(){return this.throwIfDisposed(),hd(this)},Ba().prototype.logSoftmax=function(e){return this.throwIfDisposed(),dd(this,e)},Ba().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),pd(this,e,t)},Ba().prototype.log=function(){return this.throwIfDisposed(),od(this)},Ba().prototype.log1p=function(){return this.throwIfDisposed(),ld(this)},Ba().prototype.logicalAnd=function(e){return this.throwIfDisposed(),fd(this,e)},Ba().prototype.logicalNot=function(){return this.throwIfDisposed(),md(this)},Ba().prototype.logicalOr=function(e){return this.throwIfDisposed(),gd(this,e)},Ba().prototype.logicalXor=function(e){return this.throwIfDisposed(),yd(this,e)},Ba().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),Pu(this,e,t,n)},Ba().prototype.maxPool=function(e,t,n,s){return this.throwIfDisposed(),Ad(this,e,t,n,s)},Ba().prototype.max=function(e,t){return this.throwIfDisposed(),zh(this,e,t)},Ba().prototype.maximum=function(e){return this.throwIfDisposed(),uc(this,e)},Ba().prototype.mean=function(e,t){return this.throwIfDisposed(),kd(this,e,t)},Ba().prototype.min=function(e,t){return this.throwIfDisposed(),Lh(this,e,t)},Ba().prototype.minimum=function(e){return this.throwIfDisposed(),Td(this,e)},Ba().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),Id(this,e,t)},Ba().prototype.mod=function(e){return this.throwIfDisposed(),Nd(this,e)},Ba().prototype.mul=function(e){return this.throwIfDisposed(),Gl(this,e)},Ba().prototype.neg=function(){return this.throwIfDisposed(),cd(this)},Ba().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Wh(this,e,t,n)},Ba().prototype.notEqual=function(e){return this.throwIfDisposed(),Md(this,e)},Ba().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),Fd(this,e,t,n)},Ba().prototype.onesLike=function(){return this.throwIfDisposed(),Bd(this)},Ba().prototype.pad=function(e,t){return this.throwIfDisposed(),Ld(this,e,t)},Ba().prototype.pool=function(e,t,n,s,r,i){return this.throwIfDisposed(),qd(this,e,t,n,s,r,i)},Ba().prototype.pow=function(e){return this.throwIfDisposed(),sc(this,e)},Ba().prototype.prelu=function(e){return this.throwIfDisposed(),jd(this,e)},Ba().prototype.prod=function(e,t){return this.throwIfDisposed(),Hd(this,e,t)},Ba().prototype.reciprocal=function(){return this.throwIfDisposed(),lp(this)},Ba().prototype.relu=function(){return this.throwIfDisposed(),cp(this)},Ba().prototype.relu6=function(){return this.throwIfDisposed(),up(this)},Ba().prototype.reshapeAs=function(e){return this.throwIfDisposed(),Fu(this,e.shape)},Ba().prototype.reshape=function(e){return this.throwIfDisposed(),Fu(this,e)},Ba().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),Zf(this,e,t,n)},Ba().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),Yf(this,e,t,n)},Ba().prototype.reverse=function(e){return this.throwIfDisposed(),hp(this,e)},Ba().prototype.rfft=function(){return this.throwIfDisposed(),Rp(this)},Ba().prototype.round=function(){return this.throwIfDisposed(),gp(this)},Ba().prototype.rsqrt=function(){return this.throwIfDisposed(),yp(this)},Ba().prototype.selu=function(){return this.throwIfDisposed(),bp(this)},Ba().prototype.separableConv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),wp(this,e,t,n,s,r,i)},Ba().prototype.sigmoid=function(){return this.throwIfDisposed(),Vu(this)},Ba().prototype.sign=function(){return this.throwIfDisposed(),Ap(this)},Ba().prototype.sin=function(){return this.throwIfDisposed(),xp(this)},Ba().prototype.sinh=function(){return this.throwIfDisposed(),Cp(this)},Ba().prototype.slice=function(e,t){return this.throwIfDisposed(),Wu(this,e,t)},Ba().prototype.softmax=function(e){return this.throwIfDisposed(),Tp(this,e)},Ba().prototype.softplus=function(){return this.throwIfDisposed(),ud(this)},Ba().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Ud(this,e,t)},Ba().prototype.split=function(e,t){return this.throwIfDisposed(),Dp(this,e,t)},Ba().prototype.sqrt=function(){return this.throwIfDisposed(),Ul(this)},Ba().prototype.square=function(){return this.throwIfDisposed(),ql(this)},Ba().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Mp(this,e)},Ba().prototype.squeeze=function(e){return this.throwIfDisposed(),Fp(this,e)},Ba().prototype.stack=function(e,t){this.throwIfDisposed();const n=e instanceof Fa?[this,e]:[this,...e];return Bp(n,t)},Ba().prototype.step=function(e){return this.throwIfDisposed(),zp(this,e)},Ba().prototype.stridedSlice=function(e,t,n,s,r,i,a,o){return this.throwIfDisposed(),Lp(this,e,t,n,s,r,i,a,o)},Ba().prototype.sub=function(e){return this.throwIfDisposed(),rc(this,e)},Ba().prototype.sum=function(e,t){return this.throwIfDisposed(),Ph(this,e,t)},Ba().prototype.tan=function(){return this.throwIfDisposed(),Pp(this)},Ba().prototype.tanh=function(){return this.throwIfDisposed(),Gu(this)},Ba().prototype.tile=function(e){return this.throwIfDisposed(),Hh(this,e)},Ba().prototype.toBool=function(){return this.throwIfDisposed(),Bl(this,"bool")},Ba().prototype.toFloat=function(){return this.throwIfDisposed(),Bl(this,"float32")},Ba().prototype.toInt=function(){return this.throwIfDisposed(),Bl(this,"int32")},Ba().prototype.topk=function(e,t){return this.throwIfDisposed(),Xp(this,e,t)},Ba().prototype.transpose=function(e){return this.throwIfDisposed(),af(this,e)},Ba().prototype.unique=function(e){return this.throwIfDisposed(),Yp(this,e)},Ba().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),Qp(this,e,t)},Ba().prototype.unstack=function(e){return this.throwIfDisposed(),Jp(this,e)},Ba().prototype.where=function(e,t){return this.throwIfDisposed(),xh(e,this,t)},Ba().prototype.zerosLike=function(){return this.throwIfDisposed(),jl(this)};class jy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,jy.prototype)}}class Hy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Hy.prototype)}}class $y extends Error{constructor(e){super(e),Object.setPrototypeOf(this,$y.prototype)}}class Ky extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Ky.prototype)}}class Xy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Xy.prototype)}}Error;class Zy{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 rb={};function ib(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function ab(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach((e=>ab(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?ab(t):e[n]=t.value)}}}function ob(e,t={},n={},s="object",r=!1){if("string"==typeof e){const r=e;let i;if(r in n)i=n[r];else if(r in rb)i=rb[r];else if(i=t[r],null==i)throw new $y(`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 i}{const i=e;if(null==i.className||null==i.config)throw new $y(`${s}: Improper config format: ${JSON.stringify(i)}.\n'className' and 'config' must set.`);const a=i.className;let o,l;if(a in n?[o,l]=n[a]:a in rb?[o,l]=rb.className:a in t&&([o,l]=t[a]),null==o)throw new $y(`Unknown ${s}: ${a}. 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(rb))e[t]=rb[t];for(const t of Object.keys(n))e[t]=n[t];i.config.customObjects=e;const t=Object.assign({},rb);for(const e of Object.keys(n))rb[e]=n[e];ab(i.config);const s=l(o,i.config,n,r);return rb=Object.assign({},t),s}{const e=Object.assign({},rb);for(const e of Object.keys(n))rb[e]=n[e];const t=new o(i.config);return rb=Object.assign({},e),t}}}function lb(e,t){return-1*function(e,t){return et?1:0}(e,t)}function cb(e){if(null==e)return e;const t=[];for(const n of e)-1===t.indexOf(n)&&t.push(n);return t}function ub(e){if(null==e)throw new $y(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function hb(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new $y(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function db(e,t,n=0,s=1/0){return Qy(n>=0),Qy(s>=n),Array.isArray(e)&&e.length>=n&&e.length<=s&&e.every((e=>typeof e===t))}function pb(e,t){Array.isArray(e)?(jt(e.length>0,(()=>`${t} is unexpectedly an empty array.`)),e.forEach(((e,n)=>pb(e,`element ${n+1} of ${t}`)))):jt(Number.isInteger(e)&&e>0,(()=>`Expected ${t} to be a positive integer, but got ${fb(e)}.`))}function fb(e){return null===e?"null":Array.isArray(e)?"["+e.map((e=>fb(e))).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function mb(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}let gb=0;function yb(){return gb++}const bb={};function wb(e=""){return e in bb||(bb[e]=0),bb[e]+=1,e+bb[e].toString()}const vb=["channelsFirst","channelsLast"],Ab=["nearest","bilinear"],xb=["valid","same","causal"],Cb=["max","avg"],kb=["sum","mul","concat","ave"],Sb=new Map;function Eb(e){hb(vb,"DataFormat",e)}function _b(e){hb(xb,"PaddingMode",e)}function Tb(e){hb(Cb,"PoolMode",e)}const Ib=[],Nb="/";function Ob(e,t){Ib.push(e);try{const e=t();return Ib.pop(),e}catch(e){throw Ib.pop(),e}}function Db(e){if(!Fb(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===Ib.length?"":Ib.join(Nb)+Nb)+e}function Rb(e){if(!Fb(e))throw new Error("Not a valid tensor name: '"+e+"'");Sb.has(e)||Sb.set(e,0);const t=Sb.get(e);if(Sb.set(e,Sb.get(e)+1),t>0){const n=`${e}_${t}`;return Sb.set(n,1),n}return e}const Mb=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Fb(e){return!!e.match(Mb)}function Bb(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 Pb(e,t){if(t{switch(e.rank){case 1:return kp(e,t,n);case 2:return Sp(e,[t,0],[n,e.shape[1]]);case 3:return Ep(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return _p(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Wu(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Wu(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 $y(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function jb(e,t,n){return To((()=>{switch(e.rank){case 1:return kp(e,t,n);case 2:return Sp(e,[0,t],[e.shape[0],n]);case 3:return Ep(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return _p(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new $y(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Hb(e,t,n,s){return To((()=>{switch(e.rank){case 1:return kp(e,t,n);case 2:switch(s){case 1:return qb(e,t,n);case 2:return jb(e,t,n);default:throw new $y(`The axis is not within the rank of the tensor ${s}`)}case 3:switch(s){case 1:return qb(e,t,n);case 2:return Ep(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return jb(e,t,n);default:throw new $y(`The axis is not within the rank of the tensor ${s}`)}case 4:switch(s){case 1:return qb(e,t,n);case 2:return _p(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return _p(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return jb(e,t,n);default:throw new $y(`The axis is not within the rank of the tensor ${s}`)}default:throw new $y(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function $b(e,t=-1){let n;return t<0&&(n=e[0].rank,t=0!==n?n:0),t===e[0].rank&&(t=-1),Lu(e,t)}function Kb(e,t){switch(e.rank){case 1:return th([e,t]);case 2:return nh([e,t],0);case 3:return sh([e,t],0);case 4:return rh([e,t],0);default:throw new $y(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function Xb(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new $y(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return Hh(e,t)}function Zb(e,t=0,n=1,s,r){return np(e,t,n,s,r)}function Yb(e,t,n,s){if(e.rank<2||t.rank<2)throw new Ky(`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 Ky(`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 kf({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?ew(e.rank,s,"channelsLast"):null,activation:n})}{const r=e.shape.slice(),i=r.pop();e=Fu(e,[-1,i]);const a=t.shape.slice(),o=a.pop(),l=a.pop(),c=[...a,o],u=Array.from({length:t.rank},((e,n)=>0===n?t.rank-2:n<=t.rank-2?n-1:n));t=Fu(af(t,u),[l,-1]);const h=[...r,...c];return Fu(kf({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?ew(e.rank,s,"channelsLast"):null,activation:n}),h)}}function Qb(e,t,n){return To((()=>(t=Array.isArray(t)?Vp(t,"int32"):Bl(t,"int32"),Xh(e,t,n))))}function Jb(e){return Gl(e,e)}function ew(e,t,n){const s=t.shape;if(1!==t.rank&&t.rank!==e)throw new $y(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===n)return 1===s.length?Fu(t,[1,s[0],1,1,1]):Fu(t,[1,s[3],s[0],s[1],s[2]]);if("channelsLast"===n)return 1===s.length?Fu(t,[1,1,1,1,s[0]]):Fu(t,[1].concat(s))}else if(4===e){if("channelsFirst"===n)return 1===s.length?Fu(t,[1,s[0],1,1]):Fu(t,[1,s[2],s[0],s[1]]);if("channelsLast"===n)return 1===s.length?Fu(t,[1,1,1,s[0]]):Fu(t,[1].concat(s))}else if(3===e){if("channelsFirst"===n)return 1===s.length?Fu(t,[1,s[0],1]):Fu(t,[1,s[1],s[0]]);if("channelsLast"===n)return 1===s.length?Fu(t,[1,1,s[0]]):Fu(t,[1].concat(s))}else if(e<3)return t;throw new $y(`Unsupported input rank by biasAdd: ${t.rank}`)}function tw(e,t,n){return To((()=>(null==n&&(n="channelsLast"),Eb(n),Pl(e,ew(e.rank,t,n)))))}function nw(e,t,n,s){return To((()=>hf(e,t,n,s)))}function sw(e,t,n=!1){return n?e():t()}const rw=["fanIn","fanOut","fanAvg"],iw=["normal","uniform","truncatedNormal"];class aw extends Zl{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class ow extends aw{apply(e,t){return Sd(e,t)}}ow.className="Zeros",Ql(ow);class lw extends aw{apply(e,t){return Ed(e,t)}}lw.className="Ones",Ql(lw);class cw extends aw{constructor(e){if(super(),"object"!=typeof e)throw new $y(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new $y(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return To((()=>Gl($l(this.value),Ed(e,t))))}getConfig(){return{value:this.value}}}cw.className="Constant",Ql(cw);class uw extends aw{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 rp(e,this.minval,this.maxval,t,this.seed)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}uw.className="RandomUniform",Ql(uw);class hw extends aw{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 Ky(`randomNormal does not support dType ${t}.`);return Zb(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}hw.className="RandomNormal",Ql(hw);class dw extends aw{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 Ky(`truncatedNormal does not support dType ${t}.`);return Zp(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}dw.className="TruncatedNormal",Ql(dw);class pw extends aw{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return To((()=>{if(2!==e.length||e[0]!==e[1])throw new $y("Identity matrix initializer can only be used for 2D square matrices.");return Gl(this.gain,$h(e[0]))}))}getConfig(){return{gain:this.gain}}}pw.className="Identity",Ql(pw);class fw extends aw{constructor(e){if(super(),e.scale<0)throw new $y(`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,hb(rw,"FanMode",t),this.distribution=null==e.distribution?"normal":e.distribution,function(e){hb(iw,"Distribution",e)}(this.distribution),this.seed=e.seed}apply(e,t){const n=function(e,t="channelsLast"){let n,s;if(Eb(t),2===e.length)n=e[0],s=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===t){const t=Bb(e,2);n=e[1]*t,s=e[0]*t}else if("channelsLast"===t){const t=Bb(e,0,e.length-2);n=e[e.length-2]*t,s=e[e.length-1]*t}}else{const t=Bb(e);n=Math.sqrt(t),s=Math.sqrt(t)}return[n,s]}(e),s=n[0],r=n[1];let i=this.scale;if("fanIn"===this.mode?i/=Math.max(1,s):"fanOut"===this.mode?i/=Math.max(1,r):i/=Math.max(1,(s+r)/2),"normal"===this.distribution){const n=Math.sqrt(i);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Ky(`${this.getClassName()} does not support dType ${t}.`);return Zp(e,0,n,t,this.seed)}{const n=Math.sqrt(3*i);return rp(e,-n,n,t,this.seed)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}fw.className="VarianceScaling",Ql(fw);class mw extends fw{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return fw.className}}mw.className="GlorotUniform",Ql(mw);class gw extends fw{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return fw.className}}gw.className="GlorotNormal",Ql(gw);class yw extends fw{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return fw.className}}yw.className="HeNormal",Ql(yw);class bw extends fw{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return fw.className}}bw.className="HeUniform",Ql(bw);class ww extends fw{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return fw.className}}ww.className="LeCunNormal",Ql(ww);class vw extends fw{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return fw.className}}vw.className="LeCunUniform",Ql(vw);class Aw extends aw{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 To((()=>{if(e.length<2)throw new Ky("Shape must be at least 2D.");if("int32"!==t&&"float32"!==t&&void 0!==t)throw new TypeError(`Unsupported data type ${t}.`);const n=Kt(e.slice(0,-1)),s=e[e.length-1];this.ELEMENTS_WARN_SLOW;const r=Zb([Math.max(s,n),Math.min(s,n)],0,1,t,this.seed),i=bm.qr(r,!1);let a=i[0];const o=i[1].flatten().stridedSlice([0],[Math.min(s,n)*Math.min(s,n)],[Math.min(s,n)+1]);return a=Gl(a,o.sign()),ne*t));return t}const Ow="Variable";class Dw{constructor(e,t="float32",n=Ow,s=!0,r=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=yb(),n=null==n?Ow:n,this.originalName=Db(n),this.name=Rb(this.originalName),this.trainable_=s,this.constraint=r,this.val=tf(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 Rw(e){return e.map((e=>e.read()))}function Mw(e){e.forEach((e=>{e[0].write(e[1])}))}class Fw{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 Bw{constructor(e,t,n,s,r,i,a){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=s,this.callArgs=r,this.outputTensorIndex=a,this.id=yb(),null!=i&&(this.originalName=Db(i),this.name=Rb(this.originalName)),this.rank=t.length}}let zw=0;class Lw{constructor(e,t){this.callArgs=t,this.id=zw++,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 Pw=0;class Vw extends Zl{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=Pw++,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=nb(e)+"_"+wb(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 Hy(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new $y(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return eb(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return eb(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new jy(`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 jy(`Layer ${this.name} is not connected, no input to return.`);return eb(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new jy(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new jy(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return eb(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=tb(e);if(null==this.inputSpec||0===this.inputSpec.length)return;const n=tb(this.inputSpec);if(t.length!==n.length)throw new $y(`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 $y(`Input ${e} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${i}`);if(null!=r.minNDim&&i=0?t[s]:t[t.length+s];if(null!=i&&-1===[i,null].indexOf(a))throw new $y(`Input ${e} is incompatible with layer ${this.name}: expected axis ${s} of input shape to have value ${i} 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 tb(e))t.push(n.shape);this.build(eb(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=tb(s),i=[];for(let e of r)-1!==n.indexOf(e)&&(e=e.clone()),i.push(e);if(s=eb(i),null!=this.activityRegularizer)throw new Ky("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}{const n=function(e){e=tb(e);const t=[];for(const n of e)t.push(n.shape);return eb(t)}(e),s=this.computeOutputShape(n);let r;const i="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 Bw(i,n,this,tb(e),t,this.name,s))):new Bw(i,s,this,tb(e),t,this.name),this.addInboundNode(e,r,null,null,n,s,t),this._refCount++,null!=this.activityRegularizer)throw new Ky("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 jy(`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 jy(`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 Hy(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return Nw(this.weights)}build(e){this.built=!0}getWeights(e=!1){return Rw(e?this.trainableWeights:this.weights)}setWeights(e){To((()=>{const t=this.weights;if(t.length!==e.length)throw new $y(`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=Rw(t);for(let r=0;rr.apply(c.read()))),null==i&&(i=!0),i?this._trainableWeights.push(c):this._nonTrainableWeights.push(c),c}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){null==e||Array.isArray(e)&&0===e.length||(e=tb(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=tb(t),i=tb(s);if(r.length!==i.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 Ww(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=[],c=t.names();for(const e of o)-1!==c.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=s&&(s.maxNumTensors=-1/0,s.minNumTensors=1/0);const u=o.join(",")+"|"+t.names().sort().join(",");let h,d=qw.get(u);if(null==d){const e=function(e,t){jt(null!=e&&e.length>0,(()=>"Expected at least one fetch, got none"));let n=[],s={};if(1===e.length){const r=Kw(e[0],t);n=r.sorted,s=r.recipientMap}else{const r=new Set;for(const i of e){const{sorted:e,recipientMap:a}=Kw(i,t);for(const t of e)r.has(t.name)||(n.push(t),r.add(t.name));for(const e in a)null==s[e]&&(s[e]=new Set),a[e].forEach((t=>s[e].add(t)))}}return{sorted:n,recipientCounts:$w(s)}}(a,t);d=e.sorted,h=e.recipientCounts,qw.put(u,d),jw.put(u,h)}h={},r||Object.assign(h,jw.get(u));const p=new Uw(t);for(let e=0;es.maxNumTensors&&(s.maxNumTensors=e),e0;){const e=i[i.length-1];if(n.has(e.name)){i.pop();continue}const t=a[a.length-1]===i.length-1;if(0===e.inputs.length||t)i.pop(),s.push(e),n.add(e.name),t&&a.pop();else{a.push(i.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)||i.push(t)}}return{sorted:s,recipientMap:r}}function Xw(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let n=null;for(let t=0;tUl(Ph(Gl(e,e),t,!0))))}En().registerFlag("TOPOLOGICAL_SORT_CACHE_MAX_ENTRIES",(()=>100),(function(e){null!=qw&&qw.setMaxEntries(e),null!=jw&&jw.setMaxEntries(e)}));class Yw extends Zl{getConfig(){return{}}}class Qw extends Yw{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 To((()=>{const t=Zw(e,this.axis),n=eh(t,0,this.maxValue);return Gl(e,Wl(n,Pl(Wb(),t)))}))}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}Qw.className="MaxNorm",Ql(Qw);class Jw extends Yw{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return To((()=>Wl(e,Pl(Wb(),Zw(e,this.axis)))))}getConfig(){return{axis:this.axis}}}Jw.className="UnitNorm",Ql(Jw);class ev extends Yw{apply(e){return cp(e)}}ev.className="NonNeg",Ql(ev);class tv extends Yw{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 To((()=>{const t=Zw(e,this.axis),n=Pl(Gl(this.rate,eh(t,this.minValue,this.maxValue)),Gl(1-this.rate,t));return Gl(e,Wl(n,Pl(Wb(),t)))}))}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}tv.className="MinMaxNorm",Ql(tv);const nv={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function sv(e){return ib(e)}function rv(e,t={}){return ob(e,Yl.getMap().classNameMap,t,"constraint")}function iv(e){if(null==e)return null;if("string"==typeof e){return rv({className:e in nv?nv[e]:e,config:{}})}return e instanceof Yw?e:rv(e)}async function av(e){if(null==e)return;const t=[],n=[],s=[];for(const r in e){const i=e[r];if("number"!=typeof i){const e=i;t.push(e.data()),n.push(r),s.push(e)}}if(t.length>0){const r=await Promise.all(t);for(let t=0;tPl(this.totals[e],Gl(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:To((()=>{const n=Gl(Wl(1,this.seen),this.totals[e]);t[e]=n,this.totals[e].dispose(),No(t[e])})))}}class pv extends uv{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 i=0;i{const a=null!=n?n():ma();return a-rnew fv(e,t)))}class gv{constructor(){}static registerCallbackConstructor(e,t){jt(e>=0&&Number.isInteger(e),(()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`)),gv.checkForDuplicate(t),null==gv.constructors[e]&&(gv.constructors[e]=[]),gv.constructors[e].push(t)}static checkForDuplicate(e){for(const t in gv.constructors){gv.constructors[+t].forEach((t=>{if(t===e)throw new $y("Duplicate callback constructor.")}))}}static clear(){gv.constructors={}}static createCallbacks(e){const t=[];for(const n in gv.constructors){const s=+n;e>=s&&t.push(...gv.constructors[s])}return t.map((e=>new e))}}function yv(e,t,n,s,r,i,a,o,l){const c=new pv,u=[new dv,...gv.createCallbacks(t)];null!=e&&u.push(...e),u.push(c);const h=new hv(u);return h.setParams({epochs:n,initialEpoch:s,samples:r,steps:i,batchSize:a,verbose:t,doValidation:o,metrics:l}),{callbackList:h,history:c}}function bv(e,t={},n=!1){return ob(e,Yl.getMap().classNameMap,t,"layer",n)}function wv(e,t){return To((()=>{"float32"!==e.dtype&&(e=Bl(e,"float32"));const n=Ph(Jb(e),t,!0),s=tc(n.shape,Wb()),r=Ul(uc(n,s));return Wl(e,r)}))}function vv(e,t){return To((()=>kd(Jb(rc(t,e)),-1)))}function Av(e,t){return To((()=>kd(ac(rc(t,e)),-1)))}function xv(e,t){return To((()=>{const n=rc(e,t),s=eh(ac(e),Wb(),Number.MAX_VALUE),r=ac(Wl(n,s));return Gl(100,kd(r,-1))}))}function Cv(e,t){return To((()=>{const n=eh(t,Wb(),Number.MAX_VALUE),s=od(Pl(1,n)),r=eh(e,Wb(),Number.MAX_VALUE),i=od(Pl(1,r));return kd(Jb(rc(s,i)),-1)}))}function kv(e,t,n=!1){return To((()=>{if(n)t=Tp(t);else{const e=Ph(t,t.shape.length-1,!0);t=Wl(t,e)}return t=eh(t,Wb(),1-Wb()),cd(Ph(Gl(Bl(e,"float32"),od(t)),t.shape.length-1))}))}function Sv(e,t,n=!1){return To((()=>{const s=Bl(Kh(function(e){const t=[Bb(e.shape)];return Fu(e,t)}(e)),"int32"),r=(t=eh(t,Wb(),1-Wb())).shape;return kv(Fu(Fd(s,r[r.length-1]),r),t,n)}))}function Ev(e,t){return To((()=>{let n;return n=eh(t,Wb(),1-Wb()),n=od(Wl(n,rc(1,n))),kd(function(e,t){if(!Xt(e.shape,t.shape))throw new $y(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return To((()=>{const n=cp(t),s=cd(ac(t));return Pl(rc(n,Gl(t,e)),ld(Uh(s)))}))}(e,n),-1)}))}function _v(e,t){return To((()=>{const n=eh(e,Wb(),1),s=eh(t,Wb(),1);return Ph(Gl(e,od(Wl(n,s))),-1)}))}function Tv(e,t){return To((()=>{const n=wv(e,-1),s=wv(t,-1),r=Gl(n,s);return cd(Ph(r,-1))}))}gv.constructors={};const Iv={meanSquaredError:vv,meanAbsoluteError:Av,meanAbsolutePercentageError:xv,meanSquaredLogarithmicError:Cv,squaredHinge:function(e,t){return To((()=>{const n=uc(0,rc(1,Gl(e,t)));return kd(Jb(n),-1)}))},hinge:function(e,t){return To((()=>{const n=uc(0,rc(1,Gl(e,t)));return kd(n,-1)}))},categoricalHinge:function(e,t){return To((()=>{const n=Ph(Gl(e,t),-1),s=zh(Gl(rc(1,e),t),-1);return uc(0,Pl(1,rc(s,n)))}))},logcosh:function(e,t){return To((()=>{const n=Math.log(2),s=rc(t,e),r=rc(Pl(s,ud(Gl(-2,s))),n);return kd(r,-1)}))},categoricalCrossentropy:kv,sparseCategoricalCrossentropy:Sv,binaryCrossentropy:Ev,kullbackLeiblerDivergence:_v,poisson:function(e,t){return To((()=>{const n=od(Pl(Wb(),t));return kd(rc(t,Gl(e,n)),-1)}))},cosineProximity:Tv};function Nv(e){if("string"==typeof e){if(e in Iv)return Iv[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 $y(t)}return e}function Ov(e,t){return To((()=>{const n=Gl(.5,Bd(t)),s=Gb(Zh(t,n),e.dtype);return kd(Ah(e,s),-1)}))}function Dv(e,t){return To((()=>Gb(Ah(pu(e,-1),pu(t,-1)),"float32")))}function Rv(e,t){return To((()=>Bl(Ph(fd(Ah(e,1),Ah(t,1))),"float32")))}function Mv(e,t){return Ev(e,t)}function Fv(e,t){return e.rank===t.rank&&(e=Fp(e,[e.rank-1])),(t=pu(t,-1)).dtype!==e.dtype&&(t=Bl(t,e.dtype)),Bl(Ah(e,t),"float32")}const Bv=kv,zv=Sv,Lv={binaryAccuracy:Ov,categoricalAccuracy:Dv,precision:function(e,t){return To((()=>{const n=Rv(e,t),s=function(e,t){return To((()=>Bl(Ph(fd(Ah(e,0),Ah(t,1))),"float32")))}(e,t),r=Pl(n,s);return Bl(xh(Zh(r,0),Wl(n,r),0),"float32")}))},categoricalCrossentropy:Bv,sparseCategoricalCrossentropy:zv,mse:vv,MSE:vv,mae:Av,MAE:Av,mape:xv,MAPE:xv,cosine:Tv};function Pv(e){if("string"==typeof e&&e in Lv)return Lv[e];if("string"!=typeof e&&null!=e)return e;throw new $y(`Unknown metric ${e}`)}function Vv(e){if(Qy(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const n of Object.keys(Iv))if(Iv[n]===e){t=n;break}if(void 0!==t)return t;for(const n of Object.keys(Lv))if(Lv[n]===e){t=n;break}return void 0!==t?t:e.name}}function Wv(e,t,n=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!Gv(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){JSON.stringify(e).length}}function Gv(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(!Gv(e[n]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!Gv(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}}function Uv(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),i=["Layer (type)","Input Shape","Output shape","Param #"];let a;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){i.push("Receives inputs"),a=[];for(const t in e.nodesByDepth)a.push(...e.nodesByDepth[t])}s("_".repeat(t)),qv(i,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 jv(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"}qv([`${e.name} (${e.getClassName()})`,r,s,e.countParams().toString()],t,n)}function Hv(e,t,n,s){let r,i;try{i=e.inboundNodes.map((e=>JSON.stringify(e.inputShapes))).join(",")}catch(e){i="multiple"}try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}const a=[];for(const t of e.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(t)))for(let e=0;ee.name))}`);cb(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;Qy(0===n,"input layer has >1 nodes"),Qy(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={},i={},a=[],o=(e,t,n,s,r,l)=>{null!=s&&null!=r&&null!=l||(s=e.sourceLayer,r=e.nodeIndex,l=e.tensorIndex);const c=s.inboundNodes[r];if(-1!==n.indexOf(c))throw new Hy(`The tensor ${e.name} at layer "${s.name}" is part of a cycle.`);if(-1!==t.indexOf(c))return;this.containerNodes.add(Yv.nodeKey(s,r)),s.id in i||(i[s.id]=Object.keys(i).length),-1===n.indexOf(c)&&n.push(c);const u=c.inboundLayers.length;for(let e=0;e=0;)n.splice(n.indexOf(c),1);a.push(c)},l=[],c=[];for(const e of this.outputs)o(e,l,c);const u=a.slice().reverse();for(const e of u){n[e.id]=e,e.id in t||(t[e.id]=0);let i=t[e.id];const a=null==s[e.outboundLayer.id]?0:s[e.outboundLayer.id];i=Math.max(i,a),s[e.outboundLayer.id]=i,r[e.outboundLayer.id]=e.outboundLayer,t[e.id]=i;for(let s=0;sparseInt(e,10))).sort(lb);this.layers=[];for(const e of p){const t=d[e];t.sort(((e,t)=>{const n=i[e.id],s=i[t.id];return ns?1:0}));for(const e of t)e instanceof Yv&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=d,p=Object.keys(h).map((e=>parseInt(e,10))).sort(lb);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 Hy(`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 Hy(`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 Lw({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 $y("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,i]of e.weights.entries()){const e=r?`${i.name.split("/").slice(0,-1).join("/")+"/"}${t}`:i.originalName;if(null!=n[e])throw new $y(`Duplicate weight name: ${e}`);n[e]=i,s++}const i=[];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])i.push([n[r],e[s]]);else if(t)throw new $y(`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 $y(`${e.length} of ${s} weights are not set: ${e}`)}Mw(i)}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 ${Zv}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const n=Xv(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return To((()=>{e=tb(e);const n=new Uw;for(let t=0;t{let n;return e=tb(e),n=null==t?Yy(null,e.length):tb(t),this.runInternalGraph(e,n)[1]}))}computeOutputShape(e){const t=_w(e);if(t.length!==this.inputLayers.length)throw new $y(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let e=0;eparseInt(e,10))).sort(lb);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(lb);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,i=new Array;for(const e of s)e.id in n&&i.push(n[e.id]);if(i.length===s.length){let s,a,o,l,c={};if(null!=e.callArgs&&(c=e.callArgs),1===i.length){const[e,n]=i[0];null==c.mask&&(c.mask=n),o=tb(t.call(e,c)),l=tb(t.computeMask(e,n)),s=[e],a=[n]}else s=i.map((e=>e[0])),a=i.map((e=>e[1])),null==c.mask&&(c.mask=a),o=tb(t.call(s,c)),l=tb(t.computeMask(s,a));if(t.activityRegularizer)throw new Ky("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(eb(n),s)}function l(e){const n=e.name,i=bv(e,null!=t.customObjects?t.customObjects:{});i.setFastWeightInitDuringBuild(s),r[n]=i;e.inboundNodes.forEach((e=>{if(!(e instanceof Array))throw new $y(`Corrupted configuration, expected array for nodeData: ${e}`);a(i,e)}))}const c=t.name,u=t.layers;for(const e of u)l(e);for(;!ub(i);)for(const e of u){const t=r[e.name];if(t.name in i){const e=i[t.name];delete i[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];Qy(t in r);const i=r[t].inboundNodes[n].outputTensors;h.push(i[s])}const f=t.outputLayers;for(const e of f){const t=e[0],n=e[1],s=e[2];Qy(t in r);const i=r[t].inboundNodes[n].outputTensors;d.push(i[s])}return new e({inputs:h,outputs:d,name:c})}get stateful(){if(this._stateful)throw new $y("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(){To((()=>{this.layers.forEach((e=>{e.stateful&&e.resetStates()}))}))}}function Qv(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 Jv(e,t){return Qv(e,t,"classWeight")}async function eA(e,t,n,s){if(null!=t||null!=s)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const t=To((()=>{if(1===e.shape.length)return zl(e);if(2===e.shape.length){if(e.shape[1]>1){return pu(e,1)}if(1===e.shape[1])return Fu(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());Io(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])})),Vp(r,"float32")}return null}function tA(e,t){return Gl(e,t)}function nA(e,t){let n,s;const r=t;n=r.xs,s=r.ys,jt(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 i=sA("input",e.inputNames,n),a=sA("output",e.outputNames,s),o=i[0].shape[0];jt(i.length===e.inputs.length,(()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${i.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`)),jt(a.length===e.outputs.length,(()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${a.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`));for(let t=0;t`Batch size mismatch: input ${e.inputNames[t]} has ${i[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));for(let t=0;t`Batch size mismatch: output ${e.outputNames[t]} has ${a[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));return{xs:i,ys:a}}function sA(e,t,n){if(n instanceof Fa)return[n];if(Array.isArray(n))return jt(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 $y(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);s.push(n[r])}return s}}async function rA(e,t,n){const s=null!=n.batchesPerEpoch;if(jt(null!=e.optimizer,(()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig).")),jt(null!=n,(()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call.")),jt(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}`)),jt(!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}`)),jt(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 i,a;if(r)if(iA(n.validationData))jt(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 Ky("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData);i=e.xs,a=e.ys}const o=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let c;c=r?l.slice().concat(l.map((e=>"val_"+e))):l.slice();const u=mv(n.callbacks,n.yieldEvery),h=null==n.verbose?1:n.verbose,{callbackList:d,history:p}=yv(u,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,c);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=iA(n.validationData)?tb(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):tb(e.evaluate(i,a,{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 oA(e,t,n){return null==e?[null]:Array.isArray(e)?e.map((e=>qb(e,t,n-t))):qb(e,t,n-t)}function lA(e,t){return To((()=>null==e?null:Array.isArray(e)?e.map((e=>lA(e,t))):Qb(e,"int32"===t.dtype?t:Bl(t,"int32"))))}function cA(e,t){const n=[];let s=0,r=null;for(;s=e&&(r=e),n.push([s,r]),s=r;return n}function uA(e){const t=[];e instanceof Fa&&(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 Fa)-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 dA(e){return Array.isArray(e)}function pA(e){return!function(e){return e instanceof Fa}(e)&&!dA(e)}function fA(e,t,n,s=!0,r=""){if(null==t||0===t.length){if(null!=e){let t=!1;if(dA(e)&&e.length>0)t=!0;else if(pA(e)){for(const n in e)if(e.hasOwnProperty(n)){t=!0;break}}else t=!0;if(t)throw new $y(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(null==e)return t.map((e=>null));let i;if(pA(e)){i=[];for(const n of t){if(null==e[n])throw new $y(`No data provided for "${n}". Need data for each key in: ${t}`);i.push(e[n])}}else if(dA(e)){if(e.length!==t.length)throw new $y(`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}`);i=e}else{if(t.length>1)throw new $y(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);i=[e]}if(i=uA(i),null!=n)for(let e=0;e=0&&i!==o)throw new $y(`${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 ${a.shape[0]} examples, each with shape [${a.shape.slice(1,a.shape.length)}] (tensor shape [${a.shape}])`)}}return i}function mA(e,t,n,s=!0,r=""){let i;if(Array.isArray(e)){if(e.length!==t.length)throw new $y(`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).`);i=e}else{if(t.length>1)throw new $y(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);i=[e]}if(null!=n)for(let e=0;exm.adagrad(.01),Adadelta:()=>xm.adadelta(1,.95,Wb()),Adam:()=>xm.adam(.001,.9,.999,Wb()),Adamax:()=>xm.adamax(.002,.9,.999,Wb(),0),RMSProp:()=>xm.rmsprop(.001,.9,0,Wb()),SGD:()=>xm.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 $y(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof Jl))throw new $y("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 $y(`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=>Nv(e)))}else{const n=Nv(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 $y(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)e.loss[n],t.push(Nv(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])};Ob("metric",(()=>{for(let e=0;e{let n,s,i;for(const a of t){if("string"==typeof a&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(a)){const t=this.internalOutputShapes[e];let r;1===t[t.length-1]||this.lossFunctions[e]===Ev?-1!==["accuracy","acc"].indexOf(a)?s=Ov:-1!==["crossentropy","ce"].indexOf(a)&&(s=Mv):this.lossFunctions[e]===Sv?-1!==["accuracy","acc"].indexOf(a)?s=Fv:-1!==["crossentropy","ce"].indexOf(a)&&(s=zv):-1!==["accuracy","acc"].indexOf(a)?s=Dv:-1!==["crossentropy","ce"].indexOf(a)&&(s=Bv),-1!==["accuracy","acc"].indexOf(a)?r="acc":-1!==["crossentropy","ce"].indexOf(a)&&(r="ce"),i=s,n=""+r}else{const e=Pv(a);i=e,n=""+Vv(a)}let t;Ob(n,(()=>{t=i})),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;aA(s);const r=this.standardizeUserDataXY(e,t,!0,s);try{const e=r[0].concat(r[1]);this.makeTestFunction();const t=this.testFunction;return eb(this.testLoop(t,e,s,n.verbose,n.steps))}finally{hA(r[0],e),hA(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 i=[];if(n.verbose>0)throw new Ky("Verbose mode is not implemented yet.");jt(!s||n.batches>0&&Number.isInteger(n.batches),(()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`));const a="function"==typeof t.next?t:await t.iterator();let o=0,l=0;for(;!s||l{if(t.value){const{xs:n,ys:s}=nA(e,t.value),a=n.concat(s),c=To((()=>r(a)));if(Io(a),0===l)for(let e=0;ePl(i[e],Gl(u,t)))),l>0&&Io(n)}Io(c),o+=u,++l}return i})),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 $y(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return t}predictLoop(e,t=32,n=!1){return To((()=>{const s=this.checkNumSamples(e);if(n)throw new Ky("Verbose predictLoop() is not implemented yet.");const r=cA(s,t),i=this.outputs.map((e=>[]));for(let t=0;t{const n=r[t][0],s=r[t][1],i=oA(e,n,s),a=[];if(Array.isArray(i))for(let e=0;ei[t].push(e)))}return eb(i.map((e=>Lu(e,0))))}))}predict(e,t={}){const n=uA(e);mA(n,this.inputNames,this.feedInputShapes,!1);try{const e=null==t.batchSize?32:t.batchSize;return aA(e),this.predictLoop(n,e)}finally{hA(n,e)}}predictOnBatch(e){mA(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 Hy("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=cb(t.map((e=>e.shape[0])));if(r.sort(),s.length>1)throw new $y(`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 $y(`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&&!Xt(s,r))throw new $y(`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=fA(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=fA(t,this.feedOutputNames,r,!1,"target")),function(e,t,n){const s=[vv,Ev,kv];for(let r=0;r0&&e[0].shape[0]%s!=0)throw new $y(`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,i){const[a,o]=this.standardizeUserDataXY(e,t,r,i);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=s){const e=Jv(s,this.outputNames);l=[];for(let t=0;t{const i=this.checkNumSamples(t,n,r,"steps"),a=[];if(s>0)throw new Ky("Verbose mode is not implemented yet.");if(null!=r)throw new Ky("steps mode in testLoop() is not implemented yet");{const s=cA(i,n),r=Vp(Pb(0,i));for(let n=0;n1){r+=`_${Jy(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),i=[],a=this.collectedTrainableWeights.map((e=>e.read()));return[this.optimizer_.minimize((()=>{const e=[];for(let t=0;t1&&e{l=Pl(l,e)})),l}),!0,a)].concat(i)}}makeTestFunction(){this.testFunction=e=>To((()=>{const t=[];let n;const s=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),i=[];for(let e=0;e0){if(g=!0,2!==n.validationData.length)throw 3===n.validationData.length?new Ky("validationData including sample weights is not supported yet."):new $y(`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);c=t[0],u=t[1],m=c.concat(u)}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];c=oA(s,e,t),i=s,s=oA(s,0,e),u=oA(r,e,t),a=r,r=oA(r,0,e),m=c.concat(u)}else null!=n.validationSteps&&(g=!0);const y=s.concat(r).concat(h);this.checkTrainableWeightsConsistency();const b=this.makeTrainFunction(),w=this.getDedupedMetricsNames();let v,A;g?(this.makeTestFunction(),v=this.testFunction,A=w.slice().concat(w.map((e=>"val_"+e)))):(v=null,m=[],A=w.slice());const x=mv(n.callbacks,n.yieldEvery);return await this.fitLoop(b,y,w,d,n.epochs,n.verbose,x,v,m,n.shuffle,A,n.initialEpoch,null,null)}finally{this.isTraining=!1,hA(s,e),hA(r,t),hA(i,e),hA(a,t),hA(c,o),hA(u,l),null!=h&&Io(h)}}async fitLoop(e,t,n,s,r,i,a,o,l,c,u,h,d,p){null==s&&(s=32),null==r&&(r=1),null==c&&(c=!0),null==h&&(h=0);let f=!1;if(null!=o&&null!=l&&(f=!0),null!=p&&(f=!0,null==d))throw new $y("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=Pb(0,m)),null==i&&(i=1);const{callbackList:y,history:b}=yv(a,i,r,h,m,d,s,f,u);y.setModel(this),this.history=b,await y.onTrainBegin(),this.stopTraining_=!1;for(let i=h;i{const h=a[c][0],d=a[c][1],p=qb(i,h,d-h);u.batch=c,u.size=d-h;const m=lA(t,p),g=e(m);for(let e=0;enb(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]=nb(n[s])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[nb(Vv(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((e=>nb(Vv(e))));{const e={};for(const t in this.metrics)e[t]=nb(Vv(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=bv(Kv(e.optimizer_config));let n,s;if("string"==typeof e.loss)n=sb(e.loss);else if(Array.isArray(e.loss))n=e.loss.map((e=>sb(e)));else if(null!=e.loss){n={};for(const t in e.loss)n[t]=sb(e.loss[t])}if(Array.isArray(e.metrics))s=e.metrics.map((e=>sb(e)));else if(null!=e.metrics){s={};for(const t in e.metrics)s[t]=sb(e.metrics[t])}this.compile({loss:n,metrics:s,optimizer:t})}async save(e,t){if("string"==typeof e){const t=el(e);if(0===t.length)throw new $y(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new $y(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new $y("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await Mo(this.getNamedWeights(t)),s={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${Zv}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){s.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:r}=await Mo(await this.optimizer.getWeights(),e);n.specs.push(...r),n.data=qo([n.data,t])}if(null!=this.userDefinedMetadata){const e=!0;Wv(this.userDefinedMetadata,this.name,e),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){Wv(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}gA.className="Model",Ql(gA);class yA extends gA{}yA.className="Functional",Ql(yA);class bA extends gA{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:wb("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 $y(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof bA||e instanceof gA;let n;if(t){if(n=e,1!==n.outputs.length)throw new $y("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 $y("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 $y("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 $y("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 Gw({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 $y(`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 $y("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=Ww(this.outputs[0])}this.inboundNodes=[],new Lw({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:Yy(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(Iw(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 gA({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 Hy("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 Hy("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 Hy("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 Hy("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,i={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new $y("Legacy serialization format not supported yet.");r=t}else jt(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,i=t;const a=new e(i);if(!(a instanceof bA))throw new Ky(`Sequential.fromConfig called on non-Sequential input: ${a}`);for(const e of r){const t=bv(e,void 0,s);s&&t.setFastWeightInitDuringBuild(!0),a.add(t)}return a}set stopTraining(e){if(null==this.model)throw new $y("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 $y("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}}}bA.className="Sequential",Ql(bA);class wA extends Zl{getConfig(){return{}}}class vA extends wA{apply(e,t=1){return function(e,t=1){if(1!==t)throw new Ky(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return Eh(e)}(e,t)}}vA.className="elu",Ql(vA);class AA extends wA{apply(e){return bp(e)}}AA.className="selu",Ql(AA);class xA extends wA{apply(e){return cp(e)}}xA.className="relu",Ql(xA);class CA extends wA{apply(e){return To((()=>Td(6,cp(e))))}}CA.className="relu6",Ql(CA);class kA extends wA{apply(e){return e}}kA.className="linear",Ql(kA);class SA extends wA{apply(e){return Vu(e)}}SA.className="sigmoid",Ql(SA);class EA extends wA{apply(e){return function(e){return To((()=>{const t=Pl(.5,Gl(.2,e));return eh(t,0,1)}))}(e)}}EA.className="hardSigmoid",Ql(EA);class _A extends wA{apply(e){return ud(e)}}_A.className="softplus",Ql(_A);class TA extends wA{apply(e){return function(e){return To((()=>Wl(e,Pl(ac(e),1))))}(e)}}TA.className="softsign",Ql(TA);class IA extends wA{apply(e){return Gu(e)}}IA.className="tanh",Ql(IA);class NA extends wA{apply(e,t=-1){return Tp(e,t)}}NA.className="softmax",Ql(NA);class OA extends wA{apply(e,t=-1){return dd(e,t)}}OA.className="logSoftmax",Ql(OA);class DA extends wA{apply(e){return To((()=>To((()=>{const t=Math.sqrt(2),n=Gl(.5,Pl(1,Th(Wl(e,t))));return Gl(e,n)}))))}}DA.className="gelu",Ql(DA);class RA extends wA{apply(e){return To((()=>Gl(.5,Gl(e,Pl(1,Gu(Gl(Ul(Wl(2,Math.PI)),Pl(e,Gl(.044715,sc(e,3))))))))))}}RA.className="gelu_new",Ql(RA);class MA extends wA{apply(e){return To((()=>Gl(e,Gu(ud(e)))))}}MA.className="mish",Ql(MA);class FA extends wA{apply(e,t=1){return To((()=>Gl(Vu(Gl(e,t)),e)))}}function BA(e){return e.getClassName()}function zA(e,t={}){return ob(e,Yl.getMap().classNameMap,t,"activation")}function LA(e){if(null==e){const e={className:"linear",config:{}};return zA(e)}if("string"==typeof e){const t={};return t.className=e,t.config={},zA(t)}return e instanceof wA?e:zA(e)}function PA(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}`)}FA.className="swish",Ql(FA);class VA extends Zl{}class WA extends VA{constructor(e){super(),PA(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 To((()=>{let t=Sd([1]);return this.hasL1&&(t=Pl(t,Ph(Gl(this.l1,ac(e))))),this.hasL2&&(t=Pl(t,Ph(Gl(this.l2,Jb(e))))),Fu(t,[])}))}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}WA.className="L1L2",Ql(WA);const GA={l1l2:"L1L2"};function UA(e){return ib(e)}function qA(e,t={}){return ob(e,Yl.getMap().classNameMap,t,"regularizer")}function jA(e){if(null==e)return null;if("string"==typeof e){return qA({className:e in GA?GA[e]:e,config:{}})}return e instanceof VA?e:qA(e)}class HA extends Vw{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=Tw(e);let n=cp(e);return null!=this.maxValue&&(n=eh(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}HA.className="ReLU",Ql(HA);class $A extends Vw{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=Tw(e);return nd(n,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}$A.className="LeakyReLU",Ql($A);class KA extends Vw{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=Sw(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=jA(e.alphaRegularizer),this.alphaConstraint=iv(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 $y(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=Iw(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=Tw(e);const s=t.mask;if(null!=s){const e=Gl(rc(Ed(n.shape),Bl(s,n.dtype)),$l(-1e9));n=Pl(n,e)}return this.axis instanceof Array?this.axis.length>1?Uh(rc(n,pd(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 QA(e,t,n){if("number"==typeof e)return Yy(e,t);if(e.length!==t)throw new $y(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${e.length} elements.`);for(let r=0;r(Eb(t),"channelsFirst"===t?af(e,[0,2,3,1]):e)))}function nx(e,t){return To((()=>(Eb(t),"channelsFirst"===t?af(e,[0,2,3,4,1]):e)))}function sx(e,t,n,s=1,r="valid",i,a=1){return To((()=>{if(null==i&&(i="channelsLast"),Eb(i),3!==e.shape.length)throw new $y(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new $y(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new $y(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if("channelsFirst"===i&&(e=af(e,[0,2,1])),"causal"===r)throw new Ky("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=ah(e,t,s,"same"===r?"same":"valid","NWC",a);return null!=n&&(o=tw(o,n)),o}))}function rx(e,t,n,s=[1,1],r="valid",i,a,o=null){return To((()=>{if(null==i&&(i="channelsLast"),Eb(i),3!==e.rank&&4!==e.rank)throw new $y(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new $y(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=tx(e,i);if("causal"===r)throw new Ky("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=vf({x:l,filter:t,strides:s,pad:"same"===r?"same":"valid",dilations:a,dataFormat:"NHWC",bias:n,activation:o}),"channelsFirst"===i&&(l=af(l,[0,3,1,2])),l}))}function ix(e,t,n,s=[1,1,1],r="valid",i,a){return To((()=>{if(null==i&&(i="channelsLast"),Eb(i),4!==e.rank&&5!==e.rank)throw new $y(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new $y(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=nx(e,i);if("causal"===r)throw new Ky("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=ch(o,t,s,"same"===r?"same":"valid","NDHWC",a),null!=n&&(o=tw(o,n)),"channelsFirst"===i&&(o=af(o,[0,4,1,2,3])),o}))}YA.className="Softmax",Ql(YA);class ax extends Vw{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",ax.verifyArgs(t),this.rank=e,pb(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new Ky(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=QA(t.kernelSize,e,"kernelSize"),this.strides=QA(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,_b(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Eb(this.dataFormat),this.activation=LA(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=Sw(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=iv(t.biasConstraint),this.biasRegularizer=jA(t.biasRegularizer),this.activityRegularizer=jA(t.activityRegularizer),this.dilationRate=QA(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new $y(`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 $y(`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 $y(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if(Qy("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!db(e.kernelSize,"number",1,3))throw new $y(`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:BA(this.activation),useBias:this.useBias,biasInitializer:kw(this.biasInitializer),biasRegularizer:UA(this.biasRegularizer),activityRegularizer:UA(this.activityRegularizer),biasConstraint:sv(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class ox extends ax{constructor(e,t){super(e,t),this.kernel=null,ox.verifyArgs(t),this.filters=t.filters,pb(this.filters,"filters"),this.kernelInitializer=Sw(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=iv(t.kernelConstraint),this.kernelRegularizer=jA(t.kernelRegularizer)}build(e){e=Iw(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new $y(`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 To((()=>{let t;e=Tw(e);const n=null==this.bias?null:this.bias.read(),s=mb(this.activation.getClassName());if(null!=s&&2===this.rank)t=rx(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,s);else{if(1===this.rank)t=sx(e,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=rx(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new Ky("convolutions greater than 3D are not implemented yet.");t=ix(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=Iw(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 lx extends ox{constructor(e){super(2,e),lx.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!db(e.kernelSize,"number",1,2))throw new $y(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}lx.className="Conv2D",Ql(lx);class cx extends ox{constructor(e){super(3,e),cx.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 $y(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}cx.className="Conv3D",Ql(cx);class ux extends lx{constructor(e){if(super(e),this.inputSpec=[new Fw({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new $y(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=Iw(e)).length)throw new $y("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 $y("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 Fw({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return To((()=>{let t=Tw(e);if(4!==t.shape.length)throw new $y(`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,i;"channelsFirst"===this.dataFormat?(r=2,i=3):(r=1,i=2);const a=n[r],o=n[i],l=this.kernelSize[0],c=this.kernelSize[1],u=this.strides[0],h=this.strides[1],d=[s,ex(a,u,l,this.padding),ex(o,h,c,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=af(t,[0,2,3,1]));let p=lh(t,this.kernel.read(),d,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(p=af(p,[0,3,1,2])),null!=this.bias&&(p=tw(p,this.bias.read(),this.dataFormat)),null!=this.activation&&(p=this.activation.apply(p)),p}))}computeOutputShape(e){const t=(e=Iw(e)).slice();let n,s,r;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3):(n=3,s=1,r=2);const i=this.kernelSize[0],a=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[s]=ex(t[s],o,i,this.padding),t[r]=ex(t[r],l,a,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}ux.className="Conv2DTranspose",Ql(ux);class hx extends cx{constructor(e){if(super(e),this.inputSpec=[new Fw({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new $y(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=Iw(e)).length)throw new $y("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 $y("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 Fw({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return To((()=>{let t=Tw(e);if(5!==t.shape.length)throw new $y(`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,i,a;"channelsFirst"===this.dataFormat?(a=2,r=3,i=4):(a=1,r=2,i=3);const o=n[a],l=n[r],c=n[i],u=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,ex(o,p,u,this.padding),ex(l,f,h,this.padding),ex(c,m,d,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=af(t,[0,2,3,4,1]));let y=hh(t,this.kernel.read(),g,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(y=af(y,[0,4,1,2,3])),null!==this.bias&&(y=tw(y,this.bias.read(),this.dataFormat)),null!==this.activation&&(y=this.activation.apply(y)),y}))}computeOutputShape(e){const t=(e=Iw(e)).slice();let n,s,r,i;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3,i=4):(n=4,s=1,r=2,i=3);const a=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],c=this.strides[0],u=this.strides[1],h=this.strides[2];return t[n]=this.filters,t[s]=ex(t[s],c,a,this.padding),t[r]=ex(t[r],u,o,this.padding),t[i]=ex(t[i],h,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}hx.className="Conv3DTranspose",Ql(hx);class dx extends ox{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 $y("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new $y("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 $y(`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=Sw(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=jA(t.depthwiseRegularizer),this.depthwiseConstraint=iv(t.depthwiseConstraint),this.pointwiseInitializer=Sw(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=jA(t.pointwiseRegularizer),this.pointwiseConstraint=iv(t.pointwiseConstraint)}build(e){if((e=Iw(e)).length{let t;if(e=Tw(e),1===this.rank)throw new Ky("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=af(e,[0,2,3,1])),t=wp(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=tw(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=af(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=kw(this.depthwiseInitializer),e.pointwiseInitializer=kw(this.pointwiseInitializer),e.depthwiseRegularizer=UA(this.depthwiseRegularizer),e.pointwiseRegularizer=UA(this.pointwiseRegularizer),e.depthwiseConstraint=sv(this.depthwiseConstraint),e.pointwiseConstraint=sv(this.pointwiseConstraint),e}}dx.className="SeparableConv";class px extends dx{constructor(e){super(2,e)}}px.className="SeparableConv2D",Ql(px);class fx extends ox{constructor(e){super(1,e),fx.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&&!db(e.kernelSize,"number",1,1))throw new $y(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}fx.className="Conv1D",Ql(fx);class mx extends Vw{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 To((()=>{if(e=Tw(e),"channelsLast"===this.dataFormat){const t=Hb(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Hb(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=Hb(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Hb(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}}mx.className="Cropping2D",Ql(mx);class gx extends Vw{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,Eb(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,hb(Ab,"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 To((()=>{let t=Tw(e);const n=t.shape;if("channelsFirst"===this.dataFormat){t=af(t,[0,2,3,1]);const e=this.size[0]*n[2],s=this.size[1]*n[3],r="nearest"===this.interpolation?ym.resizeNearestNeighbor(t,[e,s]):ym.resizeBilinear(t,[e,s]);return af(r,[0,3,1,2])}{const e=this.size[0]*n[1],s=this.size[1]*n[2];return"nearest"===this.interpolation?ym.resizeNearestNeighbor(t,[e,s]):ym.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}}gx.className="UpSampling2D",Ql(gx);class yx extends ax{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=Sw(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=iv(e.depthwiseConstraint),this.depthwiseRegularizer=jA(e.depthwiseRegularizer)}build(e){if((e=Iw(e)).length<4)throw new $y(`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 $y(`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 To((()=>{let t=function(e,t,n=[1,1],s="valid",r,i){return To((()=>{null==r&&(r="channelsLast"),Eb(r);let a=tx(e,r);if(4!==e.rank)throw new $y(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new $y(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return a=bh(a,t,n,"same"===s?"same":"valid","NHWC",i),"channelsFirst"===r&&(a=af(a,[0,3,1,2])),a}))}(e=Tw(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=tw(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t}))}computeOutputShape(e){e=Iw(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=JA(t,this.kernelSize[0],this.padding,this.strides[0]),i=JA(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],s,r,i]:[e[0],r,i,s]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=kw(this.depthwiseInitializer),e.depthwiseRegularizer=UA(this.depthwiseRegularizer),e.depthwiseConstraint=sv(this.depthwiseRegularizer),e}}function bx(e,t,n,s){if(Array.isArray(e)){if(null!=t||null!=n)throw new $y("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 wx(e,t,n,s=!1,r,i,a=!1,o=!1){return To((()=>{const a=t.shape.length;if(a<3)throw new $y(`Input should be at least 3D, but is ${a}D.`);const l=[1,0].concat(Pb(2,a));if(t=af(t,l),null!=i)throw new Ky("The rnn() functoin of the deeplearn.js backend does not support constants yet.");null!=r&&((r=Bl(Bl(r,"bool"),"float32")).rank===a-1&&(r=qh(r,-1)),r=af(r,l)),s&&(t=hp(t,0),null!=r&&(r=hp(r,0)));const c=[];let u,h=n;const d=t.shape[0],p=Jp(t);let f,m;null!=r&&(f=Jp(r));for(let t=0;te(n,h)));if(null==r)u=s[0],h=s[1];else{const e=To((()=>{const e=f[t],n=rc(Bd(e),e);return{output:Pl(Gl(s[0],e),Gl(h[0],n)),newStates:h.map(((t,r)=>Pl(Gl(s[1][r],e),Gl(t,n))))}}));u=e.output,h=e.newStates}o&&c.push(u)}if(o){m=Bp(c,1)}return[u,m,h]}))}yx.className="DepthwiseConv2D",Ql(yx);class vx extends Vw{constructor(e){let t;if(super(e),null==e.cell)throw new $y("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new Tx({cells:e.cell}):e.cell,null==t.stateSize)throw new $y("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 Fw({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return Pb(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((e=>null))}return this.states_}setStates(e){this.states_=e}computeOutputShape(e){Ew(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 To((()=>{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 $y(`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 Fw({shape:[null,e]})));this.stateful&&this.resetStates()}resetStates(e,t=!1){To((()=>{if(!this.stateful)throw new jy("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape[0];if(null==n)throw new $y("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=>Sd([n,e]))):this.states_=[Sd([n,this.cell.stateSize])];else if(null==e)Io(this.states_),null!=this.keptStates&&(Io(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>Sd([n,e]))):this.states_[0]=Sd([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new $y(`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()):Io(this.states_);for(let t=0;tNo(e.clone())))}))}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=bx(e,n,s,this.numConstants);e=r.inputs,n=r.initialState,s=r.constants;let i=[],a=[];if(null!=n){t.initialState=n,i=i.concat(n),this.stateSpec=[];for(const e of n)this.stateSpec.push(new Fw({shape:e.shape}));a=a.concat(this.stateSpec)}null!=s&&(t.constants=s,i=i.concat(s),this.numConstants=s.length);if(i[0]instanceof Bw){const n=[e].concat(i),s=this.inputSpec.concat(a),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 To((()=>{const n=null==t?null:t.mask,s=null==t?null:t.training;let r=null==t?null:t.initialState;e=Tw(e),null==r&&(r=this.stateful?this.states_:this.getInitialState(e));const i=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==i)throw new $y(`RNN Layer has ${i} state(s) but was passed ${r.length} initial state(s).`);this.unroll;const a={training:s},o=wx(((e,t)=>{const n=this.cell.call([e].concat(t),a);return[n[0],n.slice(1)]}),e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],c=o[1],u=o[2];this.stateful&&this.resetStates(u,s);const h=this.returnSequences?c:l;return this.returnState?[h].concat(u):h}))}getInitialState(e){return To((()=>{let t=Sd(e.shape);return t=Ph(t,[1,2]),t=Ub(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map((e=>e>1?Xb(t,[1,e]):t)):this.cell.stateSize>1?[Xb(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()===vx.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=bv(t.cell,n);return new e(Object.assign(t,{cell:s}))}}vx.className="RNN",Ql(vx);class Ax extends Vw{}class xx extends Ax{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,pb(this.units,"units"),this.activation=LA(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Sw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Sw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Sw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=jA(e.kernelRegularizer),this.recurrentRegularizer=jA(e.recurrentRegularizer),this.biasRegularizer=jA(e.biasRegularizer),this.kernelConstraint=iv(e.kernelConstraint),this.recurrentConstraint=iv(e.recurrentConstraint),this.biasConstraint=iv(e.biasConstraint),this.dropout=zb([1,Lb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=zb([1,Lb([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=Iw(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 To((()=>{if(2!==e.length)throw new $y(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];const s=null!=t.training&&t.training;let r;0Bd(e),rate:this.dropout,training:s,dropoutFunc:this.dropoutFunc})),0Bd(n),rate:this.recurrentDropout,training:s,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,a=this.recurrentDropoutMask;r=Yb(null!=i?Gl(e,i):e,this.kernel.read()),null!=this.bias&&(r=tw(r,this.bias.read())),null!=a&&(n=Gl(n,a));let o=Pl(r,Yb(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:BA(this.activation),useBias:this.useBias,kernelInitializer:kw(this.kernelInitializer),recurrentInitializer:kw(this.recurrentInitializer),biasInitializer:kw(this.biasInitializer),kernelRegularizer:UA(this.kernelRegularizer),recurrentRegularizer:UA(this.recurrentRegularizer),biasRegularizer:UA(this.biasRegularizer),activityRegularizer:UA(this.activityRegularizer),kernelConstraint:sv(this.kernelConstraint),recurrentConstraint:sv(this.recurrentConstraint),biasConstraint:sv(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign(Object.assign({},e),t)}}xx.className="SimpleRNNCell",Ql(xx);class Cx extends vx{constructor(e){e.cell=new xx(e),super(e)}call(e,t){return To((()=>{null!=this.cell.dropoutMask&&(Io(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Io(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)}}Cx.className="SimpleRNN",Ql(Cx);class kx extends Ax{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 $y("GRUCell does not support reset_after parameter set to true.");this.units=e.units,pb(this.units,"units"),this.activation=LA(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=LA(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Sw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Sw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Sw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=jA(e.kernelRegularizer),this.recurrentRegularizer=jA(e.recurrentRegularizer),this.biasRegularizer=jA(e.biasRegularizer),this.kernelConstraint=iv(e.kernelConstraint),this.recurrentConstraint=iv(e.recurrentConstraint),this.biasConstraint=iv(e.biasConstraint),this.dropout=zb([1,Lb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=zb([1,Lb([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=Iw(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 To((()=>{if(2!==e.length)throw new $y(`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],0Bd(e),rate:this.dropout,training:n,count:3,dropoutFunc:this.dropoutFunc})),0Bd(s),rate:this.recurrentDropout,training:n,count:3,dropoutFunc:this.dropoutFunc}));const r=this.dropoutMask,i=this.recurrentDropoutMask;let a,o,l;0{null!=this.cell.dropoutMask&&(Io(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Io(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)}}Sx.className="GRU",Ql(Sx);class Ex extends Ax{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,pb(this.units,"units"),this.activation=LA(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=LA(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Sw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Sw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Sw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=jA(e.kernelRegularizer),this.recurrentRegularizer=jA(e.recurrentRegularizer),this.biasRegularizer=jA(e.biasRegularizer),this.kernelConstraint=iv(e.kernelConstraint),this.recurrentConstraint=iv(e.recurrentConstraint),this.biasConstraint=iv(e.biasConstraint),this.dropout=zb([1,Lb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=zb([1,Lb([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=Iw(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 aw{apply(t,s){const r=e.apply([n]),i=(new lw).apply([n]),a=e.apply([2*n]);return Kb(Kb(r,i),a)}}).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 To((()=>{const n=null!=t.training&&t.training;if(3!==e.length)throw new $y(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let s=e[1];const r=e[2];e=e[0],0Bd(e),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc})),0Bd(s),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,a=this.recurrentDropoutMask;let o,l,c,u;0{null!=this.cell.dropoutMask&&(Io(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Io(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)}}_x.className="LSTM",Ql(_x);class Tx extends Ax{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 To((()=>{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 i;for(let a=0;a{Ob(`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(bv(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 Rw(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!=i?i(t(),n):nw(t(),n),o=()=>sw(a,t,s);if(!r||r<=1)return No(o().clone());return Array(r).fill(void 0).map(o).map((e=>No(e.clone())))}Tx.className="StackedRNNCells",Ql(Tx);var Nx=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&&(Io(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Io(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new $y("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 To((()=>{const{stateSize:t}=this.cell,n=e.shape,s=this.computeSingleOutputShape(n),r=Sd([s[0],...s.slice(2)]);return Array.isArray(t)?Array(t.length).fill(r):[r]}))}resetStates(e,t=!1){To((()=>{if(!this.stateful)throw new jy("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 $y("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((()=>Sd(r))):this.states_=[Sd(r)];else if(null==e)Io(this.states_),null!=this.keptStates&&(Io(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>Sd(r))):this.states_[0]=Sd(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new $y(`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()):Io(this.states_);for(let t=0;tNo(e.clone())))}))}computeSingleOutputShape(e){const{dataFormat:t,filters:n,kernelSize:s,padding:r,strides:i,dilationRate:a}=this.cell,o="channelsFirst"===t,l=e[o?3:2],c=e[o?4:3],u=JA(l,s[0],r,i[0],a[0]),h=JA(c,s[1],r,i[1],a[1]);return[...e.slice(0,2),...o?[n,u,h]:[u,h,n]]}}Ox.className="ConvRNN2D";class Dx extends Ex{constructor(e){const{filters:t,kernelSize:n,strides:s,padding:r,dataFormat:i,dilationRate:a}=e;super(Object.assign(Object.assign({},e),{units:t})),this.filters=t,pb(this.filters,"filters"),this.kernelSize=QA(n,2,"kernelSize"),this.kernelSize.forEach((e=>pb(e,"kernelSize"))),this.strides=QA(s||1,2,"strides"),this.strides.forEach((e=>pb(e,"strides"))),this.padding=r||"valid",_b(this.padding),this.dataFormat=i||"channelsLast",Eb(this.dataFormat),this.dilationRate=QA(a||1,2,"dilationRate"),this.dilationRate.forEach((e=>pb(e,"dilationRate")))}build(e){var t;e=Iw(e);const n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new $y(`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 i=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,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 aw{apply(e,t){return $b([n.apply([s]),Ed([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 To((()=>{if(3!==e.length)throw new $y(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const n=t.training||!1,s=e[0],r=e[1],i=e[2];0Bd(s),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const a=this.dropoutMask,o=(e,t,n)=>t&&t[n]?Gl(t[n],e):e;let l=o(s,a,0),c=o(s,a,1),u=o(s,a,2),h=o(s,a,3);0Bd(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]=Dp(this.kernel.read(),4,3),[A,x,C,k]=this.useBias?Dp(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,y,A,this.padding),c=this.inputConv(c,b,x,this.padding),u=this.inputConv(u,w,C,this.padding),h=this.inputConv(h,v,k,this.padding);const[S,E,_,T]=Dp(this.recurrentKernel.read(),4,3);p=this.recurrentConv(p,S),f=this.recurrentConv(f,E),m=this.recurrentConv(m,_),g=this.recurrentConv(g,T);const I=this.recurrentActivation.apply(Pl(l,p)),N=this.recurrentActivation.apply(Pl(c,f)),O=Pl(Gl(N,i),Gl(I,this.activation.apply(Pl(u,m)))),D=Gl(this.recurrentActivation.apply(Pl(h,g)),this.activation.apply(O));return[D,D,O]}))}getConfig(){const e=super.getConfig(),{units:t}=e,n=Nx(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=ih(e,t,this.strides,s||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?tw(r,n,this.dataFormat):r}recurrentConv(e,t){return ih(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}Dx.className="ConvLSTM2DCell",Ql(Dx);class Rx extends Ox{constructor(e){const t=new Dx(e);super(Object.assign(Object.assign({},e),{cell:t}))}static fromConfig(e,t){return new e(t)}}Rx.className="ConvLSTM2D",Ql(Rx);class Mx extends Vw{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=Tw(e);if(0nw(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()}}Mx.className="Dropout",Ql(Mx);class Fx extends Mx{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}Fx.className="SpatialDropout1D",Ql(Fx);class Bx extends Vw{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,pb(this.units,"units"),this.activation=LA(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=Sw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=Sw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=iv(e.kernelConstraint),this.biasConstraint=iv(e.biasConstraint),this.kernelRegularizer=jA(e.kernelRegularizer),this.biasRegularizer=jA(e.biasRegularizer),this.activityRegularizer=jA(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=Iw(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=Iw(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return To((()=>{this.invokeCallHook(e,t);const n=Tw(e),s=mb(this.activation.getClassName());let r;return null!=s?r=Yb(n,this.kernel.read(),s,this.bias?this.bias.read():null):(r=Yb(n,this.kernel.read()),null!=this.bias&&(r=tw(r,this.bias.read())),null!=this.activation&&(r=this.activation.apply(r))),r}))}getConfig(){const e={units:this.units,activation:BA(this.activation),useBias:this.useBias,kernelInitializer:kw(this.kernelInitializer),biasInitializer:kw(this.biasInitializer),kernelRegularizer:UA(this.kernelRegularizer),biasRegularizer:UA(this.biasRegularizer),activityRegularizer:UA(this.activityRegularizer),kernelConstraint:sv(this.kernelConstraint),biasConstraint:sv(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}Bx.className="Dense",Ql(Bx);class zx extends Vw{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=Iw(e);for(const t of e.slice(1))if(null==t)throw new $y(`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],Bb(e,1)]}call(e,t){return To((()=>{this.invokeCallHook(e,t);let n=Tw(e);if("channelsFirst"===this.dataFormat&&n.rank>1){const e=[0];for(let t=2;t{this.invokeCallHook(e,t);const n=Tw(e);return this.activation.apply(n)}))}getConfig(){const e={activation:BA(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}Lx.className="Activation",Ql(Lx);class Px extends Vw{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 To((()=>{return e=Tw(e),t=e,n=this.n,To((()=>{if(2!==t.shape.length)throw new $y(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return Xb(Ub(t,1),[1,n,1])}));var t,n}))}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}Px.className="RepeatVector",Ql(Px);class Vx extends Vw{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e{this.invokeCallHook(e,t);const n=Tw(e),s=n.shape,r=s.slice(0,1).concat(this.fixUnknownDimension(s.slice(1),this.targetShape));return Fu(n,r)}))}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}Vx.className="Reshape",Ql(Vx);class Wx extends Vw{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=Pb(1,e.dims.length+1);if(!Xt(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 Fw({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=Iw(e)).slice();return this.dims.forEach(((n,s)=>{t[s+1]=e[n]})),t}call(e,t){return af(Tw(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}Wx.className="Permute",Ql(Wx);class Gx extends Vw{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=Tw(e);return du(Md(n,this.maskValue),-1)}call(e,t){return To((()=>{this.invokeCallHook(e,t);const n=Tw(e),s=du(Md(n,this.maskValue),-1,!0);return Gl(n,Bl(s,n.dtype))}))}}Gx.className="Masking",Ql(Gx);class Ux extends Vw{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(tb(e.inputLength))}this.inputDim=e.inputDim,pb(this.inputDim,"inputDim"),this.outputDim=e.outputDim,pb(this.outputDim,"outputDim"),this.embeddingsInitializer=Sw(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=jA(e.embeddingsRegularizer),this.activityRegularizer=jA(e.activityRegularizer),this.embeddingsConstraint=iv(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 To((()=>this.maskZero?(e=Tw(e),Md(e,jl(e))):null))}computeOutputShape(e){if(e=Iw(e),null==this.inputLength)return[...e,this.outputDim];const t=tb(this.inputLength);if(t.length!==e.length-1)throw new $y(`"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=Tw(e);"int32"!==n.dtype&&(n=Gb(n,"int32"));const s=Qb(this.embeddings.read(),Fu(n,[n.size]));return Fu(s,Iw(this.computeOutputShape(n.shape)))}))}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:kw(this.embeddingsInitializer),embeddingsRegularizer:UA(this.embeddingsRegularizer),activityRegularizer:UA(this.activityRegularizer),embeddingsConstraint:sv(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}Ux.className="Embedding",Ql(Ux);class qx extends Vw{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new Ky}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length1)throw new $y(`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===cb(s).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return To((()=>{if(this.reshapeRequired){const t=[],n=e.map((e=>e.rank));if(-1===n.indexOf(null)){const s=Lb(n);for(let n of e){const e=n.rank;for(let t=0;t1){const r=Pb(1,e).concat([0]);t.push(af(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=Fu(af(Fu(s,[-1,t]),[1,0]),n)}else if(r>1){const e=[r-1].concat(Pb(0,r-1));s=af(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 $y("`mask` should be an Array");if(!Array.isArray(e))throw new $y("`inputs` should be an Array");if(t.length!==e.length)throw new $y(`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:qh(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 $y("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return To((()=>$b(e,this.axis)))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new $y("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 $y("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new $y("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new $y(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return To((()=>{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 Ky("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 $y(`Dimension incompatibility: ${t[s[0]]} !== ${n[s[1]]}`)}mergeFunction(e){if(2!==e.length)throw new $y(`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)=>Yx(t,e[n].shape.length))):[Yx(this.axes,n.shape.length),Yx(this.axes,s.shape.length)],this.normalize&&(n=wv(n,t[0]),s=wv(s,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new Ky("batchDot is not implemented for tensors of 4D or higher rank yet");if(jt(e.shape.length>=2,(()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`)),jt(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 Ky("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 i=n;return To((()=>{let n,a;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 Ky("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}}Qx.className="Dot",Ql(Qx);class Jx extends Vw{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 To((()=>{this.invokeCallHook(e,t);const n=Tw(e);return sw((()=>Pl(Zb(n.shape,0,this.stddev),n)),(()=>n),t.training||!1)}))}}Jx.className="GaussianNoise",Ql(Jx);class eC extends Vw{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 To((()=>{this.invokeCallHook(e,t);const n=Tw(e);if(this.rate>0&&this.rate<1){return sw((()=>{const e=Math.sqrt(this.rate/(1-this.rate));return Gl(n,Zb(n.shape,1,e))}),(()=>n),t.training||!1)}return n}))}}eC.className="GaussianDropout",Ql(eC);class tC extends Vw{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||Tw(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 To((()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(e);return sw((()=>{const t=Tw(e),s=-1.7580993408473766;let r=Yh(rp(n),this.rate);r=Gb(r,"float32");const i=((1-this.rate)*(1+this.rate*s**2))**-.5,a=-i*s*this.rate,o=Pl(Gl(t,r),Gl(Pl(r,-1),s));return Pl(Gl(o,i),a)}),(()=>Tw(e)),t.training||!1)}return e}))}}function nC(e,t,n,s,r,i=.001){let a;if(2===e.rank)a=Hu(e,t,n,s,r,i);else if(3===e.rank)a=$u(e,t,n,s,r,i);else{if(4!==e.rank)throw new Ky(`batchNormalization is not implemented for array of rank ${e.rank} yet`);a=Ku(e,t,n,s,r,i)}return a}function sC(e,t,n,s,r=.001){return Xt(s.slice().sort(),Pb(0,e.rank-1))?function(e,t,n,s,r=.001){return To((()=>{const i=Od(e,s),a=i.mean,o=i.variance;return[nC(e,a,o,n,t,r),a,o]}))}(e,t,n,s,r):function(e,t,n,s,r=.001){return To((()=>{const i=Od(e,s),a=i.mean,o=i.variance,l=[];for(const t of Pb(0,e.rank))-1!==s.indexOf(t)?l.push(1):l.push(e.shape[t]);const c=Fu(a,l),u=Fu(o,l),h=null==t?null:Fu(t,l),d=null==n?null:Fu(n,l);return[nC(e,c,u,d,h,r),a,o]}))}(e,t,n,s,r)}tC.className="AlphaDropout",Ql(tC);class rC extends Vw{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=Sw(e.betaInitializer||"zeros"),this.gammaInitializer=Sw(e.gammaInitializer||"ones"),this.movingMeanInitializer=Sw(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=Sw(e.movingVarianceInitializer||"ones"),this.betaConstraint=iv(e.betaConstraint),this.gammaConstraint=iv(e.gammaConstraint),this.betaRegularizer=jA(e.betaRegularizer),this.gammaRegularizer=jA(e.gammaRegularizer)}build(e){e=Iw(e);const t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new $y(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new Fw({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 To((()=>{const n=null!=t.training&&t.training,s=Tw(e),r=s.shape,i=r.length,a=Pb(0,i),o=this.axis>=0?this.axis:this.axis+i;a.splice(o,1);const l=Yy(1,i);l[o]=r[o];const c=a.slice();c.sort();const u=!Xt(c,Pb(0,i).slice(0,i-1));if(!n)return(()=>{if(u){const e=Fu(this.movingMean.read(),l),t=Fu(this.movingVariance.read(),l),n=this.center?Fu(this.beta.read(),l):null,r=this.scale?Fu(this.gamma.read(),l):null;return nC(s,e,t,n,r,this.epsilon)}return nC(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]=sC(s,this.gamma.read(),this.beta.read(),a,this.epsilon),f=(e,t,n)=>{To((()=>{const s=1-n,r=e.read(),i=Gl(rc(r,t),s);e.write(rc(r,i))}))};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:kw(this.betaInitializer),gammaInitializer:kw(this.gammaInitializer),movingMeanInitializer:kw(this.movingMeanInitializer),movingVarianceInitializer:kw(this.movingVarianceInitializer),betaRegularizer:UA(this.betaRegularizer),gammaRegularizer:UA(this.gammaRegularizer),betaConstraint:sv(this.betaConstraint),gammaConstraint:sv(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}rC.className="BatchNormalization",Ql(rC);class iC extends Vw{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=Sw(e.betaInitializer||"zeros"),this.gammaInitializer=Sw(e.gammaInitializer||"ones"),this.betaRegularizer=jA(e.betaRegularizer),this.gammaRegularizer=jA(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=Iw(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!==cb(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=Tw(e),s=n.shape,r=s.length;return To((()=>{let{mean:e,variance:t}=Od(n,this.axis,!0);const i=Yy(1,r);for(const e of this.axis)i[e]=s[e];const a=e=>null!=e&&e.shape.length!==r?Fu(e,i):e;let o=this.scale?a(this.gamma.read()):null,l=this.center?a(this.beta.read()):null;const c=[],u=[];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 To((()=>{return t=Tw(e),n=this.padding,s=this.dataFormat,To((()=>{if(4!==t.rank)throw new $y(`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 $y("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 $y(`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]],Ld(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 oC(e,t,n,s,r,i){return To((()=>{let a;Eb(r),Tb(i),_b(s),null==n&&(n=[1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==i&&(i="max"),e=tx(e,r);const o="same"===s?"same":"valid";return a="max"===i?Ad(e,t,n,o):Bu(e,t,n,o),"channelsFirst"===r&&(a=af(a,[0,3,1,2])),a}))}function lC(e,t,n,s,r,i){return To((()=>{let a;Eb(r),Tb(i),_b(s),null==n&&(n=[1,1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==i&&(i="max"),e=nx(e,r);const o="same"===s?"same":"valid";return a="max"===i?xd(e,t,n,o):zu(e,t,n,o),"channelsFirst"===r&&(a=af(a,[0,4,1,2,3])),a}))}aC.className="ZeroPadding2D",Ql(aC);class cC extends Vw{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 $y(`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(pb(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 $y(`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}pb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,_b(this.padding),this.inputSpec=[new Fw({ndim:3})]}computeOutputShape(e){const t=JA((e=Iw(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return To((()=>{this.invokeCallHook(e,t),e=Ub(Tw(e),2);const n=this.poolingFunction(Tw(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return Fp(n,[2])}))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class uC extends cC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),oC(e,t,n,s,r,"max")}}uC.className="MaxPooling1D",Ql(uC);class hC extends cC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),oC(e,t,n,s,r,"avg")}}hC.className="AveragePooling1D",Ql(hC);class dC extends Vw{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 $y(`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];pb(this.poolSize,"poolSize"),pb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Eb(this.dataFormat),_b(this.padding),this.inputSpec=[new Fw({ndim:4})]}computeOutputShape(e){e=Iw(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=JA(t,this.poolSize[0],this.padding,this.strides[0]),n=JA(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 To((()=>(this.invokeCallHook(e,t),this.poolingFunction(Tw(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 pC extends dC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),oC(e,t,n,s,r,"max")}}pC.className="MaxPooling2D",Ql(pC);class fC extends dC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),oC(e,t,n,s,r,"avg")}}fC.className="AveragePooling2D",Ql(fC);class mC extends Vw{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 $y(`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];pb(this.poolSize,"poolSize"),pb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Eb(this.dataFormat),_b(this.padding),this.inputSpec=[new Fw({ndim:5})]}computeOutputShape(e){e=Iw(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=JA(t,this.poolSize[0],this.padding,this.strides[0]),n=JA(n,this.poolSize[1],this.padding,this.strides[1]),s=JA(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 To((()=>(this.invokeCallHook(e,t),this.poolingFunction(Tw(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 gC extends mC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),lC(e,t,n,s,r,"max")}}gC.className="MaxPooling3D",Ql(gC);class yC extends mC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),lC(e,t,n,s,r,"avg")}}yC.className="AveragePooling3D",Ql(yC);class bC extends Vw{constructor(e){super(e),this.inputSpec=[new Fw({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new Ky}}class wC extends bC{constructor(e){super(e||{})}call(e,t){return To((()=>{const t=Tw(e);return kd(t,1)}))}}wC.className="GlobalAveragePooling1D",Ql(wC);class vC extends bC{constructor(e){super(e||{})}call(e,t){return To((()=>{const t=Tw(e);return zh(t,1)}))}}vC.className="GlobalMaxPooling1D",Ql(vC);class AC extends Vw{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Eb(this.dataFormat),this.inputSpec=[new Fw({ndim:4})]}computeOutputShape(e){return"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new Ky}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class xC extends AC{call(e,t){return To((()=>{const t=Tw(e);return"channelsLast"===this.dataFormat?kd(t,[1,2]):kd(t,[2,3])}))}}xC.className="GlobalAveragePooling2D",Ql(xC);class CC extends AC{call(e,t){return To((()=>{const t=Tw(e);return"channelsLast"===this.dataFormat?zh(t,[1,2]):zh(t,[2,3])}))}}CC.className="GlobalMaxPooling2D",Ql(CC);class kC extends Vw{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=bv(t.layer,n);delete t.layer;const r={layer:s};return Object.assign(r,t),new e(r)}}class SC extends kC{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=Iw(e)).length<3)throw new $y(`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=Iw(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 To((()=>wx(((e,n)=>[Tw(this.layer.call(e,t)),[]]),e=Tw(e),[],!1,null,null,!1,!0)[1]))}}SC.className="TimeDistributed",Ql(SC);class EC extends kC{constructor(e){super(e);const t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=bv(n),t.goBackwards=!0!==t.goBackwards;const s={};var r;if(s.className=e.layer.getClassName(),s.config=t,this.backwardLayer=bv(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,hb(kb,"BidirectionalMergeMode",r),e.weights)throw new Ky("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()):eb(n)}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=bx(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 i=[],a=[];if(null!=n){const e=n.length;if(e%2>0)throw new $y("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,i.push(...n);const s=n.map((e=>new Fw({shape:e.shape})));this.forwardLayer.stateSpec=s.slice(0,e/2),this.backwardLayer.stateSpec=s.slice(e/2),a.push(...s)}if(null!=s)throw new Ky("Support for constants in Bidirectional layers is not implemented yet.");const o=i[0]instanceof Bw;for(const e of i)if(e instanceof Bw!==o)throw new $y("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(i),s=this.inputSpec.concat(a),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 To((()=>{const n=t.initialState;let s,r,i,a;if(null==n)s=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{const i=n.slice(0,n.length/2),a=n.slice(n.length/2);s=this.forwardLayer.call(e,Object.assign(t,{initialState:i})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:a}))}return this.returnState&&(Array.isArray(s)&&(i=s.slice(1).concat(r.slice(1))),s=s[0],r=r[0]),this.returnSequences&&(r=hp(r,1)),"concat"===this.mergeMode?a=$b([s,r]):"sum"===this.mergeMode?a=Pl(s,r):"ave"===this.mergeMode?a=Gl(.5,Pl(s,r)):"mul"===this.mergeMode?a=Gl(s,r):null==this.mergeMode&&(a=[s,r]),this.returnState?null==this.mergeMode?a.concat(i):[a].concat(i):a}))}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Ob(this.forwardLayer.name,(()=>{this.forwardLayer.build(e)})),Ob(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=bv(t.layer);if(delete t.layer,null!=t.numConstants)throw new Ky("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const s=t;return s.layer=n,new e(s)}}EC.className="Bidirectional",Ql(EC);class _C extends Vw{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 To((()=>("float32"!==(e=Tw(e)).dtype&&(e=Gb(e,"float32")),Pl(Gl(e,this.scale),this.offset))))}}_C.className="Rescaling",Ql(_C);const{resizeBilinear:TC,cropAndResize:IC}=ym;class NC extends Vw{constructor(e){super(e),this.height=e.height,this.width=e.width}centerCrop(e,t,n,s,r,i,a,o){return To((()=>{let l,c=!1;const u=[t/i,n/a,(s+t)/i,(r+n)/a],h=[];3===e.rank?(c=!0,l=Bp([e])):l=e;for(let e=0;eGb(TC(e,[t,n]),s)))}call(e,t){return To((()=>{const t=Tw(e),n=t.dtype,s=t.shape,r=s[s.length-3],i=s[s.length-2];let a=0;r!==this.height&&(a=Math.floor((r-this.height)/2));let o=0;return i!==this.width&&(o=Math.floor((i-this.width)/2),0===o&&(o=1)),a>=0&&o>=0?this.centerCrop(t,a,o,this.height,this.width,r,i,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=Iw(e)).length-3,n=e.length-2;return e[t]=this.height,e[n]=this.width,e}}NC.className="CenterCrop",Ql(NC);class OC extends Vw{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=Iw(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 To((()=>{let n;if("int32"!==(e=Tw(e)).dtype&&(e=Gb(e,"int32")),void 0!==t.countWeights){if("count"!==this.outputMode)throw new $y(`countWeights is not used when outputMode !== count.\n Received countWeights=${t.countWeights}`);n=Tw(t.countWeights)}const s=zh(e),r=Lh(e),i=Zh(this.numTokens,s).bufferSync().get(0),a=Yh(r,0).bufferSync().get(0);if(!i||!a)throw new $y(`Input values must be between 0 < values <= numTokens with numTokens=${this.numTokens}`);return function(e,t,n,s){let r=Tw(e);if("int32"!==r.dtype&&(r=Gb(r,"int32")),"int"===t)return r;const i=r.shape;if(0===r.rank&&(r=qh(r,-1)),"oneHot"===t&&1!==r.shape[r.shape.length-1]&&(r=qh(r,-1)),r.rank>2)throw new $y(`When outputMode is not int, maximum output rank is 2 Received outputMode ${t} and input shape ${i} which would result in output rank ${r.rank}.`);const a=["multiHot","oneHot"].includes(t);let o;if(o=gh(r,void 0!==s&&"count"===t?s:[],n,a),"tfIdf"!==t)return o;if(s)return Gl(o,s);throw new $y("When outputMode is 'tfIdf', weights must be provided.")}(e,this.outputMode,this.numTokens,n)}))}}OC.className="CategoryEncoding",Ql(OC);const DC=new Set(["bilinear","nearest"]);class RC extends Vw{constructor(e){if(super(e),this.height=e.height,this.width=e.width,e.interpolation){if(!DC.has(e.interpolation))throw new $y(`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=Iw(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 To((()=>{const t=[this.height,this.width];if("bilinear"===this.interpolation)return ym.resizeBilinear(e,t,!this.cropToAspectRatio);if("nearest"===this.interpolation)return ym.resizeNearestNeighbor(e,t,!this.cropToAspectRatio);throw new Error(`Interpolation is ${this.interpolation} but only ${[...DC]} are supported`)}))}}RC.className="Resizing",Ql(RC);class MC{constructor(e){this.seed=e}next(){if(void 0!==this.seed)return this.seed++}}MC.className="RandomSeed";class FC extends Vw{constructor(e){super(e),this.randomGenerator=new MC(e.seed)}getConfig(){const e={seed:this.randomGenerator.seed},t=super.getConfig();return Object.assign(e,t),e}}FC.className="BaseRandomLayer";const BC=new Set(["bilinear","nearest"]);class zC extends FC{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 $y(`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 $y(`factor must have values larger than -1. Got: ${this.factor}`);if(this.widthUpper{const t=Tw(e);this.imgHeight=t.shape[t.shape.length-3];const n=t.shape[t.shape.length-2];this.widthFactor=rp([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 ym.resizeBilinear(e,r);case"nearest":return ym.resizeNearestNeighbor(e,r);default:throw new Error(`Interpolation is ${this.interpolation}\n but only ${[...BC]} are supported`)}}))}}zC.className="RandomWidth",Ql(zC);var LC,PC,VC;En().registerFlag("KEEP_INTERMEDIATE_TENSORS",(()=>!1),(e=>{})),(PC=LC||(LC={}))[PC.DT_INVALID=0]="DT_INVALID",PC[PC.DT_FLOAT=1]="DT_FLOAT",PC[PC.DT_DOUBLE=2]="DT_DOUBLE",PC[PC.DT_INT32=3]="DT_INT32",PC[PC.DT_UINT8=4]="DT_UINT8",PC[PC.DT_INT16=5]="DT_INT16",PC[PC.DT_INT8=6]="DT_INT8",PC[PC.DT_STRING=7]="DT_STRING",PC[PC.DT_COMPLEX64=8]="DT_COMPLEX64",PC[PC.DT_INT64=9]="DT_INT64",PC[PC.DT_BOOL=10]="DT_BOOL",PC[PC.DT_QINT8=11]="DT_QINT8",PC[PC.DT_QUINT8=12]="DT_QUINT8",PC[PC.DT_QINT32=13]="DT_QINT32",PC[PC.DT_BFLOAT16=14]="DT_BFLOAT16",PC[PC.DT_QINT16=15]="DT_QINT16",PC[PC.DT_QUINT16=16]="DT_QUINT16",PC[PC.DT_UINT16=17]="DT_UINT16",PC[PC.DT_COMPLEX128=18]="DT_COMPLEX128",PC[PC.DT_HALF=19]="DT_HALF",PC[PC.DT_RESOURCE=20]="DT_RESOURCE",PC[PC.DT_VARIANT=21]="DT_VARIANT",PC[PC.DT_UINT32=22]="DT_UINT32",PC[PC.DT_UINT64=23]="DT_UINT64",PC[PC.DT_FLOAT_REF=101]="DT_FLOAT_REF",PC[PC.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",PC[PC.DT_INT32_REF=103]="DT_INT32_REF",PC[PC.DT_UINT8_REF=104]="DT_UINT8_REF",PC[PC.DT_INT16_REF=105]="DT_INT16_REF",PC[PC.DT_INT8_REF=106]="DT_INT8_REF",PC[PC.DT_STRING_REF=107]="DT_STRING_REF",PC[PC.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",PC[PC.DT_INT64_REF=109]="DT_INT64_REF",PC[PC.DT_BOOL_REF=110]="DT_BOOL_REF",PC[PC.DT_QINT8_REF=111]="DT_QINT8_REF",PC[PC.DT_QUINT8_REF=112]="DT_QUINT8_REF",PC[PC.DT_QINT32_REF=113]="DT_QINT32_REF",PC[PC.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",PC[PC.DT_QINT16_REF=115]="DT_QINT16_REF",PC[PC.DT_QUINT16_REF=116]="DT_QUINT16_REF",PC[PC.DT_UINT16_REF=117]="DT_UINT16_REF",PC[PC.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",PC[PC.DT_HALF_REF=119]="DT_HALF_REF",PC[PC.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",PC[PC.DT_VARIANT_REF=121]="DT_VARIANT_REF",PC[PC.DT_UINT32_REF=122]="DT_UINT32_REF",PC[PC.DT_UINT64_REF=123]="DT_UINT64_REF",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={}))}(VC||(VC={}));const WC={};function GC(e){return WC[e]}function UC(e,t,n,s,r){const i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){const e=i.inputIndexStart,a=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?e+1:i.inputIndexEnd,o=e<0?t.inputNames.length+e:e;if("tensor"===i.type)return qC(t.inputNames[o],n,s,r);if("tensors"===i.type){const i=t.inputs.slice(e,a);return t.inputNames.slice(e,a).filter(((e,t)=>{var n;return"NoOp"!==(null===(n=i[t])||void 0===n?void 0:n.op)})).map((e=>qC(e,n,s,r)))}const l=qC(t.inputNames[o],n,s,r),c=l.dataSync();return"number"===i.type?c[0]:mn(l.shape,c)}const a=t.attrParams[e];return a&&a.value}function qC(e,t,n,s){const[r,i]=KC(e,n);if(null!=s){const e=s.getHashTableHandleByName(r);if(null!=e)return e}const a=n.currentContextIds.find((e=>!!t[$C(r,e)]));return void 0!==a?t[$C(r,a)][i]:void 0}function jC(e,t,n){return t[$C(e,n.currentContextId)]}function HC(e,t){const[n,s,r]=KC(e,t);return[$C(n,t&&t.currentContextId),s,r]}function $C(e,t){return t?`${e}-${t}`:e}function KC(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 XC(e,t,n){let s=UC("pad",e,t,n);if("explicit"===s){s=UC("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 ZC(e){return e.kept?e:zl(e)}const YC=[{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}]}],QC=[{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}]}],JC=[{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"}]}],ek=[{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"}]}],tk=[{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"}]}],nk=[{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}]}],sk=[{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"}]}],rk=[{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"}]}],ik=[{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"}]}],ak=[{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"}]}],ok=[{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"}]}],lk=[{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"}]}],ck=[{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"}]}],uk=[{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"}]}],hk=[{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"}]}],dk=[{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"}]}],pk=[{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}]}],fk=[{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"}]}],mk=[{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 gk{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[i,a,o,l,c,u,h,d,p,f,m,g,y,b,w,v,A,x,C].map((e=>e.json)));this.opMappers=e.reduce(((e,t)=>(e[t.tfOpName]=t,e)),{})}transformGraph(e,t={}){const n=e.node,s=[],r=[],i=[],a=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||i.push(e[t.name]),e)),{});let o=[];const l=[];let c={},u={};null!=t&&(c=this.mapSignatureEntries(t.inputs),u=this.mapSignatureEntries(t.outputs));const h=Object.keys(a);h.forEach((e=>{const t=a[e];t.inputNames.forEach(((e,n)=>{const[s,,r]=HC(e),i=a[s];if(null!=i.outputs){const e=i.outputs.indexOf(r);if(-1!==e){const r=`${s}:${e}`;t.inputNames[n]=r}}t.inputs.push(i),i.children.push(t)}))})),0===Object.keys(u).length?h.forEach((e=>{const t=a[e];0===t.children.length&&l.push(t)})):Object.keys(u).forEach((e=>{const[t]=HC(e),n=a[t];null!=n&&(n.signatureKey=u[e],l.push(n))})),Object.keys(c).length>0?Object.keys(c).forEach((e=>{const[t]=HC(e),n=a[t];n&&(n.signatureKey=c[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:a,inputs:o,outputs:l,weights:r,placeholders:s,signature:t,functions:d};return i.length>0&&(p.initNodes=i),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce(((t,n)=>(t[e[n].name]=n,t)),{})}mapNode(e){const t=GC(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=bk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=bk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":r=Tk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Tk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":r=vk(e.attr,n.tfName,n.defaultValue||0),void 0===r&&n.tfDeprecatedName&&(r=vk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":r=_k(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=_k(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":r=wk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=wk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":r=Nk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Nk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":r=Ek(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Ek(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":r=Ik(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Ik(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":r=Ck(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Ck(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":r=kk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=kk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":r=xk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=xk(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=[],i=[];e.signature.inputArg.forEach((e=>{const[t]=HC(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:Ak(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,,i]=HC(e),a=s[r];if(null!=a.outputs){const e=a.outputs.indexOf(i);if(-1!==e){const s=`${r}:${e}`;t.inputNames[n]=s}}t.inputs.push(a),a.children.push(t)}))}));const a=e.ret;e.signature.outputArg.forEach((e=>{const[t,n]=HC(a[e.name]),r=s[t];null!=r&&(r.defaultOutput=n,i.push(r))}));const o=this.mapArgsToSignature(e);return{nodes:s,inputs:r,outputs:i,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 yk(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=En().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 bk(e,t,n,s=!1){const r=e[t];return null!=r?yk(r.s,s):n}function wk(e,t,n){const s=e[t];return s?s.b:n}function vk(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 Ak(e){switch("string"==typeof e&&(e=LC[e]),e){case LC.DT_FLOAT:case LC.DT_HALF:return"float32";case LC.DT_INT32:case LC.DT_INT64:case LC.DT_INT8:case LC.DT_UINT8:return"int32";case LC.DT_BOOL:return"bool";case LC.DT_DOUBLE:return"float32";case LC.DT_STRING:return"string";case LC.DT_COMPLEX64:case LC.DT_COMPLEX128:return"complex64";default:return null}}function xk(e,t,n){const s=e[t];return s&&s.func?s.func.name:n}function Ck(e,t,n){const s=e[t];return s&&s.type?Ak(s.type):n}function kk(e,t,n){const s=e[t];return s&&s.list&&s.list.type?s.list.type.map((e=>Ak(e))):n}function Sk(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((e=>"number"==typeof e.size?e.size:parseInt(e.size,10))):[]}function Ek(e,t,n){const s=e[t];return s&&s.shape?Sk(s.shape):n}function _k(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 Tk(e,t,n,s=!1){const r=e[t];return r&&r.list&&r.list.s?r.list.s.map((e=>yk(e,s))):n}function Ik(e,t,n){const s=e[t];return s&&s.list&&s.list.shape?s.list.shape.map((e=>Sk(e))):n}function Nk(e,t,n){const s=e[t];return s&&s.list&&s.list.b?s.list.b:n}class Ok{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 qC(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return qC(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return vk(this.node.rawAttrs,e,t);if(null!=n.s)return bk(this.node.rawAttrs,e,t);if(null!=n.b)return wk(this.node.rawAttrs,e,t);if(null!=n.shape)return Ek(this.node.rawAttrs,e,t);if(null!=n.type)return Ck(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return _k(this.node.rawAttrs,e,t);if(null!=n.list.s)return Tk(this.node.rawAttrs,e,t);if(null!=n.list.shape)return Ik(this.node.rawAttrs,e,t);if(null!=n.list.b)return Nk(this.node.rawAttrs,e,t);if(null!=n.list.type)return kk(this.node.rawAttrs,e,t)}return t}}function Dk(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){jt(e.length===t.length,(()=>n+` Shapes ${e} and ${t} must match`));for(let s=0;sn+` Shapes ${e} and ${t} must match`))}}}function Rk(e){return"number"!=typeof e&&!e.some((e=>e<0))}function Mk(e,t,n){let s=Fk(e,n);const r=!Rk(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=Fk(e.shape,s)})),!Rk(s))throw new Error(`Non-fully-defined elementShape: ${s}`);return s}function Fk(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&&i>=0&&r!==i)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[s]=r>=0?r:i}return n}class Bk{constructor(e,t,n,s,r,i,a){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=s,this.identicalElementShapes=r,this.dynamicSize=i,this.clearAfterRead=a,this.tensors=[],this.closed_=!1,this.idTensor=$l(0),No(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),Dk(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,No(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,Jp(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,i=[];To((()=>{t=Fu(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}`);Dk(t,e.shape,"TensorList shape mismatch: "),No(e)})),this.idTensor=$l(0),this.maxNumElements=s,No(this.idTensor)}copy(){return new zk([...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.`);Dk(e,this.elementShape,"TensorList shape mismatch: ");const s=Mk(this.elementShape,this.tensors,e);return To((()=>{const e=this.tensors.map((e=>Fu(e,s)));return Bp(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=Mk(this.elementShape,this.tensors,e),s=this.tensors.pop();return s.kept=!1,Dk(s.shape,e,"TensorList shape mismatch: "),Fu(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(Dk(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");No(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 zk([],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.`);Dk(this.tensors[e].shape,t,"TensorList shape mismatch: ");const s=Mk(this.elementShape,this.tensors,t);return Fu(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.`);Dk(this.elementShape,t.shape,"TensorList shape mismatch: "),No(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}`);Dk(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const s=Mk(this.elementShape,this.tensors,n);return 0===e.length?Co([],[0].concat(s)):To((()=>{const t=e.map((e=>Fu(this.tensors[e],s)));return Bp(t,0)}))}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);Dk(this.elementShape,t,"TensorList shape mismatch: ");const n=Mk(this.elementShape,this.tensors,t);return 0===this.size()?Co([],[0].concat(n)):To((()=>{const e=this.tensors.map((e=>Fu(e,n)));return Lu(e,0)}))}}const Lk=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const s=UC("thenBranch",e,t,n),r=UC("elseBranch",e,t,n),i=UC("cond",e,t,n),a=UC("args",e,t,n);return(await i.data())[0]?n.functionMap[s].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const s=UC("body",e,t,n),r=UC("cond",e,t,n),i=UC("args",e,t,n),a=await n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap),o=i.map((e=>e.id));let l=await a[0].data();a.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||e.dispose()}));let c=i;for(;l[0];){const e=c;c=await n.functionMap[s].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);const t=c.map((e=>e.id));e.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}));const i=await n.functionMap[r].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);l=await i[0].data(),i.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}))}return c}case"LoopCond":return[ZC(UC("pred",e,t,n))];case"Switch":{const s=UC("pred",e,t,n);let r=UC("data",e,t,n);return r.kept||(r=ZC(r)),(await s.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{const s=e.inputNames.find((e=>void 0!==qC(e,t,n)));if(s){return[ZC(qC(s,t,n))]}return}case"Enter":{const s=UC("frameName",e,t,n),r=UC("tensor",e,t,n);return n.enterFrame(s),[ZC(r)]}case"Exit":{const s=UC("tensor",e,t,n);return n.exitFrame(),[ZC(s)]}case"NextIteration":{const s=UC("tensor",e,t,n);return n.nextIteration(),[ZC(s)]}case"TensorArrayV3":{const s=UC("size",e,t,n),r=UC("dtype",e,t,n),i=UC("elementShape",e,t,n),a=UC("dynamicSize",e,t,n),o=UC("clearAfterRead",e,t,n),l=UC("identicalElementShapes",e,t,n),c=UC("name",e,t,n),u=new Bk(c,r,s,i,l,a,o);return n.addTensorArray(u),[u.idTensor,$l(1)]}case"TensorArrayWriteV3":{const s=UC("tensorArrayId",e,t,n),r=UC("index",e,t,n),i=UC("tensor",e,t,n),a=n.getTensorArray(s.id);return a.write(r,i),[a.idTensor]}case"TensorArrayReadV3":{const s=UC("tensorArrayId",e,t,n),r=UC("index",e,t,n);return[n.getTensorArray(s.id).read(r)]}case"TensorArrayGatherV3":{const s=UC("tensorArrayId",e,t,n),r=UC("indices",e,t,n),i=UC("dtype",e,t,n);return[n.getTensorArray(s.id).gather(r,i)]}case"TensorArrayScatterV3":{const s=UC("tensorArrayId",e,t,n),r=UC("indices",e,t,n),i=UC("tensor",e,t,n),a=n.getTensorArray(s.id);return a.scatter(r,i),[a.idTensor]}case"TensorArrayConcatV3":{const s=UC("tensorArrayId",e,t,n),r=n.getTensorArray(s.id),i=UC("dtype",e,t,n);return[r.concat(i)]}case"TensorArraySplitV3":{const s=UC("tensorArrayId",e,t,n),r=UC("tensor",e,t,n),i=UC("lengths",e,t,n),a=n.getTensorArray(s.id);return a.split(i,r),[a.idTensor]}case"TensorArraySizeV3":{const s=UC("tensorArrayId",e,t,n);return[$l(n.getTensorArray(s.id).size(),"int32")]}case"TensorArrayCloseV3":{const s=UC("tensorArrayId",e,t,n),r=n.getTensorArray(s.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{const s=UC("tensorListId",e,t,n),r=UC("index",e,t,n),i=UC("tensor",e,t,n),a=n.getTensorList(s.id);return a.setItem(r,i),[a.idTensor]}case"TensorListGetItem":{const s=UC("tensorListId",e,t,n),r=UC("index",e,t,n),i=UC("elementShape",e,t,n),a=UC("elementDType",e,t,n);return[n.getTensorList(s.id).getItem(r,i,a)]}case"TensorListScatterV2":case"TensorListScatter":{const s=UC("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 i=new zk([],n,e.dtype,s),a=Jp(e,0);return t.forEach(((e,t)=>{i.setItem(e,a[t])})),i}(UC("tensor",e,t,n),s,UC("elementShape",e,t,n),UC("numElements",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const s=UC("elementShape",e,t,n),r=UC("elementDType",e,t,n);let i;i="TensorListReserve"===e.op?"numElements":"maxNumElements";const a=UC(i,e,t,n),o=function(e,t,n,s){return new zk([],e,t,s)}(s,r,0,"TensorListReserve"===e.op?-1:a);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{const s=UC("tensorListId",e,t,n),r=UC("indices",e,t,n),i=UC("elementShape",e,t,n),a=UC("elementDType",e,t,n);return[n.getTensorList(s.id).gather(r,a,i)]}case"TensorListStack":{const s=UC("tensorListId",e,t,n),r=UC("elementShape",e,t,n),i=UC("elementDType",e,t,n),a=UC("numElements",e,t,n);return[n.getTensorList(s.id).stack(r,i,a)]}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}`);Dk(e.shape.slice(1),t,"TensorList shape mismatch: ");const r=Jp(e);return new zk(r,t,s)}(UC("tensor",e,t,n),UC("elementShape",e,t,n),UC("elementDType",e,t,n));return n.addTensorList(s),[s.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const s=UC("tensorListId",e,t,n),r=n.getTensorList(s.id),i=UC("dtype",e,t,n),a=UC("elementShape",e,t,n);return[r.concat(i,a)]}case"TensorListPushBack":{const s=UC("tensorListId",e,t,n),r=UC("tensor",e,t,n),i=n.getTensorList(s.id);return i.pushBack(r),[i.idTensor]}case"TensorListPopBack":{const s=UC("tensorListId",e,t,n),r=UC("elementShape",e,t,n),i=UC("elementDType",e,t,n);return[n.getTensorList(s.id).popBack(r,i)]}case"TensorListSplit":{const s=UC("tensor",e,t,n),r=UC("elementShape",e,t,n),i=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 i=Fk(e.shape.slice(1),n),a=0===s?0:e.size/s,o=To((()=>{const n=[];e=Fu(e,[1,s,a]);for(let s=0;se.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return $l(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(),To((()=>{const e=Jp(t),s=n.length,r=e.length;jt(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=k)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[s.add(UC("a",e,t,n),UC("b",e,t,n))];case"AddN":return[s.addN(UC("tensors",e,t,n))];case"FloorMod":case"Mod":return[s.mod(UC("a",e,t,n),UC("b",e,t,n))];case"Mul":return[s.mul(UC("a",e,t,n),UC("b",e,t,n))];case"RealDiv":case"Div":return[s.div(UC("a",e,t,n),UC("b",e,t,n))];case"DivNoNan":return[s.divNoNan(UC("a",e,t,n),UC("b",e,t,n))];case"FloorDiv":return[s.floorDiv(UC("a",e,t,n),UC("b",e,t,n))];case"Sub":return[s.sub(UC("a",e,t,n),UC("b",e,t,n))];case"Minimum":return[s.minimum(UC("a",e,t,n),UC("b",e,t,n))];case"Maximum":return[s.maximum(UC("a",e,t,n),UC("b",e,t,n))];case"Pow":return[s.pow(UC("a",e,t,n),UC("b",e,t,n))];case"SquaredDifference":return[s.squaredDifference(UC("a",e,t,n),UC("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=k)=>{switch(e.op){case"Abs":case"ComplexAbs":return[s.abs(UC("x",e,t,n))];case"Acos":return[s.acos(UC("x",e,t,n))];case"Acosh":return[s.acosh(UC("x",e,t,n))];case"Asin":return[s.asin(UC("x",e,t,n))];case"Asinh":return[s.asinh(UC("x",e,t,n))];case"Atan":return[s.atan(UC("x",e,t,n))];case"Atan2":return[s.atan2(UC("x",e,t,n),UC("y",e,t,n))];case"Atanh":return[s.atanh(UC("x",e,t,n))];case"Ceil":return[s.ceil(UC("x",e,t,n))];case"Complex":return[s.complex(UC("real",e,t,n),UC("imag",e,t,n))];case"Cos":return[s.cos(UC("x",e,t,n))];case"Cosh":return[s.cosh(UC("x",e,t,n))];case"Elu":return[s.elu(UC("x",e,t,n))];case"Erf":return[s.erf(UC("x",e,t,n))];case"Exp":return[s.exp(UC("x",e,t,n))];case"Expm1":return[s.expm1(UC("x",e,t,n))];case"Floor":return[s.floor(UC("x",e,t,n))];case"Log":return[s.log(UC("x",e,t,n))];case"Log1p":return[s.log1p(UC("x",e,t,n))];case"Imag":return[s.imag(UC("x",e,t,n))];case"Neg":return[s.neg(UC("x",e,t,n))];case"Reciprocal":return[s.reciprocal(UC("x",e,t,n))];case"Real":return[s.real(UC("x",e,t,n))];case"Relu":return[s.relu(UC("x",e,t,n))];case"Round":return[s.round(UC("x",e,t,n))];case"Selu":return[s.selu(UC("x",e,t,n))];case"Sigmoid":return[s.sigmoid(UC("x",e,t,n))];case"Sin":return[s.sin(UC("x",e,t,n))];case"Sign":return[s.sign(UC("x",e,t,n))];case"Sinh":return[s.sinh(UC("x",e,t,n))];case"Softplus":return[s.softplus(UC("x",e,t,n))];case"Sqrt":return[s.sqrt(UC("x",e,t,n))];case"Square":return[s.square(UC("x",e,t,n))];case"Tanh":return[s.tanh(UC("x",e,t,n))];case"Tan":return[s.tan(UC("x",e,t,n))];case"ClipByValue":return[s.clipByValue(UC("x",e,t,n),UC("clipValueMin",e,t,n),UC("clipValueMax",e,t,n))];case"Relu6":return[s.relu6(UC("x",e,t,n))];case"Rsqrt":return[s.rsqrt(qC(e.inputNames[0],t,n))];case"LeakyRelu":return[s.leakyRelu(UC("x",e,t,n),UC("alpha",e,t,n))];case"Prelu":return[s.prelu(UC("x",e,t,n),UC("alpha",e,t,n))];case"IsNan":return[s.isNaN(qC(e.inputNames[0],t,n))];case"IsInf":return[s.isInf(qC(e.inputNames[0],t,n))];case"IsFinite":return[s.isFinite(qC(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"control":return Lk(e,t,n);case"convolution":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Conv1D":{const r=UC("stride",e,t,n),i=UC("pad",e,t,n),a=UC("dataFormat",e,t,n).toUpperCase(),o=UC("dilation",e,t,n);return[s.conv1d(UC("x",e,t,n),UC("filter",e,t,n),r,i,a,o)]}case"Conv2D":{const r=UC("strides",e,t,n),i=XC(e,t,n),a=UC("dataFormat",e,t,n).toUpperCase(),o=UC("dilations",e,t,n);return[s.conv2d(UC("x",e,t,n),UC("filter",e,t,n),[r[1],r[2]],i,a,[o[1],o[2]])]}case"_FusedConv2D":{const{stride:r,pad:i,dataFormat:a,dilations:o,biasArg:l,preluArg:c,activationFunc:u,leakyreluAlpha:h}=Pk(e,t,n);return[s.fused.conv2d({x:UC("x",e,t,n),filter:UC("filter",e,t,n),strides:[r[1],r[2]],pad:i,dataFormat:a,dilations:[o[1],o[2]],bias:l,activation:u,preluActivationWeights:c,leakyreluAlpha:h})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:i,dataFormat:a,dilations:o,biasArg:l,preluArg:c,activationFunc:u,leakyreluAlpha:h}=Pk(e,t,n);return[s.fused.depthwiseConv2d({x:UC("x",e,t,n),filter:UC("filter",e,t,n),strides:[r[1],r[2]],pad:i,dataFormat:a,dilations:[o[1],o[2]],bias:l,activation:u,preluActivationWeights:c,leakyreluAlpha:h})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=UC("outputShape",e,t,n),i=UC("strides",e,t,n),a=XC(e,t,n);return[s.conv2dTranspose(UC("x",e,t,n),UC("filter",e,t,n),r,[i[1],i[2]],a)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=UC("strides",e,t,n),i=XC(e,t,n),a=UC("dilations",e,t,n),o=UC("dataFormat",e,t,n).toUpperCase();return[s.depthwiseConv2d(UC("input",e,t,n),UC("filter",e,t,n),[r[1],r[2]],i,o,[a[1],a[2]])]}case"Conv3D":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("dataFormat",e,t,n).toUpperCase(),o=UC("dilations",e,t,n);return[s.conv3d(UC("x",e,t,n),UC("filter",e,t,n),[r[1],r[2],r[3]],i,a,[o[1],o[2],o[3]])]}case"AvgPool":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("kernelSize",e,t,n);return[s.avgPool(UC("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i)]}case"MaxPool":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("kernelSize",e,t,n);return[s.maxPool(UC("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i)]}case"MaxPoolWithArgmax":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("kernelSize",e,t,n),o=UC("includeBatchInIndex",e,t,n),{result:l,indexes:c}=s.maxPoolWithArgmax(UC("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i,o);return[l,c]}case"AvgPool3D":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("kernelSize",e,t,n);return[s.avgPool3d(UC("x",e,t,n),[a[1],a[2],a[3]],[r[1],r[2],r[3]],i)]}case"MaxPool3D":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("kernelSize",e,t,n);return[s.maxPool3d(UC("x",e,t,n),[a[1],a[2],a[3]],[r[1],r[2],r[3]],i)]}case"Dilation2D":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("dilations",e,t,n),o=r[1],l=r[2],c=a[1],u=a[2];return[s.dilation2d(UC("x",e,t,n),UC("filter",e,t,n),[o,l],i,[c,u],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"creation":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Fill":{const r=UC("shape",e,t,n),i=UC("dtype",e,t,n),a=UC("value",e,t,n);return[s.fill(r,a,i)]}case"LinSpace":{const r=UC("start",e,t,n),i=UC("stop",e,t,n),a=UC("num",e,t,n);return[s.linspace(r,i,a)]}case"Multinomial":{const r=UC("logits",e,t,n),i=UC("numSamples",e,t,n),a=UC("seed",e,t,n);return[s.multinomial(r,i,a)]}case"OneHot":{const r=UC("indices",e,t,n),i=UC("depth",e,t,n),a=UC("onValue",e,t,n),o=UC("offValue",e,t,n),l=UC("dtype",e,t,n);return[s.oneHot(r,i,a,o,l)]}case"Ones":return[s.ones(UC("shape",e,t,n),UC("dtype",e,t,n))];case"OnesLike":return[s.onesLike(UC("x",e,t,n))];case"RandomStandardNormal":return[s.randomStandardNormal(UC("shape",e,t,n),UC("dtype",e,t,n),UC("seed",e,t,n))];case"RandomUniform":return[s.randomUniform(UC("shape",e,t,n),UC("minval",e,t,n),UC("maxval",e,t,n),UC("dtype",e,t,n))];case"RandomUniformInt":return[s.randomUniformInt(UC("shape",e,t,n),UC("minval",e,t,n),UC("maxval",e,t,n),UC("seed",e,t,n))];case"Range":{const r=UC("start",e,t,n),i=UC("stop",e,t,n),a=UC("step",e,t,n);return[s.range(r,i,a,UC("dtype",e,t,n))]}case"TruncatedNormal":{const r=UC("shape",e,t,n),i=UC("mean",e,t,n),a=UC("stdDev",e,t,n),o=UC("seed",e,t,n);return[s.truncatedNormal(r,i,a,UC("dtype",e,t,n),o)]}case"Zeros":return[s.zeros(UC("shape",e,t,n),UC("dtype",e,t,n))];case"ZerosLike":return[s.zerosLike(UC("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=k)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l,softNmsSigma:c}=Vk(e,t,n),u=await r.image.nonMaxSuppressionWithScoreAsync(s,i,a,o,l,c);return[u.selectedIndices,u.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=Vk(e,t,n),c=UC("padToMaxOutputSize",e,t,n),u=await r.image.nonMaxSuppressionPaddedAsync(s,i,a,o,l,c);return[u.selectedIndices,u.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=Vk(e,t,n);return[await r.image.nonMaxSuppressionAsync(s,i,a,o,l)]}case"Where":{const s=r.cast(UC("condition",e,t,n),"bool"),i=[await r.whereAsync(s)];return s.dispose(),i}case"ListDiff":return r.setdiff1dAsync(UC("x",e,t,n),UC("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=k)=>{switch(e.op){case"LowerBound":{const r=UC("sortedSequence",e,t,n),i=UC("values",e,t,n);return[s.lowerBound(r,i)]}case"TopKV2":{const r=UC("x",e,t,n),i=UC("k",e,t,n),a=UC("sorted",e,t,n),o=s.topk(r,i,a);return[o.values,o.indices]}case"UpperBound":{const r=UC("sortedSequence",e,t,n),i=UC("values",e,t,n);return[s.upperBound(r,i)]}case"Unique":{const r=UC("x",e,t,n),i=s.unique(r);return[i.values,i.indices]}case"UniqueV2":{const r=UC("x",e,t,n),i=UC("axis",e,t,n),a=s.unique(r,i);return[a.values,a.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"image":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"ResizeBilinear":{const r=UC("images",e,t,n),i=UC("size",e,t,n),a=UC("alignCorners",e,t,n),o=UC("halfPixelCenters",e,t,n);return[s.image.resizeBilinear(r,[i[0],i[1]],a,o)]}case"ResizeNearestNeighbor":{const r=UC("images",e,t,n),i=UC("size",e,t,n),a=UC("alignCorners",e,t,n),o=UC("halfPixelCenters",e,t,n);return[s.image.resizeNearestNeighbor(r,[i[0],i[1]],a,o)]}case"CropAndResize":{const r=UC("image",e,t,n),i=UC("boxes",e,t,n),a=UC("boxInd",e,t,n),o=UC("cropSize",e,t,n),l=UC("method",e,t,n),c=UC("extrapolationValue",e,t,n);return[s.image.cropAndResize(r,i,a,o,l,c)]}case"ImageProjectiveTransformV3":{const r=UC("images",e,t,n),i=UC("transforms",e,t,n),a=UC("outputShape",e,t,n),o=UC("fillValue",e,t,n),l=UC("interpolation",e,t,n),c=UC("fillMode",e,t,n);return[s.image.transform(r,i,l.toLowerCase(),c.toLowerCase(),o,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"graph":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=UC("default",e,t,n);return[qC(e.name,t,n)||r];case"Placeholder":return[qC(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[ZC(UC("x",e,t,n))];case"IdentityN":return UC("x",e,t,n).map((e=>ZC(e)));case"Shape":return[s.tensor1d(UC("x",e,t,n).shape,"int32")];case"ShapeN":return UC("x",e,t,n).map((e=>s.tensor1d(e.shape)));case"Size":return[s.scalar(UC("x",e,t,n).size,"int32")];case"Rank":return[s.scalar(UC("x",e,t,n).rank,"int32")];case"NoOp":return[s.scalar(1)];case"Print":const i=UC("x",e,t,n),a=UC("data",e,t,n);UC("message",e,t,n),UC("summarize",e,t,n);for(let e=0;e((e,t,n,s=k)=>{switch(e.op){case"Equal":return[s.equal(UC("a",e,t,n),UC("b",e,t,n))];case"NotEqual":return[s.notEqual(UC("a",e,t,n),UC("b",e,t,n))];case"Greater":return[s.greater(UC("a",e,t,n),UC("b",e,t,n))];case"GreaterEqual":return[s.greaterEqual(UC("a",e,t,n),UC("b",e,t,n))];case"Less":return[s.less(UC("a",e,t,n),UC("b",e,t,n))];case"LessEqual":return[s.lessEqual(UC("a",e,t,n),UC("b",e,t,n))];case"LogicalAnd":return[s.logicalAnd(UC("a",e,t,n),UC("b",e,t,n))];case"LogicalNot":return[s.logicalNot(UC("a",e,t,n))];case"LogicalOr":return[s.logicalOr(UC("a",e,t,n),UC("b",e,t,n))];case"Select":case"SelectV2":return[s.where(UC("condition",e,t,n),UC("a",e,t,n),UC("b",e,t,n))];case"BitwiseAnd":return[s.bitwiseAnd(UC("a",e,t,n),UC("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=k)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[s.matMul(UC("a",e,t,n),UC("b",e,t,n),UC("transposeA",e,t,n),UC("transposeB",e,t,n))];case"Einsum":return[s.einsum(UC("equation",e,t,n),...UC("tensors",e,t,n))];case"Transpose":return[s.transpose(UC("x",e,t,n),UC("perm",e,t,n))];case"_FusedMatMul":const[r,i]=UC("fusedOps",e,t,n),a="biasadd"===r,o="prelu"===i,l=UC("numArgs",e,t,n),c=UC("leakyreluAlpha",e,t,n);if(a){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[u,h]=UC("args",e,t,n);return[s.fused.matMul({a:UC("a",e,t,n),b:UC("b",e,t,n),transposeA:UC("transposeA",e,t,n),transposeB:UC("transposeB",e,t,n),bias:u,activation:i,preluActivationWeights:h,leakyreluAlpha:c})];case"MatrixBandPart":return[s.linalg.bandPart(UC("a",e,t,n),UC("numLower",e,t,n),UC("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=k)=>{switch(e.op){case"EuclideanNorm":return[s.euclideanNorm(UC("x",e,t,n),UC("axis",e,t,n),UC("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[s.batchNorm(UC("x",e,t,n),UC("mean",e,t,n),UC("variance",e,t,n),UC("offset",e,t,n),UC("scale",e,t,n),UC("epsilon",e,t,n))];case"LRN":return[s.localResponseNormalization(UC("x",e,t,n),UC("radius",e,t,n),UC("bias",e,t,n),UC("alpha",e,t,n),UC("beta",e,t,n))];case"Softmax":return[s.softmax(UC("x",e,t,n))];case"LogSoftmax":return[s.logSoftmax(UC("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=k)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:r,outputDenseValues:i}=s.raggedGather(UC("paramsNestedSplits",e,t,n),UC("paramsDenseValues",e,t,n),UC("indices",e,t,n),UC("outputRaggedRank",e,t,n));return r.concat(i)}case"RaggedRange":{const{rtNestedSplits:r,rtDenseValues:i}=s.raggedRange(UC("starts",e,t,n),UC("limits",e,t,n),UC("splits",e,t,n));return[r,i]}case"RaggedTensorToTensor":return[s.raggedTensorToTensor(UC("shape",e,t,n),UC("values",e,t,n),UC("defaultValue",e,t,n),UC("rowPartitionTensors",e,t,n),UC("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=k)=>{switch(e.op){case"Max":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.max(UC("x",e,t,n),r,i)]}case"Mean":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.mean(UC("x",e,t,n),r,i)]}case"Min":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.min(UC("x",e,t,n),r,i)]}case"Sum":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.sum(UC("x",e,t,n),r,i)]}case"All":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.all(UC("x",e,t,n),r,i)]}case"Any":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.any(UC("x",e,t,n),r,i)]}case"ArgMax":{const r=UC("axis",e,t,n);return[s.argMax(UC("x",e,t,n),r)]}case"ArgMin":{const r=UC("axis",e,t,n);return[s.argMin(UC("x",e,t,n),r)]}case"Prod":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.prod(UC("x",e,t,n),r,i)]}case"Cumprod":{const r=UC("axis",e,t,n),i=UC("exclusive",e,t,n),a=UC("reverse",e,t,n);return[s.cumprod(UC("x",e,t,n),r,i,a)]}case"Cumsum":{const r=UC("axis",e,t,n),i=UC("exclusive",e,t,n),a=UC("reverse",e,t,n);return[s.cumsum(UC("x",e,t,n),r,i,a)]}case"Bincount":const r=UC("x",e,t,n),i=UC("weights",e,t,n),a=UC("size",e,t,n);return[s.bincount(r,i,a)];case"DenseBincount":{const r=UC("x",e,t,n),i=UC("weights",e,t,n),a=UC("size",e,t,n),o=UC("binaryOutput",e,t,n);return[s.denseBincount(r,i,a,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"slice_join":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=UC("n",e,t,n),i=UC("axis",e,t,n);let a=UC("tensors",e,t,n);return a=a.slice(0,r),[s.concat(a,i)]}case"Gather":{const r=UC("x",e,t,n),i=UC("indices",e,t,n);return[s.gather(r,s.cast(i,"int32"),0)]}case"GatherV2":{const r=UC("axis",e,t,n),i=UC("batchDims",e,t,n),a=UC("x",e,t,n),o=UC("indices",e,t,n);return[s.gather(a,s.cast(o,"int32"),r,i)]}case"Reverse":{const r=UC("dims",e,t,n),i=[];for(let e=0;e{const r=UC("axis",e,t,n),i=UC("tensors",e,t,n),a=i[0].shape,o=s.squeeze(i[0]).shape,l=i.map((e=>{const t=Xt(e.shape,a);if(!t&&!Xt(s.squeeze(e).shape,o))throw new Error("the input tensors shape does not match");return t?e:s.reshape(e,a)}));return[s.stack(l,r)]}));case"Unpack":{const r=UC("axis",e,t,n),i=UC("tensor",e,t,n);return s.unstack(i,r)}case"Tile":{const r=UC("reps",e,t,n);return[s.tile(UC("x",e,t,n),r)]}case"Split":case"SplitV":{const r=UC("axis",e,t,n),i=UC("numOrSizeSplits",e,t,n),a=UC("x",e,t,n);return s.split(a,i,r)}case"ScatterNd":{const r=UC("indices",e,t,n),i=UC("values",e,t,n),a=UC("shape",e,t,n);return[s.scatterND(r,i,a)]}case"GatherNd":{const r=UC("x",e,t,n),i=UC("indices",e,t,n);return[s.gatherND(r,i)]}case"SparseToDense":{const r=UC("sparseIndices",e,t,n),i=UC("outputShape",e,t,n),a=UC("sparseValues",e,t,n),o=UC("defaultValue",e,t,n);return[s.sparseToDense(r,a,i,a.dtype===o.dtype?o:s.cast(o,a.dtype))]}case"TensorScatterUpdate":{const r=UC("indices",e,t,n),i=UC("values",e,t,n),a=UC("tensor",e,t,n);return[s.tensorScatterUpdate(a,r,i)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"sparse":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:i,emptyRowIndicator:a,reverseIndexMap:o}=s.sparse.sparseFillEmptyRows(UC("indices",e,t,n),UC("values",e,t,n),UC("denseShape",e,t,n),UC("defaultValue",e,t,n));return[r,i,a,o]}case"SparseReshape":{const{outputIndices:r,outputShape:i}=s.sparse.sparseReshape(UC("inputIndices",e,t,n),UC("inputShape",e,t,n),UC("newShape",e,t,n));return[r,i]}case"SparseSegmentMean":return[s.sparse.sparseSegmentMean(UC("data",e,t,n),UC("indices",e,t,n),UC("segmentIds",e,t,n))];case"SparseSegmentSum":return[s.sparse.sparseSegmentSum(UC("data",e,t,n),UC("indices",e,t,n),UC("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=k)=>{switch(e.op){case"FFT":return[s.fft(UC("x",e,t,n))];case"IFFT":return[s.ifft(UC("x",e,t,n))];case"RFFT":return[s.rfft(UC("x",e,t,n))];case"IRFFT":return[s.irfft(UC("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=k)=>{switch(e.op){case"StaticRegexReplace":return[s.string.staticRegexReplace(UC("input",e,t,n),UC("pattern",e,t,n),UC("rewrite",e,t,n),UC("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:r,nGramsSplits:i}=s.string.stringNGrams(UC("data",e,t,n),UC("dataSplits",e,t,n),UC("separator",e,t,n),UC("nGramWidths",e,t,n),UC("leftPad",e,t,n),UC("rightPad",e,t,n),UC("padWidth",e,t,n),UC("preserveShortSequences",e,t,n));return[r,i]}case"StringSplit":{const{indices:r,values:i,shape:a}=s.string.stringSplit(UC("input",e,t,n),UC("delimiter",e,t,n),UC("skipEmpty",e,t,n));return[r,i,a]}case"StringToHashBucketFast":return[s.string.stringToHashBucketFast(UC("input",e,t,n),UC("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=k)=>{switch(e.op){case"Cast":return[s.cast(UC("x",e,t,n),UC("dtype",e,t,n))];case"ExpandDims":{const r=UC("axis",e,t,n);return[s.expandDims(UC("x",e,t,n),r)]}case"Squeeze":{const r=UC("axis",e,t,n);return[s.squeeze(UC("x",e,t,n),r)]}case"Reshape":return[s.reshape(UC("x",e,t,n),UC("shape",e,t,n))];case"EnsureShape":return[s.ensureShape(UC("x",e,t,n),UC("shape",e,t,n))];case"MirrorPad":return[s.mirrorPad(UC("x",e,t,n),UC("padding",e,t,n),UC("mode",e,t,n))];case"PadV2":case"Pad":return[s.pad(UC("x",e,t,n),UC("padding",e,t,n),UC("constantValue",e,t,n))];case"SpaceToBatchND":{const r=UC("blockShape",e,t,n),i=UC("paddings",e,t,n);return[s.spaceToBatchND(UC("x",e,t,n),r,i)]}case"BatchToSpaceND":{const r=UC("blockShape",e,t,n),i=UC("crops",e,t,n);return[s.batchToSpaceND(UC("x",e,t,n),r,i)]}case"DepthToSpace":{const r=UC("blockSize",e,t,n),i=UC("dataFormat",e,t,n).toUpperCase();return[s.depthToSpace(UC("x",e,t,n),r,i)]}case"BroadcastTo":return[s.broadcastTo(UC("x",e,t,n),UC("shape",e,t,n))];case"BroadcastArgs":return[s.broadcastArgs(UC("s0",e,t,n),UC("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=UC("keyDType",e,t,n),i=UC("valueDType",e,t,n),a=new Wk(r,i);return s.addHashTable(e.name,a),[a.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const r=UC("tableHandle",e,t,n,s),i=UC("keys",e,t,n),a=UC("values",e,t,n),o=s.getHashTableById(r.id);return[await o.import(i,a)]}case"LookupTableFind":case"LookupTableFindV2":{const r=UC("tableHandle",e,t,n,s),i=UC("keys",e,t,n),a=UC("defaultValue",e,t,n),o=s.getHashTableById(r.id);return[await o.find(i,a)]}case"LookupTableSize":case"LookupTableSizeV2":{const r=UC("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 i=GC(e.op);if(i&&i.customExecutor)return i.customExecutor(new Ok(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(i)?i.then((e=>[].concat(e))):[].concat(i)}class Uk{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 qk(e,t,n,s){const r=new Set,i=[];let a=null,o=null;const l=new Set,c=new Set(Object.keys(e).map((e=>KC(e)[0])));s=s||[];const u=new Set(s.map((e=>KC(e.name)[0]))),h=[...t];for(;h.length>0;){const e=h.pop();(Zk(e)||Yk(e)||Qk(e))&&null==a&&(a=e,o=a.children.map((e=>e.name)).filter((e=>r.has(e)))),r.add(e.name),null==n[e.name]&&(c.has(e.name)||u.has(e.name)||(0!==e.inputs.length?e.inputs.forEach((e=>{l.has(e.name)||(l.add(e.name),h.push(e))})):i.push(e.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:i,dynamicNode:a,syncInputs:o}}function jk(e,t){const{usedNodes:n,inputs:s}=t,r=Object.keys(s).map((e=>KC(e)[0])).map((t=>e.nodes[t])),i=e.initNodes||[],a=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,...i]).filter(a),c=o([...l,...Object.values(e.nodes)]).filter(a),u=new Map(c.map((e=>[e.name,e]))),h={};for(const e of c){h[e.name]=h[e.name]||0;for(const t of e.children)a(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=u.get(e);for(const e of t.children.filter(a))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 i=e.filter((e=>r.has(e.name)));return i}(p.map((e=>u.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),i=new Set(e.map((e=>e.name))),a=e=>i.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(a)){if(!n.has(e.name))throw new Hk(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new Hk(`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 Hk(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new Hk(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(f,l),f}class Hk extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const $k=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),Kk=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),Xk=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function Zk(e){return $k.has(e.op)}function Yk(e){return Kk.has(e.op)}function Qk(e){return Xk.has(e.op)}class Jk{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 Jk(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=qk(e,t,this.weightMap,this._initNodes),{missingInputs:s,dynamicNode:r,syncInputs:i}=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 [${i}]`);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 a=jk(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)=>Zk(e)?n:t)),r=e=>{const n=s[t.get(e.name)];return null==n?-1:n},i=e.map(((e,t)=>e.children.map(r).reduce(((e,t)=>Math.max(e,t)),s[t]))),a=new Map;for(let t=0;tthis.cloneAndKeepTensor(e)))}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[KC(e)[0]])),r=t.map((e=>KC(e)[0])),i=new Set(r);let a=r.map((e=>this.graph.nodes[e]));0===a.length&&(a=this._outputs);const o=this.getCompilationKey(s,a);let l=this.compiledMap.get(o);null==l&&(l=this.compile(e,a),this.compiledMap.set(o,l));try{this.keepIntermediateTensors=En().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const c={},u={};return To((()=>{const n=new Uk(this.weightMap,c,u,this.functionExecutorMap,this.parseNodeNameCache),s=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach((t=>{const[r,i]=KC(t,n),a=[];a[i]=e[t],s[r]=a,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(a))}));const r=this.getFrozenTensorIds(s),{orderedNodes:a,nodeLiveUntilMap:o}=l;for(const e of a){if(s[e.name])continue;const t=Gk(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,i,o.get(e.name))}return null==this.parent&&n.dispose(r),t.map((e=>qC(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,i,a){if(!Zk(t)&&!i.has(e)){for(const s of n[e])null!=s&&(a[s.id]=(a[s.id]||0)+t.children.length);for(const e of t.inputs){if(Zk(e))continue;const t=jC(e.name,n,s);if(null!=t)for(const e of t){if(!e||e.kept||r.has(e.id))continue;const t=a[e.id];1===t?(e.dispose(),delete a[e.id]):null!=t&&a[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,s,r,i){function a(e){return Zk(e)||r.has(e.name)}if(!Zk(e)&&null!=i)for(const e of i){if(a(e))continue;const r=jC(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=En().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const i=new Uk(this.weightMap,s,r,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const a=await this.executeWithControlFlow(e,i,t,n),o=t.map((e=>qC(e,a,i))),l=o.map((e=>e.id)),c=Object.keys(e).map((t=>e[t].id)),u=new Set([...l,...c,...this.weightIds]);return Object.values(a).forEach((e=>{e.forEach((e=>{!e||e.isDisposed||u.has(e.id)||e.dispose()}))})),null==this.parent&&i.dispose(u),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),i=r.map((e=>this.graph.nodes[KC(e)[0]])),a=n.map((e=>KC(e)[0])),o=new Set(a);let l=a.map((e=>this.graph.nodes[e]));0===l.length&&(l=this._outputs);const{usedNodes:c,missingInputs:u,dynamicNode:h,syncInputs:d}=qk(e,l,this.weightMap,this._initNodes),p=[...i,...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]=KC(t),r=[];r[s]=e[t],f[n]=r}));const m={},g=this.getFrozenTensorIds(f),y={};for(;p.length>0;){const e=this.processStack(i,p,t,f,y,g,o,m,c);await Promise.all(e)}const b=l.filter((e=>!Zk(e)&&!qC(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: [${u}]. ${e}`)}return f}processStack(e,t,n,s,r,i,a,o,l){const c=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let u="";if("Enter"===e.node.op&&UC("isConstant",e.node,s,n)&&([u]=HC(e.node.name,n)),null==s[e.node.name]){const h=Gk(e.node,s,n,this._resourceManager);u||([u]=HC(e.node.name,n));const d=n.currentContext;xn(h)?c.push(h.then((c=>(s[u]=c,this.keepIntermediateTensors&&(this.clonedTensorsMap[u]=this.cloneTensorList(c)),n.currentContext=d,this.checkTensorForDisposal(u,e.node,s,n,i,a,o),this.processChildNodes(e.node,t,n,s,r,l),c)))):(s[u]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[u]=this.cloneTensorList(h)),this.checkTensorForDisposal(u,e.node,s,n,i,a,o),this.processChildNodes(e.node,t,n,s,r,l))}else this.processChildNodes(e.node,t,n,s,r,l)}return c}processChildNodes(e,t,n,s,r,i){e.children.forEach((e=>{const[a]=HC(e.name,n);!r[a]&&i.has(e.name)&&("Merge"===e.op?e.inputNames.some((e=>!!qC(e,s,n)))&&(r[a]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((e=>!!qC(e,s,n)))&&(r[a]=!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]=KC(t),r=this.graph.nodes[s];if(r.attrParams.shape&&r.attrParams.shape.value){const e=r.attrParams.shape.value;jt(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&&jt(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 i=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[r];null!=i?s[i.name]=e[r]:s[r]=e[r]}return s}checkInputs(e){const t=Object.keys(e).filter((e=>{const[t]=KC(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]=KC(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)}))}}class eS{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 tS="?tfjs-format=file",nS="model.json";class sS{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 eS}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 Vo(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 Jk(gk.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=gk.Instance.transformGraph(e.modelInitializer);this.initializer=new Jk(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 Fa?[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 Fa||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,i,a;const o=null===(a=null===(i=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===i?void 0:i[n])||void 0===a?void 0:a.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&&Io(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function rS(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}${nS}${tS}`}(t));const r=new sS(t,n,s);return await r.load(),r}function iS(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(cS(e)){const r=Array.isArray(e)?[]:{};s.add(e);for(const i in e){const a=iS(e[i],t,n,s);r[i]=a}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 aS(e,t=lS){return oS(e,t)}function oS(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(cS(s)){const r=Array.isArray(s)?[]:{};n.add(s);for(const i in s){const s=oS(e.map((e=>e[i])),t,n);r[i]=s}return n.delete(s),r}throw new Error(`Can't recurse into non-iterable type: ${s}`)}return r.value}function lS(e){return null===e?null:cS(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}function cS(e){let t=!1;if(En().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 Fa)&&!(e instanceof Promise)&&!t)}function uS(e){return iS(e,hS)}function hS(e){return e instanceof Fa?{value:e.clone(),recurse:!1}:cS(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}class dS{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 pS extends dS{constructor(){super(pS.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 xS(this,e,t)}columnMajorBatch(e,t=!0,n=lS){return this.rowMajorBatch(e,t).map((e=>aS(e,n)))}concatenate(e,t){return new IS(new yS([this,e]),t)}take(e){return e<0||null==e?this:new AS(this,e)}skip(e){return e<0||null==e?this:new vS(this,e)}prefetch(e){return new OS(this,e)}shuffle(e,t){return new DS(this,e,t)}serial(){return new wS(this)}}class yS extends gS{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:uS(e),done:!1}}}class bS extends gS{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 wS extends gS{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 vS extends gS{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 xS extends gS{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 CS extends gS{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;Io(e.value)}}}class kS extends gS{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=to(e.value),n=this.transform(e.value),s=to(n);for(const e of t)eo(e,s)||e.dispose();return{value:n,done:!1}}}class SS extends gS{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 ES extends gS{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=to(e.value),n=await this.transform(e.value),s=to(n);for(const e of t)eo(e,s)||e.dispose();return{value:n,done:!1}}}class _S extends gS{constructor(){super(),this.outputQueue=new pS,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 TS extends _S{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=to(e.value),n=this.transform(e.value),s=to(n);this.outputQueue.pushAll(n);for(const e of t)eo(e,s)||e.dispose();return!0}}class IS extends gS{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 NS;!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(NS||(NS={}));class OS extends gS{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new dS(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 DS extends OS{constructor(e,t,n){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=Yd.alea(n||ma().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 RS{constructor(){this.size=null}batch(e,t=!0){const n=this;let s;return jt(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),MS((async()=>(await n.iterator()).columnMajorBatch(e,t,FS)),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,MS((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,MS((async()=>(await t.iterator()).filter((t=>To((()=>e(t)))))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return MS((async()=>(await t.iterator()).map((t=>To((()=>e(t)))))),this.size)}mapAsync(e){const t=this;return MS((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 MS((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,MS((async()=>mS(fS((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=Yd.alea(t||ma().toString());return MS((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,MS((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 MS(e,t=null){return new class extends RS{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function FS(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 Fa||ba(n)){return{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Fa?Bp(e):Co(e)}(e),recurse:!1}}var n,s;return{value:null,recurse:!0}}RS.MAX_BUFFER_SIZE=1e4;Symbol("out"),Symbol("field"),Symbol("quote"),Symbol("quoteafterquote"),Symbol("quoteinquote");function BS(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&jt("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the CPU backend.`))}))}const zS=nf;class LS extends Pt{nextDataId(){return LS.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new Lt(this,Eo())}write(e,t,n){this.firstUse&&(this.firstUse=!1,En().get("IS_NODE")&&Gi());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&&ln(n[0])){const r=n.map((e=>ga(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=>ya(e)));return Fl(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return Fl(e.shape,e.dtype,t)}makeOutput(e,t,n){return Eo().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=ma();e();return{kernelMs:ma()-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){BS([e],"where");const t=this.readSync(e.dataId);return zS(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}LS.nextDataId=0;function PS(e){return(t,n,s)=>{const r=rn(n,t.length);for(let n=0;n{const{x:a}=s;BS(a,e);const o=i,l=o.data.get(a.dataId).values;let c;if("string"===a.dtype){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");c=Ng(l)}else c=l;const u=n||a.dtype,h=t(c,u,r);return o.makeTensorInfo(a.shape,u,h)}}Oo("cpu",(()=>new LS),1);const GS=VS(Is,(e=>e>=0?e:Math.exp(e)-1)),US={kernelName:Is,backendName:"cpu",kernelFunc:GS};function qS(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 jS={kernelName:Hs,backendName:"cpu",kernelFunc:qS};function HS(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:i}=s;BS([r],"leakyRelu");const a=Kt(r.shape),o=n.data.get(r.dataId).values,l=sn("float32",a);for(let e=0;e{const a=cc(t,n),o=a.length,l=pn(a),c=sn(i,Kt(a)),u=t.length,h=n.length,d=pn(t),p=pn(n),f=oc(t,a),m=oc(n,a);if(f.length+m.length===0)for(let t=0;ti[e]=0));const a=vn(i,u,d),g=n.slice(-h);m.forEach((e=>g[e]=0));const y=vn(g,h,p);c[t]=e(s[a],r[y])}return[c,a]}}const XS=KS(((e,t)=>e<0?t*e:e));function ZS(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t;BS([s,r],"prelu");const i=n.data.get(s.dataId).values,a=n.data.get(r.dataId).values,[o,l]=XS(s.shape,r.shape,i,a,"float32");return n.makeTensorInfo(l,"float32",o)}const YS={kernelName:Rr,backendName:"cpu",kernelFunc:ZS},QS=VS(Wr,(e=>Math.max(0,e))),JS={kernelName:Wr,backendName:"cpu",kernelFunc:QS},eE=VS($r,(e=>Math.min(Math.max(0,e),6))),tE={kernelName:$r,backendName:"cpu",kernelFunc:eE},nE=PS((e=>1/(1+Math.exp(-e)))),sE=VS(ai,(e=>1/(1+Math.exp(-e)))),rE={kernelName:ai,backendName:"cpu",kernelFunc:sE};function iE(e,t,n,s,r){if("linear"===n)return qS({inputs:{x:t},backend:e});if("relu"===n)return QS({inputs:{x:t},backend:e});if("elu"===n)return GS({inputs:{x:t},backend:e});if("relu6"===n)return eE({inputs:{x:t},backend:e});if("prelu"===n)return ZS({inputs:{x:t,alpha:s},backend:e});if("leakyrelu"===n)return HS({inputs:{x:t},backend:e,attrs:{alpha:r}});if("sigmoid"===n)return sE({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function aE(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,i=n.data.get(s.dataId).values,a=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",i),imag:n.makeTensorInfo(r.shape,"float32",a)},o}const oE={kernelName:ss,backendName:"cpu",kernelFunc:aE};function lE(e,t,n="float32"){if("complex64"===n){return aE({inputs:{real:lE(e,t,"float32"),imag:lE(e,t,"float32")},backend:e})}const s=yn(Kt(t),n);return e.makeTensorInfo(t,n,s)}function cE(e){const{inputs:t,backend:n}=e,{input:s}=t,r=n.data.get(s.dataId).complexTensorInfos.real,i=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,i)}const uE={kernelName:Pr,backendName:"cpu",kernelFunc:cE};function hE(e,t,n,s){if("int32"===s){return[t,"int32",Int32Array.from(e)]}if("bool"===s){const s=fa([0],n),[r,i]=KS(((e,t)=>e!==t?1:0))(t,[],e,s,"bool");return[i,"bool",r]}throw new Error(`Error in Cast: failed to cast ${n} to ${s}`)}function dE(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dtype:i}=s;if("complex64"===i){if("complex64"===r.dtype)return qS({inputs:{x:r},backend:n});const e=lE(n,r.shape,r.dtype),t=dE({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),s=aE({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),s}if("complex64"===r.dtype){const e=cE({inputs:{input:r},backend:n}),t=dE({inputs:{x:e},backend:n,attrs:{dtype:i}});return n.disposeIntermediateTensorInfo(e),t}if(!an(r.dtype,i)){const e=qS({inputs:{x:r},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:i}}const a=n.data.get(r.dataId).values,[o,l,c]=hE(a,r.shape,r.dtype,i);return n.makeTensorInfo(o,l,c)}const pE={kernelName:es,backendName:"cpu",kernelFunc:dE};function fE(e,t,n,s){return null==n?({inputs:n,backend:r})=>{const{a:i,b:a}=n,o=r;BS([i,a],e);const l=o.data.get(i.dataId).values,c=o.data.get(a.dataId).values,u="string"===i.dtype?Ng(l):l,h="string"===i.dtype?Ng(c):c,d=s||i.dtype,[p,f]=t(i.shape,a.shape,u,h,d);return o.makeTensorInfo(f,d,p)}:({inputs:e,backend:r})=>{const{a:i,b:a}=e,o=r;if("complex64"===i.dtype||"complex64"===a.dtype){const e=dE({inputs:{x:i},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,c=o.data.get(r.dataId).values,u=dE({inputs:{x:a},backend:o,attrs:{dtype:"complex64"}}),h=o.data.get(u.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(i.shape,a.shape,l,c,f,m),w=o.makeTensorInfo(b,"float32",g),v=o.makeTensorInfo(b,"float32",y),A=aE({inputs:{real:w,imag:v},backend:o});return o.disposeIntermediateTensorInfo(e),o.disposeIntermediateTensorInfo(u),o.disposeIntermediateTensorInfo(w),o.disposeIntermediateTensorInfo(v),A}{const e=o.data.get(i.dataId).values,n=o.data.get(a.dataId).values,r=s||i.dtype,[l,c]=t(i.shape,a.shape,e,n,r);return o.makeTensorInfo(c,r,l)}}}function mE(e){return(t,n,s,r,i,a)=>{const o=cc(t,n),l=Kt(o),c=o.length,u=pn(o),h=sn("float32",l),d=sn("float32",l),p=oc(t,o),f=oc(n,o),m=Zm(s,r),g=Zm(i,a),y=t.length,b=pn(t),w=n.length,v=pn(n);if(p.length+f.length===0)for(let t=0;ts[e]=0));const r=vn(s,y,b),i=n.slice(-w);f.forEach((e=>i[e]=0));const a=vn(i,w,v),o=e(m[2*r],m[2*r+1],g[2*a],g[2*a+1]);h[t]=o.real,d[t]=o.imag}return[h,d,o]}}const gE=KS(((e,t)=>e+t)),yE=mE(((e,t,n,s)=>({real:e+n,imag:t+s}))),bE=fE(Mn,gE,yE),wE={kernelName:Mn,backendName:"cpu",kernelFunc:bE};function vE(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{shape:i}=s,a=Kt(r.shape),o=en(i,a),l=Kt(o);jt(a===l,(()=>`The new shape (${o}) has ${l} elements and the old shape (${r.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`)),n.incRef(r.dataId);const c=n.data.get(r.dataId);if(null!=c.complexTensorInfos){const e=c.complexTensorInfos.real,t=c.complexTensorInfos.imag;e.shape=o,t.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}const AE={kernelName:Gr,backendName:"cpu",kernelFunc:vE};function xE(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i}=t,{transposeA:a,transposeB:o}=s;BS([r,i],"matMul");const l=r.shape.length,c=i.shape.length,u=a?r.shape[l-2]:r.shape[l-1],h=o?i.shape[c-1]:i.shape[c-2],d=a?r.shape[l-1]:r.shape[l-2],p=o?i.shape[c-2]:i.shape[c-1],f=r.shape.slice(0,-2),m=i.shape.slice(0,-2),g=Kt(f),y=Kt(m),b=cc(r.shape.slice(0,-2),i.shape.slice(0,-2)).concat([d,p]);jt(u===h,(()=>`Error in matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${r.shape} and ${i.shape} and transposeA=${a} and transposeB=${o} must match.`));const w=o?[y,p,h]:[y,h,p],v=vE({inputs:{x:r},backend:n,attrs:{shape:a?[g,u,d]:[g,d,u]}}),A=vE({inputs:{x:i},backend:n,attrs:{shape:w}}),x=a?v.shape[1]:v.shape[2],C=a?v.shape[2]:v.shape[1],k=o?A.shape[1]:A.shape[2],S=Math.max(g,y),E=n.data.get(v.dataId).values,_=n.data.get(A.dataId).values,T=pn(v.shape),I=pn(A.shape),[N,O,D]=a?[T[0],1,T[1]]:[T[0],T[1],1],[R,M,F]=o?[1,I[1],I[0]]:[I[1],1,I[0]],B=C*k,z=Fl([S,C,k],v.dtype),L=z.values,P=n.blockSize;for(let e=0;e{const{x:t}=e.inputs,n=e.backend;BS(t,"abs");let s=new Float32Array(Kt(t.shape));return s=SE(n.data.get(t.dataId).values),n.makeOutput(s,t.shape,t.dtype)}},_E=VS(Dn,(e=>Math.acos(e))),TE={kernelName:Dn,backendName:"cpu",kernelFunc:_E},IE=VS(Rn,(e=>Math.acosh(e))),NE={kernelName:Rn,backendName:"cpu",kernelFunc:IE};const OE={kernelName:Fn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,s=t;BS(t,"addN");const r=s.map((e=>n.data.get(e.dataId).values)),i=Fl(s[0].shape,s[0].dtype),a=i.values;for(let e=0;en&&(n=r,s=e)}d[e]=s}return c.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(u,"int32",d)}};const LE={kernelName:Pn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;BS(r,"argMin");let a=tn(i,r.shape);const o=Mh(a,r.shape.length);let l=r;const c=[];null!=o&&(l=RE({inputs:{x:r},backend:n,attrs:{perm:o}}),c.push(l),a=Bh(a.length,l.shape.length)),a=[a[0]],Rh("argMin",a,l.shape.length);const[u,h]=Oh(l.shape,a),d=yn(Kt(u),"int32"),p=Kt(h),f=n.data.get(l.dataId).values;for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(u,"int32",d)}},PE=VS(Vn,(e=>Math.asin(e))),VE={kernelName:Vn,backendName:"cpu",kernelFunc:PE},WE=VS(Wn,(e=>Math.asinh(e))),GE={kernelName:Wn,backendName:"cpu",kernelFunc:WE},UE=VS(Gn,(e=>Math.atan(e))),qE={kernelName:Gn,backendName:"cpu",kernelFunc:UE},jE=KS(((e,t)=>Math.atan2(e,t))),HE=fE(qn,jE),$E={kernelName:qn,backendName:"cpu",kernelFunc:HE},KE=VS(Un,(e=>Math.atanh(e))),XE={kernelName:Un,backendName:"cpu",kernelFunc:KE};function ZE(e,t,n,s,r,i){const a=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,c=r.dilationWidth,u=r.effectiveFilterHeight,h=r.effectiveFilterWidth,d=r.padInfo.top,p=r.padInfo.left,f="max"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=Fl(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=a:"avg"===i&&(b+=a,v++)}if(isNaN(y))break}g[C+n*w+t]="avg"===i?b/v:y}}}return m}function YE(e,t,n,s,r=!1,i=!1){const a=Fl(s.outShape,"int32"),o=s.strideHeight,l=s.strideWidth,c=s.dilationHeight,u=s.dilationWidth,h=s.effectiveFilterHeight,d=s.effectiveFilterWidth,p=s.padInfo.top,f=s.padInfo.left,m=Fl(t,n,e);for(let e=0;ev&&(v=c,A=r?i?((e*s.inHeight+n)*s.inWidth+o)*s.inChannels+t:(n*s.inWidth+o)*s.inChannels+t:a*d+l)}}a.set(A,e,n,o,t)}}return a}function QE(e,t,n,s,r,i){const a=r.strideDepth,o=r.strideHeight,l=r.strideWidth,c=r.dilationDepth,u=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"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,w=Fl(r.outShape,n),v=w.values,A=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],x=r.outShape[2]*r.outShape[3]*r.outShape[4],C=r.outShape[3]*r.outShape[4],k=r.outShape[4];for(let t=0;tx?x=r:"avg"===i&&(C+=r,S++),isNaN(x))break}if(isNaN(x))break}if(isNaN(x))break}v[g+t]="avg"===i?C/Math.max(S,1):x}}}}return w}const JE={kernelName:jn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;BS(r,"avgPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;jt(Ou(a,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const c=Au(r.shape,i,a,1,o,l);let u;if(1===c.filterWidth&&1===c.filterHeight&&Xt(c.inShape,c.outShape))u=qS({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=pn(r.shape),s=ZE(e,r.shape,r.dtype,t,c,"avg");u=n.makeTensorInfo(c.outShape,r.dtype,s.values)}return u}};const e_={kernelName:$n,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:c}=s;BS(r,"avgPool3d");const u=xu(r.shape,i,a,1,o,l,c),h=QE(n.data.get(r.dataId).values,r.shape,r.dtype,pn(r.shape),u,"avg");return n.makeTensorInfo(h.shape,"float32",h.values)}};const t_={kernelName:Kn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,{filterSize:a,strides:o,pad:l,dimRoundingMode:c}=s;BS([r,i],"avgPool3DGrad");const u=xu(i.shape,a,o,1,l,c),h=u.strideDepth,d=u.strideHeight,p=u.strideWidth,f=u.filterDepth,m=u.filterHeight,g=u.filterWidth,y=u.dilationDepth,b=u.dilationHeight,w=u.dilationWidth,v=u.effectiveFilterDepth,A=u.effectiveFilterHeight,x=u.effectiveFilterWidth,C=v-1-u.padInfo.front,k=x-1-u.padInfo.left,S=A-1-u.padInfo.top,E=Fl(i.shape,"float32"),_=1/(f*m*g),T=n.bufferSync(r);for(let e=0;e=u.outDepth||Math.floor(s)!==s))for(let n=0;n=u.outHeight||Math.floor(r)!==r))for(let n=0;n=u.outWidth||Math.floor(i)!==i)continue;l+=T.get(e,s,r,i,t)}}}E.set(l*_,e,n,s,r,t)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}};const n_={kernelName:Hn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i;BS([r,i],"avgPoolGrad");const{filterSize:o,strides:l,pad:c}=s,u=Au(a.shape,o,l,1,c),h=u.strideHeight,d=u.strideWidth,p=u.filterHeight,f=u.filterWidth,m=u.dilationHeight,g=u.dilationWidth,y=u.effectiveFilterHeight,b=u.effectiveFilterWidth,w=b-1-u.padInfo.left,v=y-1-u.padInfo.top,A=Fl(a.shape,"float32"),x=1/(p*f),C=n.data.get(r.dataId).values,k=Fl(r.shape,"float32",C);for(let e=0;e=u.outHeight||Math.floor(s)!==s))for(let n=0;n=u.outWidth||Math.floor(r)!==r)continue;a+=k.get(e,s,r,t)}}A.set(a*x,e,n,s,t)}return n.makeTensorInfo(A.shape,A.dtype,A.values)}};const s_={kernelName:Ws,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,scale:i,offset:a,mean:o,variance:l}=t;jt(o.shape.length===l.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),jt(null==a||o.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),jt(null==i||o.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks.")),BS([r,o,l,i,a],"batchNorm");let{varianceEpsilon:c}=s;null==c&&(c=.001);const u=n.data.get(r.dataId).values,h=n.data.get(o.dataId).values,d=n.data.get(l.dataId).values,p=i?n.data.get(i.dataId).values:new Float32Array([1]),f=a?n.data.get(a.dataId).values:new Float32Array([0]),m=new Float32Array(u.length),g=f.length,y=p.length,b=d.length,w=h.length;let v=0,A=0,x=0,C=0;for(let e=0;e=g&&(v=0),A>=w&&(A=0),x>=y&&(x=0),C>=b&&(C=0);return n.makeTensorInfo(r.shape,r.dtype,m)}};function r_(e,t,n,s,r){const i=su(s,t,n),a=Kt(n),o=pn(s);if(i){const n=ru(t,o);return"string"===r?e.slice(n,n+a):e.subarray(n,n+a)}const l=Fl(s,r,"string"===r?Ng(e):e),c=Fl(n,r);for(let e=0;ee+t[n]));c.set(l.get(...s),...n)}return"string"===r?Og(c.values):c.values}function i_(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,size:a}=s;BS(r,"slice");const[o,l]=iu(r,i,a);jc(r,o,l);const c=r_(n.data.get(r.dataId).values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,c)}const a_={kernelName:ni,backendName:"cpu",kernelFunc:i_};const o_={kernelName:Zn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,crops:a}=s;BS([r],"batchToSpaceND");const o=i.reduce(((e,t)=>e*t)),l=Bm(r.shape,i,o),c=zm(l.length,i.length),u=Lm(r.shape,i,o),h=Pm(a,i.length),d=Vm(u,a,i.length),p=vE({inputs:{x:r},backend:n,attrs:{shape:l}}),f=RE({inputs:{x:p},backend:n,attrs:{perm:c}}),m=vE({inputs:{x:f},backend:n,attrs:{shape:u}}),g=i_({inputs:{x:m},backend:n,attrs:{begin:h,size:d}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}};function l_(e,t,n,s,r){const i=Kt(s),a=yn(r,n);for(let n=0;n=r||(a[s]+=i>0?t[n]:1)}return a}function c_(e,t,n,s=!1){const r=e.shape[0],i=e.shape[1],a=Fl([r,n],t.dtype);for(let o=0;o=n||(s?a.set(1,o,i):t.size>0?a.set(a.get(o,i)+t.get(o,r),o,i):a.set(a.get(o,i)+1,o,i))}return a}const u_={kernelName:Yn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a}=s,o=l_(n.data.get(r.dataId).values,n.data.get(i.dataId).values,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,o)}},h_=KS(((e,t)=>e&t)),d_=fE(Qn,h_),p_={kernelName:Qn,backendName:"cpu",kernelFunc:d_};const f_={kernelName:Jn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,i=n.data.get(s.dataId).values,a=n.data.get(r.dataId).values,o=cc(Array.from(i),Array.from(a));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},m_=PS((e=>Math.ceil(e))),g_=WS(ts,m_),y_={kernelName:ts,backendName:"cpu",kernelFunc:g_},b_=VS(ns,((e,t)=>{const n=t;return e>n.clipValueMax?n.clipValueMax:e{const{x:t}=e.inputs,n=e.backend,s=new Float32Array(Kt(t.shape)),r=n.data.get(t.dataId),i=r.complexTensorInfos.real,a=r.complexTensorInfos.imag,o=n.data.get(i.dataId).values,l=n.data.get(a.dataId).values;for(let e=0;e{const n=Kt(e.shape);r.set(e.vals,t),t+=n}))}else{let s=0;e.forEach((e=>{const i="string"===n?Ng(e.vals):e.vals;let a=0;for(let n=0;ne.shape)),i);let a=Em(t.map((e=>e.shape)),i);if(0===Kt(a))return n.makeTensorInfo(a,t[0].dtype,[]);const o=t.filter((e=>Kt(e.shape)>0));if(1===o.length)return qS({inputs:{x:o[0]},backend:n});if("complex64"===o[0].dtype){const e=o.map((e=>cE({inputs:{input:e},backend:n}))),t=o.map((e=>x_({inputs:{input:e},backend:n}))),s=k_({inputs:e,backend:n,attrs:{axis:i}}),r=k_({inputs:t,backend:n,attrs:{axis:i}}),a=aE({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),a}const l=o.map((e=>{const t=Kt(e.shape.slice(i));return vE({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})})),c=l.map((e=>({vals:n.data.get(e.dataId).values,shape:e.shape})));a=Em(l.map((e=>e.shape)),1);const u=1===l[0].shape[0],h=A_(c,a,t[0].dtype,u),d=Em(o.map((e=>e.shape)),i),p=n.makeTensorInfo(d,t[0].dtype,h);return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}const S_={kernelName:is,backendName:"cpu",kernelFunc:k_};function E_(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dataFormat:l,dilations:c,dimRoundingMode:u}=s;BS([r,i],"conv2d");const h=Ru(l),d=Cu(r.shape,i.shape,a,c,o,u,!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 Oa(d.outShape,r.dtype),A=pn(r.shape),x=pn(i.shape),C=A[0],k=w?A[1]:A[2],S=w?A[2]:1,E=w?1:A[1],_=v.strides[0],T=w?v.strides[1]:v.strides[2],I=w?v.strides[2]:1,N=w?1:v.strides[1],O=n.data.get(r.dataId).values,D=n.data.get(i.dataId).values,R=v.values;for(let e=0;e=d.inHeight)continue;const i=e*x[0],a=t+n*k;for(let e=0;e=d.inWidth)continue;const r=a+s*S;let o=i+e*x[1];for(let e=0;e=c.inDepth)continue;const i=e*S[0],a=t+n*k[1];for(let e=0;e=c.inHeight)continue;const r=i+e*S[1],o=a+s*k[2];for(let e=0;e=c.inWidth)continue;const i=r+e*S[2],a=o+t*c.inChannels;let l=i;for(let e=0;eMath.cos(e))),M_={kernelName:ds,backendName:"cpu",kernelFunc:R_},F_=VS(ps,(e=>Math.cosh(e))),B_={kernelName:ps,backendName:"cpu",kernelFunc:F_};const z_={kernelName:gs,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:i,boxInd:a}=t,{cropSize:o,method:l,extrapolationValue:c}=s,[u,h,d,p]=r.shape,f=i.shape[0],[m,g]=o,y=Fl([f,m,g,p],"float32"),b=n.data.get(i.dataId).values,w=n.data.get(a.dataId).values,v=n.data.get(r.dataId).values,A=pn(r.shape),x=pn(y.shape);for(let e=0;e=u)continue;const o=m>1?(r-n)*(h-1)/(m-1):0,f=g>1?(i-s)*(d-1)/(g-1):0;for(let t=0;t1?n*(h-1)+t*o:.5*(n+r)*(h-1);if(u<0||u>h-1)for(let n=0;n1?s*(d-1)+l*f:.5*(s+i)*(d-1);if(u<0||u>d-1){for(let n=0;n1?s*(d-1)+n*f:.5*(s+i)*(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 ${a}`));const o=r.shape[0],l=r.shape[1],c=r.shape[2],u=r.shape[3],h=l*i,d=c*i,p=u/(i*i),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 ${a} and dilations '${d}'`));const p=Cu(r.shape,i.shape,a,d,o,c,!0),{filterHeight:f,filterWidth:m,dilationHeight:g,dilationWidth:y,padInfo:b}=p,w=b.left,v=b.top,A=p.outChannels/p.inChannels,x=new Oa(p.outShape,r.dtype),C=n.data.get(r.dataId).values,k=n.data.get(i.dataId).values,S=x.values;for(let e=0;e=p.inHeight)continue;const i=e*h[0],a=t+n*u[1];for(let e=0;e=p.inWidth)continue;const r=i+e*h[1],o=a+s*p.inChannels;let l=t,c=r;for(let e=0;e{const{x:s,filter:r}=e,{strides:i,pad:a,dilations:o}=n,l=t,c=l.data.get(s.dataId).values,u=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:A,filterHeight:x,filterWidth:C,dilationHeight:k,dilationWidth:S,outShape:E}=vu(s.shape,r.shape,i,a,"NHWC",o),_=Kt(E),T=E.length,I=rn(s.dtype,_);for(let e=0;e=0&&i=0&&pl&&(l=m)}}}I[vn([e,t,i,o],T,pn(E))]=l}}}return{dataId:l.write(fa(I,s.dtype),E,s.dtype),shape:E,dtype:s.dtype}}},K_={kernelName:Ss,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:i}=e,{strides:a,pad:o,dilations:l}=n,c=t,u=mn(s.shape,c.data.get(s.dataId).values),h=mn(r.shape,c.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:A,filterWidth:x,dilationHeight:C,dilationWidth:k,outShape:S}=vu(s.shape,r.shape,a,o,"NHWC",l);jt(i.rank===S.length,(()=>`Error in ${Ss}, dy must have the same rank as output ${S.length}, but got ${i.rank}`));const E=mn(S,c.data.get(i.dataId).values),_=bn(r.shape,r.dtype);for(let e=0;e=0&&s=0&&ca&&(a=r,o=t,l=n)}}}_[o][l][i]+=E[e][t][s][i]}}}return{dataId:c.write(fa(_,s.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},X_={kernelName:ks,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:i}=e,{strides:a,pad:o,dilations:l}=n,c=t,u=mn(s.shape,c.data.get(s.dataId).values),h=mn(r.shape,c.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:A,filterWidth:x,dilationHeight:C,dilationWidth:k,outShape:S}=vu(s.shape,r.shape,a,o,"NHWC",l);jt(i.rank===S.length,(()=>`Error in ${ks}, dy must have the same rank as output ${S.length}, but got ${i.rank}`));const E=mn(S,c.data.get(i.dataId).values),_=bn(s.shape,s.dtype);for(let e=0;e=0&&s=0&&ca&&(a=r,o=s,l=c)}}}_[e][o][l][i]+=E[e][t][s][i]}}}return{dataId:c.write(fa(_,s.dtype),s.shape,s.dtype),shape:s.shape,dtype:s.dtype}}};const Z_={kernelName:Es,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r}=t,{canvas:i,options:a}=s,{contextOptions:o,imageOptions:l}=a||{},c=(null==l?void 0:l.alpha)||1,u=(null==o?void 0:o.contextType)||"2d";if("2d"!==u)throw new Error(`Context type ${o.contextType} is not supported by the CPU backend.`);const h=i.getContext(u,(null==o?void 0:o.contextAttributes)||{});if(null==h)throw new Error(`Could not get the context with ${u} 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])}i.width=p,i.height=d;const b=new ImageData(y,p,d);return h.putImageData(b,0,0),r}},Y_=KS(((e,t)=>e*t)),Q_=mE(((e,t,n,s)=>({real:e*n-t*s,imag:e*s+t*n}))),J_=fE(xr,Y_,Q_),eT={kernelName:xr,backendName:"cpu",kernelFunc:J_};function tT(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s;let o;BS(r,"sum"),o="bool"===r.dtype?dE({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):qS({inputs:{x:r},backend:n});const l=o.shape.length,c=tn(i,o.shape),u=Mh(c,l);let h=c,d=o;null!=u&&(d=RE({inputs:{x:o},backend:n,attrs:{perm:u}}),h=Bh(h.length,l)),Rh("sum",h,d.shape.length);const[p,f]=Oh(d.shape,h);let m=lE(n,p,Xa(d.dtype,"int32"));const g=Kt(f),y=n.data.get(m.dataId).values,b=n.data.get(d.dataId).values;for(let e=0;e=0&&(d=tT({inputs:{x:d},backend:n,attrs:{axis:c[e]-(a.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}};const rT={kernelName:Ns,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{dy:s,y:r}=t;BS([s,r],"eluGrad");const i=new Float32Array(Kt(r.shape)),a=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",i)}},iT=KS(((e,t)=>e===t?1:0)),aT=fE(Ds,iT,null,"bool"),oT={kernelName:Ds,backendName:"cpu",kernelFunc:aT},lT=qm,cT=jm,uT=Hm,hT=$m,dT=Km,pT=Xm,fT=VS(Os,(e=>{const t=Math.sign(e),n=Math.abs(e),s=1/(1+lT*n);return t*(1-((((pT*s+dT)*s+hT)*s+uT)*s+cT)*s*Math.exp(-n*n))})),mT={kernelName:Os,backendName:"cpu",kernelFunc:fT},gT=PS((e=>Math.exp(e))),yT=WS(Rs,gT,"float32"),bT={kernelName:Rs,backendName:"cpu",kernelFunc:yT};function wT(e){const{inputs:t,backend:n,attrs:s}=e,{input:r}=t,{dim:i}=s,a=r.shape.length,o=r.shape.slice();let l=i;return i<0&&(jt(-(a+1)<=i,(()=>`Axis must be in the interval [${-(a+1)}, ${a}]`)),l=a+i+1),o.splice(l,0,1),vE({inputs:{x:r},backend:n,attrs:{shape:o}})}const vT={kernelName:Ms,backendName:"cpu",kernelFunc:wT},AT=PS((e=>Math.expm1(e))),xT=WS(Fs,AT),CT={kernelName:Fs,backendName:"cpu",kernelFunc:xT},kT=KS(((e,t)=>e/t)),ST=fE(_s,kT),ET={kernelName:_s,backendName:"cpu",kernelFunc:ST},_T=KS(((e,t)=>e-t)),TT=mE(((e,t,n,s)=>({real:e-n,imag:t-s}))),IT=fE(Si,_T,TT),NT={kernelName:Si,backendName:"cpu",kernelFunc:IT};function OT(e,t,n){const s=e.shape,r=s[0],i=s[1],a=n.data.get(e.dataId),o=a.complexTensorInfos.real,l=a.complexTensorInfos.imag,c=[r,i],u=Kt(c),h=sn("float32",u),d=sn("float32",u);for(let e=0;e{const{image:s}=e,r=n,i=sn(s.dtype,Kt(s.shape)),[a,o,l,c]=s.shape,u=r.data.get(s.dataId).values;for(let e=0;e=0&&aMath.floor(e))),PT=WS(Ps,LT),VT={kernelName:Ps,backendName:"cpu",kernelFunc:PT},WT=KS(((e,t)=>Math.floor(e/t))),GT=fE(Vs,WT,null,"int32"),UT={kernelName:Vs,backendName:"cpu",kernelFunc:GT};const qT={kernelName:Vi,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=E_({inputs:{x:r,filter:i},backend:n,attrs:{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d}});if(a){const e=m;if("NCHW"===u&&1===a.shape.length&&1!==a.shape[0]){const e=vE({inputs:{x:a},backend:n,attrs:{shape:[a.shape[0],1,1]}});m=bE({inputs:{a:m,b:e},backend:n}),n.disposeIntermediateTensorInfo(e)}else m=bE({inputs:{a:m,b:a},backend:n});n.disposeIntermediateTensorInfo(e)}if(p){const e=m;if("NCHW"===u&&"prelu"===p&&1===o.shape.length&&1!==o.shape[0]){const e=vE({inputs:{x:o},backend:n,attrs:{shape:[o.shape[0],1,1]}});m=iE(n,m,p,e,f),n.disposeIntermediateTensorInfo(e)}else m=iE(n,m,p,o,f);n.disposeIntermediateTensorInfo(e)}return m}};const jT={kernelName:Wi,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=G_({inputs:{x:r,filter:i},backend:n,attrs:{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d}});if(a){const e=m;m=bE({inputs:{a:m,b:a},backend:n}),n.disposeIntermediateTensorInfo(e)}if(p){const e=m;m=iE(n,m,p,o,f),n.disposeIntermediateTensorInfo(e)}return m}};function HT(e,t,n,s,r,i,a,o,l){const c=Fl([s,i],n);for(let n=0;n=l/i)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, ${u-1}]`))}let h=o;null==o&&(h=0);const d=Kt(i.shape),p=Ig(r,i,l,h),f=vE({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),m=vE({inputs:{x:i},backend:n,attrs:{shape:[p.batchSize,d/p.batchSize]}}),g=[p.batchSize,p.outerSize,d/p.batchSize,p.sliceSize],y=n.bufferSync(m),b=KT(n.bufferSync(f),y,g);return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.makeTensorInfo(p.outputShape,b.dtype,b.values)}},ZT=KS(((e,t)=>e>t?1:0)),YT=fE(qs,ZT,null,"bool"),QT={kernelName:qs,backendName:"cpu",kernelFunc:YT},JT=KS(((e,t)=>e>=t?1:0)),eI=fE(js,JT,null,"bool"),tI={kernelName:js,backendName:"cpu",kernelFunc:eI};const nI={kernelName:$s,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t,r=Kt(s.shape),i=s.shape[s.shape.length-1],a=vE({inputs:{x:s},backend:n,attrs:{shape:[r/i,i]}}),o=OT(a,!0,n),l=vE({inputs:{x:o},backend:n,attrs:{shape:s.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(o),l}},sI=VS(Xs,(e=>Number.isFinite(e)?1:0),"bool"),rI={kernelName:Xs,backendName:"cpu",kernelFunc:sI},iI=VS(Zs,(e=>Math.abs(e)===1/0?1:0),"bool"),aI={kernelName:Zs,backendName:"cpu",kernelFunc:iI},oI=VS(Ys,(e=>Number.isNaN(e)?1:0),"bool"),lI={kernelName:Ys,backendName:"cpu",kernelFunc:oI},cI=KS(((e,t)=>ee<=t?1:0)),pI=fE(er,dI,null,"bool"),fI={kernelName:er,backendName:"cpu",kernelFunc:pI};function mI(e,t,n){const s=(t-e)/(n-1),r=yn(n,"float32");r[0]=e;for(let e=1;eMath.log(e))),bI=WS(nr,yI),wI={kernelName:nr,backendName:"cpu",kernelFunc:bI},vI=VS(sr,(e=>Math.log1p(e))),AI={kernelName:sr,backendName:"cpu",kernelFunc:vI},xI=KS(((e,t)=>e&&t)),CI=fE(rr,xI,null,"bool"),kI={kernelName:rr,backendName:"cpu",kernelFunc:CI},SI=VS(ir,(e=>e?0:1),"bool"),EI={kernelName:ir,backendName:"cpu",kernelFunc:SI},_I=KS(((e,t)=>e||t)),TI=fE(ar,_I,null,"bool"),II={kernelName:ar,backendName:"cpu",kernelFunc:TI};const NI={kernelName:or,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:i,bias:a,alpha:o,beta:l}=s;BS(r,"LRN");const c=r.shape[3],u=c-1,h=n.data.get(r.dataId).values,d=Kt(r.shape),p=new Float32Array(d);function f(e){const t=e%c;let n=e-t+Math.max(0,t-i);const s=e-t+Math.min(t+i,u);let r=0;for(;n<=s;n++){const e=h[n];r+=e*e}return r}for(let e=0;ei)&&(i=t)}r[n]=i}return r}function RI(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:i,keepDims:a}=s,o=n;let l=r.shape;const c=l.length,u=tn(i,l);let h=u;const d=Mh(h,c);let p=o.data.get(r.dataId).values;if(null!=d){const e=new Array(c);for(let t=0;tMath.max(e,t))),BI=fE(ur,FI),zI={kernelName:ur,backendName:"cpu",kernelFunc:BI};const LI={kernelName:hr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;BS(r,"maxPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;jt(Ou(a,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const c=Au(r.shape,i,a,1,o,l);let u;if(1===c.filterWidth&&1===c.filterHeight&&Xt(c.inShape,c.outShape))u=qS({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=pn(r.shape),s=ZE(e,r.shape,r.dtype,t,c,"max");u=n.makeTensorInfo(c.outShape,r.dtype,s.values)}return u}};const PI={kernelName:pr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:c}=s;BS(r,"maxPool3d");const u=xu(r.shape,i,a,1,o,l,c),h=QE(n.data.get(r.dataId).values,r.shape,r.dtype,pn(r.shape),u,"max");return n.makeTensorInfo(h.shape,"float32",h.values)}};const VI={kernelName:fr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,{filterSize:a,strides:o,pad:l,dimRoundingMode:c}=s;BS([r,i],"maxPool3DGrad");const u=xu(i.shape,a,o,1,l,c),h=function(e,t){const n=Fl(t.outShape,"int32"),s=t.strideDepth,r=t.strideHeight,i=t.strideWidth,a=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,c=t.effectiveFilterDepth,u=t.effectiveFilterHeight,h=t.effectiveFilterWidth,d=t.padInfo.front,p=t.padInfo.top,f=t.padInfo.left;for(let m=0;m=k&&(k=o,S=n*u*h+r*u+a)}}}n.set(S,m,y,s,r,g)}}}return n}(n.bufferSync(i),u),d=u.strideDepth,p=u.strideHeight,f=u.strideWidth,m=u.dilationDepth,g=u.dilationHeight,y=u.dilationWidth,b=u.effectiveFilterDepth,w=u.effectiveFilterHeight,v=u.effectiveFilterWidth,A=b-1-u.padInfo.front,x=v-1-u.padInfo.left,C=w-1-u.padInfo.top,k=Fl(i.shape,"float32"),S=n.bufferSync(r);for(let e=0;e=u.outDepth||Math.floor(s)!==s))for(let r=0;r=u.outHeight||Math.floor(i)!==i))for(let a=0;a=u.outWidth||Math.floor(c)!==c)continue;const d=b*w*v-1-h.get(e,s,i,c,t)===n*w*v+r*v+a?1:0;if(0===d)continue;l+=S.get(e,s,i,c,t)*d}}}k.set(l,e,n,s,r,t)}return n.makeTensorInfo(k.shape,k.dtype,k.values)}};const WI={kernelName:dr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i,output:a}=t,o=i;BS([i,a],"maxPoolGrad");const{filterSize:l,strides:c,pad:u,dimRoundingMode:h}=s,d=Au(o.shape,l,c,1,u,h),p=n.data.get(o.dataId).values,f=Fl(d.outShape,o.dtype,YE(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,A=v-1-d.padInfo.left,x=w-1-d.padInfo.top,C=Fl(o.shape,"float32"),k=n.data.get(r.dataId).values,S=Fl(r.shape,"float32",k);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;a+=S.get(e,s,o,t)*l}}C.set(a,e,n,s,t)}return n.makeTensorInfo(C.shape,C.dtype,C.values)}};const GI={kernelName:mr,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:i,pad:a,includeBatchInIndex:o}=t,l=n;BS(s,"MaxPoolWithArgmax");const c=l.data.get(s.dataId).values,u=Au(s.shape,r,i,[1,1],a),[h,d]=function(e,t,n,s,r){const i=ZE(e,0,n,pn(t),r,"max"),a=YE(e,t,n,r,!0,s);return[i.values,a.values]}(c,s.shape,s.dtype,o,u),p=l.write(h,u.outShape,s.dtype),f=l.write(d,u.outShape,s.dtype);return[{dataId:p,shape:u.outShape,dtype:s.dtype},{dataId:f,shape:u.outShape,dtype:"int32"}]}};const UI={kernelName:gr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=tn(i,r.shape),l=Kt(Oh(r.shape,o)[1]),c=[],u=n.makeTensorInfo([],"float32",new Float32Array([l]));c.push(u);const h=dE({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});c.push(h);const d=ST({inputs:{a:h,b:u},backend:n});c.push(d);const p=tT({inputs:{x:d},backend:n,attrs:{axis:i,keepDims:a}});return c.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}};const qI={kernelName:yr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s;BS(r,"min");const o=tn(i,r.shape);let l=o;const c=Mh(l,r.shape.length);let u=r;null!=c&&(u=RE({inputs:{x:r},backend:n,attrs:{perm:c}}),l=Bh(l.length,r.shape.length)),Rh("min",l,u.shape.length);const[h,d]=Oh(u.shape,l),p=Kt(d),f=yn(Kt(h),u.dtype),m=n.data.get(u.dataId).values;for(let e=0;eMath.min(e,t))),HI=fE(br,jI),$I={kernelName:br,backendName:"cpu",kernelFunc:HI};const KI={kernelName:wr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:i,mode:a}=s;BS(r,"mirrorPad");const o=i.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=i.map((e=>e[0])),c=i.map(((e,t)=>e[0]+r.shape[t])),u="reflect"===a?0:1,h=n.data.get(r.dataId).values,d=r.shape.length,p=pn(r.shape),f=Kt(o),m=o.length,g=pn(o),y=sn(r.dtype,f);for(let e=0;e=c[e]&&(t[e]=2*(c[e]-1)-t[e]+u);t=t.map(((e,t)=>e-l[t]));const n=vn(t,d,p);y[e]=h[n]}return{dataId:n.write(y,o,r.dtype),shape:o,dtype:r.dtype}}},XI=KS(((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t})),ZI=fE(vr,XI),YI={kernelName:vr,backendName:"cpu",kernelFunc:ZI};function QI(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:i}=s,a=r.shape.length;let o=i;if(-1===o&&(o=a-1),o!==a-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a} and dim was ${o}`);const l=tn([o],r.shape),c=RI({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),u=Dh(c.shape,l),h=vE({inputs:{x:c},backend:n,attrs:{shape:u}}),d=IT({inputs:{a:r,b:h},backend:n}),p=yT({inputs:{x:d},backend:n}),f=tT({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),m=vE({inputs:{x:f},backend:n,attrs:{shape:u}}),g=ST({inputs:{a:p,b:m},backend:n});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}const JI={kernelName:di,backendName:"cpu",kernelFunc:QI};const eN={kernelName:Ar,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:i,seed:a,normalized:o}=s;BS(r,"multinomial");const l=o?r:QI({inputs:{logits:r},backend:n,attrs:{dim:-1}}),c=l.shape[0],u=l.shape[1],h=n.data.get(l.dataId).values,d=[c,i],p=yn(Kt(d),"int32");for(let e=0;ee!==t?1:0)),uN=fE(kr,cN,null,"bool"),hN={kernelName:kr,backendName:"cpu",kernelFunc:uN};const dN={kernelName:Ir,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:i,depth:a,onValue:o,offValue:l}=s;BS(r,"oneHot");const c=Kt(r.shape),u=new Float32Array(c*a);u.fill(l);const h=n.data.get(r.dataId).values;for(let e=0;e=0&&h[e]{Ht(i,e.shape,"All tensors passed to stack must have matching shapes"),jt(a===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=k_({inputs:t.map((e=>{const t=wT({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 yN={kernelName:Nr,backendName:"cpu",kernelFunc:gN};const bN={kernelName:Or,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:i,constantValue:a}=s;BS(r,"pad");const o=i.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=i.map((e=>e[0])),c=n.data.get(r.dataId).values,u=Kt(r.shape),h=r.shape.length,d=pn(r.shape),p=Kt(o),f=o.length,m=pn(o),g=sn(r.dtype,p);0!==a&&g.fill(a);for(let e=0;ee+l[t])),f,m)]=c[e]}return{dataId:n.write(g,o,r.dtype),shape:o,dtype:r.dtype}}},wN=KS(((e,t)=>Math.pow(e,t))),vN=fE(Dr,wN),AN={kernelName:Dr,backendName:"cpu",kernelFunc:vN};function xN(e,t,n,s){const[r,i]=Oh(e,s),a=Xa(t,"int32"),o=yn(Kt(r),a),l=Kt(i);for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(y,g,f)}};function kN(e,t,n,s){const r=[];let i=0;const a=t.length-1+n.length,o=new Array(a).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[a];for(let e=a;e{if(e<0||e>=n){const r=An(s,t.length,pn(t)).join(",");throw new Error(`indices[${r}] = ${e} is not in [0, ${n})`)}}))}(i,a,t[0][0]-1),0===s.length)throw new Error("params.rank must be nonzero");const l=s[0],{outSplits:c,valueSlices:u,numValues:h}=kN(i,a,e,l),d=function(e){const t=[];for(let n=0;ns[t]=e))}return t}(c),p=EN(n,s,r,u,h);return[d,p[0],p[1]]}const TN={kernelName:Fr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:i,indices:a}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.data.get(e.dataId).values)),c=r.map((e=>e.shape)),u=n.data.get(i.dataId).values,h=n.data.get(a.dataId).values,[d,p,f]=_N(l,c,u,i.shape,i.dtype,h,a.shape),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,i.dtype,p);return m.concat([g])}},IN=2147483647;function NN(e,t,n,s,r,i,a){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(a.length>1)throw new Error("deltas must be a scalar or vector");const o=0===t.length,l=0===r.length,c=0===a.length,u=[];o||u.push(t[0]),l||u.push(r[0]),c||u.push(a[0]);for(let e=1;e0&&rn)u=0;else if(u=Math.ceil(Math.abs((r-n)/a)),u>IN)throw new Error(`Requires ((limit - start) / delta) <= ${IN}`);d[t+1]=d[t]+u}const p=rn(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 i=1;i"Final length of result must be equal to firstDimension.")),r}calculateOutputIndexRowSplit(e,t,n,s){const r=e.length,i=[];for(let a=0;a0&&i.length!==e[r-1])throw new Error("Invalid row split size.");return i}calculateOutputIndexValueRowID(e,t,n,s){const r=e.length,i=[];if(0===r)return[];let a=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];i.push(l);for(let c=1;c=0&&(++a,a=t.length)throw new Error(`Got nextValueRowId=${r} which is not less than ${t.length}`);l=t[r]}i.push(l)}if(i.length!==e.length)throw new Error("Invalid row ids.");return i}calculateOutputIndex(e,t,n,s){const r=this.getRowPartitionTensor(e),i=this.getRowPartitionTypeByDimension(e);switch(i){case DN.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(r,t,n,s);case DN.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: ${DN[i]}`)}}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 DN.FIRST_DIM_SIZE:return e[0];case DN.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case DN.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${DN[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=FN(t,!1),r=rn(this.valuesDType,Kt(s));if(n[0]*t[0]>0){let i=this.calculateFirstParentOutputIndex(e,n[0],t[0]);for(let e=1;e<=this.raggedRank;++e){i=this.calculateOutputIndex(e-1,i,n[e],t[e])}this.setOutput(this.raggedRank,i,r,s)}return[s,r]}setOutput(e,t,n,s){if(0===n.length)return;const r=this.values,i=n;let a=s.slice();a=a.slice(e+1);const o=Kt(a),l=t.length;let c=this.defaultValue;if(c.length!==o&&1!==c.length){const e=this.defaultValueShape;To((()=>{const t=Fu(c,e),n=Qu(t,a);c=n.dataSync()}))}let u=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)i.subarray(d*o,s*o).fill(this.defaultValue[0]),d=s;else for(;s>d;){MN(i.slice(d*o),c,o),++d}s<0?(u=e+1,h=d):(u=e,h=d,d=h+1)}else++d}}}function MN(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 BN(e,t,n,s,r,i,a,o,l,c){return new RN(e,t,n,s,r,i,a,o,l,c).compute()}const zN={kernelName:zr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:i,defaultValue:a,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,c=n.data.get(r.dataId).values,u=n.data.get(i.dataId).values,h=n.data.get(a.dataId).values,d=o.map((e=>n.data.get(e.dataId).values)),p=o.map((e=>e.shape)),[f,m]=BN(c,r.shape,u,i.shape,i.dtype,h,a.shape,d,p,l);return n.makeTensorInfo(f,i.dtype,m)}};function LN(e,t,n,s){if(e===t||e1)return yn(0,s);const r=yn(Math.abs(Math.ceil((t-e)/n)),s);t1/e)),WN={kernelName:Vr,backendName:"cpu",kernelFunc:VN};const GN={kernelName:jr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s;BS(r,"resizeBilinear");const l=pn(r.shape),[c,u]=o,[h,d,p,f]=r.shape,m=n.data.get(r.dataId).values,g=new Float32Array(Kt([h,c,u,f])),y=[i&&c>1?d-1:d,i&&u>1?p-1:p],b=[i&&c>1?c-1:c,i&&u>1?u-1:u];let w=0;const v=y[0]/b[0],A=y[1]/b[1];for(let e=0;e1?c-1:c,a&&p>1?u-1:u],g=[a&&d>1?d-1:d,a&&p>1?p-1:p],y=m[0]/g[0],b=m[1]/g[1],w=n.data.get(i.dataId).values;let v=0;for(let e=0;e1?d-1:d,i&&u>1?p-1:p],b=[i&&c>1?c-1:c,i&&u>1?u-1:u],w=y[0]/b[0],v=y[1]/b[1];let A=0;for(let e=0;e1?u-1:u,a&&f>1?h-1:h],b=[a&&p>1?p-1:p,a&&f>1?f-1:f],w=y[0]/b[0],v=y[1]/b[1],A=1/w,x=1/v,C=2*Math.ceil(A)+2,k=2*Math.ceil(x)+2;for(let e=0;e=p)continue;const d=t+c*l[1],m=c*w;if(e===Math.min(u-1,a?Math.round(m):Math.floor(m)))for(let e=0;e=f)continue;const r=d+t*l[2],i=t*v;s===Math.min(h-1,a?Math.round(i):Math.floor(i))&&(o+=g[r+n])}}m[i+n]=o}}}}return n.makeTensorInfo(r.shape,r.dtype,m)}};const HN={kernelName:Kr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:i}=s;BS(r,"reverse");const a=r.shape.length,o=tn(i,r.shape);if(0===a)return qS({inputs:{x:r},backend:n});const l=new Oa(r.shape,r.dtype),c=n.bufferSync(r);for(let e=0;en[e]=r.shape[e]-1-n[e])),l.set(c.get(...n),...t)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}},$N={kernelName:Li,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:i,center:a}=t,o=n,l=sn(s.dtype,Kt(s.shape)),[c,u,h,d]=s.shape,[p,f]=Fm(a,u,h),m=Math.sin(r),g=Math.cos(r),y=o.data.get(s.dataId).values;for(let e=0;e=0&&v=0&&A{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1})),XN={kernelName:Xr,backendName:"cpu",kernelFunc:KN},ZN=PS((e=>1/Math.sqrt(e))),YN=WS(Zr,ZN),QN={kernelName:Zr,backendName:"cpu",kernelFunc:YN};function JN(e,t,n,s,r,i,a,o,l,c){const u=[s/r,r],h=e.values,d=t.values;if(0===s)return Fl(n,t.dtype);const p=l instanceof Oa?l:Fl(u,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: ${i} does not index into ${n}`);for(let n=0;n1||1===r.shape.length?1:Kt(r.shape.slice(1));for(let e=0;ee>=0?aO*e:iO*(Math.exp(e)-1))),lO={kernelName:ti,backendName:"cpu",kernelFunc:oO},cO=VS(ii,(e=>e<0?-1:e>0?1:0)),uO={kernelName:ii,backendName:"cpu",kernelFunc:cO},hO=VS(si,(e=>Math.sin(e))),dO={kernelName:si,backendName:"cpu",kernelFunc:hO},pO=VS(ri,(e=>Math.sinh(e))),fO={kernelName:ri,backendName:"cpu",kernelFunc:pO},mO=Math.log(1.1920928955078125e-7)+2,gO=VS(oi,(e=>{const t=e>-mO,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 AO(e,t,n,s,r){const i=Kt(s),a=t[0],o=r.length,l=[];let c=1,u=-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=rn(n,a*o);for(let t=0;t0?r[o-1]+1:0;if(u<0)throw new Error("segment ids must be >= 0");const h=t.slice();h[0]=u;const d=rn(n,h.reduce(((e,t)=>e*t),1));if(0===o)return u>0&&d.fill(a),[d,h];if(u<=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>=u)throw new Error(Sg(g,u));g>m&&d.fill(a,m*c,g*c);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=[...u];t[o]=e;const s=i_({inputs:{x:r},backend:n,attrs:{begin:c,size:t}});return c[o]+=e,s}))}},TO=PS((e=>Math.sqrt(e))),IO=VS(li,(e=>Math.sqrt(e))),NO={kernelName:li,backendName:"cpu",kernelFunc:IO},OO={kernelName:wi,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,s=t;BS(n,"square");const r=s.data.get(n.dataId).values,i=new Float32Array(r.length);for(let e=0;e{const n=e-t;return n*n})),RO=fE(bi,DO),MO={kernelName:bi,backendName:"cpu",kernelFunc:RO},FO=PS(((e,t)=>{const{pattern:n,replaceGlobal:s,rewrite:r}=t;return e.replace(new RegExp(n,s?"g":""),r)})),BO=WS(vi,FO),zO={kernelName:vi,backendName:"cpu",kernelFunc:BO},LO=VS(Bi,((e,t)=>{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha})),PO={kernelName:Bi,backendName:"cpu",kernelFunc:LO};function VO(e,t,n,s){const r=Fl(e,t.dtype);for(let e=0;e=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=$c(b,w,v),t=i_({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});A=vE({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{const e=VO(p,n.bufferSync(r),v,b);A=n.makeTensorInfo(f,e.dtype,e.values)}return A}};class GO{constructor(e,t,n,s,r,i){this.separator=ga(e),this.nGramWidths=t,this.leftPad=ga(n),this.rightPad=ga(s),this.padWidth=r,this.preserveShort=i}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,i){for(let a=0;a0?0:a-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+u-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,i=rn("int32",s);if(0===n||0===s){const e=new Array(n);for(let e=0;e<=r;++e)i[e]=0;return[e,i]}i[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),i[e]=i[e-1]+s}const a=new Array(i[r]);for(let n=0;n{const o=t[n+1]-t[n],l=this.getNumNGrams(o,i);this.createNGrams(e,s,a,r,l,i),r+=l})),this.preserveShort&&r===i[n]){const i=t[n+1]-t[n];if(0===i)continue;const o=i+2*this.padWidth,l=1;this.createNGrams(e,s,a,r,l,o)}}return[a,i]}}function UO(e,t,n,s,r,i,a,o){return new GO(n,s,r,i,a,o).compute(e,t)}const qO={kernelName:xi,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:i,leftPad:a,rightPad:o,padWidth:l,preserveShortSequences:c}=s,{data:u,dataSplits:h}=t,d=n.data.get(u.dataId).values,p=n.data.get(h.dataId).values,[f,m]=UO(d,p,r,i,a,o,l,c);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};function jO(e,t,n,s){if(!e.length)return;if(0===t.length){for(let t=0;tMath.tan(e))),YO={kernelName:Ei,backendName:"cpu",kernelFunc:ZO},QO=VS(_i,(e=>Math.tanh(e)));function JO(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 tD(e,t,n=0,s=e.length-1){for(;s>n;){if(s-n>600){const r=s-n+1,i=t-n+1,a=Math.log(r),o=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*o*(r-o)/r)*Math.sign(i-r/2);tD(e,t,Math.max(n,Math.floor(t-i*o/r+l)),Math.min(s,Math.floor(t+(r-i)*o/r+l)))}const r=e[t];let i=n,a=s;for(qt(e,n,t),eD(e[s],r)>0&&qt(e,n,s);i0;)a-=1}0===eD(e[n],r)?qt(e,n,a):(a+=1,qt(e,a,s)),a<=t&&(n=a+1),t<=a&&(s=a-1)}}function nD(e,t,n,s,r){const i=t[t.length-1],[a,o]=[e.length/i,i],l=sn(n,a*s),c=sn("int32",a*s);for(let t=0;ta[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 Gt(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 Gt(0,n,t-1)}(e,t);case"nearest":return function(e,t){return Gt(0,e,t-1)}(e,t);default:return function(e,t){return e}(e)}}function rD(e,t,n,s,r,i,a,o,l,c,u){return 0<=o&&o{for(let n=0;nn.disposeIntermediateTensorInfo(e))),h}},cD=[kE,EE,TE,NE,wE,OE,FE,BE,zE,LE,VE,GE,qE,$E,XE,JE,e_,t_,n_,CE,s_,o_,u_,p_,f_,pE,y_,w_,oE,v_,S_,__,T_,I_,N_,O_,D_,M_,B_,z_,L_,P_,V_,W_,U_,q_,j_,H_,$_,K_,X_,Z_,sT,US,rT,oT,mT,bT,vT,CT,MT,BT,zT,VT,UT,qT,jT,$T,XT,QT,tI,jS,nI,C_,rI,aI,lI,$S,hI,fI,gI,wI,AI,kI,EI,II,NI,OI,MI,zI,LI,PI,VI,WI,GI,UI,qI,$I,KI,YI,eN,eT,nN,rN,aN,lN,hN,dN,mN,yN,bN,AN,YS,CN,TN,ON,zN,PN,uE,ET,WN,JS,tE,AE,GN,UN,qN,jN,HN,$N,XN,QN,eO,sO,rO,lO,rE,uO,dO,fO,a_,JI,yO,bO,vO,xO,kO,SO,EO,_O,NO,OO,MO,zO,PO,WO,qO,$O,XO,NT,nT,YO,{kernelName:_i,backendName:"cpu",kernelFunc:QO},{kernelName:Qr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{tensor:s,indices:r,updates:i}=t,{sliceRank:a,numUpdates:o,sliceSize:l,strides:c,outputSize:u}=$p(0,r,s.shape),h=n.bufferSync(r),d=n.bufferSync(i),p=n.bufferSync(s),f=JN(h,d,s.shape,u,l,o,a,c,p,!1);return n.makeTensorInfo(s.shape,f.dtype,f.values)}},{kernelName:Ti,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reps:i}=s;BS(r,"tile");const a=JO(n.bufferSync(r),i);return n.makeTensorInfo(a.shape,a.dtype,a.values)}},{kernelName:Ii,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{k:i,sorted:a}=s;BS(r,"topk");const o=n.data.get(r.dataId).values,[l,c]=nD(o,r.shape,r.dtype,i,a);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(c.shape,c.dtype,c.values)]}},{kernelName:Ni,backendName:"cpu",kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,{image:r,transforms:i}=t,{interpolation:a,fillMode:o,fillValue:l,outputShape:c}=n,[u,h,d,p]=r.shape,[f,m]=null!=c?c:[h,d],g=[u,f,m,p],y=pn(r.shape),b=y[0],w=y[1],v=y[2],A=pn(g),x=A[0],C=A[1],k=A[2],S=sn(r.dtype,Kt(g));S.fill(l);const E=s.data.get(r.dataId).values,_=s.data.get(i.dataId).values;for(let e=0;e{t.preventDefault(),delete uD[e]}),!1),En().getBool("SOFTWARE_WEBGL_ENABLED")&&(hD.failIfMajorPerformanceCaveat=!1);if(1===e)return n.getContext("webgl",hD)||n.getContext("experimental-webgl",hD);return n.getContext("webgl2",hD)}(e,t);if(null===n)return null;uD[e]=n}const n=uD[e];return null==n||n.isContextLost()?(delete uD[e],dD(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),uD[e])}var pD,fD,mD,gD,yD,bD;function wD(e,t){return[t,e]}function vD(e){const t=Kt(e);return Yt(Math.ceil(t/4))}function AD(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function xD(e,t){const n=e;let s,r,i,a,o,l,c,u,h,d;return 2===En().getNumber("WEBGL_VERSION")?(s=n.R32F,r=n.R16F,i=n.RGBA16F,a=n.RGBA32F,o=n.RED,c=4,u=1,h=n.HALF_FLOAT,d=n.FLOAT,l=n.RGBA8):(s=e.RGBA,r=e.RGBA,i=e.RGBA,a=n.RGBA,o=e.RGBA,c=4,u=4,h=null!=t?t.HALF_FLOAT_OES:null,d=e.FLOAT,l=e.RGBA),{internalFormatFloat:s,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:a,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:c,defaultNumChannels:u,textureTypeHalfFloat:h,textureTypeFloat:d}}function CD(e,t){const n=t();return En().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}(fD=pD||(pD={}))[fD.DENSE=0]="DENSE",fD[fD.SHARED_BATCH=1]="SHARED_BATCH",(gD=mD||(mD={}))[gD.RENDER=0]="RENDER",gD[gD.UPLOAD=1]="UPLOAD",gD[gD.PIXELS=2]="PIXELS",gD[gD.DOWNLOAD=3]="DOWNLOAD",(bD=yD||(yD={}))[bD.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",bD[bD.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",bD[bD.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",bD[bD.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",bD[bD.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16";function kD(e){return!!(En().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8e.getExtension(t)),'Extension "'+t+'" not supported on this browser.')}const ED=/ERROR: [0-9]+:([0-9]+):/g;function _D(e,t){const n=ED.exec(t);if(null==n)return;const s=+n[1],r=e.split("\n"),i=r.length.toString().length+2,a=r.map(((e,t)=>Qt((t+1).toString(),i)+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 ID(e,t,n,s,r,i,a){const o=e.getAttribLocation(t,n);return-1!==o&&(CD(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,s))),CD(e,(()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,i,a))),CD(e,(()=>e.enableVertexAttribArray(o))),!0)}function ND(e,t,n,s){CD(e,(()=>function(e,t,n){FD(e,n),CD(e,(()=>e.activeTexture(e.TEXTURE0+n))),CD(e,(()=>e.bindTexture(e.TEXTURE_2D,t)))}(e,t,s))),CD(e,(()=>e.uniform1i(n,s)))}function OD(e,t,n){CD(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,n))),CD(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)))}function DD(e,t){CD(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,t))),CD(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)))}function RD(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 MD(e,t,n){const s=CD(e,(()=>t()));if(null==s)throw new Error(n);return s}function FD(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 BD(e,t=2){return Kt(e.slice(0,e.length-t))}function zD(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 LD(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[BD(e),...zD(e)]),t}function PD(e){return e%2==0}function VD(e,t){if(Xt(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(PD(n)&&PD(s)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&PD(e[0])&&PD(t[0])}let WD,GD;function UD(e,t){return null!=e.getExtension(t)}function qD(e){try{if(null!=dD(e))return!0}catch(e){return!1}return!1}function jD(e){if(0===e)return!1;const t=dD(e);if(1!==e){if(UD(t,"EXT_color_buffer_float"))return HD(t);const e="EXT_color_buffer_half_float";if(UD(t,e)){const n=t.getExtension(e);return function(e,t){const n=xD(e,t),s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s);const r=1,i=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,i,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const a=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,a),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(a),o}(t,n)}return!1}if(!UD(t,"OES_texture_float"))return!1;if(!UD(t,"WEBGL_color_buffer_float"))return!1;return HD(t)}function HD(e){const t=xD(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 $D(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&jt("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the WebGL backend.`))}))}const KD=En();function XD(){let e,t,n,s,r,i,a,o,l,c;return 2===En().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",s="in",r="texture",i="outputColor",a="out vec4 outputColor;",o=En().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="",c="\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",i="gl_FragColor",a="",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 ",c="\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:i,defineOutput:a,defineSpecialNaN:o,defineSpecialInf:l,defineRound:c}}function ZD(e,t,n="index"){const s=pn(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 YD(e,t,n="index"){const s=pn(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 QD(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 JD(e){const t=pn(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`}KD.registerFlag("HAS_WEBGL",(()=>KD.getNumber("WEBGL_VERSION")>0)),KD.registerFlag("WEBGL_VERSION",(()=>qD(2)?2:qD(1)?1:0)),KD.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",(()=>!1)),KD.registerFlag("WEBGL_BUFFER_SUPPORTED",(()=>2===KD.get("WEBGL_VERSION"))),KD.registerFlag("WEBGL_CPU_FORWARD",(()=>!0)),KD.registerFlag("WEBGL_FORCE_F16_TEXTURES",(()=>!1)),KD.registerFlag("WEBGL_PACK",(()=>KD.getBool("HAS_WEBGL"))),KD.registerFlag("WEBGL_PACK_NORMALIZATION",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_CLIP",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_DEPTHWISECONV",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_REDUCE",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_LAZILY_UNPACK",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_CONV_IM2COL",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_MAX_TEXTURE_SIZE",(()=>function(e){if(null==WD){const t=dD(e);WD=t.getParameter(t.MAX_TEXTURE_SIZE)}return WD}(KD.getNumber("WEBGL_VERSION")))),KD.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",(()=>function(e){if(null==GD){const t=dD(e);GD=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,GD)}(KD.getNumber("WEBGL_VERSION")))),KD.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",(()=>{const e=KD.getNumber("WEBGL_VERSION");return 0===e?0:function(e){if(0===e)return 0;let t;const n=dD(e);return t=UD(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:UD(n,"EXT_disjoint_timer_query")?1:0,t}(e)})),KD.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",(()=>KD.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!uo())),KD.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",(()=>function(e){if(0===e)return!1;const t=dD(e);if(1===e){if(!UD(t,"OES_texture_float"))return!1}else if(!UD(t,"EXT_color_buffer_float"))return!1;return HD(t)}(KD.getNumber("WEBGL_VERSION")))),KD.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",(()=>!KD.getBool("WEBGL_FORCE_F16_TEXTURES")&&KD.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))),KD.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",(()=>jD(KD.getNumber("WEBGL_VERSION")))),KD.registerFlag("WEBGL_FENCE_API_ENABLED",(()=>{return 2===(e=KD.getNumber("WEBGL_VERSION"))&&null!=dD(e).fenceSync;var e})),KD.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",(()=>KD.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0)),KD.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}.`)})),KD.registerFlag("WEBGL_FLUSH_THRESHOLD",(()=>uo()?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}.`)})),KD.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",(()=>128)),KD.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",(()=>!1)),KD.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",(()=>1e5)),KD.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",(()=>128)),KD.registerFlag("WEBGL_EXP_CONV",(()=>!1)),KD.registerFlag("SOFTWARE_WEBGL_ENABLED",(()=>KD.getBool("IS_TEST"))),KD.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",(()=>1/0)),KD.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",(()=>!1)),KD.registerFlag("WEBGL2_ISNAN_CUSTOM",(()=>!1)),KD.registerFlag("ENGINE_COMPILE_ONLY",(()=>!1));const eR="\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:tR}=r;function nR(e,t,n){const s=[];if(e.forEach((e=>{const t=Kt(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}=pR(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"),i=e.map((e=>function(e,t,n=!1,s){let r="";r+=n?rR(e,s):sR(e,s);const i=e.shapeInfo.logicalShape,a=t.logicalShape;i.length<=a.length&&(r+=n?function(e,t){const n=e.name,s=n.charAt(0).toUpperCase()+n.slice(1),r="get"+s+"AtOutCoords",i=e.shapeInfo.logicalShape.length,a=t.logicalShape.length,o=tR(e.shapeInfo.logicalShape,t.logicalShape),l=dR(a),c=a-i;let u;const h=["x","y","z","w","u","v"];u=0===i?"":a<2&&o.length>=1?"coords = 0;":o.map((e=>`coords.${h[e+c]} = 0;`)).join("\n");let d="";d=a<2&&i>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${h[t+c]}`)).join(", ");let p="return outputValue;";const f=1===Kt(e.shapeInfo.logicalShape),m=Kt(t.logicalShape),g=1===m;if(1!==i||f||g){if(f&&!g)p=1===a?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(o.length){const e=i-2,t=i-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 ${u}\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",i=t.texShape,a=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&null==e.shapeInfo.flatOffset&&Xt(a,i))return`\n float ${r}() {\n return sampleTexture(${n}, resultUV);\n }\n `;const c=dR(l),u=tR(e.shapeInfo.logicalShape,t.logicalShape),h=l-o;let d;const p=["x","y","z","w","u","v"];d=0===o?"":l<2&&u.length>=1?"coords = 0;":u.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 ${c} coords = getOutputCoords();\n ${d}\n return get${s}(${f});\n }\n `}(e,t));return r}(e,t,n.packedInputs,n.enableShapeUniforms))).join("\n"),a=t.texShape,o=XD(),l=function(e){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${e.texture2D}(textureSampler, uv).r;\n }\n `}(o);let c,u,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 ${iR}\n ${aR}\n ${oR}\n `;return t}(o);t.isPacked?(c=function(e,t,n){switch(e.length){case 0:return cR();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(Xt(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),i=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 / ${i};\n index -= b * ${i};\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),i=r*Math.ceil(e[e.length-2]/2);let a=i,o="",l="b, r, c";for(let t=2;t1&&!Xt(t,n)&&s.lengthe[t])).join(", ")}function gR(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}})),i=r.map((e=>e.shapeInfo)),a={logicalShape:s.shape,texShape:s.texData.texShape,isUniform:!1,isPacked:s.texData.isPacked,flatOffset:null},o=nR(r,a,t),l=function(e,t){const n=MD(e,(()=>e.createShader(e.FRAGMENT_SHADER)),"Unable to create fragment WebGLShader.");if(CD(e,(()=>e.shaderSource(n,t))),CD(e,(()=>e.compileShader(n))),En().get("ENGINE_COMPILE_ONLY"))return n;if(!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw _D(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}(e.gl,o),c=e.createProgram(l);return En().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:o,webGLProgram:c,inShapeInfos:i,outShapeInfo:a,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(c),Object.assign({program:t,fragmentShader:l,source:o,webGLProgram:c,inShapeInfos:i,outShapeInfo:a},yR(e,t,c)))}function yR(e,t,n){const s=[],r=[];let i,a,o,l=null,c=null;c=e.getUniformLocation(n,"NAN",!1),1===En().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(n,"INFINITY",!1));const u=!1;for(const r of t.variableNames){const i={name:r,uniform:e.getUniformLocation(n,r,u),offset:e.getUniformLocation(n,`offset${r}`,u)};t.enableShapeUniforms&&(i.shape=e.getUniformLocation(n,`${r}Shape`,u),i.texShape=e.getUniformLocation(n,`${r}TexShape`,u)),s.push(i)}if(t.enableShapeUniforms&&(i=e.getUniformLocation(n,"outShape",u),o=e.getUniformLocation(n,"outShapeStrides",u),a=e.getUniformLocation(n,"outTexShape",u)),t.customUniforms)for(const s of t.customUniforms)r.push(e.getUniformLocation(n,s.name,u));return{variablesLocations:s,customUniformLocations:r,infLoc:l,nanLoc:c,outShapeLocation:i,outShapeStridesLocation:o,outTexShapeLocation:a}}function bR(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],i=r.shape;if(!Xt(s,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${s} and ${i} must match`);if(e.isUniform&&r.isUniform)return;const a=e.texShape,o=r.isUniform?null:r.texData.texShape;if(!Xt(a,o))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${a} and ${o} must match`)}))}function wR(e){return En().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}class vR{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=pD.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=XD();this.outputShape=e,this.enableShapeUniforms=wR(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?YD(["r","c","d"],e):ZD(["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 AR{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=pD.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=XD();this.outputShape=e,this.enableShapeUniforms=wR(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?YD(["r","c","d"],e):ZD(["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 xR{constructor(e){this.variableNames=["A"],this.outTexUsage=mD.DOWNLOAD;const t=XD();this.outputShape=e,this.userCode=`\n ${eR}\n\n void main() {\n float x = getAAtOutCoords();\n ${t.output} = encode_float(x);\n }\n `}}class CR{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=mD.DOWNLOAD;const t=XD();this.outputShape=e,this.userCode=`\n ${eR}\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 kR={R:0,G:1,B:2,A:3};class SR{constructor(e,t=!1,n="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const s=XD();this.outputShape=e,this.enableShapeUniforms=wR(this.outputShape.length);let r="result";t&&(r="floor(result * 255. + 0.5)");let i="";for(let e=0;ee.createShader(e.VERTEX_SHADER)),"Unable to create vertex WebGLShader.");if(CD(e,(()=>e.shaderSource(n,t))),CD(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 TR(e){return function(e,t){const n=MD(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return CD(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),CD(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 IR(e){return function(e,t){const n=MD(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return CD(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n))),CD(e,(()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW))),n}(e,new Uint16Array([0,1,2,2,1,3]))}function NR(e,t,n,s,r,i){!function(e,t){const n=En().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 a=function(e){return MD(e,(()=>e.createTexture()),"Unable to create WebGLTexture.")}(e),o=e.TEXTURE_2D;return CD(e,(()=>e.bindTexture(o,a))),CD(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE))),CD(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE))),CD(e,(()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST))),CD(e,(()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST))),1===En().getNumber("WEBGL_VERSION")?CD(e,(()=>e.texImage2D(o,0,s,t,n,0,r,i,null))):CD(e,(()=>e.texStorage2D(o,1,s,t,n))),CD(e,(()=>e.bindTexture(e.TEXTURE_2D,null))),{texture:a,texShape:[n,t]}}function OR(e){return e.internalFormatFloat}function DR(e){return e.internalFormatHalfFloat}function RR(e){return e.downloadTextureFormat}function MR(e){return e.internalFormatPackedFloat}function FR(e){return e.internalFormatPackedHalfFloat}function BR(e,t,n,s,r,i,a,o){const l=e,c=new Float32Array(function(e,t){const[n,s]=AD(e,t);return n*s*4}(i,a));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,c),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),c}class zR{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const t=En().getNumber("WEBGL_VERSION");if(null!=e?(this.gl=e,function(e,t){uD[e]=t}(t,e)):this.gl=dD(t),e=this.gl,2===En().getNumber("WEBGL_VERSION")){const t=e;this.createVertexArray=()=>CD(t,(()=>t.createVertexArray())),this.bindVertexArray=e=>CD(t,(()=>t.bindVertexArray(e))),this.deleteVertexArray=e=>CD(t,(()=>t.deleteVertexArray(e))),this.getVertexArray=()=>CD(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=()=>CD(e,(()=>t.createVertexArrayOES())),this.bindVertexArray=n=>CD(e,(()=>t.bindVertexArrayOES(n))),this.deleteVertexArray=n=>CD(e,(()=>t.deleteVertexArrayOES(n))),this.getVertexArray=()=>CD(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===En().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=SD(this.gl,e),UD(this.gl,t))this.textureHalfFloatExtension=SD(this.gl,t);else if(En().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),UD(this.gl,s))this.colorBufferHalfFloatExtension=SD(this.gl,s);else if(En().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",UD(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!UD(this.gl,s))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(s)}this.vertexBuffer=TR(this.gl),this.indexBuffer=IR(this.gl),this.framebuffer=function(e){return MD(e,(()=>e.createFramebuffer()),"Unable to create WebGLFramebuffer.")}(this.gl),this.textureConfig=xD(this.gl,this.textureHalfFloatExtension)}get debug(){return En().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program,this.outputTexture;const e=this.gl;CD(e,(()=>e.finish())),CD(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,null))),CD(e,(()=>e.deleteFramebuffer(this.framebuffer))),CD(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,null))),CD(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null))),CD(e,(()=>e.deleteBuffer(this.indexBuffer))),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=wD(t,n);return NR(e,r,i,OR(s),s.textureFormatFloat,e.FLOAT)}(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=wD(t,n);return NR(e,r,i,DR(s),s.textureFormatFloat,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=wD(t,n);return NR(e,r,i,RR(s),e.RGBA,e.UNSIGNED_BYTE)}(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),function(e,t,n){CD(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),n.data instanceof Uint8Array?2===En().getNumber("WEBGL_VERSION")?CD(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,e.RGBA,e.UNSIGNED_BYTE,n.data))):CD(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data))):2===En().getNumber("WEBGL_VERSION")?CD(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,n))):CD(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n))),CD(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,s){this.throwIfDisposed(),function(e,t,n,s,r,i){let a,o,l;CD(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),r instanceof Uint8Array?(a=new Uint8Array(n*s*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(a=new Float32Array(n*s*4),o=e.FLOAT,l=i.internalFormatPackedFloat),a.set(r),2===En().getNumber("WEBGL_VERSION")?CD(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,s,e.RGBA,o,a))):CD(e,(()=>e.texImage2D(e.TEXTURE_2D,0,l,n,s,0,e.RGBA,o,a))),CD(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,i]=AD(t,n);return NR(e,r,i,FR(s),e.RGBA,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=AD(t,n);return NR(e,r,i,MR(s),e.RGBA,e.FLOAT)}(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(DD(this.gl,this.framebuffer),this.outputTexture=null),CD(this.gl,(()=>this.gl.deleteTexture(e)))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,(()=>function(e,t,n,s){const[r,i]=wD(t,n),a=new Uint8Array(t*n*4);return CD(e,(()=>e.readPixels(0,0,r,i,s.downloadTextureFormat,e.UNSIGNED_BYTE,a))),new Float32Array(a.buffer)}(this.gl,t,n,this.textureConfig)))}downloadPackedMatrixFromBuffer(e,t,n,s,r,i){return BR(this.gl,e,0,0,0,r,i,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();CD(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r)));const i=16*t*n;return CD(e,(()=>e.bufferData(e.PIXEL_PACK_BUFFER,i,e.STREAM_READ))),CD(e,(()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0))),CD(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(En().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 En().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,En().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 CD(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=_R(t));const n=function(e){return MD(e,(()=>e.createProgram()),"Unable to create WebGLProgram.")}(t);CD(t,(()=>t.attachShader(n,this.vertexShader))),CD(t,(()=>t.attachShader(n,e))),function(e,t){if(CD(e,(()=>e.linkProgram(t))),!En().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&&TD(t,s),s}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const t=this.gl;CD(t,(()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer))),function(e,t,n){CD(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),ID(e,t,"clipSpacePos",n,3,20,0)&&ID(e,t,"uv",n,2,20,12)}(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&(CD(this.gl,(()=>this.gl.deleteProgram(e))),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&TD(this.gl,this.program),CD(this.gl,(()=>this.gl.useProgram(e)))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?function(e,t,n){return MD(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(),CD(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(),ND(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();const[s,r]=AD(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&&TD(this.gl,this.program),RD(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){this.getVertexArray();this.debugValidate()}CD(e,(()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),CD(this.gl,(()=>this.gl.finish()))}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=SD(this.gl,2===En().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===En().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===En().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 Jt((()=>this.disposed||this.isQueryAvailable(e,En().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")))),this.getQueryTime(e,En().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 En().platform&&(n=En().platform.setTimeoutCustom.bind(En().platform)),Jt((()=>(this.pollItems(),0===this.itemsToPoll.length)),(()=>0),null,n)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),OD(this.gl,e,this.framebuffer),this.debug&&RD(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(OD(this.gl,this.outputTexture,this.framebuffer),this.debug&&RD(this.gl)):DD(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;OD(s,e,this.framebuffer),this.debug&&RD(s),this.outputTexture=e,CD(s,(()=>s.viewport(0,0,t,n))),CD(s,(()=>s.scissor(0,0,t,n)))}setOutputMatrixWriteRegionDriver(e,t,n,s){this.throwIfDisposed(),CD(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{mx:LR,XI:PR,Nk:VR,f6:WR,ct:GR,YG:UR,hH:qR,z3:jR,sG:HR,uM:$R,vS:KR,qB:XR,GG:ZR,rq:YR,lg:QR,WR:JR,cu:eM,GE:tM,px:nM,jC:sM,He:rM,hE:iM,BF:aM,Dk:oM,cl:lM,_B:cM,ub:uM,_f:hM,Ku:dM,qy:pM,Zy:fM,bu:mM,zv:gM,dH:yM,HS:bM,yH:wM,l3:vM,z9:AM,x6:xM,_m:CM,eW:kM,GK:SM,SP:EM,yr:_M,dl:TM,Dw:IM,xT:NM,_X:OM,wz:DM}=S;function RM(e,t){return["x","y","z","w","u","v"].slice(0,t).map((t=>`${e}.${t}`))}function MM(e,t){return 1===t?[e]:RM(e,t)}class FM{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=wR(this.outputShape.length),0===this.rank)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{const e=MM("rc",this.rank),t=dR(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 BM{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=wR(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?QD(["r","c","d"],"inputShape"):ZD(["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":JD(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 zM{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=PM(t,n),r=VM(e,s,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);const i=LM(e,s,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=i,this.log();const e=this.freeTextures[r].pop();return this.usedTextures[r].push(e),e}let a;return s===yD.PACKED_2X2_FLOAT32?a=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):s===yD.PACKED_2X2_FLOAT16?a=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):s===yD.UNPACKED_FLOAT32?a=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):s===yD.UNPACKED_FLOAT16?a=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):s===yD.PACKED_4X1_UNSIGNED_BYTE&&(a=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(a),this.numUsedTextures++,this._numBytesAllocated+=i,this.log(),a}releaseTexture(e,t,n,s){if(null==this.freeTextures)return;const r=PM(n,s),i=VM(t,r,s);i in this.freeTextures||(this.freeTextures[i]=[]);const a=LM(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,s),o=En().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==o&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=a):(this.freeTextures[i].push(e),this.numFreeTextures++,this._numBytesFree+=a),this.numUsedTextures--;const l=this.usedTextures[i],c=l&&l.indexOf(e);if(null==c||c<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[c]=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 LM(e,t,n,s,r){const i=function(e,t){switch(e){case yD.PACKED_2X2_FLOAT32:return MR(t);case yD.PACKED_2X2_FLOAT16:return FR(t);case yD.UNPACKED_FLOAT32:return OR(t);case yD.UNPACKED_FLOAT16:return DR(t);case yD.PACKED_4X1_UNSIGNED_BYTE:return RR(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,s);let a;if(r){const[t,n]=AD(e[0],e[1]);a=t*n}else{const[t,n]=wD(e[0],e[1]);a=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,i);return a*o}function PM(e,t){if(e===mD.UPLOAD)return yD.PACKED_2X2_FLOAT32;if(e===mD.RENDER||null==e)return function(e){return En().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?yD.PACKED_2X2_FLOAT32:yD.UNPACKED_FLOAT32:e?yD.PACKED_2X2_FLOAT16:yD.UNPACKED_FLOAT16}(t);if(e===mD.DOWNLOAD||e===mD.PIXELS)return yD.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function VM(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}class WM{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=wR(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 GM="if (isnan(x)) return x;",UM="return x;",qM="return abs(x);";const jM="return (x >= 0.0) ? x : (exp(x) - 1.0);",HM=GM+"\n return (x < 0.0) ? 0.0 : x;\n",$M=GM+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",KM="return x;",XM="return 1.0 / (1.0 + exp(-1.0 * x));",ZM="return x;",YM="\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",QM="\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",JM="\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",eF="return 1.0 / (1.0 + exp(-1.0 * x));";class tF{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=wR(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 nF{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=wR(this.outputShape.length);const t=e.length,n=MM("rc",t),s=dR(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:i,complexTensorInfos:a,isPacked:o}=t;if(null!=r){let t;t=o?new tF(s,KM):new WM(s,KM);const n=this.runWebGLProgram(t,[{dataId:e,shape:s,dtype:i}],i),r=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if(En().getBool("DEBUG")&&!En().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===En().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l,c,u=null;if("complex64"!==i&&En().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);u=this.gpgpu.createBufferFromTexture(t.texture.texture,...vD(s))}if(this.pendingRead.set(e,[]),"complex64"!==i&&await this.gpgpu.createAndWaitForFence(),"complex64"===i){const e=await Promise.all([this.read(a.real.dataId),this.read(a.imag.dataId)]);c=Zm(e[0],e[1])}else if(null==u)c=this.getValuesFromTexture(e);else{const e=Kt(s);c=this.gpgpu.downloadFloat32MatrixFromBuffer(u,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=u){const e=this.gpgpu.gl;CD(e,(()=>e.deleteBuffer(u)))}const h=this.convertAndCacheOnCPU(e,c),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)&&Eo().removeDataId(e,this),this.pendingDeletes--),h}readToGPU(e,t={}){const n=this.texData.get(e),{values:s,shape:r,slice:i,dtype:a,isPacked:o,texture:l}=n;if("complex64"===a)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=i){let n;n=o?new tF(r,KM):new WM(r,KM);const s=this.runWebGLProgram(n,[{dataId:e,shape:r,dtype:a}],a),i=this.readToGPU(s,t);return this.disposeIntermediateTensorInfo(s),i}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 c=this.decode(e,t.customTexShape),u=Eo().makeTensorFromTensorInfo(c),h=this.texData.get(c.dataId);return Object.assign({tensorRef:u},h.texture)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map((e=>ya(e)));return Fl(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return Fl(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=wa(this.activeTimers.map((e=>e.query))).filter((e=>null!=e)),i=wa(this.activeTimers.map((e=>e.name))).filter((e=>null!=e));this.activeTimers=t,s&&(this.programTimersStack=null);const a={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(En().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(r);a.kernelMs=function(e){let t=0;for(let n=0;ne.map(((e,t)=>({name:i[t],ms:e}))).map((e=>`${e.name}: ${e.ms}`)).join(", ")}else a.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,a})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return En().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:ma(),endMs:null}}endTimer(e){return En().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=ma(),e)}async getQueryTime(e){if(En().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:i,slice:a}=this.texData.get(e),o=a&&a.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,i)));const c=this.texData.get(e);c.texture=null,c.texShape=null,c.isPacked=!1,c.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=iF){return En().getBool("WEBGL_CPU_FORWARD")&&e.every((e=>null==this.texData.get(e.dataId).texture&&Kt(e.shape)0&&ln(n[0])){const r=n.map((e=>ga(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 Eo().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,n),this)}unpackTensor(e){const t=new nF(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new FM(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const n=[BD(e.shape),...zD(e.shape)],s={dtype:e.dtype,shape:n,dataId:e.dataId},r=[BD(t),...zD(t)],i=new BM(r,n),a=[n],o=this.runWebGLProgram(i,[s],e.dtype,a,!0);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e,t){const n=this.texData.get(e),{isPacked:s,shape:r,dtype:i}=n;if(null!=t){jt(Kt(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 a=LD(r);let o;o=s?new AR(a):new vR(a);const l=[null!=t?t:vD(a)];return{dtype:i,shape:r,dataId:this.runWebGLProgram(o,[{shape:a,dtype:i,dataId:e}],i,l,!0,t).dataId}}runWebGLProgram(e,t,n,s,r=!1,i){const a=this.makeTensorInfo(e.outputShape,n),o=this.texData.get(a.dataId);if(e.packedOutput&&(o.isPacked=!0),e.outPackingScheme===pD.DENSE){const t=null!=i?i:vD(e.outputShape);o.texShape=t.map((e=>2*e))}if(null!=e.outTexUsage&&(o.usage=e.outTexUsage),0===Kt(a.shape))return o.values=sn(a.dtype,0),a;const l=[],c=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&&Kt(t.shape)<=En().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&&!VD(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(a.dataId);const u={shape:a.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 i=t.texData.texShape,{useSqueezeShape:a,uniformShape:o,keptDims:l}=pR(e.packedInputs,t.shape,i);let c="",u="",h="";if(1===o.length&&e.packedInputs){const e=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];c=`${e[0]>1}_${e[1]>1}`}else if(2!==o.length||e.packedInputs){if(o.length>2&&!e.packedInputs){const e=pn(o);h=`${e[0]===i[1]}_${e[e.length-1]===i[1]}`}}else u=`${o[0]>1}_${o[1]>1}`;const d=t.shape.length,p=2===o.length&&Xt(t.shape,i),f=1===Kt(t.shape),m=oc(t.shape,n.shape),g=!e.packedInputs&&d===n.shape.length&&Xt(i,n.texData.texShape),y=e.packedInputs||o.length>2?"":`${i[0]>1}_${i[1]>1}`;s+=`${d}_${g}_${a?l:""}_${o.length}_${f}_${m}_${p}_${c}_${u}_${h}_${y}_${r}`}else{const e=t.isUniform?"uniform":t.texData.texShape;s+=`${t.shape}_${e}_${r}`}}));const r=e.userCode;let i=e.constructor.name;return i+="_"+s+"_"+r+`${En().getNumber("WEBGL_VERSION")}`,i}(e,c,u),d=this.getAndSaveBinary(h,(()=>gR(this.gpgpu,e,c,u))),p=null!=this.activeTimers;let f;p&&(f=this.startTimer()),En().get("ENGINE_COMPILE_ONLY")||function(e,t,n,s,r){t.program.enableShapeUniforms||(bR(t.inShapeInfos,n),bR([t.outShapeInfo],[s]));const i=s.texData.texture,a=s.texData.texShape;s.texData.isPacked?e.setOutputPackedMatrixTexture(i.texture,a[0],a[1]):e.setOutputMatrixTexture(i.texture,a[0],a[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),1===En().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=En().getNumber("WEBGL_FLUSH_THRESHOLD");if(m>0){const e=ma();e-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!En().getBool("WEBGL_LAZILY_UNPACK")&&o.isPacked&&!1===r){const e=this.unpackTensor(a);return this.disposeIntermediateTensorInfo(a),e}return a}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(!En().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=To((()=>{if(!En().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=En().getBool("DEBUG");En().set("DEBUG",!1);const t=this.abs($l(1e-8)).dataSync()[0];if(En().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:i,usage:a,isPacked:o}=t;if(null!=i)return;const l=null!=this.activeTimers;let c;l&&(c=ma());let u=t.texShape;if(null==u&&(u=function(e,t=!1){let n=En().getNumber("WEBGL_MAX_TEXTURE_SIZE"),s=En().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");if(s===1/0&&En().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=nn(e);e=t.newShape}let r=Kt(e),i=null;e.length<=1&&r<=n?i=[1,r]:2===e.length&&e[0]<=n&&e[1]<=n?i=e:3===e.length&&e[0]*e[1]<=n&&e[2]<=n?i=[e[0]*e[1],e[2]]:3===e.length&&e[0]<=n&&e[1]*e[2]<=n?i=[e[0],e[1]*e[2]]:4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n?i=[e[0]*e[1]*e[2],e[3]]:4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n&&(i=[e[0],e[1]*e[2]*e[3]]);const a=null!=i&&Math.max(...i)>s&&Math.min(...i)<=(t?2:1)&&Math.min(...i)>0;if(null==i||a)if(t){const t=BD(e);let n=2,s=2;e.length&&([n,s]=zD(e)),r=t*(n/2)*(s/2),i=Yt(r).map((e=>2*e))}else i=Yt(r);return i}(n,o),t.texShape=u),null!=r){const e=LD(n);let i,a=u[1],h=u[0];const d=r instanceof Uint8Array||r instanceof Uint8ClampedArray;!o&&d||([a,h]=AD(u[0],u[1])),i=o?new ER(e,d):new SR(e,d);const p=d?[h,a]:u,f=this.makeTensorInfo(p,s),m=this.texData.get(f.dataId);m.usage=d?mD.PIXELS:mD.UPLOAD,m.texShape=p,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(f.dataId),a,h,r);const g=[[h,a]],y=!0,b=this.runWebGLProgram(i,[f],s,g,y),w=this.texData.get(b.dataId);t.texShape=w.texShape,t.isPacked=w.isPacked,t.usage=w.usage,En().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+=ma()-c)}else{const e=this.acquireTexture(u,a,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]*on(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 km(),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 _D(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:i,outShapeStridesLocation:a,outTexShapeLocation:o}=yR(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=n,e.infLoc=s,e.nanLoc=r,e.outShapeLocation=i,e.outShapeStridesLocation=a,e.outTexShapeLocation=o}}createTensorFromGPUData(e,t,n){e.channels=e.channels||"RGBA";const{texture:s,height:r,width:i,channels:a}=e,o=Eo().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,i,a);return Eo().makeTensorFromDataId(l,t,n,o)}}aF.nextDataId=0;ho()&&Oo("webgl",(()=>new aF),2);const oF="\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";class lF{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=cc(t,n),this.enableShapeUniforms=wR(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 cF="\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 uF{constructor(e,t,n,s=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=cc(t,n);const r=this.outputShape.length;this.enableShapeUniforms=wR(r);let i="";if(s)if(0===r||1===Kt(this.outputShape))i="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{if(i=`\n ${dR(r)} coords = getOutputCoords();\n `,1===r)this.enableShapeUniforms?i+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":i+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{const e=MM("coords",r);this.enableShapeUniforms?i+=`\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 `:i+=`\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 ${i}\n\n setOutput(result);\n }\n `}}function hF(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 dF={kernelName:Hs,backendName:"webgl",kernelFunc:hF};function pF(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,i=n.makeTensorInfo(s.shape,"complex64"),a=n.texData.get(i.dataId),o=hF({inputs:{x:s},backend:n}),l=hF({inputs:{x:r},backend:n});return a.complexTensorInfos={real:o,imag:l},i}const fF={kernelName:ss,backendName:"webgl",kernelFunc:pF},mF="return (a < 0.) ? b * a : a;",gF="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const yF={kernelName:Qs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:i}=s,a=n.makeTensorInfo([],"float32",pa(i,"float32")),o=En().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new uF(gF,r.shape,a.shape):new lF(mF,r.shape,a.shape),l=n.runWebGLProgram(o,[r,a],"float32");return n.disposeIntermediateTensorInfo(a),l}},bF="return (a < 0.) ? b * a : a;",wF="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const vF={kernelName:Rr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t,i=En().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new uF(wF,s.shape,r.shape):new lF(bF,s.shape,r.shape);return n.runWebGLProgram(i,[s,r],"float32")}},AF="if (isnan(x)) return x;";function xF({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:s}){return({inputs:r,backend:i})=>{const{x:a}=r,o=i,l=s||a.dtype;if(o.shouldExecuteOnCPU([a])&&null!=n){const e=o.texData.get(a.dataId),t=n(e.values,l);return o.makeTensorInfo(a.shape,l,t)}let c;return c=En().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new tF(a.shape,t):new WM(a.shape,e),o.runWebGLProgram(c,[a],l)}}function CF({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:s=!1,cpuKernelImpl:r,dtype:i}){return({inputs:a,backend:o})=>{const{a:l,b:c}=a,u=o;if(s&&"complex64"===l.dtype){const t=u.texData.get(l.dataId),n=u.texData.get(c.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},i={dataId:s.dataId,dtype:s.dtype,shape:c.shape},a=new lF(e,l.shape,c.shape);return u.runWebGLProgram(a,[r,i],Xa(n.dtype,s.dtype))})),i=pF({inputs:{real:s,imag:r},backend:u});return u.disposeIntermediateTensorInfo(s),u.disposeIntermediateTensorInfo(r),i}const h=i||Xa(l.dtype,c.dtype);if(("string"===l.dtype||"string"===c.dtype||u.shouldExecuteOnCPU([l,c]))&&null!=r){const e=u.texData.get(l.dataId).values,t=u.texData.get(c.dataId).values,n="string"===l.dtype?Ng(e):e,s="string"===l.dtype?Ng(t):t,[i,a]=r(l.shape,c.shape,n,s,h),o=u.makeTensorInfo(a,h);return u.texData.get(o.dataId).values=i,o}let d;return d=En().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new uF(t,l.shape,c.shape,n):new lF(e,l.shape,c.shape),u.runWebGLProgram(d,[l,c],h)}}function kF(e,t=!1){if("linear"===e)return t?ZM:UM;if("relu"===e)return t?QM:HM;if("elu"===e)return t?YM:jM;if("relu6"===e)return t?JM:$M;if("prelu"===e)return t?wF:bF;if("leakyrelu"===e)return t?gF:mF;if("sigmoid"===e)return t?eF:XM;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}class SF{constructor(e,t,n,s=!1,r=!1,i=!1,a=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.enableShapeUniforms=wR(this.outputShape.length);const c=s?e[1]:e[2],u=Math.ceil(c/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="";a&&(m=o?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${a}\n }`:l?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${a}\n }`:`vec4 activation(vec4 x) {\n ${a}\n }`,g="result = activation(result);");const y=i?"result += getBiasAtOutCoords();":"";i&&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 ${c} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`));const u=a.texData.get(r.dataId);return!u.isPacked||VD(r.shape,l)||null!==u.texture&&VD(u.shape,l)?(a.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype}):function(e,t,n){const s=[BD(e.shape),...zD(e.shape)],r={dtype:e.dtype,shape:s,dataId:e.dataId},i=[BD(t),...zD(t)],a=new BM(i,s),o=[s],l=n.runWebGLProgram(a,[r],e.dtype,o,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(r,l,a)}const DF={kernelName:Gr,backendName:"webgl",kernelFunc:OF};class RF{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:i}=e;this.outputShape=[s,i];const a=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 * ${Zt(e)?e.toPrecision(2):e}, ones);`}let c="";r%n>0&&(c=`\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 ${c}\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 < ${a}; 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 + ${a};\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 MF{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:i}=e;this.outputShape=[s,i];let a="0.0",o="";"prod"===t?a="1.0":"min"===t?(a="1.0 / 1e-20",o="min"):"max"===t&&(a="-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 c=4*Math.floor(n/4),u=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?(a="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&&(a="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 = ${a};\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(${a});\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 < ${c}; 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 + ${c};\n if (${1===u}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${2===u}) {\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===u}) {\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 FF(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 i=e;for(let a=0;a6)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=dR(this.rank),r=RM("rc",this.rank),i=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],A=s?[b,f,d]:[b,d,f],x=OF({inputs:{x:e},backend:r,attrs:{shape:v}}),C=OF({inputs:{x:t},backend:r,attrs:{shape:A}}),k=[x,C],S=Math.max(y,b),E=n?x.shape[1]:x.shape[2],_=null!=i,T=null!=a,I="leakyrelu"===l,N=null!=l?kF(l,!0):null;let O;if((1===p||1===f)&&E>UF&&!1===(_||T||I||null!=N)){let e=x,t=C;n&&(e=WF({inputs:{x},backend:r,attrs:{perm:[0,2,1]}}),k.push(e)),s&&(t=WF({inputs:{x:C},backend:r,attrs:{perm:[0,2,1]}}),k.push(t));const i=1===f;let a=e;1!==f&&(a=OF({inputs:{x:e},backend:r,attrs:{shape:[S,E,1]}}),k.push(a));const o=1===f?2:1;let l=t;i&&(l=OF({inputs:{x:t},backend:r,attrs:{shape:[S,1,E]}}),k.push(l));const c=IF({inputs:{a,b:l},backend:r});O=PF({inputs:{x:c},backend:r,attrs:{axis:o,keepDims:!0}}),k.push(c)}else{const l=Xa(e.dtype,t.dtype),c=new SF(v,A,[S,p,f],n,s,_,N,T,I),u=[x,C];if(null!=i&&u.push(i),T&&u.push(a),I){const e=r.makeTensorInfo([],"float32",pa(o,"float32"));u.push(e),k.push(e)}O=r.runWebGLProgram(c,u,l)}const D=OF({inputs:{x:O},backend:r,attrs:{shape:w}});k.push(O);for(const e of k)r.disposeIntermediateTensorInfo(e);return D}const jF={kernelName:Pi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i,bias:a,preluActivationWeights:o}=t,{transposeA:l,transposeB:c,activation:u,leakyreluAlpha:h}=s;return qF({a:r,b:i,transposeA:l,transposeB:c,backend:n,bias:a,preluActivationWeights:o,leakyreluAlpha:h,activation:u})}},HF="return abs(x);";const $F={kernelName:On,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=yM(e.values);return n.makeTensorInfo(s.shape,s.dtype,t)}let r;return r=En().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new tF(s.shape,HF):new WM(s.shape,HF),n.runWebGLProgram(r,[s],s.dtype)}},KF=xF({opSnippet:GM+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),XF={kernelName:Dn,backendName:"webgl",kernelFunc:KF},ZF=xF({opSnippet:GM+"\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),YF={kernelName:Rn,backendName:"webgl",kernelFunc:ZF},QF="return a + b;",JF=CF({opSnippet:QF,packedOpSnippet:QF,supportsComplex:!0,cpuKernelImpl:LR}),eB={kernelName:Mn,backendName:"webgl",kernelFunc:JF};class tB{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 nB{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 sB={kernelName:Fn,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s}=t,r=n;if(1===r.length)return hF({inputs:{x:r[0]},backend:s});if(r.length>En().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(r.length/2),n=e({inputs:r.slice(0,t),backend:s}),i=e({inputs:r.slice(t),backend:s});return e({inputs:[n,i],backend:s})}const i=r.map((e=>e.dtype)).reduce(((e,t)=>Xa(e,t))),a=r.map((e=>e.shape)),o=En().getBool("WEBGL_PACK")?new nB(r[0].shape,a):new tB(r[0].shape,a);return s.runWebGLProgram(o,r,i)}};const rB={kernelName:Bn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=tn(i,r.shape);let c=l;const u=Mh(c,o);let h=r;null!=u&&(h=WF({inputs:{x:r},backend:n,attrs:{perm:u}}),c=Bh(c.length,o)),Rh("all",c,o);const[d,p]=Oh(h.shape,c),f=OF({inputs:{x:h},backend:n,attrs:{shape:[-1,Kt(p)]}}),m=FF(f,f.dtype,"all",n);let g;if(a){g=OF({inputs:{x:m},backend:n,attrs:{shape:Dh(d,l)}})}else g=OF({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=u&&n.disposeIntermediateTensorInfo(h),g}};const iB={kernelName:zn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=tn(i,r.shape);let c=l;const u=Mh(c,o);let h=r;null!=u&&(h=WF({inputs:{x:r},backend:n,attrs:{perm:u}}),c=Bh(c.length,o)),Rh("any",c,o);const[d,p]=Oh(h.shape,c),f=OF({inputs:{x:h},backend:n,attrs:{shape:[-1,Kt(p)]}}),m=FF(f,f.dtype,"any",n);let g;if(a){g=OF({inputs:{x:m},backend:n,attrs:{shape:Dh(d,l)}})}else g=OF({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=u&&n.disposeIntermediateTensorInfo(h),g}};class aB{constructor(e,t,n){this.variableNames=["A"];const{windowSize:s,batchSize:r,outSize:i}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,i];const a="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 ${a} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}}class oB{constructor(e,t,n,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,jt(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],i=Math.ceil(r/t);this.outputShape=e.slice(0,-1),i>1&&this.outputShape.push(i),s||this.variableNames.push("bestIndicesA");const a=this.outputShape,o=a.length,l=dR(o),c=MM("coords",o);let u,h;if(1===i){h=o+1;const e=dR(h);u=`\n ${e} sourceLocR = ${e}(${c.join()}, 0);\n ++${c[o-1]};\n ${e} sourceLocG = ${e}(${c.join()}, 0);\n ++${c[o-2]};\n ${e} sourceLocA = ${e}(${c.join()}, 0);\n --${c[o-1]};\n ${e} sourceLocB = ${e}(${c.join()}, 0);\n --${c[o-2]};`}else h=o,u=`\n ${l} sourceLocR = coords;\n ++${c[o-1]};\n ${l} sourceLocG = coords;\n ++${c[o-2]};\n ${l} sourceLocA = coords;\n --${c[o-1]};\n ${l} sourceLocB = coords;\n --${c[o-2]};`;const d=["x","y","z","w","u","v"].slice(0,h),p="."+d[h-1],f=d.map((e=>"int "+e)),m=MM("sourceLocR",h-1).concat("inIdx.r"),g=MM("sourceLocG",h-1).concat("inIdx.g"),y=MM("sourceLocB",h-1).concat("inIdx.b"),b=MM("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()})));`,A=`vec4(\n getAChannel(${m.join()}),\n hasNextCol ? getAChannel(${g.join()}) : 0.,\n hasNextRow ? getAChannel(${y.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${b.join()}) : 0.)`,x=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 ${x}\n void main() {\n ${l} coords = getOutputCoords();\n bool hasNextCol = ${c[o-1]} < ${a[o-1]-1};\n bool hasNextRow = ${c[o-2]} < ${a[o-2]-1};\n ${u}\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 = ${A};\n\n for (int i = 0; i < ${t}; i++) {\n inIdx = srcIdx;\n ${v}\n vec4 candidate = ${A};\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 lB(e,t,n,s=null){let r=t.shape[0],i=t.shape[1];null!=s&&(r=s.shape[0],i=s.shape[1]);const a=Mm(i),o={windowSize:a,inSize:i,batchSize:r,outSize:Math.ceil(i/a)},l=new aB(o,n,null==s),c=[t];null!=s&&c.push(s);const u=e.runWebGLProgram(l,c,"int32");if(1===u.shape[1])return u;const h=lB(e,t,n,u);return e.disposeIntermediateTensorInfo(u),h}function cB(e,t,n,s=null){const r=null!=s?s.shape:t.shape,i=Mm(r[r.length-1]),a=new oB(r,i,n,null==s),o=null==s?[t]:[t,s],l=e.runWebGLProgram(a,o,"int32");if(l.shape.length===t.shape.length){const s=cB(e,t,n,l);return e.disposeIntermediateTensorInfo(l),s}return l}function uB(e,t,n,s){const r=[n];if(Rh("arg"+s.charAt(0).toUpperCase()+s.slice(1),r,t.shape.length),!En().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const n=[],i=e.texData.get(t.dataId);let a=t;null!==i&&i.isPacked&&(a=e.unpackTensor(t),n.push(a));const[o,l]=Oh(a.shape,r),c=Kt(l),u=OF({inputs:{x:a},backend:e,attrs:{shape:[-1,c]}});n.push(u);const h=lB(e,u,s);n.push(h);const d=OF({inputs:{x:h},backend:e,attrs:{shape:o}});return n.forEach((t=>e.disposeIntermediateTensorInfo(t))),d}return cB(e,t,s)}const hB={kernelName:Ln,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;let a=tn(i,r.shape);const o=Mh(a,r.shape.length);let l=r;const c=[];null!=o&&(l=WF({inputs:{x:r},backend:n,attrs:{perm:o}}),c.push(l),a=Bh(a.length,l.shape.length)),Rh("argMax",[a[0]],l.shape.length);const u=uB(n,l,a[0],"max");return c.forEach((e=>n.disposeIntermediateTensorInfo(e))),u}};const dB={kernelName:Pn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;let a=tn(i,r.shape);const o=Mh(a,r.shape.length);let l=r;const c=[];null!=o&&(l=WF({inputs:{x:r},backend:n,attrs:{perm:o}}),c.push(l),a=Bh(a.length,l.shape.length)),Rh("argMin",[a[0]],l.shape.length);const u=uB(n,l,a[0],"min");return c.forEach((e=>n.disposeIntermediateTensorInfo(e))),u}},pB=xF({opSnippet:GM+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),fB={kernelName:Vn,backendName:"webgl",kernelFunc:pB},mB=xF({opSnippet:GM+"return log(x + sqrt(x * x + 1.0));"}),gB={kernelName:Wn,backendName:"webgl",kernelFunc:mB},yB=xF({opSnippet:GM+"\n return atan(x);\n"}),bB={kernelName:Gn,backendName:"webgl",kernelFunc:yB},wB=CF({opSnippet:oF+"\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 "+cF+"\n return result;\n"}),vB={kernelName:qn,backendName:"webgl",kernelFunc:wB},AB=xF({opSnippet:GM+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),xB={kernelName:Un,backendName:"webgl",kernelFunc:AB};class CB{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 i=e.filterWidth,a=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,u=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(${a}, ${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 < ${u};\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 += ${c}) {\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(i/4),v=i%4,A=`\n if (${f}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${a}, ${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 < ${u};\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 * ${c};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${c}, d),\n getValue(batch, xR, xC + 2 * ${c}, d),\n getValue(batch, xR, xC + 3 * ${c}, d)\n );\n\n ${A}\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 ${A}\n } else if (${2===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${c}, d),\n initializationValue,\n initializationValue\n );\n\n ${A}\n } else if (${3===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${c}, d),\n getValue(batch, xR, xC + 2 * ${c}, d),\n initializationValue\n );\n\n ${A}\n }\n }\n setOutput(${b});\n }\n `}}class kB{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 i=e.filterWidth,a=e.strideDepth,o=e.strideHeight,l=e.strideWidth,c=e.dilationDepth,u=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(${a}, ${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 += ${c}) {\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 += ${u}) {\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 A=4*Math.floor(i/4),x=i%4,C=`\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(${a}, ${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 += ${c}) {\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 += ${u}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${A}; 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 ${C}\n }\n\n int xC = xCCorner + ${A};\n if (${1===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${C}\n } else if (${2===x}) {\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 ${C}\n } else if (${3===x}) {\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 ${C}\n }\n }\n }\n setOutput(${v});\n }\n `}}const SB={kernelName:jn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;$D(r,"avgPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;jt(Ou(a,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const c=Au(r.shape,i,a,1,o,l);if(1===c.filterWidth&&1===c.filterHeight&&Xt(c.inShape,c.outShape))return hF({inputs:{x:r},backend:n});const u=new CB(c,"avg",!1);return n.runWebGLProgram(u,[r],"float32")}};const EB={kernelName:$n,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:c}=s,u=xu(r.shape,i,a,[1,1,1],o,l,c),h=new kB(u,"avg",!1);return n.runWebGLProgram(h,[r],"float32")}};class _B{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i=e.dilationHeight,a=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,c=o-1-e.padInfo.top,u=l-1-e.padInfo.left,h=1/(t*n);this.userCode=`\n const ivec2 pads = ivec2(${c}, ${u});\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 += ${i}) {\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+= ${a}) {\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 TB{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,i=e.strideHeight,a=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=e.effectiveFilterDepth,h=e.effectiveFilterHeight,d=e.effectiveFilterWidth,p=u-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 < ${u};\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) / ${i}.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 += ${c}) {\n float dyC = float(dyCCorner + wC) / ${a}.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 IB={kernelName:Kn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i,{filterSize:o,strides:l,pad:c,dimRoundingMode:u}=s,h=xu(a.shape,o,l,[1,1,1],c,u),d=new TB(h);return n.runWebGLProgram(d,[r],a.dtype)}};const NB={kernelName:Hn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i;$D([r,i],"avgPoolGrad");const{filterSize:o,strides:l,pad:c}=s,u=Au(a.shape,o,l,1,c),h=new _B(u);return n.runWebGLProgram(h,[r],a.dtype)}};const OB={kernelName:Xn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i}=t,{transposeA:a,transposeB:o}=s;return qF({a:r,b:i,transposeA:a,transposeB:o,backend:n})}};class DB{constructor(e,t,n,s,r,i){this.outputShape=[],this.variableNames=["x","mean","variance"],cc(e,t),cc(e,n);let a="0.0";null!=s&&(cc(e,s),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let o="1.0";null!=r&&(cc(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 = ${a};\n float scale = ${o};\n float inv = scale * inversesqrt(variance + float(${i}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}}class RB{constructor(e,t,n,s,r,i){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],cc(e,t),cc(e,n);let a="vec4(0.0)";null!=s&&(cc(e,s),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let o="vec4(1.0)";null!=r&&(cc(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n vec4 offset = ${a};\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(${i}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}}const MB={kernelName:Ws,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,mean:r,variance:i,offset:a,scale:o}=e;jt(r.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),jt(null==a||r.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),jt(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 c=[s,r,i];let u=null;null!=a&&(u=a.shape,c.push(a));let h=null;null!=o&&(h=o.shape,c.push(o));const d=En().getBool("WEBGL_PACK_NORMALIZATION")?new RB(s.shape,r.shape,i.shape,u,h,l):new DB(s.shape,r.shape,i.shape,u,h,l);return t.runWebGLProgram(d,c,c[0].dtype)}};class FB{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=dR(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(e){if(1===e)return"sourceLoc";if(e<=6)return BB.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.${BB[t]} = start[${t}] + coords.${BB[t]};`)).join("\n")}\n `,this.userCode=`\n void main() {\n ${s}\n setOutput(getSource(${n}));\n }\n `}}const BB=["x","y","z","w","u","v"];class zB{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=dR(this.rank),n=MM("coords",this.rank),s=MM("sourceLoc",this.rank),r=1===this.rank?"sourceLoc":`vec2(${s.slice(-2).join()})`,i=`getChannel(getSource(${s.join()}), ${r})`,a=`\n result.x = ${i};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.y = ${i};\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 = ${i};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.w = ${i};\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 ${a}\n ${o}\n setOutput(result);\n }\n `}}function LB(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,size:a}=s,[o,l]=iu(r,i,a);if(jc(r,o,l),0===Kt(l))return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||"string"===r.dtype){const e=n.texData.get(r.dataId),t=bM(e.values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,t)}const{isPacked:c}=n.texData.get(r.dataId),u=su(r.shape,o,l);if(c||!u){const e=En().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new zB(l):new FB(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),i=s.makeTensorInfo(n,e.dtype),a=s.texData.get(i.dataId);Object.assign(a,r),a.refCount=1,a.shape=n,a.dtype=e.dtype;let o=ru(t,pn(e.shape));r.slice&&(o+=r.slice.flatOffset),a.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};const l=s.dataRefCount.get(a.slice.origDataId)||1;return s.dataRefCount.set(a.slice.origDataId,l+1),i}(r,o,l,n)}const PB={kernelName:ni,backendName:"webgl",kernelFunc:LB},VB={kernelName:Zn,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,crops:a}=s;jt(r.shape.length<=4,(()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"));const o=i.reduce(((e,t)=>e*t)),l=Bm(r.shape,i,o),c=zm(l.length,i.length),u=Lm(r.shape,i,o),h=Pm(a,i.length),d=Vm(u,a,i.length),p=[],f=OF({inputs:{x:r},backend:n,attrs:{shape:l}}),m=WF({inputs:{x:f},backend:n,attrs:{perm:c}}),g=OF({inputs:{x:m},backend:n,attrs:{shape:u}}),y=LB({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 WB={kernelName:Yn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a}=s,o=n.readSync(r.dataId),l=n.readSync(i.dataId),c=PR(o,l,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,c)}};const GB={kernelName:Qn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{a:s,b:r}=t,i=En().getBool("WEBGL_PACK_BINARY_OPERATIONS"),a=En().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([s,r])||1===a){const e=n.texData.get(s.dataId).values,t=n.texData.get(r.dataId).values,[i,a]=WR(s.shape,r.shape,e,t,s.dtype),o=n.makeTensorInfo(a,s.dtype);return n.texData.get(o.dataId).values=i,o}let o;return o=i?new uF("\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 lF("\n return float(int(a.r) & int(b.r));\n",s.shape,r.shape),n.runWebGLProgram(o,[s,r],s.dtype)}};const UB={kernelName:Jn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,i=n.readSync(s.dataId),a=n.readSync(r.dataId),o=cc(Array.from(i),Array.from(a));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},qB=CF({opSnippet:"return float(a != b);",cpuKernelImpl:lM,dtype:"bool"}),jB={kernelName:kr,backendName:"webgl",kernelFunc:qB};function HB(e){const{inputs:t,backend:n}=e,{input:s}=t;return hF({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.real},backend:n})}const $B={kernelName:Pr,backendName:"webgl",kernelFunc:HB},KB="return float(int(x));";const XB={kernelName:es,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s,attrs:r}=t,{x:i}=n,{dtype:a}=r;if("complex64"===a){if("complex64"===i.dtype)return hF({inputs:{x:i},backend:s});const t=Sd(i.shape),n=e({inputs:{x:i},backend:s,attrs:{dtype:"float32"}}),r=pF({inputs:{real:n,imag:t},backend:s});return t.dispose(),s.disposeIntermediateTensorInfo(n),r}if("complex64"===i.dtype){const t=HB({inputs:{input:i},backend:s}),n=e({inputs:{x:t},backend:s,attrs:{dtype:a}});return s.disposeIntermediateTensorInfo(t),n}if(!an(i.dtype,a)){const e=hF({inputs:{x:i},backend:s});return{dataId:e.dataId,shape:e.shape,dtype:a}}if(s.shouldExecuteOnCPU([i])){const e=s.texData.get(i.dataId).values,[t,n,r]=GR(e,i.shape,i.dtype,a);return s.makeTensorInfo(t,n,r)}if("int32"===a)return function(e,t){const n=new WM(e.shape,KB),s=t.runWebGLProgram(n,[e],"int32");return{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}(i,s);if("bool"===a){const e=s.makeTensorInfo([],"bool",sn("bool",1)),t=qB({inputs:{a:i,b:e},backend:s});return s.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${i.dtype} to ${a}`)}},ZB="return ceil(x);",YB=xF({opSnippet:ZB,packedOpSnippet:ZB,cpuKernelImpl:UR}),QB={kernelName:ts,backendName:"webgl",kernelFunc:YB};class JB{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 ez{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 tz={kernelName:ns,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{clipValueMin:i,clipValueMax:a}=s;let o;o=En().getBool("WEBGL_PACK_CLIP")?new ez(r.shape):new JB(r.shape);const l=[[i],[a]];return n.runWebGLProgram(o,[r],r.dtype,l)}};class nz{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 sz(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const rz={kernelName:rs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=n.texData.get(s.dataId),i=new nz(s.shape),a=[sz(s,r.complexTensorInfos.real),sz(s,r.complexTensorInfos.imag)];return n.runWebGLProgram(i,a,a[0].dtype)}};class iz{constructor(e){this.outputShape=[],this.outputShape=Em(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}(${oz(a,l,t)}),\n vec2(${oz(c,l,t)}));\n }`}const d=o.length,p=o[o.length-1];h+=`\n return getChannel(\n getT${d}(${oz(a,l,p)}),\n vec2(${oz(c,l,p)}));`,this.userCode=`\n float getValue(${a.map((e=>"int "+e))}) {\n ${h}\n }\n\n void main() {\n ${r} coords = getOutputCoords();\n vec4 result = vec4(getValue(${i}), 0., 0., 0.);\n\n ${i[s-1]} = ${i[s-1]} + 1;\n if (${i[s-1]} < ${n[s-1]}) {\n result.g = getValue(${i});\n }\n\n ${i[s-2]} = ${i[s-2]} + 1;\n if (${i[s-2]} < ${n[s-2]}) {\n result.a = getValue(${i});\n }\n\n ${i[s-1]} = ${i[s-1]} - 1;\n if (${i[s-2]} < ${n[s-2]} &&\n ${i[s-1]} < ${n[s-1]}) {\n result.b = getValue(${i});\n }\n setOutput(result);\n }\n `}}function oz(e,t,n){const s=e.indexOf(t);return e.map(((e,t)=>t===s?`${e} - ${n}`:e)).join()}function lz(e){const{inputs:t,backend:n}=e,{input:s}=t;return hF({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.imag},backend:n})}const cz={kernelName:Ks,backendName:"webgl",kernelFunc:lz};function uz(e,t,n){const s=e[0].dtype;if("complex64"===s){const s=e.map((e=>HB({inputs:{input:e},backend:n}))),r=e.map((e=>lz({inputs:{input:e},backend:n}))),i=uz(s,t,n),a=uz(r,t,n),o=pF({inputs:{real:i,imag:a},backend:n});return s.forEach((e=>n.disposeIntermediateTensorInfo(e))),r.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(a),o}let r=n.shouldExecuteOnCPU(e);if("string"===s&&(r=!0),r){const r=e.map((e=>{const s=Kt(e.shape.slice(t));return OF({inputs:{x:e},backend:n,attrs:{shape:[-1,s]}})})),i=r.map((e=>({vals:n.readSync(e.dataId),shape:e.shape}))),a=Em(r.map((e=>e.shape)),1),o=1===r[0].shape[0],l=qR(i,a,s,o),c=Em(e.map((e=>e.shape)),t),u=n.makeTensorInfo(c,s,l);return r.forEach((e=>n.disposeIntermediateTensorInfo(e))),u}const i=e.filter((e=>Kt(e.shape)>0)),a=En().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&i[0].shape.length>1;if(1===i.length){const t=a?new WM(e[0].shape,KM):new tF(e[0].shape,KM);return n.runWebGLProgram(t,e,s)}const o=En().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(i.length>o){const e=[];for(let s=0;se.shape)),t);return n.runWebGLProgram(e,i,s)}const{tensors2D:l,outShape:c}=function(e,t,n){const s=Em(e.map((e=>e.shape)),t),r=e.map((e=>OF({inputs:{x:e},attrs:{shape:[-1,Kt(e.shape.slice(t))]},backend:n})));return{tensors2D:r,outShape:s}}(i,t,n),u=new iz(l.map((e=>e.shape))),h=n.runWebGLProgram(u,l,s);l.forEach((e=>n.disposeIntermediateTensorInfo(e)));const d=OF({inputs:{x:h},attrs:{shape:c},backend:n});return n.disposeIntermediateTensorInfo(h),d}function hz(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s,i=tn(r,t[0].shape)[0];Sm(t.map((e=>e.shape)),i);const a=Em(t.map((e=>e.shape)),i);if(0===Kt(a))return n.makeTensorInfo(a,t[0].dtype,[]);const o=t.filter((e=>Kt(e.shape)>0));return 1===o.length?hF({inputs:{x:o[0]},backend:n}):uz(o,i,n)}const dz={kernelName:is,backendName:"webgl",kernelFunc:hz};class pz{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const i=e.padInfo.top,a=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,c=e.dilationHeight,u=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 A=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(${i}, ${a});\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 * ${c};\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 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 ${A}\n ${v}\n setOutput(result);\n }\n `}}class fz{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,i=e.strideHeight,a=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=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}, ${i}, ${a});\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 < ${u}; 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 * ${c};\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 mz{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=wR(this.outputShape.length);const i=e.padInfo.left,a=e.strideWidth,o=e.dilationWidth,l=e.filterHeight,c=e.filterWidth,u=c;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<(u+1)/2;t++){const n=2*t;if(h+=`\n xC = xCCorner + ${n*o};\n `,1===a){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[${a}] && 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 yz(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 bz({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:i=null,leakyreluAlpha:a=0,activation:o=null}){const l=e.shape,c=s.texData.get(e.dataId),u=n.inChannels,h=l[0]*l[1]*l[2],d=n.outChannels,p="channelsLast"===n.dataFormat,f=!1;let m;const g=[];if(null!=i){const e=yz(i.shape,p);null!=e&&(i=OF({inputs:{x:i},backend:s,attrs:{shape:e}}),g.push(i))}if(null!=r){const e=yz(r.shape,p);null!=e&&(r=OF({inputs:{x:r},backend:s,attrs:{shape:e}}),g.push(r))}if(!((1===h||1===d)&&u>UF)&&c.isPacked&&p&&null!=c.texture&&l[2]%2!=0&&Xt(c.shape.slice(-3),l.slice(-3))){const u=l[0]*l[1]*(l[2]+1),h={dataId:e.dataId,shape:[1,u,n.inChannels],dtype:e.dtype},d=c.shape;c.shape=c.shape.slice(),c.shape[c.shape.length-2]++,jt(VD(c.shape,h.shape),(()=>`packed reshape ${c.shape} to ${h.shape} isn't free`));const p=OF({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}});g.push(p);const y=qF({a:h,b:p,backend:s,transposeA:false,transposeB:f,bias:r,activation:o,preluActivationWeights:i,leakyreluAlpha:a}),b=s.texData.get(y.dataId);jt(b.isPacked,(()=>"batchMatMul result is expected to be packed")),c.shape=d,b.shape=n.outShape,m=hF({inputs:{x:y},backend:s}),m.shape=n.outShape,g.push(y)}else{const l=n.outHeight*n.outWidth,c=OF({inputs:{x:e},backend:s,attrs:{shape:p?[n.batchSize,l,n.inChannels]:[n.batchSize,n.inChannels,l]}}),u=OF({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}}),h=qF({a:p?c:u,b:p?u:c,transposeA:!p,transposeB:f,backend:s,bias:r,activation:o,preluActivationWeights:i,leakyreluAlpha:a});m=OF({inputs:{x:h},backend:s,attrs:{shape:n.outShape}}),g.push(c),g.push(u),g.push(h)}for(const e of g)s.disposeIntermediateTensorInfo(e);return m}function wz({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:i=null,leakyreluAlpha:a=0,activation:o=null}){const{filterWidth:l,filterHeight:c,inChannels:u,outWidth:h,outHeight:d,dataFormat:p}=n,f="channelsLast"===p,m=l*c*u,g=d*h,y=[n.batchSize,m,g],b=[];if(null!=i){const e=yz(i.shape,f);null!=e&&(i=OF({inputs:{x:i},backend:s,attrs:{shape:e}}),b.push(i))}if(null!=r){const e=yz(r.shape,f);null!=e&&(r=OF({inputs:{x:r},backend:s,attrs:{shape:e}}),b.push(r))}const w=OF({inputs:{x:t},backend:s,attrs:{shape:[1,m,Kt(t.shape)/m]}});b.push(w);const v=new gz(y,n),A=[e.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],x=s.runWebGLProgram(v,[e],"float32",A),C=OF({inputs:{x},backend:s,attrs:{shape:y}});b.push(x),b.push(C);const k=null!=r,S=null!=i,E="leakyrelu"===o,_=o?kF(o,!0):null,T=new SF(f?C.shape:w.shape,f?w.shape:C.shape,f?[n.batchSize,g,n.outChannels]:[n.batchSize,n.outChannels,g],!0,!1,k,_,S,E),I=f?[C,w]:[w,C];if(r&&I.push(r),S&&I.push(i),E){const e=s.makeTensorInfo([],"float32",pa(a,"float32"));I.push(e),b.push(e)}const N=s.runWebGLProgram(T,I,"float32"),O=OF({inputs:{x:N},backend:s,attrs:{shape:n.outShape}});b.push(N);for(const e of b)s.disposeIntermediateTensorInfo(e);return O}const vz={kernelName:as,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dataFormat:l,dilations:c,dimRoundingMode:u}=s,h=Ru(l),d=Cu(r.shape,i.shape,a,c,o,u,!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&&En().getBool("WEBGL_EXP_CONV")){const e=new mz(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,i],"float32",t)}else if(En().getBool("WEBGL_CONV_IM2COL"))p=wz({x:r,filter:i,convInfo:d,backend:n});else{const e=new pz(d);p=n.runWebGLProgram(e,[r,i],"float32")}else p=bz({x:r,filter:i,convInfo:d,backend:n});const f=OF({inputs:{x:p},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(p),f}};class Az{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,i="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 ${i?"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 xz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i="channelsLast"===e.dataFormat,a=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=i?1:2,c=i?2:3,u=i?3:1;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${u}];\n\n ivec2 dyCorner = ivec2(coords[${l}], coords[${c}]) - 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 (${i}) {\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 Cz{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.padInfo.front,i=e.padInfo.top,a=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} - ${i};\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} - ${a};\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 kz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,i=e.strideHeight,a=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,c=s-1-e.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${o}, ${l}, ${c});\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) / ${i}.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) / ${a}.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 Sz={kernelName:os,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,pad:o,dataFormat:l,dimRoundingMode:c,filterShape:u}=s,h=Ru(l),d=Cu(r.shape,u,a,1,o,c,!1,h),p=new Az(d);return n.runWebGLProgram(p,[r,i],"float32")}};class Ez{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=wR(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 _z={kernelName:ls,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{inputShape:a,strides:o,pad:l,dataFormat:c,dimRoundingMode:u}=s,h=Ru(c),d=Cu(a,i.shape,o,1,l,u,!1,h);if(En().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&"channelsLast"===h){const e=[[d.strideHeight,d.strideWidth]],t=new Ez(d);return n.runWebGLProgram(t,[r,i],"float32",e)}{const e=new xz(d);return n.runWebGLProgram(e,[r,i],"float32")}}};const Tz={kernelName:cs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dilations:l}=s,c=ku(r.shape,i.shape,a,l,o),u=new fz(c);return n.runWebGLProgram(u,[r,i],"float32")}};const Iz={kernelName:us,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,pad:o,filterShape:l}=s,c=ku(r.shape,l,a,1,o),u=new Cz(c);return n.runWebGLProgram(u,[r,i],"float32")}};const Nz={kernelName:hs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{pad:a,strides:o,inputShape:l}=s,c=ku(l,i.shape,o,1,a),u=new kz(c);return n.runWebGLProgram(u,[r,i],"float32")}},Oz=xF({opSnippet:AF+"\n return cos(x);\n",packedOpSnippet:`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${cF}\n return result;\n`}),Dz={kernelName:ds,backendName:"webgl",kernelFunc:Oz},Rz=xF({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),Mz={kernelName:ps,backendName:"webgl",kernelFunc:Rz};class Fz{constructor(e,t,n,s,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[i,a,o,l]=e,[c]=t,[u,h]=n;this.outputShape=[c,u,h,l];const d="bilinear"===s?1:0,[p,f]=[a-1+".0",o-1+".0"],[m,g,y]=u>1?[""+(a-1)/(u-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 >= ${i}) {\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 Bz={kernelName:gs,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:i,boxInd:a}=t,{cropSize:o,method:l,extrapolationValue:c}=s,u=new Fz(r.shape,i.shape,o,l,c);return n.runWebGLProgram(u,[r,i,a],"float32")}};var zz,Lz;(Lz=zz||(zz={})).Prod="*",Lz.Sum="+";class Pz{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,i=this.op===zz.Prod?"1.0":"0.0",a=n?i:`getX(${Vz(r,"coords",this.op)})`,o=this.outputShape[this.outputShape.length-1];let l="",c="";n?(l=s?"end != "+(o-1):"end != 0",c=s?"end + 1":"end - 1"):(l=s?`end + pow2 < ${o}`:"end >= pow2",c=s?"end + pow2":"end - pow2"),this.userCode=`\n void main() {\n ${dR(r)} coords = getOutputCoords();\n int end = ${Wz(r,"coords",this.op)};\n float val = ${a};\n int pow2 = int(pow(2.0, index));\n if (${l}) {\n int idx = ${c};\n ${Wz(r,"coords",this.op)} = idx;\n val ${this.op}= getX(${Vz(r,"coords",this.op)});\n }\n setOutput(val);\n }\n `}}function Vz(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 Wz(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 Gz(e,t,n,s,r,i){const a=t.shape.length,o=Mh([s],a);let l=t;null!=o&&(l=WF({inputs:{x:t},backend:n,attrs:{perm:o}}));const c=Bh(1,a)[0];if(c!==a-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${s}`);const u=l.shape[c];let h=hF({inputs:{x:l},backend:n});for(let t=0;t<=Math.ceil(Math.log2(u))-1;t++){const s=new Pz(e,l.shape,!1,i),r=[[t]],a=h;h=n.runWebGLProgram(s,[h],h.dtype,r),n.disposeIntermediateTensorInfo(a)}if(r){const t=new Pz(e,l.shape,r,i),s=h;h=n.runWebGLProgram(t,[h],h.dtype),n.disposeIntermediateTensorInfo(s)}if(null!=o){const e=WF({inputs:{x:h},backend:n,attrs:{perm:Fh(o)}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(l),e}return h}const Uz={kernelName:fs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,exclusive:a,reverse:o}=s;return Gz(zz.Prod,r,n,i,a,o)}};const qz={kernelName:ms,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,exclusive:a,reverse:o}=s;return Gz(zz.Sum,r,n,i,a,o)}};const jz={kernelName:ys,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a,binaryOutput:o}=s;if(1===r.shape.length){const e=n.readSync(r.dataId),t=n.readSync(i.dataId),s=PR(e,t,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,s)}if(2===r.shape.length){const e=n.bufferSync(r),t=n.bufferSync(i),s=VR(e,t,a,o);return n.makeTensorInfo(s.shape,i.dtype,s.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}};class Hz{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 $z={kernelName:bs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockSize:i,dataFormat:a}=s,o=r.shape[0],l=("NHWC"===a?r.shape[1]:r.shape[2])*i,c=("NHWC"===a?r.shape[2]:r.shape[3])*i,u=("NHWC"===a?r.shape[3]:r.shape[1])/(i*i),h=new Hz("NHWC"===a?[o,l,c,u]:[o,u,l,c],i,a);return n.runWebGLProgram(h,[r],r.dtype)}};class Kz{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=wR(this.outputShape.length);const i=e.filterHeight,a=e.filterWidth,o=e.outChannels/e.inChannels;let l="",c="";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 `,c="result = activation(result);");const u=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 < ${i}; 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 < ${a}; 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 ${u}\n ${c}\n setOutput(result);\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=wR(this.outputShape.length);const i=e.outChannels/e.inChannels,a=e.padInfo.left,o=e.strideWidth,l=e.dilationWidth,c=e.filterHeight,u=e.filterWidth,h=u;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 ${a} and dilations '${u}'`));const h=Cu(r.shape,i.shape,a,u,o,c,!0);let d;d=En().getBool("WEBGL_PACK_DEPTHWISECONV")&&h.strideWidth<=2&&h.outChannels/h.inChannels==1?new Xz(h):new Kz(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,i],"float32",p)}};class Yz{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,i=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 * ${i} + 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 Qz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i=t-1-e.padInfo.top,a=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${a});\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 Jz={kernelName:vs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,dilations:o,pad:l,dimRoundingMode:c,filterShape:u}=s,h=Cu(r.shape,u,a,o,l,c,!0),d=new Yz(h);return n.runWebGLProgram(d,[r,i],"float32")}};const eL={kernelName:As,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{strides:a,dilations:o,pad:l,dimRoundingMode:c,inputShape:u}=s,h=Cu(u,i.shape,a,o,l,c,!0),d=new Qz(h);return n.runWebGLProgram(d,[r,i],"float32")}};class tL{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 nL={kernelName:xs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=[...s.shape,...s.shape],i=Kt(s.shape),a=OF({inputs:{x:s},backend:n,attrs:{shape:[i]}}),o=new tL(i),l=n.runWebGLProgram(o,[a],a.dtype),c=OF({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(l),c}};class sL{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:n,padInfo:s,strideHeight:r,strideWidth:i,filterHeight:a,filterWidth:o,dilationHeight:l,dilationWidth:c}=e,{top:u,left:h}=s;this.userCode=`\n const ivec2 strides = ivec2(${r}, ${i});\n const ivec2 pads = ivec2(${u}, ${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 < ${a}; 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 * ${c};\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 rL={kernelName:Cs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dilations:l}=s,c=vu(r.shape,i.shape,a,o,"NHWC",l);let u;const h=new sL(c);u=n.runWebGLProgram(h,[r,i],"float32");const d=OF({inputs:{x:u},backend:n,attrs:{shape:c.outShape}});return n.disposeIntermediateTensorInfo(u),d}};const iL={kernelName:Ts,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{equation:r}=s,i=t,{allDims:a,summedDims:o,idDims:l}=lg(r,i.length);ug(a.length,l,i);const{path:c,steps:u}=hg(o,l),h=u.length;let d=null,p=a.length;const f=[];for(let e=0;e=0&&(d=PF({inputs:{x:d},backend:n,attrs:{axis:c[e]-(a.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}},aL=xF({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"}),oL={kernelName:Is,backendName:"webgl",kernelFunc:aL},lL={kernelName:Ns,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n}=e,{dy:s,y:r}=t,i=En().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new uF("\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 lF("return (b >= 0.0) ? a : a * (b + 1.0);",s.shape,r.shape);return n.runWebGLProgram(i,[s,r],s.dtype)}},cL=CF({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:jR}),uL={kernelName:Ds,backendName:"webgl",kernelFunc:cL},hL=xF({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`}),dL={kernelName:Os,backendName:"webgl",kernelFunc:hL},pL=xF({opSnippet:AF+"\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:HR,dtype:"float32"}),fL={kernelName:Rs,backendName:"webgl",kernelFunc:pL};function mL(e){const{inputs:t,attrs:n,backend:s}=e,{dim:r}=n,{input:i}=t,a=i.shape.length,o=i.shape.slice();let l=r;return r<0&&(jt(-(a+1)<=r,(()=>`Axis must be in the interval [${-(a+1)}, ${a}]`)),l=a+r+1),o.splice(l,0,1),OF({inputs:{x:i},backend:s,attrs:{shape:o}})}const gL={kernelName:Ms,backendName:"webgl",kernelFunc:mL},yL="return exp(x) - 1.0;",bL=xF({opSnippet:yL,packedOpSnippet:yL,cpuKernelImpl:$R}),wL={kernelName:Fs,backendName:"webgl",kernelFunc:bL};class vL{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}`,i=n?`${s}.0`:"1.0";let a;if("real"===e)a="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);a="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 ${a}\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) / ${i};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}}function AL(e,t,n){const s=n.texData.get(e.dataId),r=Kt(e.shape),i=e.shape[e.shape.length-1],a=OF({inputs:{x:e},backend:n,attrs:{shape:[r/i,i]}}),o=a.shape,l=new vL("real",o,t),c=new vL("imag",o,t),u=[{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,u,"float32"),d=n.runWebGLProgram(c,u,"float32"),p=pF({inputs:{real:h,imag:d},backend:n});n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d);const f=OF({inputs:{x:p},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(p),f}const xL={kernelName:Bs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return AL(s,!1,n)}};class CL{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 kL(e){const{backend:t,attrs:n}=e,{shape:s,value:r}=n;let{dtype:i}=n;if(i=i||un(r),"string"===i){const e=rn(i,Kt(s));return e.fill(r),t.makeTensorInfo(s,i,e)}{const e=new CL(s,r),n=[[r]];return t.runWebGLProgram(e,[],i,n)}}const SL={kernelName:zs,backendName:"webgl",kernelFunc:kL};class EL{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 _L={kernelName:Ls,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:n}=e,s=t,r=new EL(n.shape);return s.runWebGLProgram(r,[n],n.dtype)}},TL="return floor(x);",IL=xF({opSnippet:TL,packedOpSnippet:TL,cpuKernelImpl:KR}),NL={kernelName:Ps,backendName:"webgl",kernelFunc:IL},OL=CF({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"}),DL={kernelName:Vs,backendName:"webgl",kernelFunc:OL};class RL{constructor(e){this.variableNames=["A"];const t=XD(),[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 ML{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=XD(),[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 FL={kernelName:zi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e;let{pixels:r}=t;const{numChannels:i}=s,a="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement,o="undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement,[l,c]=a?[r.videoWidth,r.videoHeight]:[r.width,r.height],u=[c,l],h=[c,l,i];if(o||a){const e=En().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");null!=BL&&e===zL||(zL=e,BL=document.createElement("canvas").getContext("2d",{willReadFrequently:zL})),BL.canvas.width=l,BL.canvas.height=c,BL.drawImage(r,0,0,l,c),r=BL.canvas}const d=n.makeTensorInfo(u,"int32");n.texData.get(d.dataId).usage=mD.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(d.dataId),r);const p=En().getBool("WEBGL_PACK")?new ML(h):new RL(h),f=n.runWebGLProgram(p,[d],"int32");return n.disposeData(d.dataId),f}};let BL,zL=En().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");const LL={kernelName:Vi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s,m=Ru(u),g=Cu(r.shape,i.shape,l,h,c,d,!1,m);let y;const b=[],w=null!=a,v=null!=o,A="leakyrelu"===p,x=()=>{const e=[r,i],t=(e,t)=>{if("NCHW"===t&&1===e.shape.length&&1!==e.shape[0]){const t=OF({inputs:{x:e},backend:n,attrs:{shape:[e.shape[0],1,1]}});return b.push(t),t}return e};if(w&&e.push(t(a,u)),v&&e.push(t(o,u)),A){const t=n.makeTensorInfo([],"float32",pa(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&&En().getBool("WEBGL_EXP_CONV")){const e=p?kF(p,!0):null,t=new mz(g,w,e,v,A),s=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],r=x();y=n.runWebGLProgram(t,r,"float32",s)}else if(En().getBool("WEBGL_CONV_IM2COL"))y=wz({x:r,filter:i,convInfo:g,backend:n,bias:a,activation:p,preluActivationWeights:o,leakyreluAlpha:f});else{const e=p?kF(p,!1):null,t=new pz(g,w,e,v,A),s=x();y=n.runWebGLProgram(t,s,"float32")}else y=bz({x:r,filter:i,convInfo:g,backend:n,bias:a,activation:p,preluActivationWeights:o,leakyreluAlpha:f});const C=OF({inputs:{x:y},backend:n,attrs:{shape:g.outShape}});return b.push(y),b.forEach((e=>n.disposeIntermediateTensorInfo(e))),C}};const PL={kernelName:Wi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:c,dilations:u,dimRoundingMode:h,activation:d,leakyreluAlpha:p}=s,f=[];let m=u;null==m&&(m=[1,1]),jt(Ou(l,m),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`));const g=Cu(r.shape,i.shape,l,m,c,h,!0),y=En().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels==1,b=d?kF(d,y):null,w=[r,i],v=null!=a,A=null!=o,x="leakyrelu"===d;if(v&&w.push(a),A&&w.push(o),x){const e=n.makeTensorInfo([],"float32",pa(p,"float32"));w.push(e),f.push(e)}let C;C=y?new Xz(g,v,b,A,x):new Kz(g,v,b,A,x);const k=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],S=n.runWebGLProgram(C,w,"float32",k);return f.forEach((e=>n.disposeIntermediateTensorInfo(e))),S}};class VL{constructor(e,t,n,s){this.sliceDim=e,this.strides=t,this.paramsShape=s,this.variableNames=["x","indices"],this.outputShape=n;const r=dR(n.length);let i="\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 ${i}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}}const WL={kernelName:Us,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{params:s,indices:r}=t,i=r.shape,a=i[i.length-1],o=Kt(s.shape),[l,c,u,h]=Wm(s,r),d=OF({inputs:{x:r},backend:n,attrs:{shape:[c,a]}}),p=OF({inputs:{x:s},backend:n,attrs:{shape:[Kt(s.shape)/u,u]}});if(n.shouldExecuteOnCPU([s,r])||"string"===s.dtype){const e=n.readSync(r.dataId),t=n.bufferSync(s),i=XR(e,t,s.dtype,c,a,u,h,s.shape,o);return n.makeTensorInfo(l,s.dtype,i.values)}const f=new VL(a,h,[c,u],s.shape),m=n.runWebGLProgram(f,[p,d],p.dtype),g=OF({inputs:{x:m},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),g}};class GL{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const n=dR(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 UL(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,indices:i}=t,{axis:a,batchDims:o}=s,l=tn(a,r.shape)[0];if(En().get("DEBUG")){const e=n.readSync(i.dataId),t=r.shape[l];for(let n=0;n=0,(()=>`GatherV2: the index value ${s} is not in [0, ${t-1}]`))}}const c=Ig(r,i,l,o),u=Kt(i.shape),h=[],d=OF({inputs:{x:r},backend:n,attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]}}),p=OF({inputs:{x:i},backend:n,attrs:{shape:[c.batchSize,u/c.batchSize]}});h.push(d),h.push(p);const f=[c.batchSize,c.outerSize,u/c.batchSize,c.sliceSize];if(n.shouldExecuteOnCPU([r,i])||"string"===r.dtype){const e=n.bufferSync(p),t=n.bufferSync(d),s=ZR(t,e,f);return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(c.outputShape,s.dtype,s.values)}const m=new GL(d.shape,f),g=n.runWebGLProgram(m,[d,p],d.dtype);h.push(g);const y=OF({inputs:{x:g},backend:n,attrs:{shape:c.outputShape}});return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),y}const qL={kernelName:Gs,backendName:"webgl",kernelFunc:UL},jL=CF({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:YR,dtype:"bool"}),HL={kernelName:qs,backendName:"webgl",kernelFunc:jL},$L=CF({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:QR}),KL={kernelName:js,backendName:"webgl",kernelFunc:$L};const XL={kernelName:$s,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return AL(s,!0,n)}},ZL=xF({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),YL={kernelName:Xs,backendName:"webgl",kernelFunc:ZL},QL=xF({opSnippet:"return float(isinf(x));",dtype:"bool"}),JL={kernelName:Zs,backendName:"webgl",kernelFunc:QL},eP=xF({opSnippet:"return float(isnan(x));",dtype:"bool"}),tP={kernelName:Ys,backendName:"webgl",kernelFunc:eP},nP=CF({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:JR,dtype:"bool"}),sP={kernelName:Js,backendName:"webgl",kernelFunc:nP},rP=CF({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:eM,dtype:"bool"}),iP={kernelName:er,backendName:"webgl",kernelFunc:rP};const aP={kernelName:tr,backendName:"webgl",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:s,stop:r,num:i}=n,a=tM(s,r,i);return t.makeTensorInfo([a.length],"float32",a)}},oP=xF({opSnippet:AF+"\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:nM}),lP={kernelName:nr,backendName:"webgl",kernelFunc:oP},cP=xF({opSnippet:AF+"\n return log(1.0 + x);\n"}),uP={kernelName:sr,backendName:"webgl",kernelFunc:cP},hP=CF({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"}),dP={kernelName:rr,backendName:"webgl",kernelFunc:hP},pP=xF({opSnippet:"return float(!(x >= 1.0));"}),fP={kernelName:ir,backendName:"webgl",kernelFunc:pP},mP=CF({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"}),gP={kernelName:ar,backendName:"webgl",kernelFunc:mP};class yP{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[];const i=t,a=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 = -${i}; j <= ${i}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${a}) {\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 bP{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const i=t,a=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 - ${i};\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 = - ${i}; j <= ${i}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${a}));\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 wP={kernelName:or,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:i,bias:a,alpha:o,beta:l}=s,c=En().getBool("WEBGL_PACK_NORMALIZATION")?new bP(r.shape,i,a,o,l):new yP(r.shape,i,a,o,l);return n.runWebGLProgram(c,[r],r.dtype)}};class vP{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 AP={kernelName:lr,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r,y:i,dy:a}=t,{depthRadius:o,bias:l,alpha:c,beta:u}=s,h=new vP(r.shape,o,l,c,u);return n.runWebGLProgram(h,[r,i,a],r.dtype)}};function xP(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:i,keepDims:a}=s,o=r.shape.length,l=tn(i,r.shape);let c=l;const u=Mh(c,o),h=null!=u,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 ${a} and dilations '1'`));const c=Au(r.shape,i,a,1,o,l);if(1===c.filterWidth&&1===c.filterHeight&&Xt(c.inShape,c.outShape))return hF({inputs:{x:r},backend:n});const u=new CB(c,"max",!1);return n.runWebGLProgram(u,[r],r.dtype)}};const _P={kernelName:pr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dataFormat:l,dimRoundingMode:c}=s,u=xu(r.shape,i,a,[1,1,1],o,c,l),h=new kB(u,"max",!1);return n.runWebGLProgram(h,[r],r.dtype)}};class TP{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,n=e.strideWidth,s=e.dilationHeight,r=e.effectiveFilterHeight,i=e.effectiveFilterWidth,a=r-1-e.padInfo.top,o=i-1-e.padInfo.left,l=r*i-1;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${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 < ${i}; 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 * ${i} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}}class IP{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.dilationDepth,i=e.dilationHeight,a=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,c=e.effectiveFilterWidth,u=o-1-e.padInfo.front,h=l-1-e.padInfo.top,d=c-1-e.padInfo.left,p=o*l*c-1;this.userCode=`\n const ivec3 pads = ivec3(${u}, ${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 += ${i}) {\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 < ${c};\n wC += ${a}) {\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} * ${c} +\n wR * ${c} + 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 NP={kernelName:fr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i,{filterSize:o,strides:l,pad:c,dimRoundingMode:u}=s,h=xu(a.shape,o,l,[1,1,1],c,u),d=new kB(h,"max",!0),p=n.runWebGLProgram(d,[a],a.dtype),f=new IP(h),m=n.runWebGLProgram(f,[r,p],a.dtype);return n.disposeIntermediateTensorInfo(p),m}};const OP={kernelName:dr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i,output:a}=t,o=i;$D([i,a],"maxPoolGrad");const{filterSize:l,strides:c,pad:u,dimRoundingMode:h}=s,d=Au(o.shape,l,c,1,u,h),p=new CB(d,"max",!0),f=n.runWebGLProgram(p,[o],o.dtype),m=new TP(d),g=n.runWebGLProgram(m,[r,f],o.dtype);return n.disposeIntermediateTensorInfo(f),g}};const DP={kernelName:mr,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:i,pad:a,includeBatchInIndex:o}=t,l=n;jt(4===s.shape.length,(()=>`Error in maxPool: input must be rank 4 but got rank ${s.shape.length}.`));const c=[1,1];jt(Ou(i,c),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`));const u=Au(s.shape,r,i,c,a),[h,d]=function(e,t,n,s){let r=new CB(n,"max",!1);const i=s.runWebGLProgram(r,[e],"float32");return r=new CB(n,"max",!0,!0,t),[i,s.runWebGLProgram(r,[e],"float32")]}(s,o,u,l);return[h,d]}};const RP={kernelName:gr,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{keepDims:r,axis:i}=t,a=n,o=s.shape.length,l=tn(i,s.shape);let c=l;const u=Mh(c,o),h=null!=u,d=a.shouldExecuteOnCPU([s]),p=[];let f=s;if(h){if(d){const e=a.texData.get(f.dataId).values,t=new Array(o);for(let e=0;et[0]+e[n]+t[1]));const s=e.length,r=dR(s),i=t.map((e=>e[0])).join(","),a=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}(${i});\n ${r} end = ${r}(${a});\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 = ${i};\n int end = ${a};\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 LP{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=dR(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=MM("rc",s),l=MM("source",s),c=`${o[s-1]} < ${this.outputShape[s-1]}`,u=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()}), ${u});\n ${o[s-1]} += 1;\n if(${c}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${u});\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()}), ${u});\n ${o[s-1]} += 1;\n if(${c}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${u});\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()}), ${u});\n ${o[s-1]} += 1;\n if(${c}) {\n ${e}\n result[3] = getChannel(getX(${l.join()}), ${u});\n }\n }\n `}this.userCode=`\n const ${r} start = ${r}(${i});\n const ${r} end = ${r}(${a});\n\n void main() {\n ${r} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${d}\n setOutput(result);\n }\n `}}const PP={kernelName:wr,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s}=e,{paddings:r,mode:i}=n,a=En().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new LP(s.shape,r,i):new zP(s.shape,r,i);return t.runWebGLProgram(a,[s],s.dtype)}},VP=CF({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 "+cF+"\n return result;\n"}),WP={kernelName:vr,backendName:"webgl",kernelFunc:VP};class GP{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 UP=CF({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}),qP={kernelName:_s,backendName:"webgl",kernelFunc:UP},jP="return a - b;",HP=CF({opSnippet:jP,packedOpSnippet:jP,supportsComplex:!0,cpuKernelImpl:TM}),$P={kernelName:Si,backendName:"webgl",kernelFunc:HP};function KP(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:i}=s,a=tn([i],r.shape),o=xP({inputs:{x:r},backend:n,attrs:{reductionIndices:a,keepDims:!1}}),l=Dh(o.shape,a),c=OF({inputs:{x:o},backend:n,attrs:{shape:l}}),u=HP({inputs:{a:r,b:c},backend:n}),h=pL({inputs:{x:u},backend:n}),d=PF({inputs:{x:h},backend:n,attrs:{axis:a,keepDims:!1}}),p=OF({inputs:{x:d},backend:n,attrs:{shape:l}}),f=UP({inputs:{a:h,b:p},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),f}const XP={kernelName:di,backendName:"webgl",kernelFunc:KP};const ZP={kernelName:Ar,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:i,seed:a,normalized:o}=s,l=o?r:KP({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),c=l.shape[0],u=l.shape[1],h=new GP(c,u,i),d=[[a]],p=n.runWebGLProgram(h,[l],"int32",d);return o||n.disposeIntermediateTensorInfo(l),p}},YP=GM+"\n return -x;\n";const QP={kernelName:Cr,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]=oM(e.values,s.shape,s.dtype);return n.makeTensorInfo(r,s.dtype,t)}let r;return r=En().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new tF(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 WM(s.shape,YP),n.runWebGLProgram(r,[s],s.dtype)}},JP=Lf;const eV={kernelName:Sr,backendName:"webgl",kernelFunc:function(e){Gi();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=s,c=n.readSync(r.dataId),u=n.readSync(i.dataId),{selectedIndices:h}=JP(c,u,a,o,l);return n.makeTensorInfo([h.length],"int32",new Int32Array(h))}},tV=Pf;const nV={kernelName:Er,backendName:"webgl",kernelFunc:function(e){Gi();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:c}=s,u=n.readSync(r.dataId),h=n.readSync(i.dataId),{selectedIndices:d,validOutputs:p}=tV(u,h,a,o,l,c);return[n.makeTensorInfo([d.length],"int32",new Int32Array(d)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}},sV=Vf;const rV={kernelName:_r,backendName:"webgl",kernelFunc:function(e){Gi();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l,softNmsSigma:c}=s,u=n.readSync(r.dataId),h=n.readSync(i.dataId),d=a,p=o,f=l,m=c,{selectedIndices:g,selectedScores:y}=sV(u,h,d,p,f,m);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}};class iV{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 aV={kernelName:Ir,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:i,depth:a,onValue:o,offValue:l}=s,c=Kt(r.shape),u=new iV(c,a,o,l),h=OF({inputs:{x:r},backend:n,attrs:{shape:[c]}}),d=n.runWebGLProgram(u,[h],i);n.disposeIntermediateTensorInfo(h);const p=OF({inputs:{x:d},backend:n,attrs:{shape:[...r.shape,a]}});return n.disposeIntermediateTensorInfo(d),p}};function oV(e){const{inputs:t,backend:n}=e,{x:s}=t;if("complex64"===s.dtype){const e=HB({inputs:{input:s},backend:n}),t=oV({inputs:{x:e},backend:n}),r=lz({inputs:{input:s},backend:n}),i=oV({inputs:{x:r},backend:n}),a=pF({inputs:{real:t,imag:i},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(i),a}return kL({attrs:{shape:s.shape,dtype:s.dtype,value:"string"===s.dtype?"":0},backend:n})}const lV={kernelName:Fi,backendName:"webgl",kernelFunc:oV};const cV={kernelName:Tr,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=HB({inputs:{input:r},backend:s}),n=e({inputs:{x:t},backend:s}),i=lz({inputs:{input:r},backend:s}),a=oV({inputs:{x:i},backend:s}),o=pF({inputs:{real:n,imag:a},backend:s});return s.disposeIntermediateTensorInfo(t),s.disposeIntermediateTensorInfo(n),s.disposeIntermediateTensorInfo(i),s.disposeIntermediateTensorInfo(a),o}return kL({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:s})}};const uV={kernelName:Nr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s;if(1===t.length)return mL({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const i=t[0].shape,a=t[0].dtype;t.forEach((e=>{Ht(i,e.shape,"All tensors passed to stack must have matching shapes"),jt(a===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=hz({inputs:t.map((e=>{const t=mL({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 hV{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=dR(s),i=t.map((e=>e[0])).join(","),a=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}(${i});\n ${r} end = ${r}(${a});\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 = ${i};\n int end = ${a};\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 dV{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=dR(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=MM("rc",s),l=MM("source",s),c=`${o[s-1]} < ${this.outputShape[s-1]}`,u=1===s?"source":`vec2(${l.slice(-2).join()})`,h=[`${r} rc = outputLoc;`,`${o[s-1]} += 1;\n if(${c}) {\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(${c}) {`],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:i,constantValue:a}=s;if(0===Kt(r.shape)){return kL({backend:n,attrs:{shape:i.map(((e,t)=>e[0]+r.shape[t]+e[1])),value:a,dtype:r.dtype}})}const o=En().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new dV(r.shape,i,a):new hV(r.shape,i,a),l=[[a]];return n.runWebGLProgram(o,[r],r.dtype,l)},fV={kernelName:Or,backendName:"webgl",kernelFunc:pV},mV=CF({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 "+cF+"\n return result;\n"}),gV={kernelName:Dr,backendName:"webgl",kernelFunc:mV};const yV={kernelName:Mr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=[],c=tn(i,r.shape);let u=c;const h=Mh(u,o);let d,p=r;if(null!=h&&(p=WF({inputs:{x:r},backend:n,attrs:{perm:h}}),u=Bh(u.length,o),l.push(p)),Rh("prod",u,o),n.shouldExecuteOnCPU([p])){const e=n.texData.get(p.dataId).values,{outVals:t,outShape:s,outDtype:r}=cM(p.shape,p.dtype,e,u);d=n.makeTensorInfo(s,r,t)}else{const[e,t]=Oh(p.shape,u),s=Kt(t),i=OF({inputs:{x:p},backend:n,attrs:{shape:[-1,s]}}),a=FF(i,Za(r.dtype),"prod",n);d=OF({inputs:{x:a},backend:n,attrs:{shape:e}}),l.push(i),l.push(a)}if(a){l.push(d);const e=Dh(d.shape,c);d=OF({inputs:{x:d},backend:n,attrs:{shape:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),d}};const bV={kernelName:Fr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:i,indices:a}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.readSync(e.dataId))),c=r.map((e=>e.shape)),u=n.readSync(i.dataId),h=n.readSync(a.dataId),[d,p,f]=uM(l,c,u,i.shape,i.dtype,h,a.shape,o),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,i.dtype,p);return m.concat([g])}};const wV={kernelName:Br,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{starts:s,limits:r,deltas:i}=t,a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[c,u]=hM(a,s.shape,s.dtype,o,r.shape,l,i.shape);return[n.makeTensorInfo([c.length],"int32",c),n.makeTensorInfo([u.length],s.dtype,u)]}};const vV={kernelName:zr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:i,defaultValue:a,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,c=n.readSync(r.dataId),u=n.readSync(i.dataId),h=n.readSync(a.dataId),d=o.map((e=>n.readSync(e.dataId))),p=o.map((e=>e.shape)),[f,m]=dM(c,r.shape,u,i.shape,i.dtype,h,a.shape,d,p,l);return n.makeTensorInfo(f,i.dtype,m)}},AV=e=>{const{backend:t,attrs:n}=e,{start:s,stop:r,step:i,dtype:a}=n,o=pM(s,r,i,a);return t.makeTensorInfo([o.length],a,o)},xV={kernelName:Lr,backendName:"webgl",kernelFunc:AV},CV=xF({opSnippet:"return 1.0 / x;"}),kV={kernelName:Vr,backendName:"webgl",kernelFunc:CV},SV=xF({opSnippet:GM+"\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"}),EV={kernelName:Wr,backendName:"webgl",kernelFunc:SV},_V=xF({opSnippet:GM+"\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"}),TV={kernelName:$r,backendName:"webgl",kernelFunc:_V};class IV{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const c=[s&&t>1?a-1:a,s&&n>1?o-1:o],u=[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 ${c[0]/u[0]},\n ${c[1]/u[1]});\n const vec2 inputShapeRC = vec2(${a}.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 NV{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const c=[s&&t>1?a-1:a,s&&n>1?o-1:o],u=[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 ${c[0]/u[0]},\n ${c[1]/u[1]},\n ${c[1]/u[1]});\n const vec3 inputShapeRC = vec3(${a}.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 OV={kernelName:jr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s,[l,c]=o,u=En().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new NV(r.shape,l,c,i,a):new IV(r.shape,l,c,i,a);return n.runWebGLProgram(u,[r],"float32")}};class DV{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,i,a]=e,o=[n&&i>1?s-1:s,n&&a>1?r-1:r],l=[n&&i>1?i-1:i,n&&a>1?a-1:a],c=o[0]/l[0],u=o[1]/l[1],h=1/c,d=1/u,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(${c});\n const float widthScale = float(${u});\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 >= ${i}) {\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 >= ${a}) {\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 RV={kernelName:Hr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:i}=t,{alignCorners:a}=s,o=new DV(i.shape,r.shape,a);return n.runWebGLProgram(o,[i],i.dtype)}};class MV{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const c=[s&&t>1?a-1:a,s&&n>1?o-1:o],u=[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 ${c[0]/u[0]},\n ${c[1]/u[1]});\n const vec2 inputShapeRC = vec2(${a}.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 FV{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const c=[s&&t>1?a-1:a,s&&n>1?o-1:o],u=[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 ${c[0]/u[0]},\n ${c[1]/u[1]},\n ${c[1]/u[1]});\n const vec3 inputShapeRC = vec3(${a}.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 BV={kernelName:Ur,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s,[l,c]=o,u=En().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new FV(r.shape,l,c,i,a):new MV(r.shape,l,c,i,a);return n.runWebGLProgram(u,[r],r.dtype)}};class zV{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,i,a]=e,o=[n&&i>1?s-1:s,n&&a>1?r-1:r],l=[n&&i>1?i-1:i,n&&a>1?a-1:a],c=o[0]/l[0],u=o[1]/l[1],h=1/c,d=1/u,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(${c});\n const float widthScale = float(${u});\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 >= ${i}) {\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 >= ${a}) {\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 LV={kernelName:qr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:i}=t,{alignCorners:a}=s,o=new zV(i.shape,r.shape,a);return n.runWebGLProgram(o,[i],i.dtype)}};class PV{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=dR(n);this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n setOutput(getX(${s}));\n }\n `}}class VV{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=MM("rc",n),r=`${s[n-1]} + 1 < ${this.outputShape[n-1]}`,i=`${s[n-2]} + 1 < ${this.outputShape[n-2]}`,a=dR(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 ${a} 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(${i}) {\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 WV={kernelName:Kr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:i}=s,a=r.shape.length,o=tn(i,r.shape);if(0===a)return hF({inputs:{x:r},backend:n});const l=En().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new VV(r.shape,o):new PV(r.shape,o);return n.runWebGLProgram(l,[r],r.dtype)}};class GV{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 UV={kernelName:Li,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:i,center:a}=t,o=n,l=new GV(s.shape,i),[c,u]=Fm(a,s.shape[1],s.shape[2]),h=[[c,u,Math.sin(r),Math.cos(r)]];return o.runWebGLProgram(l,[s],s.dtype,h)}},qV=xF({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"}),jV={kernelName:Xr,backendName:"webgl",kernelFunc:qV},HV=xF({opSnippet:"return inversesqrt(x);",cpuKernelImpl:fM}),$V={kernelName:Zr,backendName:"webgl",kernelFunc:HV};class KV{constructor(e,t,n,s,r,i,a=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=i;const l=dR(r.length),c=dR(i.length);let u="";1===n?u="i":2===n&&(u="i, j");const h=`getIndices(${u})`;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 ${c} 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 XV{constructor(e,t,n,s,r,i,a=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=i;const l=dR(r.length),c=dR(i.length);let u="";1===n?u="i":2===n&&(u="i, j");const h=`getIndices(${u})`;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 ${c} 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 ZV={kernelName:Yr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r,updates:i}=t,{shape:a}=s,{sliceRank:o,numUpdates:l,sliceSize:c,strides:u,outputSize:h}=$p(0,r,a),d=[h/c,c];if(0===h)return n.makeTensorInfo(a,r.dtype);const p=OF({inputs:{x:r},backend:n,attrs:{shape:[l,o]}}),f=OF({inputs:{x:i},backend:n,attrs:{shape:[l,c]}}),m=n.makeTensorInfo([],"float32",new Float32Array([0]));let g;g=En().getBool("WEBGL_PACK")?new XV(l,o,p.shape.length,f.shape.length,u,d):new KV(l,o,p.shape.length,f.shape.length,u,d);const y=n.runWebGLProgram(g,[f,p,m],f.dtype),b=OF({inputs:{x:y},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(m),b}};class YV{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;`,i=2===En().getNumber("WEBGL_VERSION")?"while (left < right) {":r,a="left"===s?"<":"<=";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${i}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${a} 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 QV={kernelName:Jr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sortedSequence:r,values:i}=t,{side:a}=s,o=new YV(r.shape[0],r.shape[1],i.shape[1],a),l=[[r.shape[1]]];return n.runWebGLProgram(o,[r,i],"int32",l)}};class JV{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"],i=[],a=[];for(let s=0;s= 1.0) {\n setOutput(getA(${r}));\n } else {\n setOutput(getB(${r}));\n }\n }\n `}}const eW={kernelName:ei,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{condition:s,t:r,e:i}=t,a=new JV(s.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(a,[s,r,i],Xa(r.dtype,i.dtype))}},tW=xF({opSnippet:`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${Gm};\n float scale = ${Um};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),nW={kernelName:ti,backendName:"webgl",kernelFunc:tW},sW=xF({opSnippet:AF+"\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:gM}),rW={kernelName:ai,backendName:"webgl",kernelFunc:sW},iW=xF({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),aW={kernelName:ii,backendName:"webgl",kernelFunc:iW},oW=xF({opSnippet:AF+"\n return sin(x);\n",packedOpSnippet:`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${cF}\n return result;\n`}),lW={kernelName:si,backendName:"webgl",kernelFunc:oW},cW=xF({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),uW={kernelName:ri,backendName:"webgl",kernelFunc:cW},hW=xF({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"}),dW={kernelName:oi,backendName:"webgl",kernelFunc:hW},pW={kernelName:ui,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,paddings:a}=s;jt(r.shape.length<=4,(()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"));const o=i.reduce(((e,t)=>e*t)),l=[[0,0]];l.push(...a);for(let e=1+i.length;en.disposeIntermediateTensorInfo(e))),g}};const fW={kernelName:pi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{indices:s,values:r,denseShape:i,defaultValue:a}=t;if(1!==i.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${i.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!==a.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${a.shape}`);const o=n.readSync(s.dataId),l=n.readSync(r.dataId),c=n.readSync(i.dataId),u=n.readSync(a.dataId)[0],[h,d,p,f,m]=wM(o,s.shape,s.dtype,l,r.dtype,c,u);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 mW={kernelName:fi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{inputIndices:s,inputShape:r,newShape:i}=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!==i.shape.length)throw new Error(`Target shape should be a vector but received shape ${i.shape}`);const a=Array.from(n.readSync(r.dataId)),o=n.readSync(s.dataId),l=Array.from(n.readSync(i.dataId)),[c,u,h]=vM(o,s.shape,s.dtype,a,l);return[n.makeTensorInfo(u,s.dtype,c),n.makeTensorInfo([h.length],i.dtype,new Int32Array(h))]}};const gW={kernelName:mi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:i}=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!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${i.shape}`);const a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[c,u]=AM(a,s.shape,s.dtype,o,l,!0);return n.makeTensorInfo(u,s.dtype,c)}};const yW={kernelName:gi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:i}=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!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${i.shape}`);const a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[c,u]=AM(a,s.shape,s.dtype,o,l);return n.makeTensorInfo(u,s.dtype,c)}};const bW={kernelName:yi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sparseIndices:r,sparseValues:i,defaultValue:a}=t,{outputShape:o}=s,{sliceRank:l,numUpdates:c,sliceSize:u,strides:h,outputSize:d}=$p(0,r,o),p=!1;if("string"===i.dtype){const e=n.bufferSync(r),t=n.bufferSync(i),s=ya(n.readSync(a.dataId)[0]),f=mM(e,t,o,d,u,c,l,h,s,p);return n.makeTensorInfo(o,f.dtype,f.values)}const f=new KV(c,l,r.shape.length,i.shape.length,h,[d,1],p),m=n.runWebGLProgram(f,[i,r,a],i.dtype),g=OF({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),g}};const wW={kernelName:hi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{numOrSizeSplits:i,axis:a}=s,o=tn(a,r.shape)[0],l=fg(r,i,o),c=r.shape.length,u=new Array(c).fill(0),h=r.shape.slice();return l.map((e=>{const t=[...h];t[o]=e;const s=LB({inputs:{x:r},backend:n,attrs:{begin:u,size:t}});return u[o]+=e,s}))}},vW="return sqrt(x);",AW=xF({opSnippet:vW,packedOpSnippet:vW,cpuKernelImpl:xM}),xW={kernelName:li,backendName:"webgl",kernelFunc:AW},CW={kernelName:wi,backendName:"webgl",kernelFunc:xF({opSnippet:"return x * x;"})},kW="return (a - b) * (a - b);",SW=CF({opSnippet:kW,packedOpSnippet:kW}),EW={kernelName:bi,backendName:"webgl",kernelFunc:SW};const _W={kernelName:vi,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 i=Ng(n.readSync(r.dataId)),a=CM(i,"string",s);return n.makeTensorInfo(r.shape,"string",a)}};const TW={kernelName:Bi,backendName:"webgl",kernelFunc:function({inputs:e,attrs:t,backend:n}){const{x:s}=e,r=GM+`\n return x > 0.0 ? 1.0 : float(${t.alpha});\n `,i=new WM(s.shape,r);return n.runWebGLProgram(i,[s],s.dtype)}};class IW{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const s=n.length,r=dR(n.length),i=dR(n.length);let a="";if(1===s)a="coords * strides + begin";else{let e=0;a=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 ${i} coords = getOutputCoords();\n setOutput(getX(${a}));\n }\n `}}const NW={kernelName:Ai,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,end:a,strides:o,beginMask:l,endMask:c,ellipsisMask:u,newAxisMask:h,shrinkAxisMask:d}=s,{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:y,begin:b,end:w,strides:v}=au(r.shape,i,a,o,l,c,u,h,d);let A;if(m)A=OF({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||y){jt(r.shape.length>=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=$c(b,w,v),t=LB({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});A=OF({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{if(n.shouldExecuteOnCPU([r])){const e=n.readSync(r.dataId),t=Fl(r.shape,r.dtype,e),s=kM(p,t,v,b);A=n.makeTensorInfo(f,r.dtype,s.values)}else{const e=new IW(b,v,p);A=n.runWebGLProgram(e,[r],r.dtype)}}const x=OF({inputs:{x:A},backend:n,attrs:{shape:f}});return n.disposeIntermediateTensorInfo(A),x}};const OW={kernelName:xi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:i,leftPad:a,rightPad:o,padWidth:l,preserveShortSequences:c}=s,{data:u,dataSplits:h}=t,d=n.readSync(u.dataId),p=n.readSync(h.dataId),[f,m]=SM(d,p,r,i,a,o,l,c);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};const DW={kernelName:Ci,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{skipEmpty:r}=s,{input:i,delimiter:a}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(1!==i.shape.length)throw new Error(`Input must be a vector, got shape: ${i.shape}`);if(0!==a.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);const o=n.readSync(i.dataId),l=n.readSync(a.dataId)[0],[c,u,h]=EM(o,l,r),d=u.length;return[n.makeTensorInfo([d,2],"int32",c),n.makeTensorInfo([d],"string",u),n.makeTensorInfo([2],"int32",new Int32Array(h))]}};const RW={kernelName:ki,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{numBuckets:r}=s,{input:i}=t;if("string"!==i.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 a=n.readSync(i.dataId),o=_M(a,r);return n.makeTensorInfo(i.shape,"int32",o)}},MW=xF({opSnippet:"return tan(x);"}),FW={kernelName:Ei,backendName:"webgl",kernelFunc:MW},BW=xF({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),zW={kernelName:_i,backendName:"webgl",kernelFunc:BW};const LW={kernelName:Qr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{tensor:r,indices:i,updates:a}=t,{}=s,{sliceRank:o,numUpdates:l,sliceSize:c,strides:u,outputSize:h}=$p(0,i,r.shape),d=[h/c,c];if(0===h)return n.makeTensorInfo(r.shape,i.dtype);const p=OF({inputs:{x:i},backend:n,attrs:{shape:[l,o]}}),f=OF({inputs:{x:a},backend:n,attrs:{shape:[l,c]}}),m=OF({inputs:{x:r},backend:n,attrs:{shape:d}}),g=new KV(l,o,p.shape.length,f.shape.length,u,d,!1,!0),y=n.runWebGLProgram(g,[f,p,m],m.dtype),b=OF({inputs:{x:y},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(y),b}};class PW{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=>ya(e))):e,s=Fl(r.shape,r.dtype,t),a=IM(s,i);return n.makeTensorInfo(a.shape,a.dtype,a.values)}const a=new PW(r.shape,i);return n.runWebGLProgram(a,[r],r.dtype)}const WW={kernelName:Ti,backendName:"webgl",kernelFunc:VW};class GW{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 UW{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 qW(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function jW(e){let t=1;for(;tl){const e=n.readSync(r.dataId),[t,s]=NM(e,c,r.dtype,i,a);return[n.makeTensorInfo(t.shape,t.dtype,t.values),n.makeTensorInfo(s.shape,s.dtype,s.values)]}if(0===i)return c[c.length-1]=0,[n.makeTensorInfo(c,r.dtype,[]),n.makeTensorInfo(c,"int32",[])];if(1===u)return[r,kL({attrs:{shape:c,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=Kt(c)/u,m=OF({inputs:{x:p},attrs:{shape:[f,u]},backend:n});d&&qW(n,p);const g=jW(i),y=jW(u);let b=null;const w=()=>null===b?[m,m]:[m,b],v=(e,t,s)=>{const r=w(),i=new GW(s),a=[[u],[null===b?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],o=b;b=n.runWebGLProgram(i,r,"int32",a),qW(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 UW([f,e/2]),r=[[u],[null===b?1:0],[g]],i=b;b=n.runWebGLProgram(s,t,"int32",r),qW(n,i);const a=g/2,o=2*a;for(let e=a;e>=1;e/=2)v(o,e,b.shape)}let A=b;b=LB({inputs:{x:b},backend:n,attrs:{begin:0,size:[f,i]}}),qW(n,A);let x=UL({inputs:{x:m,indices:b},backend:n,attrs:{axis:1,batchDims:1}});qW(n,m);const C=c.slice(0,-1);C.push(i),A=b,b=OF({inputs:{x:b},attrs:{shape:C},backend:n}),qW(n,A);const k=x;return x=OF({inputs:{x},attrs:{shape:C},backend:n}),qW(n,k),[x,b]}};class $W{constructor(e,t,n,s,r,i){this.variableNames=["Image","Transforms"],this.outputShape=i;const a="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 (${a} == 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 KW={kernelName:Ni,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,transforms:i}=t,{interpolation:a,fillMode:o,fillValue:l,outputShape:c}=s,[u,h,d,p]=r.shape,[f,m]=null!=c?c:[h,d],g=new $W(h,d,a,o,l,[u,f,m,p]);return n.runWebGLProgram(g,[r,i],"float32")}};const XW={kernelName:Di,backendName:"webgl",kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,{axis:r}=n,{x:i}=t;$D(i,"unique");const a=s.readSync(i.dataId),{outputValues:o,outputShape:l,indices:c}=DM(a,r,i.shape,i.dtype);return[s.makeTensorInfo(l,i.dtype,o),s.makeTensorInfo([c.length],"int32",c)]}};const ZW={kernelName:Ri,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{value:r}=t;let{axis:i}=s;i<0&&(i+=r.shape.length);const a=r,o=a.shape.length,l=r.shape[i],c=new Array(o-1);let u=0;for(let e=0;en.disposeIntermediateTensorInfo(e))),f}};class YW{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windowSize,s=e.batchSize,r=e.inSize,i=e.numSegments,a=i*Math.ceil(r/n);this.outputShape=[s,a];const o=4*Math.floor(n/4),l=n%4,c="\n sumValue += dot(values, segFilter);\n ";let u="";r%n>0&&(u=`\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 ${u}\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 ${i})) * float(${n}));\n int currentSeg = int(mod(float(outIdx), float(${i})));\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 ${c}\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 ${c}\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 ${c}\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 ${c}\n }\n setOutput(sumValue);\n }\n `}}const QW={kernelName:Mi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,segmentIds:i}=t,{numSegments:a}=s,o=r.shape.length,l=[];let c=0;const u=Mh([c],o);let h=r;null!=u&&(h=WF({inputs:{x:r},backend:n,attrs:{perm:u}}),l.push(h),c=Bh(1,o)[0]);const d=Tg(h.shape,c,a),p=Kt([h.shape[c]]),f=OF({inputs:{x:h},backend:n,attrs:{shape:[-1,p]}});l.push(f);const m=Za(r.dtype),g=(e,t,s,r,i)=>{const a=e.shape[0],o=e.shape[1],c=_g(o,i),u=new YW({windowSize:c,inSize:o,batchSize:a,numSegments:i},t),h=n.compileAndRun(u,[e,s],r);if(l.push(h),h.shape[1]===i)return h;const d=AV({backend:n,attrs:{start:0,stop:i,step:1,dtype:"float32"}}),p=VW({inputs:{x:d},backend:n,attrs:{reps:[o/c]}});l.push(d),l.push(p);return g(h,t,p,r,i)},y=OF({inputs:{x:g(f,"unsortedSegmentSum",i,m,a)},backend:n,attrs:{shape:d}});let b=y;if(null!=u){l.push(y);const e=Fh(u);b=WF({inputs:{x:b},backend:n,attrs:{perm:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),b}},JW=[jF,$F,XF,YF,eB,sB,rB,iB,hB,dB,fB,gB,bB,vB,xB,SB,EB,IB,NB,OB,MB,VB,WB,GB,UB,XB,QB,tz,fF,rz,dz,vz,Sz,_z,Tz,Iz,Nz,Dz,Mz,Bz,Uz,qz,jz,$z,Zz,Jz,eL,nL,rL,iL,oL,lL,uL,dL,fL,gL,wL,xL,SL,_L,NL,DL,FL,LL,PL,WL,qL,HL,KL,dF,XL,cz,YL,JL,tP,yF,sP,iP,aP,lP,uP,dP,fP,gP,wP,AP,CP,SP,EP,_P,NP,OP,DP,RP,MP,BP,PP,WP,ZP,NF,QP,eV,nV,rV,jB,aV,cV,uV,fV,gV,vF,yV,bV,wV,vV,xV,$B,qP,kV,EV,TV,DF,OV,RV,BV,LV,WV,UV,jV,$V,ZV,QV,eW,nW,rW,aW,lW,uW,PB,XP,dW,pW,fW,mW,gW,yW,bW,wW,xW,CW,EW,_W,TW,NW,OW,DW,RW,$P,VF,FW,zW,LW,WW,HW,KW,GF,XW,ZW,QW,lV];for(const e of JW)Xi(e);__webpack_require__(9464);const eG={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:7680},height:{min:240,ideal:4320},facingMode:"user"}},dataTimestep:50,showVideoPreview:!0,applyKalmanFilter:!0,saveDataAcrossSessions:!0,storingPoints:!1,videoIsOn:!1,trackEye:"both"};__webpack_require__(6003);var tG=__webpack_require__(7350),nG=__webpack_require__.n(tG),sG=__webpack_require__(8990),rG=function(){return rG=Object.assign||function(e){for(var t,n=1,s=arguments.length;n0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[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(" "),a=0;a(t=t||0)&&(t=Math.max(t+s,0));t>2];a=t[(3&a)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[i++]=c+a+o+l}switch(c=0,l=s,e.length-r){case 2:l=t[(15&(c=e[r+1]))<<2]||s;case 1:e=e[r],n[i]=t[e>>2]+t[(3&e)<<4|c>>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!=a&&(t(i<<4&240|a>>2),64!=o&&t(a<<6&192|o))}}(e,(function(e){s[r++]=e})),r!==n?s.subarray(0,r):s}function B(){if(!R){R={};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;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 U(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 U(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 ie(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 ae(e){var t;return null==(t=re?e[re]:e.N)?0:t}function oe(e){return ie(e,1),e}function le(e){return!!Array.isArray(e)&&!!(2&ae(e))}function ce(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ie(e,2)}function ue(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,i=r?1:0;i>>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)?G=0<1/s?0:2147483648:isNaN(s)?G=2147483647:34028234663852886e22>>0:11754943508222875e-54>s?(s=Math.round(s/Math.pow(2,-149)),G=(n<<31|s)>>>0):(t=Math.floor(Math.log(s)/Math.LN2),s*=Math.pow(2,-t),16777216<=(s=Math.round(8388608*s))&&++t,G=(n<<31|t+127<<23|8388607&s)>>>0),n=G,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),it=st((function(e,t,n){if(0!==e.h)return!1;for(var s=e.g,r=128,i=0,a=e=0;4>a&&128<=r;a++)r=s.h[s.g++],$(s),i|=(127&r)<<7*a;if(128<=r&&(r=s.h[s.g++],$(s),i|=(127&r)<<28,e|=(127&r)>>4),128<=r)for(a=0;5>a&&128<=r;a++)r=s.h[s.g++],$(s),e|=(127&r)<<7*a+3;if(!(128>r))throw q();return s=i>>>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=G=t,t=s;0>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),at=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,i=(e=e.g).g;if(e.g+=r,$(e),e=e.h,N)(s=T)||(s=T=new TextDecoder("utf-8",{fatal:!0})),s=s.decode(e.subarray(i,i+r));else{r=i+r;for(var a,o,l,c=[],u=null;i(a=e[i++])?c.push(a):224>a?i>=r?E():(o=e[i++],194>a||128!=(192&o)?(i--,E()):c.push((31&a)<<6|63&o)):240>a?i>=r-1?E():128!=(192&(o=e[i++]))||224===a&&160>o||237===a&&160<=o||128!=(192&(s=e[i++]))?(i--,E()):c.push((15&a)<<12|(63&o)<<6|63&s):244>=a?i>=r-2?E():128!=(192&(o=e[i++]))||o-144+(a<<28)>>30||128!=(192&(s=e[i++]))||128!=(192&(l=e[i++]))?(i--,E()):(a=(7&a)<<18|(63&o)<<12|(63&s)<<6|63&l,a-=65536,c.push(55296+(a>>10&1023),56320+(1023&a))):E(),8192<=c.length&&(u=_(u,c),c.length=0);s=_(u,c)}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=(I||(I=new TextEncoder)).encode(t)}else{for(var r=0,i=new Uint8Array(3*t.length),a=0;ao)i[r++]=o;else{if(2048>o)i[r++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&a=l){o=1024*(o-55296)+l-56320+65536,i[r++]=o>>18|240,i[r++]=o>>12&63|128,i[r++]=o>>6&63|128,i[r++]=63&o|128;continue}a--}if(s)throw Error("Found an unpaired surrogate");o=65533}i[r++]=o>>12|224,i[r++]=o>>6&63|128}i[r++]=63&o|128}}t=i.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=Ae(t,n,s),n=e.g.i,s=K(e.g)>>>0;var i=e.g.g+s,a=i-n;if(0>=a&&(e.g.i=i,r(t,e),a=i-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+s+" bytes, instead read "+(s-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=i,e.g.i=n,!0}),(function(e,t,n,s,r){if(null!=(t=ve(t,s,n)))for(s=0;s>>=7,a.h++;i.push(o),a.h++}}));function ct(){Ne.apply(this,arguments)}if(p(ct,Ne),fe){var ut={};Object.defineProperties(ct,(ut[Symbol.hasInstance]=me(Object[Symbol.hasInstance]),ut))}function ht(e){ct.call(this,e)}function dt(){return[1,at,2,rt,3,ot,4,ot]}function pt(e){ct.call(this,e,-1,mt)}function ft(){return[1,lt,ht,dt]}p(ht,ct),p(pt,ct),pt.prototype.addClassification=function(e,t){return Ae(this,1,ht,e,t),this};var mt=[1];function gt(e){ct.call(this,e)}function yt(){return[1,rt,2,rt,3,rt,4,rt,5,rt]}function bt(e){ct.call(this,e,-1,vt)}function wt(){return[1,lt,gt,yt]}p(gt,ct),p(bt,ct);var vt=[1];function At(e){ct.call(this,e)}function xt(){return[1,rt,2,rt,3,rt,4,rt,5,rt,6,it]}p(At,ct);var Ct=[[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]],kt=[[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]],Tt=[[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]],It=[].concat(o(Ct),o(kt),o(St),o(Et),o(_t),o(Tt));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:xe(e,1),ga:we(e,2),label:null!=ge(e,3)?Ce(e,3):void 0,displayName:null!=ge(e,4)?Ce(e,4):void 0}}))}function Dt(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 Rt(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),i=n.createProgram();if(n.attachShader(i,s),n.attachShader(i,r),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(i));s=e.o=i,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=a(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 x((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,i,o,l,c,u,h,d,p,f,m,g,b;return x((function(w){switch(w.g){case 1:if(!n)return w.return(t);for(s={},r=0,i=a(Object.keys(n)),o=i.next();!o.done;o=i.next())l=o.value,"string"!=typeof(c=n[l])&&"texture"===c.type&&void 0!==t[c.stream]&&++r;10&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0){var u=o===e.strides.length-1?1:IG(e.minScale,e.maxScale,o+1,e.strides.length);a.push(Math.sqrt(l*u)),i.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})),Io([s,r,i]),[2,o]}}))}))}function DG(e,t,n){return wG(this,void 0,void 0,(function(){var s,r,i,a,o;return vG(this,(function(l){switch(l.label){case 0:return s=e[0],r=e[1],i=function(e,t,n){return To((function(){var s,r,i,a;n.reverseOutputOrder?(r=Fp(Wu(e,[0,n.boxCoordOffset+0],[-1,1])),s=Fp(Wu(e,[0,n.boxCoordOffset+1],[-1,1])),a=Fp(Wu(e,[0,n.boxCoordOffset+2],[-1,1])),i=Fp(Wu(e,[0,n.boxCoordOffset+3],[-1,1]))):(s=Fp(Wu(e,[0,n.boxCoordOffset+0],[-1,1])),r=Fp(Wu(e,[0,n.boxCoordOffset+1],[-1,1])),i=Fp(Wu(e,[0,n.boxCoordOffset+2],[-1,1])),a=Fp(Wu(e,[0,n.boxCoordOffset+3],[-1,1]))),r=Pl(Gl(Wl(r,n.xScale),t.w),t.x),s=Pl(Gl(Wl(s,n.yScale),t.h),t.y),n.applyExponentialOnBoxSize?(i=Gl(Uh(Wl(i,n.hScale)),t.h),a=Gl(Uh(Wl(a,n.wScale)),t.w)):(i=Gl(Wl(i,n.hScale),t.h),a=Gl(Wl(a,n.wScale),t.h));var o=rc(s,Wl(i,2)),l=rc(r,Wl(a,2)),c=Pl(s,Wl(i,2)),u=Pl(r,Wl(a,2)),h=Lu([Fu(o,[n.numBoxes,1]),Fu(l,[n.numBoxes,1]),Fu(c,[n.numBoxes,1]),Fu(u,[n.numBoxes,1])],1);if(n.numKeypoints)for(var d=0;d0)for((u=l.locationData).relativeKeypoints=[],h=n.numKeypoints*n.numValuesPerKeypoint,d=0;dl?(i=e.width,a=e.width*o,u=(1-l/o)/2):(i=e.height/o,a=e.height,c=(1-o/l)/2),e.width=i,e.height=a,{top:u,left:c,right:c,bottom:u}}(l,s,r),u=function(e,t,n,s){var r=e.width,i=e.height,a=Math.cos(e.rotation),o=Math.sin(e.rotation),l=e.xCenter,c=e.yCenter,u=1/t,h=1/n,d=new Array(16);return d[0]=r*a*1*u,d[1]=-i*o*u,d[2]=0,d[3]=(-.5*r*a*1+.5*i*o+l)*u,d[4]=r*o*1*h,d[5]=i*a*h,d[6]=0,d[7]=(-.5*i*a-.5*r*o*1+c)*h,d[8]=0,d[9]=0,d[10]=r*u,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=To((function(){var t=EG(e),n=Wp(function(e,t,n){return _G(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]}(u,o,s),[1,8]),r="zero"===i?"constant":"nearest",l=ym.transform(qh(Bl(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=a?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 To((function(){return Pl(Gl(e,n.scale),n.offset)}))}(l,a):l}));return{imageTensor:h,padding:c,transformationMatrix:u}}(n,this.imageToTensorConfig),r=s.imageTensor,i=s.transformationMatrix,a=this.detectorModel.execute(r,"Identity:0"),o=function(e){return To((function(){var t=function(e){return To((function(){return[Wu(e,[0,0,0],[1,-1,1]),Wu(e,[0,0,1],[1,-1,-1])]}))}(e),n=t[0],s=t[1];return{boxes:Fp(s),logits:Fp(n)}}))}(a),l=o.boxes,[4,DG([c=o.logits,l],this.anchorTensor,this.tensorsToDetectionConfig)]);case 1:return 0===(u=p.sent()).length?(Io([n,r,a,c,l]),[2,u]):[4,OG(u,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=NG(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,i=Number.MAX_VALUE,a=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=NG(s,e),n=t[0],l=t[1];r=Math.min(r,n),a=Math.max(a,n),i=Math.min(i,l),o=Math.max(o,l)})),t.relativeBoundingBox={xMin:r,xMax:a,yMin:i,yMax:o,width:a-r,height:o-i}})),e}(h,i),Io([n,r,a,c,l]),[2,d]}}))}))},e.prototype.estimateFaces=function(e,t){return wG(this,void 0,void 0,(function(){var n,s;return vG(this,(function(r){return n=SG(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 bG(bG({},e),{x:e.x*n.width,y:e.y*n.height,name:AG[t]})})),s=e.locationData.relativeBoundingBox,r=0,i=["width","xMax","xMin"];r-1,[4,rS(t.detectorModelUrl,{fromTFHub:n})];case 1:return s=r.sent(),[2,new UG(t.modelType,s,t.maxFaces)]}}))}))}function jG(e,t){return wG(this,void 0,void 0,(function(){var n,s;return vG(this,(function(r){if(e===FG.MediaPipeFaceDetector){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,qG(n)];if("mediapipe"===n.runtime)return[2,kG(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 HG(e){return e.width*e.height}function $G(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 KG(e){return e instanceof Fa?{height:e.shape[0],width:e.shape[1]}:{height:e.height,width:e.width}}function XG(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function ZG(e){return e instanceof Fa?e:Gc(e)}function YG(e,t){jt(0!==e.width,(function(){return t+" width cannot be 0."})),jt(0!==e.height,(function(){return t+" height cannot be 0."}))}function QG(e,t,n){var s=t.outputTensorSize,r=t.keepAspectRatio,i=t.borderMode,a=t.outputTensorFloatRange,o=KG(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),c=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;YG(t,"targetSize"),YG(e,"roi");var i,a,o=s/r,l=e.height/e.width,c=0,u=0;return o>l?(i=e.width,a=e.width*o,u=(1-l/o)/2):(i=e.height/o,a=e.height,c=(1-o/l)/2),e.width=i,e.height=a,{top:u,left:c,right:c,bottom:u}}(l,s,r),u=function(e,t,n,s){var r=e.width,i=e.height,a=s?-1:1,o=Math.cos(e.rotation),l=Math.sin(e.rotation),c=e.xCenter,u=e.yCenter,h=1/t,d=1/n,p=new Array(16);return p[0]=r*o*a*h,p[1]=-i*l*h,p[2]=0,p[3]=(-.5*r*o*a+.5*i*l+c)*h,p[4]=r*l*a*d,p[5]=i*o*d,p[6]=0,p[7]=(-.5*i*o-.5*r*l*a+u)*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=To((function(){var t=ZG(e),n=Wp(function(e,t,n){return YG(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]}(u,o,s),[1,8]),r="zero"===i?"constant":"nearest",l=ym.transform(qh(Bl(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=a?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 To((function(){return Pl(Gl(e,n.scale),n.offset)}))}(l,a):l}));return{imageTensor:h,padding:c,transformationMatrix:u}}function JG(e){return{xCenter:e.xMin+e.width/2,yCenter:e.yMin+e.height/2,width:e.width,height:e.height}}function eU(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,i=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),i=Math.max(i,e.y)})),{xCenter:(n+r)/2,yCenter:(s+i)/2,width:r-n,height:i-s}}function tU(e,t,n,s,r){var i="rect"===n?function(e,t,n){var s,r=e.locationData;if("boundingbox"===t)s=JG(r.boundingBox);else{s=eU(r);var i=n.width,a=n.height;s.xCenter=Math.round(s.xCenter*i),s.yCenter=Math.round(s.yCenter*a),s.width=Math.round(s.width*i),s.height=Math.round(s.height*a)}return s}(e,t,s):function(e,t){var n=e.locationData;return"boundingbox"===t?JG(n.relativeBoundingBox):eU(n)}(e,t);return r&&(i.rotation=function(e,t,n){var s,r=e.locationData,i=n.rotationVectorStartKeypointIndex,a=n.rotationVectorEndKeypointIndex;s=n.rotationVectorTargetAngle?n.rotationVectorTargetAngle:Math.PI*n.rotationVectorTargetAngleDegree/180;var o=r.relativeKeypoints[i].x*t.width,l=r.relativeKeypoints[i].y*t.height,c=r.relativeKeypoints[a].x*t.width,u=r.relativeKeypoints[a].y*t.height;return XG(s-Math.atan2(-(u-l),c-o))}(e,s,r)),i}function nU(e,t,n){for(var s=0;s1&&(h.y=s?t.inputImageHeight-a[c+1]:a[c+1]),i>2&&(h.z=a[c+2]),i>3&&(h.score=aU(t.visibilityActivation,a[c+3])),o.push(h);for(u=0;u0?r/i:0}(e,t)<=.5}))).push(e)}))})),l=y,[4,Promise.all(l.map((function(e){return m.faceLandmark(e,r)})))];case 4:for(c=g.sent(),u=[],this.prevFaceRectsFromLandmarks=[],h=0;h-1,[4,rS(t.landmarkModelUrl,{fromTFHub:n})];case 1:return s=i.sent(),[4,jG(FG.MediaPipeFaceDetector,{modelType:"short",maxFaces:t.maxFaces,detectorModelUrl:t.detectorModelUrl,runtime:t.runtime})];case 2:return r=i.sent(),[2,new kU(r,s,t.maxFaces,t.refineLandmarks)]}}))}))}(cU||(cU={})).MediaPipeFaceMesh="MediaPipeFaceMesh";Object.freeze({__proto__:null,getKeypointIndexByContour:function(e){if(e===cU.MediaPipeFaceMesh)return lG;throw new Error("Model "+e+" is not supported.")},getAdjacentPairs:function(e){if(e===cU.MediaPipeFaceMesh)return cG;throw new Error("Model "+e+" is not supported.")}});const EU=(e,t,n,s)=>1===s?.5*(e+t):e+(t-e)*n/(s-1),_U={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},TU={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},IU={outputTensorSize:{width:192,height:192},keepAspectRatio:!0,outputTensorFloatRange:[-1,1],borderMode:"zero"},NU=e=>{e.detector.imageToTensorConfig=IU,e.detector.tensorsToDetectionConfig=_U,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:EU(e.minScale,e.maxScale,o+1,e.strides.length);a.push(Math.sqrt(t*n)),i.push(e.interpolatedScaleAspectRatio)}}o++}for(let e=0;e0)l=e.featureMapHeight[n],c=e.featureMapWidth[n];else{const t=e.strides[n];l=Math.ceil(e.inputSizeHeight/t),c=Math.ceil(e.inputSizeWidth/t)}for(let n=0;ne.width))),n=Vp(e.detector.anchors.map((e=>e.height))),s=Vp(e.detector.anchors.map((e=>e.xCenter))),r=Vp(e.detector.anchors.map((e=>e.yCenter)));e.detector.anchorTensor={x:s,y:r,w:t,h:n}},OU=()=>navigator.onLine,DU=function(){this.model=function(e,t){return iG(this,void 0,void 0,(function(){var n,s;return aG(this,(function(r){if(e===cU.MediaPipeFaceMesh){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,SU(n)];if("mediapipe"===n.runtime)return[2,mG(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.")}))}))}(cU.MediaPipeFaceMesh,{runtime:"tfjs",detectorModelUrl:OU()?"https://tfhub.dev/mediapipe/tfjs-model/face_detection/full/1":"./models/detector/model.json",landmarkModelUrl:OU()?void 0:"./models/landmark/model.json"}),this.predictionReady=!1,this.modelLoaded=!1},RU={current:!1,resolves:[]};DU.prototype.loadModel=async function(){if(!this.modelLoaded){if(RU.current){const e=new Promise((e=>{RU.resolves.push(e)}));return await e}RU.current=!0;try{this.model=await this.model,NU(this.model),this.modelLoaded=!0,RU.resolves.forEach((e=>e()))}finally{RU.current=!1,RU.resolves=[]}}},DU.prototype.positionsArray=null,DU.prototype.getEyePatches=async function(e,t,n,s){if(0===t.width)return null;const r=this.model,i=await r.estimateFaces(t,{flipHorizontal:!1});if(0===i.length)return!1;this.positionsArray=i[0].keypoints;const a=i[0],[o,l]=[{eyeTopArc:[466,388,387,386,385,384,398].map((e=>a.keypoints[e])),eyeBottomArc:[263,249,390,373,374,380,381,382,362].map((e=>a.keypoints[e]))},{eyeTopArc:[246,161,160,159,158,157,173].map((e=>a.keypoints[e])),eyeBottomArc:[33,7,163,144,145,153,154,155,133].map((e=>a.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 c=o.origin.x,u=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(c,u,h,d);y.left={patch:b,imagex:c,imagey:u,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},DU.prototype.getPositions=function(){return this.positionsArray},DU.prototype.reset=function(){},DU.prototype.drawFaceOverlay=function(e,t){if(t){e.fillStyle="#32EEDB",e.strokeStyle="#32EEDB",e.lineWidth=.5;for(let n=0;nn?n:e}FU.Eye=function(e,t,n,s,r){this.patch=e,this.imagex=t,this.imagey=n,this.width=s,this.height=r},FU.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),i=[];this.equalizeHistogram(s,5,i);var a=[];return this.equalizeHistogram(r,5,a),i.concat(a)},FU.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)},FU.DataWindow.prototype.push=function(e){return this.data.length>2),r=0,i=0,a=0;at?255:0;return e},FU.correlation=function(e,t){const n=Math.min(e.length,t.length);let s=0;for(let r=0;rLU(e,t,((e,t)=>e+t)),sub:(e,t)=>LU(e,t,((e,t)=>e-t)),inv:e=>PU.solve(e,PU.identity(e.length,e[0].length)),identity(e,t=e){const n=new Array(e);for(let s=0;se.length===e[0].length?PU.LUDecomposition(e,t):PU.QRDecomposition(e,t),LUDecomposition(e,t){for(var n=new Array(e.length),s=0;sMath.abs(u[f])&&(f=s);if(f!=r){for(p=0;p=0;p--){for(r=0;r=0;c--){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},WU.addData=function(e,t,n){e&&("click"===n?(this.screenXClicksArray.push([t[0]]),this.screenYClicksArray.push([t[1]]),this.eyeFeaturesClicks.push(zU.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(zU.getEyeFeats(e)),this.trailTimes.push(performance.now()),this.dataTrail.push({eyes:e,screenPos:t,type:n})))};const GU=WU,UU={RidgeReg:function(){this.init()}};UU.RidgeReg.prototype.init=GU.InitRegression,UU.RidgeReg.prototype.addData=GU.addData,UU.RidgeReg.prototype.predict=function(e){if(!e||0===this.eyeFeaturesClicks.length)return null;for(var t=performance.now()-this.trailTime,n=[],s=[],r=[],i=0;it&&(n.push(this.screenXTrailArray.get(i)),s.push(this.screenYTrailArray.get(i)),r.push(this.eyeFeaturesTrail.get(i)));var a=this.screenXClicksArray.data.concat(n),o=this.screenYClicksArray.data.concat(s),l=this.eyeFeaturesClicks.data.concat(r),c=GU.ridge(a,l,this.ridgeParameter),u=GU.ridge(o,l,this.ridgeParameter),h=zU.getEyeFeats(e),d=0;for(i=0;it&&(n.push(this.screenXTrailArray.get(i)),s.push(this.screenYTrailArray.get(i)),r.push(this.eyeFeaturesTrail.get(i)));var a=this.eyeFeaturesClicks.data.length,o=Array(a),l=Array(a),c=Array(a);for(i=0;isetTimeout(t,e)))}function QU(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}const JU={tracker:{}};JU.tracker.TFFaceMesh=MU,JU.reg=qU,JU.reg.RidgeWeightedReg=HU.RidgeWeightedReg,JU.reg.RidgeRegThreaded=ZU.RidgeRegThreaded,JU.util=zU,JU.params=eG,JU.videoParamsToReport={height:0,width:0};var eq=null,tq=null,nq=null,sq=null,rq=null,iq=null,aq=null,oq=!1,lq=new Array(50),cq=new Array(50),uq=(performance.now(),null),hq=null;JU.params.paused=!1,JU.params.greedyLearner=!1,JU.params.framerate=60,JU.params.showGazeDot=!1,JU.params.getLatestVideoFrameTimestamp=()=>{},JU.params.activeCamera={label:"",id:""};let dq=[];var pq=function(e){},fq=pq,mq=["click","move"],gq=performance.now(),yq=new JU.tracker.TFFaceMesh,bq=[new JU.reg.RidgeReg],wq={TFFacemesh:function(){return new JU.tracker.TFFaceMesh}},vq={ridge:function(){return new JU.reg.RidgeReg},weightedRidge:function(){return new JU.reg.RidgeWeightedReg},threadedRidge:function(){return new JU.reg.RidgeRegThreaded}},Aq="webgazerGlobalData",xq="webgazerGlobalSettings",Cq={},kq=[];let Sq,Eq,_q,Tq,Iq,Nq,Oq,Dq,Rq,Mq,Fq,Bq;JU.computeValidationBoxSize=function(){var e=nq.videoWidth,t=nq.videoHeight,n=parseInt(nq.style.width),s=parseInt(nq.style.height),r=Math.min(e,t),i=e==Math.max(e,t)?n/e:s/t,a=r*JU.params.faceFeedbackBoxRatio*i;return[(s-a)/2,(n-a)/2,a,a]};let zq=!1,Lq=!1;function Pq(){null!==iq&&uq?(zq||Lq||(Lq=!0,setTimeout((()=>{Sq=nq.videoWidth,Eq=nq.videoHeight,_q=Math.min(Sq,Eq),Tq=_q*JU.params.faceFeedbackBoxRatio,Iq=(Eq-Tq)/2,Nq=(Sq-Tq)/2,Oq=Nq+Tq,Dq=Iq+Tq,zq=!0,Lq=!1}),500)),Rq=Sq-uq.left.imagex,Fq=Sq-uq.right.imagex,Mq=uq.left.imagey,Bq=uq.right.imagey,iq.style.border=zq&&Rq>Nq&&RqNq&&FqIq&&MqIq&&Bq=1e3/JU.params.framerate&&(Hq=jq,hq=Gq(),hq=await hq,fq(hq),$q=!0,hq)){Uq.push(hq);var e=0,t=0,n=Uq.length;for(var s in Uq.data)e+=Uq.get(s).x,t+=Uq.get(s).y;var r=zU.bound({x:e/n,y:t/n});JU.params.storingPoints&&(JU.storePoints(r.x,r.y,qq),50==++qq&&(qq=0)),aq.style.opacity="",aq.style.left=`${r.x}px`,aq.style.top=`${r.y}px`}requestAnimationFrame(Xq)}var Zq=function(e,t,n){if(!JU.params.paused){if(0===bq.length)return null;for(var s in bq)uq&&bq[s].addData(uq,[e,t],n)}},Yq=async function(e){Zq(e.clientX,e.clientY,mq[0]),JU.params.saveDataAcrossSessions&&await async function(){var e=bq[0].getData()||kq;nG().setItem(xq,Cq),nG().setItem(Aq,e)}()},Qq=function(e){if(!JU.params.paused){var t=performance.now();tJU.params.activeCamera.id?{video:{...e.video,deviceId:JU.params.activeCamera.id}}:e;function sj(e){navigator.vendor&&navigator.vendor.indexOf("Apple")>-1?(e.style.opacity=JU.params.showVideo?"1":"0",e.style.display="block"):e.style.display=JU.params.showVideo?"block":"none"}JU._begin=function(e,t){if(!JU.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;dq=[],e.forEach((e=>{"videoinput"===e.kind&&dq.push(e),e.label.includes("FaceTime")&&(t=e.label,n=e.deviceId)})),dq.length&&(JU.params.activeCamera.label=t||dq[0].label,JU.params.activeCamera.id=n||dq[0].deviceId)})(s),0===dq.length)throw t(dq),JSON.stringify({message:"We can't find any video input devices.",devices:s});try{r=await navigator.mediaDevices.getUserMedia(nj(JU.params.camConstraints));const e=r.getVideoTracks()[0],{height:t,width:n}=e.getSettings();JU.videoParamsToReport={height:t,width:n}}catch(e){throw t(dq),e}tj(e?"video":"all",r).then((()=>{dq.length>1&&(e=>{const t=tq,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("%");JU.params.activeCamera.label=s,JU.params.activeCamera.id=t,JU.setCameraConstraints(nj(JU.params.camConstraints))},t.appendChild(n)})(dq)})),JU.params.videoIsOn=!0,e||n(JU)}else t([])}catch(e){throw nq=null,r=null,t([]),s(e),JSON.stringify({error:e,devices:await navigator.mediaDevices.enumerateDevices()})}}));tj("gaze")},JU.isReady=function(){return null!==sq&&sq.width>0},JU.pause=function(){return JU.params.paused=!0,JU},JU.stopLearning=function(e){return ej(e),JU},JU.startLearning=function(e){return Jq(e),JU},JU.resume=async function(){return JU.params.paused?(JU.params.paused=!1,$q=!0,rj.current&&(clearInterval(rj.current),rj.current=void 0,oq=!1,aq.style.backgroundColor="",aq.style.opacity=""),await Xq(),JU):JU},JU.end=function(e=!1){return e&&(Uq=new zU.DataWindow(4),qq=0,jq=null,Hq=-1,zq=!1,JU.params.videoIsOn=!1,setTimeout((()=>{JU.stopVideo(),tq.remove()}),500)),JU},JU.stopVideo=function(){return eq.getTracks()[0].stop(),JU},JU.detectCompatibility=function(){return void 0!==(navigator.mediaDevices.getUserMedia||navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia)},JU.showVideoPreview=function(e){return JU.params.showVideoPreview=e,JU.showVideo(e&&JU.params.showVideo),JU.showFaceOverlay(e&&JU.params.showFaceOverlay),JU.showFaceFeedbackBox(e&&JU.params.showFaceFeedbackBox),JU},JU.showVideo=function(e,t=.8){return JU.params.showVideo=e,nq&&sj(nq),tq&&sj(tq),JU},JU.showFaceOverlay=function(e){return JU.params.showFaceOverlay=e,rq&&(rq.style.display=e?"block":"none"),JU},JU.showFaceFeedbackBox=function(e){return JU.params.showFaceFeedbackBox=e,iq&&(iq.style.display=e?"block":"none"),JU},JU.showPredictionPoints=function(e){return JU.params.showGazeDot=e,aq&&(aq.style.display=e?"block":"none"),JU};const rj={current:void 0};function ij(e,t){sq&&(sq.width=e,sq.height=t),rq&&(rq.width=e,rq.height=t)}JU.popPredictionPoints=function(){return rj.current&&(clearInterval(rj.current),rj.current=void 0,oq=!1),aq&&JU.params.showGazeDot&&(oq=!0,aq.style.backgroundColor="red",aq.style.opacity=1,rj.current=setInterval((()=>{aq.style.opacity-=.02,aq.style.opacity<=.02&&(clearInterval(rj.current),rj.current=void 0,oq=!1,aq.style.backgroundColor="",aq.style.opacity="")}),50)),JU},JU.saveDataAcrossSessions=function(e){return JU.params.saveDataAcrossSessions=e,JU},JU.applyKalmanFilter=function(e){return JU.params.applyKalmanFilter=e,JU},JU.setCameraConstraints=async function(e){if(JU.params.camConstraints=e,eq){JU.pause();try{eq.getVideoTracks().forEach((e=>{e.stop()}));const e=await navigator.mediaDevices.getUserMedia(JU.params.camConstraints);setTimeout((()=>{const t=e.getVideoTracks()[0].getSettings();eq=e,nq.srcObject=e,ij(t.width,t.height),JU.videoParamsToReport={height:t.height,width:t.width}}),1500)}catch(e){return}await JU.resume()}},JU.setStaticVideo=function(e){return e,JU},JU.setVideoViewerSize=function(e,t){JU.params.videoViewerWidth=e,JU.params.videoViewerHeight=t,nq.style.width=e+"px",nq.style.height=t+"px",tq.style.width=e+"px",tq.style.height=t+"px",rq.style.width=e+"px",rq.style.height=t+"px";var n=JU.computeValidationBoxSize();iq.style.top=n[0]+"px",iq.style.left=n[1]+"px",iq.style.width=n[2]+"px",iq.style.height=n[3]+"px"},JU.addMouseEventListeners=function(){return Jq(),JU},JU.removeMouseEventListeners=function(){return ej(),JU},JU.recordScreenPosition=function(e,t,n){return Zq(e,t,n||mq[0]),JU},JU.storePoints=function(e,t,n){lq[n]=e,cq[n]=t},JU.setTracker=function(e){if(void 0===wq[e]){for(var t in wq);return JU}return yq=wq[e](),JU},JU.setRegression=function(e){if(void 0===vq[e]){for(var t in vq);return JU}return kq=bq[0].getData(),(bq=[vq[e]()])[0].setData(kq),JU},JU.addTrackerModule=function(e,t){wq[e]=function(){return new t}},JU.addRegressionModule=function(e,t){vq[e]=function(){return new t}},JU.addRegression=function(e){var t=vq[e]();return kq=bq[0].getData(),t.setData(kq),bq.push(t),JU},JU.setGazeListener=function(e){return fq=e,JU},JU.clearGazeListener=function(){return fq=pq,JU},JU.setVideoElementCanvas=function(e){return sq=e},JU.clearData=async function(){!function(){for(var e in nG().clear(),bq)bq[e].init()}()},JU.getTracker=function(){return yq},JU.getRegression=function(){return bq},JU.getCurrentPrediction=async function(e=0,t=150,n=5){let s=0;const r=[],i=[];for(let e=0;et.x>=0&&t.x<=window.innerWidth?e+t.x:e),0)/i.length),l=Math.round(i.reduce(((e,t)=>t.y>=0&&t.y<=window.innerHeight?e+t.y:e),0)/i.length);return aq&&(aq.style.left=`${o}px`,aq.style.top=`${l}px`),{x:o,y:l,raw:i.map((e=>({x:QU(e.x,0),y:QU(e.y,0)})))}},JU.params.getEventTypes=function(){return mq.slice()},JU.getVideoElementCanvas=function(){return sq},JU.getVideoPreviewToCameraResolutionRatio=function(){return[JU.params.videoViewerWidth/nq.videoWidth,JU.params.videoViewerHeight/nq.videoHeight]},JU.getStoredPoints=function(){return[lq,cq]};const aj=JU;class oj{constructor(e){this.calibrator=e,this.webgazer=aj,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=ie(this.calibrator,{showIcon:!0});Q.A.fire({...t,icon:"error",iconColor:this.calibrator._CONST.COLOR.DARK_RED,showConfirmButton:!1,html:e.length?G.H.RC_errorCameraUseDenied[this.calibrator.L]:G.H.RC_errorNoCamera[this.calibrator.L]})}attachNewCallback(e){this.checkInitialized("gaze",!0)&&this.webgazer.setGazeListener((t=>{if(t){const n=this.getData(t);this.calibrator.newGazePositionData=n,(0,_.nB)(e,n)}}))}async getGazeNow(e={},t=void 0){const n=Object.assign({wait:0,frames:5},e),s=this.getData(await this.webgazer.getCurrentPrediction(0,n.wait,n.frames));return this.calibrator.newGazePositionData=s,this.webgazer.popPredictionPoints(),(0,_.nB)(t,s),s}end(){this.webgazer.end()}}oj.prototype._init=function({greedyLearner:e,framerate:t,toFixedN:n,showVideo:s,showFaceOverlay:r,showGazer:i},a){this.checkInitialized(a)||("gaze"===a&&(this.webgazer.params.greedyLearner=e,this.webgazer.params.framerate=t,this.webgazer.params.getLatestVideoFrameTimestamp=this._getLatestVideoTimestamp.bind(this),this.showGazer(i)),this._toFixedN=n,this.showVideo(s),this.showFaceOverlay(r),this._initialized[a]=!0)},oj.prototype.checkInitialized=function(e,t=!1){return!!(""===e?this._initialized.gaze||this._initialized.distance:this._initialized[e])},oj.prototype.getData=function(e){const 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}},oj.prototype.pause=function(){this.webgazer.pause()},oj.prototype.resume=function(){this.webgazer.resume()},oj.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)},oj.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=()=>{}},oj.prototype._getLatestVideoTimestamp=function(e){this.calibrator._trackingVideoFrameTimestamps.gaze=e},oj.prototype.startStoringPoints=function(){this.webgazer.params.storingPoints=!0},oj.prototype.stopStoringPoints=function(){this.webgazer.params.storingPoints=!1},oj.prototype.startLearning=function(e){this._learning||(this.webgazer.startLearning(e),this._learning=!0)},oj.prototype.stopLearning=function(e){this._learning&&(this.webgazer.stopLearning(e),this._learning=!1)},oj.prototype.showGazer=function(e){this.webgazer.showPredictionPoints(e)},oj.prototype.showVideo=function(e){this.webgazer.showVideo(e,this.calibrator._params.videoOpacity)},oj.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(),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 i={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=i),(0,_.nB)(e,i),i},E.A.prototype.performance=async function(e={},t=void 0){if(!this.checkInitialized())return;const n=Object.assign({testComputation:!0,testFrameCount:180,testObjectCount:1e4,headline:`🚀 ${G.H.RC_performanceTitle[this.L]}`,description:G.H.RC_performanceIntro[this.L]},e);this._addBackground(),this._addBackgroundText(n.headline,n.description),await(0,_.yy)(200);const s=n.testComputation?await this.performanceCompute(null,!0):{value:{computeArrayFillMHz:void 0,computeRandomMHz:void 0}},r=document.createElement("canvas"),i=r.getContext("2d");r.width=window.innerWidth,r.height=window.innerHeight,this.background.appendChild(r);const a=await lj(i),o=await cj(i,n.testFrameCount,n.testObjectCount),l={value:{computeArrayFillMHz:s.value.computeArrayFillMHz,computeRandomMHz:s.value.computeRandomMHz,idealFps:Math.round(6e4/(a.end-a.start)),stressFps:Math.round(1e3*n.testFrameCount/(o.end-o.start))},timestamp:performance.now()};return this.newPerformanceData=l,this._removeBackground(),(0,_.nB)(t,l),l};const lj=()=>{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)}))},cj=async(e,t,n)=>{let s=t;const r=[],i=["#000000","#333333","#999999"];for(let e=0;e{const n=()=>{e.clearRect(0,0,window.innerWidth,window.innerHeight),e.beginPath();for(const t of r)t.move(),t.draw(e);s--,s>0?requestAnimationFrame(n):t({start:a,end:performance.now()})};requestAnimationFrame(n)}))};class uj{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,n="original"){if(this.equipment&&!t)return(0,_.nB)(e);let s,r;this._replaceBackground(),"original"===n?(s="Do you have a ruler or tape measure?",r='\n

      \n Ideally, it should be long enough to measure your viewing distance, but even a 6 inch (15 cm) ruler can be useful. \n Please select the units you\'ll use, or indicate that no ruler or tape measure is available.\n

      \n
      \n \n \n \n
      \n '):(s=`

      ${G.H.RC_TestDistances[this.language.value].replace(/(?:\r\n|\r|\n)/g,"
      ")}

      `,r=`\n

      ${G.H.RC_rulerUnit[this.language.value].replace(/(?:\r\n|\r|\n)/g,"
      ")}

      \n
      \n \n \n \n
      \n `);const{value:i}=await Q.A.fire({...ie(this,{showIcon:!1}),title:s,html:r,preConfirm:()=>{const e=document.querySelector('input[name="equipment"]:checked');return e?e.value:(Q.A.showValidationMessage("Please select an option."),null)},didOpen:()=>{const e=document.querySelectorAll(".custom-input-class"),t=e=>{"Enter"===e.key&&Q.A.clickConfirm()};if(e.forEach((e=>{e.addEventListener("keyup",t)})),this.keypadHandler){const e=U(null,this.keypadHandler,(()=>{e(),Q.A.clickConfirm()}),!1,["return"],this)}this.customKeydownListener=t,this.customInputs=e},willClose:()=>{this.customInputs&&this.customInputs.forEach((e=>{e.removeEventListener("keyup",this.customKeydownListener)}))}});if(!i)return;const a="none"!==i,o={value:{has:a,unit:a?i:null,equipment:a?"":null,length:a?"":null},timestamp:performance.now()};return"original"!==n&&a?await hj(this,o):this.newEquipmentData=o,(0,_.nB)(e)};const hj=async(e,t)=>{const{value:n}=await Q.A.fire({...ie(e,{showIcon:!1}),title:"

      "+G.H.RC_howLong[e.language.value].replace("AAA",t.value.unit)+"

      ",input:"number",inputAttributes:{min:0,step:1},inputPlaceholder:"",inputValidator:n=>new Promise((s=>{(!n?.length||isNaN(n)||parseInt(n)<=0)&&s("Please provide a number for the length of your ruler or tape measure."),e.rulerLength=n,t.value.length=n,e.newEquipmentData=t,s()})),didOpen:()=>{const t=Q.A.getInput(),n=e=>{"Enter"===e.key&&Q.A.clickConfirm()};if(t&&t.addEventListener("keyup",n),e.keypadHandler){const t=U(null,e.keypadHandler,(()=>{t(),Q.A.clickConfirm()}),!1,["return"],void 0)}e.swalKeydownListener=n},willClose:()=>{const t=Q.A.getInput();t&&e.swalKeydownListener&&t.removeEventListener("keydown",e.swalKeydownListener)}});return n};var dj=__webpack_require__(2016),pj=__webpack_require__(980),fj=__webpack_require__.n(pj),mj=__webpack_require__(3890),gj=__webpack_require__.n(mj);E.A.prototype._checkScreenSize=async function(e,t,n){await this.getEquipment((()=>{yj(this,e,t,n)}))};const yj=async(e,t,n,s)=>{if(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(const t of e.background.getElementsByClassName("arrow-two-sided-svg"))t.remove()},{callback:()=>{},content:"Ruler is too short"}],n=await(0,dj.K)(e,...t(fj())),r=await(0,dj.K)(e,...t(gj())),i={};if(n){const t=n.value,s=e.windowWidthPx.value,r=(0,_.Nh)(2.54*s/e.screenPpi.value,1);i.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);i.vertical={...t,calibratorArrowHeightCm:s,arrowHeightPx:n}}if(i.vertical||i.horizontal){const t={value:i,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,r=[],i=(()=>{})){await this.getEquipment((()=>{}),!1,"new"),await bj(this,e,t,n,s,r,i)};const bj=async(e,t,n,s,r,i,a)=>{const o="trackDistance"===s,l=()=>{e._removeBackground(),o||(0,_.nB)(t,n,!1),a()};if(o&&(0,_.nB)(t,n,!1),e.equipment?.value?.has){if("inches"===e.equipment?.value?.unit&&(i=i.map((e=>Math.round(e/2.54)))),0===(i=i.filter((t=>t>0&&t<=e.equipment?.value?.length))).length)return void l();e._removeBackground(),e.pauseNudger(),xj(),wj(),e.calibrateTrackDistanceRequestedCm=i.map((t=>"inches"===e.equipment?.value?.unit?Math.round(2.54*t):t)),e.calibrateTrackDistanceMeasuredCm=[];for(let t=0;t
      "),!1,"","left",G.H.RC_produceDistanceTitle2[e.language.value].replace("222",s).replace("333",i.length));e._replaceBackground(r),await new Promise((t=>{document.addEventListener("keydown",(function n(s){if("Enter"===s.key){const s=e.viewingDistanceAllowedPreciseBool?e.viewingDistanceCm.value.toFixed(1):Math.round(e.viewingDistanceCm.value);e.calibrateTrackDistanceMeasuredCm.push(s),document.removeEventListener("keydown",n),t()}}));const n=U(null,e.keypadHandler,(()=>{const s=e.viewingDistanceAllowedPreciseBool?e.viewingDistanceCm.value.toFixed(1):Math.round(e.viewingDistanceCm.value);e.calibrateTrackDistanceMeasuredCm.push(s),n(),t()}),!1,["return"],e)}))}e.resumeNudger(),kj(),vj()}l()},wj=()=>{if(document.getElementById("viewing-distance-div"))return;const e=document.createElement("viewing-distance-div");e.id="calibration-trackDistance-check-viewingDistance-container",e.className="calibration-trackDistance-check-viewingDistance-container";const t=document.createElement("p");t.id="viewing-distance-p",t.className="calibration-trackDistance-check-viewingDistance";const n=document.createElement("p");n.id="calibration-trackDistance-check-viewingDistance-units",n.className="calibration-trackDistance-check-viewingDistance-units",e.appendChild(t),e.appendChild(n),document.body.appendChild(e)},vj=()=>{const e=document.getElementById("viewing-distance-p"),t=document.getElementById("calibration-trackDistance-check-viewingDistance-units"),n=document.getElementById("calibration-trackDistance-check-viewingDistance-container");e&&e.remove(),t&&t.remove(),n&&n.remove()},Aj=(e,t)=>{const n=document.getElementById("viewing-distance-p");if(!n)return;n.innerText=e;const s=document.getElementById("calibration-trackDistance-check-viewingDistance-units");s&&(s.innerText=t,((e,t)=>{const n=e.parentElement,s=n.offsetWidth,r=n.offsetHeight;let i=s;for(e.style.fontSize=`${i}px`,t.style.fontSize=.5*i+"px";(e.scrollWidth>s||t.scrollWidth>s||e.offsetHeight+t.offsetHeight>r)&&i>10;)i-=1,e.style.fontSize=`${i}px`,t.style.fontSize=.5*i+"px"})(n,s))},xj=()=>{if(document.getElementById("custom-progress-bar"))return;const e=document.createElement("div");e.id="custom-progress-bar",e.className="calibration-trackDistance-check-progessBar-container";const t=document.createElement("div");t.id="calibration-trackDistance-check-progessBar",t.className="calibration-trackDistance-check-progessBar";const n=document.createElement("p");n.id="calibration-trackDistance-check-progessBar-text",n.className="calibration-trackDistance-check-progessBar-text",e.appendChild(t),e.appendChild(n),document.body.appendChild(e)},Cj=(e,t,n)=>{const s=document.getElementById("calibration-trackDistance-check-progessBar"),r=document.getElementById("calibration-trackDistance-check-progessBar-text");if(!s||!r)return;const i=Math.min(100,Math.max(0,e));s.style.width=`${i}%`,r.innerText=`${t}/${n}`},kj=()=>{const e=document.getElementById("custom-progress-bar");e&&document.body.removeChild(e)};var Sj=__webpack_require__(7790),Ej=__webpack_require__(627),_j=__webpack_require__.n(Ej),Tj=__webpack_require__(8110),Ij=__webpack_require__.n(Tj),Nj=__webpack_require__(5072),Oj=__webpack_require__.n(Nj),Dj=__webpack_require__(7825),Rj=__webpack_require__.n(Dj),Mj=__webpack_require__(7659),Fj=__webpack_require__.n(Mj),Bj=__webpack_require__(5056),zj=__webpack_require__.n(Bj),Lj=__webpack_require__(540),Pj=__webpack_require__.n(Lj),Vj=__webpack_require__(1113),Wj=__webpack_require__.n(Vj),Gj=__webpack_require__(4636),Uj={};Uj.styleTagTransform=Wj(),Uj.setAttributes=zj(),Uj.insert=Fj().bind(null,"head"),Uj.domAPI=Rj(),Uj.insertStyleElement=Pj();Oj()(Gj.A,Uj);Gj.A&&Gj.A.locals&&Gj.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,eH(this),!0)},E.A.prototype.resetPanel=function(e=null,t=null,n=null,s=null,r=null){if(!this._panelStatus.hasPanel)return!1;const i=e||[...this._panel.panelTasks],a=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(i,t,a,o,l)):(eH(this),this.panel(i,this._panel.panelParent,a,o,l,!0))},E.A.prototype.panel=async function(e,t,n={},s=null,r=null,i=!1){if(this._panelStatus.hasPanel^i)return!1;if(!Hj(e))return!1;const a=document.querySelector(t);if(!a)return!1;const o=Object.assign({headline:G.H.RC_panelTitle[this.L],description:G.H.RC_panelIntro[this.L],showNextButton:!1,nextHeadline:G.H.RC_panelTitleNext[this.L],nextDescription:G.H.RC_panelIntroNext[this.L],nextButton:G.H.RC_panelButton[this.L],color:"#3490de",debug:!1,i18n:!0,_demoActivateAll:!1},n),l=qe(o.color).darken(20).toString();document.documentElement.style.setProperty("--rc-panel-theme-color",o.color),document.documentElement.style.setProperty("--rc-panel-darken-color",l),document.documentElement.style.setProperty("--rc-panel-theme-color-semi",`${o.color}66`),document.documentElement.style.setProperty("--rc-panel-darken-color-semi",`${l}88`);const c=document.createElement("div");c.className=c.id="rc-panel",this.LD===this._CONST.RTL?c.className+=" rc-lang-rtl":c.className+=" rc-lang-ltr",o.i18n&&(c.innerHTML+='
      '),c.innerHTML+=`

      ${o.headline}

      `,c.innerHTML+=`

      ${o.description}

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

      ${r}

      `:""}

      ${Number(t)+1}  ${G.H[qj[Qj(n)].phraseHandle][e.L]}

      ${r.length?`

      ${r} ${i}

      `:""}`,a},Kj=(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},Xj=(e,t,n)=>{if(t<640){e.classList.add("rc-panel-steps-s"),e.classList.remove("rc-panel-steps-l");for(const t of e.childNodes)t.classList.add(`rc-lang-${n.toLowerCase()}`)}else{e.classList.add("rc-panel-steps-l"),e.classList.remove("rc-panel-steps-s");for(const t of e.childNodes)t.classList.remove("rc-lang-ltr"),t.classList.remove("rc-lang-rtl")}},Zj=(e,t,n,s,r)=>{document.querySelectorAll(".rc-panel-step").forEach(((i,a)=>{const o=Number(i.dataset.index);if(s._demoActivateAll)i.onclick=()=>{e[Qj(n[a])](...Jj(n[a])),Yj(a),t.finished.push(Qj(n[a]));for(const e of n)if(!t.finished.includes(Qj(e)))return;const 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()})}},U(i,e.keypadHandler,null,!0,["return"],e);else if(o===t.index)if(i.classList.replace("rc-panel-step-inactive","rc-panel-step-active"),i.focus(),o!==n.length)o!==n.length-1||s.showNextButton?i.onclick=()=>{e[Qj(n[t.index])](...Jj(n[t.index],(()=>{Yj(t.index),t.index++,Zj(e,t,n,s,r)})))}:i.onclick=()=>{e[Qj(n[t.index])](...Jj(n[t.index],(()=>{Yj(t.index)}),r,(()=>{e._panelStatus.panelFinished=!0})))},U(i,e.keypadHandler,null,!0,["return"],e);else if(o===n.length&&s.showNextButton){const{headline:t,nextHeadline:n,description:a,nextDescription:o}=s;t!==n&&(document.querySelector("#rc-panel-title").innerHTML=n),a!==o&&(document.querySelector("#rc-panel-description").innerHTML=o),i.onclick=()=>{e._panelStatus.panelFinished=!0,(0,_.nB)(r,{timestamp:performance.now()})},U(i,e.keypadHandler,null,!0,["return"],e)}}))},Yj=e=>{const t=document.querySelectorAll(".rc-panel-step");for(const n of t)Number(n.dataset.index)===e&&(n.classList.replace("rc-panel-step-todo","rc-panel-step-finished"),n.classList.replace("rc-panel-step-active","rc-panel-step-inactive"))},Qj=e=>"string"==typeof e?e:e.name,Jj=(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},eH=e=>{e._panelStatus.panelResolveIntervals.map((e=>clearInterval(e))),e._panelStatus.panelResolveIntervals=[]},tH=(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";const 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;const 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 nH=__webpack_require__(9725),sH={};sH.styleTagTransform=Wj(),sH.setAttributes=zj(),sH.insert=Fj().bind(null,"head"),sH.domAPI=Rj(),sH.insertStyleElement=Pj();Oj()(nH.A,sH);nH.A&&nH.A.locals&&nH.A.locals;var rH=__webpack_require__(5151),iH={};iH.styleTagTransform=Wj(),iH.setAttributes=zj(),iH.insert=Fj().bind(null,"head"),iH.domAPI=Rj(),iH.insertStyleElement=Pj();Oj()(rH.A,iH);rH.A&&rH.A.locals&&rH.A.locals;var aH=__webpack_require__(2945),oH={};oH.styleTagTransform=Wj(),oH.setAttributes=zj(),oH.insert=Fj().bind(null,"head"),oH.domAPI=Rj(),oH.insertStyleElement=Pj();Oj()(aH.A,oH);aH.A&&aH.A.locals&&aH.A.locals;var lH=__webpack_require__(9057),cH={};cH.styleTagTransform=Wj(),cH.setAttributes=zj(),cH.insert=Fj().bind(null,"head"),cH.domAPI=Rj(),cH.insertStyleElement=Pj();Oj()(lH.A,cH);lH.A&&lH.A.locals&&lH.A.locals;var uH=__webpack_require__(4889),hH={};hH.styleTagTransform=Wj(),hH.setAttributes=zj(),hH.insert=Fj().bind(null,"head"),hH.domAPI=Rj(),hH.insertStyleElement=Pj();Oj()(uH.A,hH);uH.A&&uH.A.locals&&uH.A.locals;var dH=__webpack_require__(2636),pH={};pH.styleTagTransform=Wj(),pH.setAttributes=zj(),pH.insert=Fj().bind(null,"head"),pH.domAPI=Rj(),pH.insertStyleElement=Pj();Oj()(dH.A,pH);dH.A&&dH.A.locals&&dH.A.locals;var fH=__webpack_require__(2921),mH={};mH.styleTagTransform=Wj(),mH.setAttributes=zj(),mH.insert=Fj().bind(null,"head"),mH.domAPI=Rj(),mH.insertStyleElement=Pj();Oj()(fH.A,mH);fH.A&&fH.A.locals&&fH.A.locals;var gH=__webpack_require__(7271),yH={};yH.styleTagTransform=Wj(),yH.setAttributes=zj(),yH.insert=Fj().bind(null,"head"),yH.domAPI=Rj(),yH.insertStyleElement=Pj();Oj()(gH.A,yH);gH.A&&gH.A.locals&&gH.A.locals;var bH=__webpack_require__(2551),wH={};wH.styleTagTransform=Wj(),wH.setAttributes=zj(),wH.insert=Fj().bind(null,"head"),wH.domAPI=Rj(),wH.insertStyleElement=Pj();Oj()(bH.A,wH);bH.A&&bH.A.locals&&bH.A.locals;var vH=__webpack_require__(8470),AH={};AH.styleTagTransform=Wj(),AH.setAttributes=zj(),AH.insert=Fj().bind(null,"head"),AH.domAPI=Rj(),AH.insertStyleElement=Pj();Oj()(vH.A,AH);vH.A&&vH.A.locals&&vH.A.locals;var xH=__webpack_require__(2535),CH={};CH.styleTagTransform=Wj(),CH.setAttributes=zj(),CH.insert=Fj().bind(null,"head"),CH.domAPI=Rj(),CH.insertStyleElement=Pj();Oj()(xH.A,CH);xH.A&&xH.A.locals&&xH.A.locals;var kH=__webpack_require__(663),SH={};SH.styleTagTransform=Wj(),SH.setAttributes=zj(),SH.insert=Fj().bind(null,"head"),SH.domAPI=Rj(),SH.insertStyleElement=Pj();Oj()(kH.A,SH);kH.A&&kH.A.locals&&kH.A.locals;var EH=__webpack_require__(5319),_H={};_H.styleTagTransform=Wj(),_H.setAttributes=zj(),_H.insert=Fj().bind(null,"head"),_H.domAPI=Rj(),_H.insertStyleElement=Pj();Oj()(EH.A,_H);EH.A&&EH.A.locals&&EH.A.locals;var TH=__webpack_require__(290),IH={};IH.styleTagTransform=Wj(),IH.setAttributes=zj(),IH.insert=Fj().bind(null,"head"),IH.domAPI=Rj(),IH.insertStyleElement=Pj();Oj()(TH.A,IH);TH.A&&TH.A.locals&&TH.A.locals;const NH=new E.A;NH.gazeTracker=new oj(NH);const OH=NH})(),__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:()=>i});var s=n(9199);const r=(e,t,{go:n,cancel:r,custom:i},a,o=!0)=>{const l=document.createElement("div");let c,u,h;if(l.className="rc-buttons"+(o?" rc-absolute-buttons":""),l.id="rc-buttons",n&&(c=document.createElement("button"),c.className="rc-button rc-go-button",c.onclick=n,c.innerHTML=s.H.RC_ok[e],l.appendChild(c)),r&&a&&(u=document.createElement("button"),u.className="rc-button rc-cancel-button",u.onclick=r,u.innerHTML=s.H.RC_cancel[e],l.appendChild(u)),i){const{callback:e,content:t}=i;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,c,u,h]},i=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=Number.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(const t of e.children)t.remove();e.remove(),(0,_utils__WEBPACK_IMPORTED_MODULE_2__.nB)(t)},validInput=e=>e.length>0&&!e.includes(" ")&&(!Number.isNaN(e)||!Number.isNaN(e.replace(",","."))),validInputInteger=e=>!!validInput(e)&&(Number.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:()=>i,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 i(e,t="keydown"){document.body.removeEventListener(t,e)}},2646:(e,t,n)=>{"use strict";n.d(t,{G:()=>a,t:()=>r});var s=n(9199);function r(e){const t=Object.keys(s.H.EE_languageNameNative);if(t.includes(e))return i(e);const n=[];t.map((e=>{n.push(e.split("-")[0])}));const r=e.split("-")[0].toLowerCase();return n.includes(r)?i(t[n.indexOf(r)]):i("en-US")}function i(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 a(e){return"1"===s.H.EE_languageUseSpace[e]?" ":""}},477:(e,t,n)=>{"use strict";n.d(t,{l:()=>c});const s="mocha"===n(7786)._;let r,i;if(!s){const e=n(9171);r=e.Synth,i=e.Volume}class a{triggerAttackRelease(){}}const o=s?new a:new r({oscillator:{type:"sine"},envelope:{attack:.001,decay:.001,sustain:1,release:.001}}).connect(new i(-17).toDestination()),l=s?new a:new r({oscillator:{type:"sine"}}).connect(new i(-5).toDestination()),c=(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";n.d(t,{$O:()=>h,$k:()=>x,AU:()=>d,Av:()=>v,DW:()=>m,Ew:()=>p,G8:()=>w,JZ:()=>b,KY:()=>C,Md:()=>a,Nh:()=>y,Sf:()=>l,aS:()=>u,k4:()=>g,ll:()=>f,ln:()=>A,nB:()=>i,yy:()=>o});var s=n(4284),r=(n(8840),n(9199));function i(e,...t){if(e&&"function"==typeof e)return t.length?e(...t):e()}!function(){let e=0;const t=["ms","moz","webkit","o"];for(let e=0;e{};function o(e){return new Promise((t=>setTimeout(t,e)))}async function l(e="en-US",t=null){if(u())return!0;if(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)try{return await c()}catch(n){let i=!1;return t&&(t.disableKeypadHandler=!0),await s.A.fire({html:r.H.EE_FullScreenOk[e],confirmButtonText:"OK",preConfirm:async()=>{i=await c()}}),t&&(t.disableKeypadHandler=!1),i}return!1}const c=async()=>{const e=document.documentElement;return e.requestFullscreen?(await e.requestFullscreen(),!0):e.mozRequestFullScreen?(await e.mozRequestFullScreen(),!0):e.webkitRequestFullscreen?(await e.webkitRequestFullscreen(),!0):!!e.msRequestFullscreen&&(await e.msRequestFullscreen(),!0)};function u(){return null!=document.fullscreenElement||null!=document.webkitFullscreenElement||null!=document.mozFullScreenElement||null!=document.msFullscreenElement}function h(e,t=null,n=!1,s="",r=null,i=null){return`

      ${e}

      ${i?"

      "+i+"

      ":""}${t?`

      ${t}

      `:""}`}function d(e,t,n){return en?n:e}function p(e,t,n,s,r){return s+1*(e-t)/(n-t)*(r-s)}function f(e,t,n,s){return Math.sqrt((e-n)**2+(t-s)**2)}function m(e){return e&&!(e&e-1)}function g(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 y(e,t){const n=10**t;return Math.round(e*n)/n}const b=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},w=e=>e.reduce(((e,t)=>e+t))/e.length;function v(e,t,n=1){let s=0,r=0;for(;0===s;)s=Math.random();for(;0===r;)r=Math.random();let i=Math.sqrt(-2*Math.log(s))*Math.cos(2*Math.PI*r);return i=i/10+.5,i>1||i<0?i=v(e,t,n):(i=i**n,i*=t-e,i+=e),i}const A=e=>JSON.parse(JSON.stringify(e));function x(){"activeElement"in document&&document.activeElement.blur()}const C=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}}},7786:(e,t,n)=>{"use strict";n.d(t,{A:()=>w,_:()=>y});var s=n(7503),r=n.n(s),i=n(115),a=n.n(i);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"],c=["blue","bronze","fire","forest","gold","gray","green","navy","purple","red","silver","sky","yellow","neon","black","white","brown","aqua"];function u(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(u(o))+h(u(c))+h(u(l))+e.substring(e.length-3)}var p=n(782),f=n(9043),m=n(2646),g=n(9199);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._initializing=!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,needEasyEyesKeypadBeyondCm: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},this.viewingDistanceAllowedPreciseBool=!0,this.keypadHandler=null}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;const n=e[e.length-1];return t?{value:n.value[t],timestamp:n.timestamp}:n}get version(){return{value:"0.7.32"}}get supportedLanguages(){const e=[];for(const 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&&a()((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=void 0,n={easyEyesKeypadHandler:null}){if(!this._initialized&&!this._initializing){this._initializing=!0;const s=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@latest/src/i18n/phrases.js");Object.assign(g.H,t),e&&Object.assign(g.H,e)})(s.languagePhrasesJSON),s.fullscreen&&!p.Y&&await(0,f.Sf)(this.language.value,this),this._id={value:s.id,timestamp:performance.now(),date:new Date},this._environment(!0),this._displaySize(!0),this._CONST.S.AUTO===s.language?this.newLanguageData=(0,m.t)(this.userLanguage.value):this.newLanguageData=(0,m.t)(s.language),this._lang=this.language.value,this._initializing=!1,this._initialized=!0,n?.easyEyesKeypadHandler&&(this.keypadHandler=n.easyEyesKeypadHandler,this.disableKeypadHandler=!1),(0,f.nB)(t,this._id)}},b.prototype._environment=function(e=!1){if(e||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=async function(e=!0){try{if((0,f.aS)())return!0;this.newFullscreenData={value:(e&&p.Y,await(0,f.Sf)(this.language.value,this)),timestamp:performance.now()},this.isMobile.value&&window.scrollBy(0,1)}catch(e){}return 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(){const 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){const n=this.background.getElementsByClassName("calibration-instruction");for(let e=0;e{"use strict";n.d(t,{Y:()=>s});const s=!1},8840:(e,t,n)=>{"use strict"},9199:(e,t,n)=>{"use strict";n.d(t,{H:()=>r});const s=["en-US","ar","hy","bg","zh-CN","zh-HK","hr","cs","da","nl","en-UK","fi","fr","de","el","he","hi","hu","is","id","it","ja","kn","ko","lt","ms","ml","no","fa","pl","pt","ro","ru","sr","es","sw","sv","tl","tr","ur"],r={};["EE_languageNameEnglish","EE_languageNameNative","EE_languageDirection","EE_languageUseSpace","EE_phraseSource","EE_FullScreenOk","RC_cancel","RC_distanceTracking","RC_distanceTrackingCloseL","RC_distanceTrackingCloseR","RC_distanceTrackingGuide","RC_distanceTrackingIntroEnd","RC_distanceTrackingIntroStart","RC_distanceTrackingMoveCloser","RC_distanceTrackingMoveFurther","RC_rulerUnit","RC_howLong","RC_produceDistanceTitle1","RC_produceDistanceTitle2","RC_produceDistanceTitle","RC_produceDistance","RC_TestDistances","RC_canUsePhoneKeypad","RC_distanceTrackingRedo","RC_distanceTrackingTitle","RC_errorCameraUseDenied","RC_errorNoCamera","RC_gazeTracking","RC_gazeTrackingIntro","RC_gazeTrackingNudge","RC_gazeTrackingTitle","RC_nearPointIntro","RC_nearPointTitle","RC_ok","RC_panelButton","RC_panelIntro","RC_panelTitle","RC_panelTitleNext","RC_panelIntroNext","RC_panelUsesWebcam","RC_panelUsesWebcamPhone","RC_performance","RC_performanceIntro","RC_performanceTitle","RC_privacyCamera","RC_requestCamera","RC_screenSize","RC_screenSizeCredit","RC_screenSizeCreditCard","RC_screenSizeHave","RC_screenSizeIntro","RC_screenSizeTitle","RC_screenSizeUSBA","RC_screenSizeUSBC","RC_starting","RC_viewingBlindSpotCredit","RC_viewingBlindSpotRejected","RC_viewingDistance","RC_viewingDistanceIntroTitle","RC_viewingDistanceIntroLiMethod","RC_viewingDistanceTitle","T_proceed"].map((e=>{r[e]={},s.map((t=>{r[e][t]=""}))}))},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 i=[];for(const t of n){const n=t.name?t.name:t,s=document.createElement("div");s.className="rc-panel-debug-control-task-row",s.id=`rc-debugger-row-${n}`;const a=e._debuggerDefault[n];if(a){r.innerHTML+=`

      ${n}

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

      ${t}

      \n
      `,_wrapValues=(e,t)=>{for(const 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(const 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),i=n(6314),a=n.n(i)()(r());a.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=a},2636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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=a},7271:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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=a},2551:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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=a},8470:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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):where(.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):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.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):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.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):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px hsla(208,8%,47%,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{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-visible{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:0;overflow:auto;padding:1em 1.6em .3em;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,.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,.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.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/_body.scss","webpack://./node_modules/sweetalert2/src/scss/_toasts-body.scss"],names:[],mappings:"AACE,yBAOE,eCNU,CDOV,sJCuOF,CD9OE,qBAAA,CACA,yBAAA,CACA,sBAAA,CACA,kDAAA,CAEA,iBAAA,CADA,WCqPkB,CDjPlB,kBAAA,CAEA,2BACE,aAAA,CAGF,sCAGE,aC2OwB,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a},663:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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",sourceRoot:""}]);const o=a},290:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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",sourceRoot:""}]);const o=a},2945:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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;text-align:justify}#rc-distance-correct #rc-distance-correct-guide{font-size:3rem;font-weight:500;line-height:300%;text-align:justify}#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,kBAAA,CAEA,kBAAA,CAGF,gDAEE,cAAA,CADA,eAAA,CAEA,gBAAA,CACA,kBAAA,CAEA,iEAEE,2BAAA,CAEA,+BAAA,CAEA,cAAA,CAHA,eAAA,CAFA,aAAA,CAIA,qBACA",sourceRoot:""}]);const o=a},4636:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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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BAGA,CAEA,qDAEE,aAAA,CADA,YAAA,CAEA,SAAA,CAGF,kEACE,gBAAA,CAKF,wGAEE,qBAAA,CAEA,sJAEE,mBAAA,CAIJ,qDACE,kCAAA,CAIJ,kDACE,4CAAA,CAGF,kDACE,UAAA,CACA,mBAAA,CAGF,gDAEE,cAAA,CADA,SACA,CAIJ,8BAEE,YAAA,CADA,OACA,CAKF,kCAME,mCAAA,CAFA,qBAAA,CACA,iBAAA,CAHA,eAAA,CAKA,eAAA,CAJA,aAIA,CAEA,oCACE,aAAA,CAGF,8GAGE,kBAAA,CAGF,qCAEE,0BAAA,CADA,yBACA,CAGF,qCAEE,eAAA,CADA,uBAAA,CAEA,eAAA,CAEA,oBAAA,CADA,iBACA,CAGF,4DACE,wBAAA,CACA,eAAA,CAGF,+DAIE,qBAAA,CAGA,WAAA,CADA,iBAAA,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",sourceRoot:""}]);const o=a},5151:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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",sourceRoot:""}]);const o=a},5319:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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",sourceRoot:""}]);const o=a},4889:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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",sourceRoot:""}]);const o=a},9057:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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=a},9725:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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-trackDistance-check-progessBar-container{background-color:#f3f3f3;bottom:0;height:40px;left:0;position:fixed;width:100%;z-index:999999999999}.calibration-trackDistance-check-progessBar{background-color:#4caf50;height:100%;transition:width .3s ease;width:0}.calibration-trackDistance-check-progessBar-text{color:#000;font-size:30px;left:2%;margin:0;position:absolute;top:1%}.calibration-trackDistance-check-viewingDistance-container{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;line-height:1;max-width:50%;min-width:50%;position:fixed;right:0;top:0;z-index:999999999999}.calibration-trackDistance-check-viewingDistance{font-size:60vh;margin:0;text-align:center}.calibration-trackDistance-check-viewingDistance-units{font-size:30vh;margin:0;text-align:center}.calibration-instruction-left{bottom:0;left:0;margin:auto;right:50%;top:0}.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,sDAME,wBAAyB,CAJzB,QAAS,CAGT,WAAY,CAFZ,MAAO,CA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A0B,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-trackDistance-check-progessBar-container {\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 40px;\n background-color: #f3f3f3;\n z-index: 999999999999;\n}\n\n.calibration-trackDistance-check-progessBar {\n height: 100%;\n width: 0%;\n background-color: #4caf50;\n transition: width 0.3s ease;\n}\n\n.calibration-trackDistance-check-progessBar-text {\n position: absolute;\n top: 1%;\n left: 2%;\n /* transform: translate(-50%, -80%); */\n color: #000;\n font-size: 30px;\n margin: 0;\n}\n.calibration-trackDistance-check-viewingDistance-container {\n position: fixed;\n top: 0;\n right: 0;\n max-width: 50%;\n min-width: 50%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 999999999999;\n line-height: 1;\n}\n.calibration-trackDistance-check-viewingDistance {\n font-size: 60vh;\n margin: 0;\n text-align: center;\n}\n.calibration-trackDistance-check-viewingDistance-units {\n font-size: 30vh;\n margin: 0;\n text-align: center;\n}\n\n.calibration-instruction-left {\n /* use only the left half of the screen */\n left: 0;\n right: 50%;\n top: 0;\n bottom: 0;\n margin: auto;\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=a},2535:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(1354),r=n.n(s),i=n(6314),a=n.n(i)()(r());a.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}#custom-radio-group{align-items:center;display:flex;flex-direction:row}#custom-radio-group label{display:flex;flex-direction:row;margin-right:25px}#custom-radio-group input{margin-right:5px;width:auto}","",{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,CAEA,oBAGE,kBAAmB,CAFnB,YAAa,CACb,kBAEF,CAEA,0BAEE,YAAa,CACb,kBAAmB,CAFnB,iBAGF,CAGA,0BAEE,gBAAiB,CADjB,UAEF",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\n#custom-radio-group {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n#custom-radio-group label {\n margin-right: 25px;\n display: flex;\n flex-direction: row;\n}\n\n/* input inside the label */\n#custom-radio-group input {\n width: auto;\n margin-right: 5px;\n}\n"],sourceRoot:""}]);const o=a},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,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(s)for(var o=0;o0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),t.push(u))}},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),i="/*# ".concat(r," */");return[t].concat([i]).join("\n")}return[t].join("\n")}},7158:function(e){var t=function(){"use strict";var e,t,n,s,r,i,a,o,l,c,u,h,d,p,f,m,g,y,b,w,v,A,x,C="leader-line",k=1,S=2,E=3,_=4,T={top:k,right:S,bottom:E,left:_},I=1,N=2,O=3,D=4,R=5,M={straight:I,arc:N,fluid:O,magnet:D,grid:R},F="behind",B=C+"-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=[k,S,E,_],G="auto",U={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,ie=!(ne||re||!window.chrome||!window.CSS),ae=!(ne||se||re||ie||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]},ce=(v={}.toString,A={}.hasOwnProperty.toString,x=A.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&&A.call(n)===x)}),ue=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,i,a){var o,l,c,u,h,d,m,g,y,v,A,x,C,k=++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,c=e.Symbol?e.Symbol():"__cachedPathData",u=e.Symbol?e.Symbol():"__cachedNormalizedPathData",h=function(e,t,n,s,r,i,a,o,l,c){function u(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,A,x,C,k,S,E,_=(d=a,Math.PI*d/180),T=[];c?(S=c[0],E=c[1],C=c[2],k=c[3]):(e=(p=u(e,t,-_)).x,t=p.y,1<(y=(m=(e-(n=(f=u(n,s,-_)).x))/2)*m/(r*r)+(g=(t-(s=f.y))/2)*g/(i*i))&&(r*=y=Math.sqrt(y),i*=y),v=(b=r*r)*(w=i*i)-b*g*g-w*m*m,A=b*g*g+w*m*m,C=(x=(o===l?-1:1)*Math.sqrt(Math.abs(v/A)))*r*g/i+(e+n)/2,k=x*-i*m/r+(t+s)/2,S=Math.asin(parseFloat(((t-k)/i).toFixed(9))),E=Math.asin(parseFloat(((s-k)/i).toFixed(9))),e120*Math.PI/180&&(I=E,N=n,O=s,E=l&&S=n.duration&&n.count&&n.loopsLeft<=1)return i=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(i.value,!0,i.timeRatio,i.outputRatio),void(n.framesStart=null);if(s>n.duration){if(r=Math.floor(s/n.duration),n.count){if(r>=n.loopsLeft)return i=n.frames[n.lastFrame=n.reverse?0:n.frames.length-1],n.frameCallback(i.value,!0,i.timeRatio,i.outputRatio),void(n.framesStart=null);n.loopsLeft-=r}n.framesStart+=n.duration*r,s=e-n.framesStart}n.reverse&&(s=n.duration-s),i=n.frames[n.lastFrame=Math.round(s/f)],!1!==n.frameCallback(i.value,!1,i.timeRatio,i.outputRatio)?t=!0:n.framesStart=null}})),t&&(d=m.call(window,Ce))}function ke(e,t){e.framesStart=Date.now(),null!=t&&(e.framesStart-=e.duration*(e.reverse?1-t:t)),e.loopsLeft=e.count,e.lastFrame=null,Ce()}function Se(e,t){var n,s;return typeof e!=typeof t||(n=ce(e)?"obj":Array.isArray(e)?"array":"")!=(ce(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?ce(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,i=e=(e+"").trim();function a(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:k))}))),A.position_path!==x.position_path||A.position_lineStrokeWidth!==x.position_lineStrokeWidth||[0,1].some((function(e){return A.position_plugOverheadSE[e]!==x.position_plugOverheadSE[e]||(i=C[e],a=x.position_socketXYSE[e],i.x!==a.x||i.y!==a.y||i.socketId!==a.socketId)||(n=t[e],s=x.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,i,a}))){switch(e.pathList.baseVal=s=[],e.pathList.animVal=null,A.position_path){case I:s.push([F(C[0]),F(C[1])]);break;case N:d="number"==typeof t[0]&&0j?(A.position_lineStrokeWidth-j)*H:0),e.socketId===k?((i=(e.y-n.y)/2)=t.x:t.dirId===i?e.y>=t.y:e.x<=t.x}function p(e,t){return t.dirId===n||t.dirId===i?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],c[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],c[t]);rZ&&(l[i]-eZ&&(l[i]-es.outlineMax&&(t=s.outlineMax),t*=2*s.outlineBase,A=Xe(b,v.plugOutline_strokeWidthSE,e,t)||A,A=Xe(b,v.plugOutline_inStrokeWidthSE,e,v.plugOutline_colorTraSE[e]?t-oe/(v.line_strokeWidth/le.lineSize)/w.plugSizeSE[e]*2:t/2)||A)})),A)),(n.faces||he.line||he.plug||he.lineOutline||he.plugOutline)&&(he.faces=(k=(x=t).curStats,S=x.aplStats,E=x.events,_=!1,!k.line_altColor&&Xe(x,S,"line_color",C=k.line_color,E.apl_line_color)&&(x.lineFace.style.stroke=C,_=!0),Xe(x,S,"line_strokeWidth",C=k.line_strokeWidth,E.apl_line_strokeWidth)&&(x.lineShape.style.strokeWidth=C+"px",_=!0,(re||se)&&(qe(x,x.lineShape),se&&(qe(x,x.lineFace),qe(x,x.lineMaskCaps)))),Xe(x,S,"lineOutline_enabled",C=k.lineOutline_enabled,E.apl_lineOutline_enabled)&&(x.lineOutlineFace.style.display=C?"inline":"none",_=!0),k.lineOutline_enabled&&(Xe(x,S,"lineOutline_color",C=k.lineOutline_color,E.apl_lineOutline_color)&&(x.lineOutlineFace.style.stroke=C,_=!0),Xe(x,S,"lineOutline_strokeWidth",C=k.lineOutline_strokeWidth,E.apl_lineOutline_strokeWidth)&&(x.lineOutlineMaskShape.style.strokeWidth=C+"px",_=!0,se&&(qe(x,x.lineOutlineMaskCaps),qe(x,x.lineOutlineFace))),Xe(x,S,"lineOutline_inStrokeWidth",C=k.lineOutline_inStrokeWidth,E.apl_lineOutline_inStrokeWidth)&&(x.lineMaskShape.style.strokeWidth=C+"px",_=!0,se&&(qe(x,x.lineOutlineMaskCaps),qe(x,x.lineOutlineFace)))),Xe(x,S,"plug_enabled",C=k.plug_enabled,E.apl_plug_enabled)&&(x.plugsFace.style.display=C?"inline":"none",_=!0),k.plug_enabled&&[0,1].forEach((function(e){var t=k.plug_plugSE[e],n=t!==F?L[V[t]]:null,s=$e(e,n);Xe(x,S.plug_enabledSE,e,C=k.plug_enabledSE[e],E.apl_plug_enabledSE)&&(x.plugsFace.style[s.prop]=C?"url(#"+x.plugMarkerIdSE[e]+")":"none",_=!0),k.plug_enabledSE[e]&&(Xe(x,S.plug_plugSE,e,t,E.apl_plug_plugSE)&&(x.plugFaceSE[e].href.baseVal="#"+n.elmId,He(x,x.plugMarkerSE[e],s.orient,n.bBox,x.svg,x.plugMarkerShapeSE[e],x.plugsFace),_=!0,re&&qe(x,x.plugsFace)),Xe(x,S.plug_colorSE,e,C=k.plug_colorSE[e],E.apl_plug_colorSE)&&(x.plugFaceSE[e].style.fill=C,_=!0,(ie||ae||se)&&!k.line_colorTra&&qe(x,se?x.lineMaskCaps:x.capsMaskLine)),["markerWidth","markerHeight"].forEach((function(t){var n="plug_"+t+"SE";Xe(x,S[n],e,C=k[n][e],E["apl_"+n])&&(x.plugMarkerSE[e][t].baseVal.value=C,_=!0)})),Xe(x,S.plugOutline_enabledSE,e,C=k.plugOutline_enabledSE[e],E.apl_plugOutline_enabledSE)&&(C?(x.plugFaceSE[e].style.mask="url(#"+x.plugMaskIdSE[e]+")",x.plugOutlineFaceSE[e].style.display="inline"):(x.plugFaceSE[e].style.mask="none",x.plugOutlineFaceSE[e].style.display="none"),_=!0),k.plugOutline_enabledSE[e]&&(Xe(x,S.plugOutline_plugSE,e,t,E.apl_plugOutline_plugSE)&&(x.plugOutlineFaceSE[e].href.baseVal=x.plugMaskShapeSE[e].href.baseVal=x.plugOutlineMaskShapeSE[e].href.baseVal="#"+n.elmId,[x.plugMaskSE[e],x.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(x,S.plugOutline_colorSE,e,C=k.plugOutline_colorSE[e],E.apl_plugOutline_colorSE)&&(x.plugOutlineFaceSE[e].style.fill=C,_=!0,se&&(qe(x,x.lineMaskCaps),qe(x,x.lineOutlineMaskCaps))),Xe(x,S.plugOutline_strokeWidthSE,e,C=k.plugOutline_strokeWidthSE[e],E.apl_plugOutline_strokeWidthSE)&&(x.plugOutlineMaskShapeSE[e].style.strokeWidth=C+"px",_=!0),Xe(x,S.plugOutline_inStrokeWidthSE,e,C=k.plugOutline_inStrokeWidthSE[e],E.apl_plugOutline_inStrokeWidthSE)&&(x.plugMaskShapeSE[e].style.strokeWidth=C+"px",_=!0)))})),_)),(n.position||he.line||he.plug)&&(he.position=Qe(t)),(n.path||he.position)&&(he.path=(N=(T=t).curStats,O=T.aplStats,D=T.pathList.animVal||T.pathList.baseVal,R=N.path_edge,M=!1,D&&(R.x1=R.x2=D[0][0].x,R.y1=R.y2=D[0][0].y,N.path_pathData=I=Le(D,(function(e){e.xR.x2&&(R.x2=e.x),e.y>R.y2&&(R.y2=e.y)})),Ve(I,O.path_pathData)&&(T.linePath.setPathData(I),O.path_pathData=I,M=!0,se?(qe(T,T.plugsFace),qe(T,T.lineMaskCaps)):re&&qe(T,T.linePath),T.events.apl_path&&T.events.apl_path.forEach((function(e){e(T,I)})))),M)),he.viewBox=(z=(B=t).curStats,P=B.aplStats,W=z.path_edge,G=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)})),G.x=z.lineMask_x=z.lineOutlineMask_x=z.maskBGRect_x=X.x1,G.y=z.lineMask_y=z.lineOutlineMask_y=z.maskBGRect_y=X.y1,G.width=X.x2-X.x1,G.height=X.y2-X.y1,["x","y","width","height"].forEach((function(e){var t;(t=G[e])!==q[e]&&(j[e]=q[e]=t,H[U[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,ae&&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,ae&&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,ae&&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&&(ce=(te=t).curStats,ue=te.aplStats,Object.keys(e).forEach((function(t){var n=e[t],s=t+"_enabled",r=t+"_options",i=ce[r];Xe(te,ue,s,ne=ce[s])?(ne&&(ue[r]=Ee(i)),n[ne?"init":"remove"](te)):ne&&Se(i,ue[r])&&(n.remove(te),ue[s]=!0,ue[r]=Ee(i),n.init(te))}))),(ie||ae)&&he.line&&!he.path&&qe(t,t.lineShape),ie&&he.plug&&!he.line&&qe(t,t.plugsFace),je(t)}function tt(e,t){return{duration:ue(e.duration)&&0t.x2&&(t.x2=s.x2),s.y2>t.y2&&(t.y2=s.y2),["x","y"].forEach((function(n){var s,a="dropShadow_"+n;r[a]=s=t[n+"1"],Xe(e,i,a,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,i=e.pathList.baseVal,a=Pe(i),o=a.segsLen,l=a.lenAll;s.show_animId&&he.remove(s.show_animId),s.show_animId=he.add((function(e){var t,n,s,r,a=-1;if(0===e)n=[[i[0][0],i[0][0]]];else if(1===e)n=i;else{for(t=l*e,n=[];t>=o[++a];)n.push(i[a]),t-=o[a];t&&(2===(s=i[a]).length?n.push([s[0],Re(s[0],s[1],t/o[a])]):(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){Ge(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(at.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?G:Ee(e)},set:ot(t),enumerable:!0})})),[["path",M],["startSocket",T,"socketSE",0],["endSocket",T,"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(at.prototype,t,{get:function(){var e,i=null!=r?be[this._id].options[s][r]:s?be[this._id].options[s]:be[this._id].options[t];return i?Object.keys(n).some((function(t){return n[t]===i&&(e=t,!0)}))?e:new Error("It's broken"):G},set:ot(t),enumerable:!0})})),Object.keys(e).forEach((function(t){var n=e[t];Object.defineProperty(at.prototype,t,{get:function(){var e,s,r=be[this._id].options[t];return ce(r)?(e=r,s=n.optionsConf.reduce((function(t,n){var s,r=n[0],i=n[1],a=n[2],o=n[3],l=n[4],c=null!=l?e[o][l]:o?e[o]:e[i];return t[i]="id"===r?c?Object.keys(a).some((function(e){return a[e]===c&&(s=e,!0)}))?s:new Error("It's broken"):G:null==c?G:Ee(c),t}),{}),n.anim&&(s.animation=Ee(e.animation)),s):r},set:ot(t),enumerable:!0})})),["startLabel","endLabel","middleLabel"].forEach((function(e,t){Object.defineProperty(at.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})})),at.prototype.setOptions=function(e){return it(be[this._id],e),this},at.prototype.position=function(){return et(be[this._id],{position:!0}),this},at.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]},at.prototype.show=function(e,t){return nt(be[this._id],!0,e,t),this},at.prototype.hide=function(e,t){return nt(be[this._id],!1,e,t),this},i=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)})),Ue((function(){var t=ve[e._id];t&&i(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:Te}],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,i={},a=e.element,o=r.options.anchorSE["start"===t.optionName?1:0];a===o&&(a=o===document.body?new s(n.pointAnchor,[a]):document.body),i[t.optionName]=a,it(r,i)},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 ue(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(!Te(e))throw new Error("`element` must be Element");return e}},areaAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Te},{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,i,a=[];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()),ue(t.size)&&0<=t.size&&(e.size=t.size),t.dash&&(e.dash=!0,ue(t.dash.len)&&0s.right&&(s.right=n),is.bottom&&(s.bottom=i)):s={left:n,right:n,top:i,bottom:i},r?R.pathListRel.push([r,{x:n,y:i}]):R.pathListRel=[],r={x:n,y:i}})),R.pathListRel.push([]),i=R.strokeWidth/2,a=[{x:s.left-i,y:s.top-i},{x:s.right+i,y:s.bottom+i}],R.bBoxRel={left:a[0].x,top:a[0].y,right:a[1].x,bottom:a[1].y,width:a[1].x-a[0].x,height:a[1].y-a[0].y}}B.pathListRel=B.bBoxRel=!0}return(B.pathListRel||B.elementLeft||B.elementTop)&&(R.pathData=Le(R.pathListRel,(function(e){e.x+=t.left,e.y+=t.top}))),Xe(e,M,"strokeWidth",n=R.strokeWidth)&&(e.path.style.strokeWidth=n+"px"),Ve(n=R.pathData,M.pathData)&&(e.path.setPathData(n),M.pathData=n,B.pathData=!0),e.dash&&(!B.pathData&&(!B.strokeWidth||e.dashLen&&e.dashGap)||(R.dashLen=e.dashLen||2*R.strokeWidth,R.dashGap=e.dashGap||R.strokeWidth),B.dash=Xe(e,M,"dashLen",R.dashLen)||B.dash,B.dash=Xe(e,M,"dashGap",R.dashGap)||B.dash,B.dash&&(e.path.style.strokeDasharray=M.dashLen+","+M.dashGap)),I=R.viewBoxBBox,N=M.viewBoxBBox,O=e.svg.viewBox.baseVal,D=e.svg.style,I.x=R.bBoxRel.left+t.left,I.y=R.bBoxRel.top+t.top,I.width=R.bBoxRel.width,I.height=R.bBoxRel.height,["x","y","width","height"].forEach((function(t){(n=I[t])!==N[t]&&(O[t]=N[t]=n,D[U[t]]=n+("x"===t||"y"===t?e.bodyOffset[t]:0)+"px")})),B.strokeWidth||B.pathListRel||B.bBoxRel}},mouseHoverAnchor:{type:"anchor",argOptions:[{optionName:"element",type:Te},{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,i,a,o,l,c,u,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 i,a,o,c,u,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?(a=t.createElementNS(te,"defs"),h.id=s,a.appendChild(h),(c=(i=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(o=i.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+s,(u=c.style).strokeLinejoin="round",{elmPosition:h,styleText:h.style,styleFill:o.style,styleStroke:u,styleShow:i.style,elmsAppend:[a,i]}):(u=h.style,r&&(u.strokeLinejoin="round",u.paintOrder="stroke"),{elmPosition:h,styleText:u,styleFill:u,styleStroke:r?u:null,styleShow:u,elmsAppend:[h]})},getMidPoint:function(e,t){var n,s,r=Pe(e),i=r.segsLen,a=r.lenAll,o=-1,l=a/2+(t||0);if(l<=0)return 2===(n=e[0]).length?Re(n[0],n[1],0):Fe(n[0],n[1],n[2],n[3],0);if(a<=l)return 2===(n=e[e.length-1]).length?Re(n[0],n[1],1):Fe(n[0],n[1],n[2],n[3],1);for(s=[];l>i[++o];)s.push(e[o]),l-=i[o];return 2===(n=e[o]).length?Re(n[0],n[1],l/i[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,i=n.captionLabel.newText(e.text,t.baseWindow.document,t.svg,C+"-captionLabel-"+e._id,e.outlineColor);["elmPosition","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=i[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(i.styleText[t]=e[t])})),i.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),s=i.elmPosition.getBBox(),e.width=s.width,e.height=s.height,e.outlineColor&&(r=10<(r=s.height/9)?10:r<2?2:r,i.styleStroke.strokeWidth=r+"px",i.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),ae&&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),ae&&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||Ge(s,"cur_line_color",e.updateColor),e.refSocketXY?(Ge(s,"apl_position",e.updateSocketXY),e.offset||(Ge(s,"cur_attach_plugSideLenSE",e.updateSocketXY),Ge(s,"cur_line_strokeWidth",e.updateSocketXY))):Ge(s,"apl_path",e.updatePath),Ge(s,"svgShow",e.updateShow),ae&&(Ge(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",it(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",ue(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,i=e.aplStats,a=t.curStats,o=t.pathList.animVal||t.pathList.baseVal;o&&(r.pathData=s=n.pathLabel.getOffsetPathData(o,a.line_strokeWidth/2+e.strokeWidth/2+e.height/4,1.25*e.height),Ve(s,i.pathData)&&(e.elmPath.setPathData(s),i.pathData=s,e.bBox=e.elmPosition.getBBox(),e.updateStartOffset(t)))},e.updateStartOffset=function(t){var n,s,r,i,a=e.curStats,o=e.aplStats,l=t.curStats;a.pathData&&(2===e.semIndex&&!e.lineOffset||(r=a.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+=De(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),i=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,i=(i+=0===e.semIndex?n:-n)<0?0:rt?((r=s.points)[1]=Me(r[0],r[1],-t),s.len=De(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=De(r[0],r[1])):(e.points=null,e.len=0)),e):null})),i.reduce((function(e,t){var n=t.points;return n&&(r&&a(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,i,a,o,c,u,h,d,p=t.createElementNS(te,"defs"),f=p.appendChild(t.createElementNS(te,"path"));return f.id=r=n+"-path",(o=(a=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 a.style),s&&!l?(a.id=i=n+"-text",p.appendChild(a),(h=(c=t.createElementNS(te,"g")).appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+i,(u=c.appendChild(t.createElementNS(te,"use"))).href.baseVal="#"+i,(d=h.style).strokeLinejoin="round",{elmPosition:a,elmPath:f,elmOffset:o,styleText:a.style,styleFill:u.style,styleStroke:d,styleShow:c.style,elmsAppend:[p,c]}):(d=a.style,s&&(d.strokeLinejoin="round",d.paintOrder="stroke"),{elmPosition:a,elmPath:f,elmOffset:o,styleText:d,styleFill:d,styleStroke:s?d:null,styleShow:d,elmsAppend:[p,a]})},initSvg:function(e,t){var s,r,i=n.pathLabel.newText(e.text,t.baseWindow.document,C+"-pathLabel-"+e._id,e.outlineColor);["elmPosition","elmPath","elmOffset","styleFill","styleShow","elmsAppend"].forEach((function(t){e[t]=i[t]})),e.isShown=!1,e.styleShow.visibility="hidden",n.captionLabel.textStyleProps.forEach((function(t){null!=e[t]&&(i.styleText[t]=e[t])})),i.elmsAppend.forEach((function(e){t.svg.appendChild(e)})),i.elmPath.setPathData([{type:"M",values:[0,100]},{type:"h",values:[100]}]),s=i.elmPosition.getBBox(),i.styleText.textAnchor=["start","end","middle"][e.semIndex],2!==e.semIndex||e.lineOffset||i.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,i.styleStroke.strokeWidth=r+"px",i.styleStroke.stroke=e.outlineColor),e.strokeWidth=r||0,Ke(e.aplStats,n.pathLabel.stats),e.updateColor(t),e.updatePath(t),e.updateStartOffset(t),ae&&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),ae&&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||Ge(s,"cur_line_color",e.updateColor),Ge(s,"cur_line_strokeWidth",e.updatePath),Ge(s,"apl_path",e.updatePath),2===e.semIndex&&!e.lineOffset||Ge(s,"cur_attach_plugBackLenSE",e.updateStartOffset),Ge(s,"svgShow",e.updateShow),ae&&(Ge(s,"new_edge4viewBox",e.adjustEdge),et(s,{}))},removeOption:function(e,t){var n=t.props,s={};s[t.optionName]="",it(n,s)},remove:function(e){e.boundTargets.length&&e.boundTargets.forEach((function(t){n.pathLabel.unbind(e,t)}))}}},Object.keys(n).forEach((function(e){at[e]=function(){return new s(n[e],Array.prototype.slice.call(arguments))}})),at.positionByWindowResize=!0,window.addEventListener("resize",pe.add((function(){at.positionByWindowResize&&Object.keys(be).forEach((function(e){et(be[e],{position:!0})}))})),!1),at}();e.exports=t},7503:function(e,t,n){var s;e=n.nmd(e),function(){"use strict";var r={function:!0,object:!0},i=r[typeof window]&&window||this,a=r[typeof t]&&t,o=r.object&&e&&!e.nodeType&&e,l=a&&o&&"object"==typeof n.g&&n.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(i=l);var c=Math.pow(2,53)-1,u=/\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<=c)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"==G?"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",G="Windows Phone "+(/\+$/.test(o)?o:o+".x"),M.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(P="IE Mobile",G="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!=(c=n)?typeof c[h]:"number",/^(?:boolean|number|string|undefined)$/.test(d)||"object"==d&&!c[h])y(o=n.runtime)==x?(P="Adobe AIR",G=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"],G="Windows");else if(E&&(R=(o=E.lang.System).getProperty("os.arch"),G=G||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",G||(G=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",R=o.arch,G=o.platform,z=(z=/[\d.]+/.exec(o.version))?z[0]:null));G=G&&m(G)}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?I:T)+(/\d+\+?/.exec(o)||"")),"Fennec"==P||"Firefox"==P&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(G))P="Firefox Mobile";else if("Maxthon"==P&&z)z=z.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(V))"Xbox 360"==V&&(G=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"!=G&&!/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)?(G=((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(G)||"IE"==P&&(G&&!/^Win/.test(G)&&z>5.5||/\bWindows XP\b/.test(G)&&z>8||8==z&&!/\bTrident\b/.test(t)))&&!u.test(o=e.call(g,t.replace(u,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),u.test(P)?(/\bIE\b/.test(o)&&"Mac OS"==G&&(G=null),o="identify"+o):(o="mask"+o,P=D?m(D.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(G=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(G))?(P+=" ",M.unshift("desktop mode"),"zvav"==o?(P+="Mini",z=null):P+="Mobile",G=G.replace(RegExp(" *"+o+"$"),"")):"Safari"==P&&/\bChrome\b/.exec(L&&L[1])?(M.unshift("desktop mode"),P="Chrome Mobile",z=null,/\bOS X\b/.test(G)?(W="Apple",G="iOS 4.3+"):G=null):/\bSRWare Iron\b/.test(P)&&!z&&(z=q("Chrome")),z&&0==z.indexOf(o=/[\d.]+$/.exec(G))&&t.indexOf("/"+o+"-")>-1&&(G=v(G.replace(o,""))),G&&-1!=G.indexOf(P)&&!RegExp(P+" OS").test(G)&&(G=G.replace(RegExp(" *"+b(P)+" *"),"")),L&&!/\b(?:Avant|Nook)\b/.test(P)&&(/Browser|Lunascape|Maxthon/.test(P)||"Safari"!=P&&/^iOS/.test(G)&&/\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),G&&(o=/ ([\d.+]+)$/.exec(G),l=o&&"/"==G.charAt(G.length-o[0].length-1),G={architecture:32,family:o&&!l?G.replace(o[0],""):G,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(R))&&!/\bi686\b/i.test(R)?(G&&(G.architecture=64,G.family=G.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")):G&&/^OS X/.test(G.family)&&"Chrome"==P&&parseFloat(z)>=39&&(G.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=G||{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),G&&P&&(G!=String(G).split(" ")[0]||G!=P.split(" ")[0]&&!V)&&M.push(V?"("+G+")":"on "+G),M.length&&(j.description=M.join(" ")),j}();i.platform=A,void 0===(s=function(){return A}.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 i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var o,l,c,u;if(Array.isArray(e)){if((o=e.length)!=a.length)return!1;for(l=o;0!=l--;)if(!i(e[l],a[l]))return!1;return!0}if(n&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!a.has(l.value[0]))return!1;for(u=e.entries();!(l=u.next()).done;)if(!i(l.value[1],a.get(l.value[0])))return!1;return!0}if(s&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!a.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((o=e.length)!=a.length)return!1;for(l=o;0!=l--;)if(e[l]!==a[l])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof a.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof a.toString)return e.toString()===a.toString();if((o=(c=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(l=o;0!=l--;)if(!Object.prototype.hasOwnProperty.call(a,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=o;0!=l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!i(e[c[l]],a[c[l]]))return!1;return!0}return e!=e&&a!=a}e.exports=function(e,t){try{return i(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 i=n.sourceMap;i&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),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=''},4284:(e,t,n)=>{"use strict";function s(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 r(e,t){return e.get(s(e,t))}function i(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}n.d(t,{A:()=>Wn});const a={},o=e=>new Promise((t=>{if(!e)return t();const n=window.scrollX,s=window.scrollY;a.restoreFocusTimeout=setTimeout((()=>{a.previousActiveElement instanceof HTMLElement?(a.previousActiveElement.focus(),a.previousActiveElement=null):document.body&&document.body.focus(),t()}),100),window.scrollTo(n,s)})),l="swal2-",c=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=l+t,e)),{}),u=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=l+t,e)),{}),h=e=>e.charAt(0).toUpperCase()+e.slice(1),d=e=>{},p=[],f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var n;n=`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`,p.includes(n)||(p.push(n),d(n))},m=e=>"function"==typeof e?e():e,g=e=>e&&"function"==typeof e.toPromise,y=e=>g(e)?e.toPromise():Promise.resolve(e),b=e=>e&&Promise.resolve(e)===e,w=()=>document.body.querySelector(`.${c.container}`),v=e=>{const t=w();return t?t.querySelector(e):null},A=e=>v(`.${e}`),x=()=>A(c.popup),C=()=>A(c.icon),k=()=>A(c.title),S=()=>A(c["html-container"]),E=()=>A(c.image),_=()=>A(c["progress-steps"]),T=()=>A(c["validation-message"]),I=()=>v(`.${c.actions} .${c.confirm}`),N=()=>v(`.${c.actions} .${c.cancel}`),O=()=>v(`.${c.actions} .${c.deny}`),D=()=>v(`.${c.loader}`),R=()=>A(c.actions),M=()=>A(c.footer),F=()=>A(c["timer-progress-bar"]),B=()=>A(c.close),z=()=>{const e=x();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return n>s?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(r))].filter((e=>te(e)))},L=()=>W(document.body,c.shown)&&!W(document.body,c["toast-shown"])&&!W(document.body,c["no-backdrop"]),P=()=>{const e=x();return!!e&&W(e,c.toast)},V=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),s=n.querySelector("head");s&&Array.from(s.childNodes).forEach((t=>{e.appendChild(t)}));const r=n.querySelector("body");r&&Array.from(r.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},W=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{if(((e,t)=>{Array.from(e.classList).forEach((n=>{Object.values(c).includes(n)||Object.values(u).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))})(e,t),!t.customClass)return;const s=t.customClass[n];s&&("string"==typeof s||s.forEach?H(e,s):d(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof s}"`))},U=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${c.popup} > .${c[t]}`);case"checkbox":return e.querySelector(`.${c.popup} > .${c.checkbox} input`);case"radio":return e.querySelector(`.${c.popup} > .${c.radio} input:checked`)||e.querySelector(`.${c.popup} > .${c.radio} input:first-child`);case"range":return e.querySelector(`.${c.popup} > .${c.range} input`);default:return e.querySelector(`.${c.popup} > .${c.input}`)}},q=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},j=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},H=(e,t)=>{j(e,t,!0)},$=(e,t)=>{j(e,t,!1)},K=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style.setProperty(t,"number"==typeof n?`${n}px`:n):e.style.removeProperty(t)},Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},Y=e=>{e&&(e.style.display="none")},Q=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((()=>{ee(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},J=(e,t,n,s)=>{const r=e.querySelector(t);r&&r.style.setProperty(n,s)},ee=function(e,t){t?Z(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):Y(e)},te=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),ne=e=>!!(e.scrollHeight>e.clientHeight),se=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||s>0},re=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=F();n&&te(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},ie=`\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,""),ae=()=>{a.currentInstance.resetValidationMessage()},oe=e=>{const t=(()=>{const e=w();return!!e&&(e.remove(),$([document.documentElement,document.body],[c["no-backdrop"],c["toast-shown"],c["has-column"]]),!0)})();if("undefined"==typeof window||"undefined"==typeof document)return;const n=document.createElement("div");n.className=c.container,t&&H(n,c["no-transition"]),V(n,ie);const s="string"==typeof(r=e.target)?document.querySelector(r):r;var r;s.appendChild(n),(e=>{const t=x();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&H(w(),c.rtl)})(s),(()=>{const e=x(),t=K(e,c.input),n=K(e,c.file),s=e.querySelector(`.${c.range} input`),r=e.querySelector(`.${c.range} output`),i=K(e,c.select),a=e.querySelector(`.${c.checkbox} input`),o=K(e,c.textarea);t.oninput=ae,n.onchange=ae,i.onchange=ae,a.onchange=ae,o.oninput=ae,s.oninput=()=>{ae(),r.value=s.value},s.onchange=()=>{ae(),r.value=s.value}})()},le=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?ce(e,t):e&&V(t,e)},ce=(e,t)=>{e.jquery?ue(t,e):V(t,e.toString())},ue=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},he=(e,t)=>{const n=R(),s=D();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?Z(n):Y(n),G(n,t,"actions"),function(e,t,n){const s=I(),r=O(),i=N();if(!s||!r||!i)return;de(s,"confirm",n),de(r,"deny",n),de(i,"cancel",n),function(e,t,n,s){if(!s.buttonsStyling)return void $([e,t,n],c.styled);H([e,t,n],c.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,H(e,c["default-outline"]));s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,H(t,c["default-outline"]));s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,H(n,c["default-outline"]))}(s,r,i,n),n.reverseButtons&&(n.toast?(e.insertBefore(i,s),e.insertBefore(r,s)):(e.insertBefore(i,t),e.insertBefore(r,t),e.insertBefore(s,t)))}(n,s,t),V(s,t.loaderHtml||""),G(s,t,"loader"))};function de(e,t,n){const s=h(t);ee(e,n[`show${s}Button`],"inline-block"),V(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=c[t],G(e,n,`${t}Button`)}const pe=(e,t)=>{const n=w();n&&(!function(e,t){"string"==typeof t?e.style.background=t:t||H([document.documentElement,document.body],c["no-backdrop"])}(n,t.backdrop),function(e,t){if(!t)return;t in c?H(e,c[t]):(d('The "position" parameter is not valid, defaulting to "center"'),H(e,c.center))}(n,t.position),function(e,t){if(!t)return;H(e,c[`grow-${t}`])}(n,t.grow),G(n,t,"container"))};var fe={innerParams:new WeakMap,domCache:new WeakMap};const me=["input","file","range","select","radio","checkbox","textarea"],ge=e=>{if(!e.input)return;if(!Ce[e.input])return Object.keys(Ce).join(" | "),void e.input;const t=Ae(e.input);if(!t)return;const n=Ce[e.input](t,e);Z(t),e.inputAutoFocus&&setTimeout((()=>{q(n)}))},ye=(e,t)=>{const n=x();if(!n)return;const s=U(n,e);if(s){(e=>{for(let t=0;t{if(!e.input)return;const t=Ae(e.input);t&&G(t,e,"input")},we=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},ve=(e,t,n)=>{if(n.inputLabel){const s=document.createElement("label"),r=c["input-label"];s.setAttribute("for",e.id),s.className=r,"object"==typeof n.customClass&&H(s,n.customClass.inputLabel),s.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",s)}},Ae=e=>{const t=x();if(t)return K(t,c[e]||c.input)},xe=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:b(t)||d(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},Ce={};Ce.text=Ce.email=Ce.password=Ce.number=Ce.tel=Ce.url=Ce.search=Ce.date=Ce["datetime-local"]=Ce.time=Ce.week=Ce.month=(e,t)=>(xe(e,t.inputValue),ve(e,e,t),we(e,t),e.type=t.input,e),Ce.file=(e,t)=>(ve(e,e,t),we(e,t),e),Ce.range=(e,t)=>{const n=e.querySelector("input"),s=e.querySelector("output");return xe(n,t.inputValue),n.type=t.input,xe(s,t.inputValue),ve(n,e,t),e},Ce.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");V(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return ve(e,e,t),e},Ce.radio=e=>(e.textContent="",e),Ce.checkbox=(e,t)=>{const n=U(x(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const s=e.querySelector("span");return V(s,t.inputPlaceholder||t.inputLabel),n},Ce.textarea=(e,t)=>{xe(e,t.inputValue),we(e,t),ve(e,e,t);return setTimeout((()=>{if("MutationObserver"in window){const n=parseInt(window.getComputedStyle(x()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const s=e.offsetWidth+(r=e,parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight));var r;s>n?x().style.width=`${s}px`:X(x(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const ke=(e,t)=>{const n=S();n&&(Q(n),G(n,t,"htmlContainer"),t.html?(le(t.html,n),Z(n,"block")):t.text?(n.textContent=t.text,Z(n,"block")):Y(n),((e,t)=>{const n=x();if(!n)return;const s=fe.innerParams.get(e),r=!s||t.input!==s.input;me.forEach((e=>{const s=K(n,c[e]);s&&(ye(e,t.inputAttributes),s.className=c[e],r&&Y(s))})),t.input&&(r&&ge(t),be(t))})(e,t))},Se=(e,t)=>{for(const[n,s]of Object.entries(u))t.icon!==n&&$(e,s);H(e,t.icon&&u[t.icon]),Te(e,t),Ee(),G(e,t,"icon")},Ee=()=>{const e=x();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,s="";if(t.iconHtml)s=Ie(t.iconHtml);else if("success"===t.icon)s='\n
        \n \n
        \n
        \n',n=n.replace(/ style=".*?"/g,"");else if("error"===t.icon)s='\n \n \n \n \n';else if(t.icon){s=Ie({question:"?",warning:"!",info:"i"}[t.icon])}n.trim()!==s.trim()&&V(e,s)},Te=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])J(e,n,"background-color",t.iconColor);J(e,".swal2-success-ring","border-color",t.iconColor)}},Ie=e=>`
        ${e}
        `,Ne=(e,t)=>{const n=t.showClass||{};e.className=`${c.popup} ${te(e)?n.popup:""}`,t.toast?(H([document.documentElement,document.body],c["toast-shown"]),H(e,c.toast)):H(e,c.modal),G(e,t,"popup"),"string"==typeof t.customClass&&H(e,t.customClass),t.icon&&H(e,c[`icon-${t.icon}`])},Oe=e=>{const t=document.createElement("li");return H(t,c["progress-step"]),V(t,e),t},De=e=>{const t=document.createElement("li");return H(t,c["progress-step-line"]),e.progressStepsDistance&&X(t,"width",e.progressStepsDistance),t},Re=(e,t)=>{((e,t)=>{const n=w(),s=x();if(n&&s){if(t.toast){X(n,"width",t.width),s.style.width="100%";const e=D();e&&s.insertBefore(e,C())}else X(s,"width",t.width);X(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),Y(T()),Ne(s,t)}})(0,t),pe(0,t),((e,t)=>{const n=_();if(!n)return;const{progressSteps:s,currentProgressStep:r}=t;s&&0!==s.length&&void 0!==r?(Z(n),n.textContent="",r>=s.length&&d("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach(((e,i)=>{const a=Oe(e);if(n.appendChild(a),i===r&&H(a,c["active-progress-step"]),i!==s.length-1){const e=De(t);n.appendChild(e)}}))):Y(n)})(0,t),((e,t)=>{const n=fe.innerParams.get(e),s=C();if(s){if(n&&t.icon===n.icon)return _e(s,t),void Se(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(u).indexOf(t.icon))return t.icon,void Y(s);Z(s),_e(s,t),Se(s,t),H(s,t.showClass&&t.showClass.icon)}else Y(s)}})(e,t),((e,t)=>{const n=E();n&&(t.imageUrl?(Z(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),X(n,"width",t.imageWidth),X(n,"height",t.imageHeight),n.className=c.image,G(n,t,"image")):Y(n))})(0,t),((e,t)=>{const n=k();n&&(Q(n),ee(n,t.title||t.titleText,"block"),t.title&&le(t.title,n),t.titleText&&(n.innerText=t.titleText),G(n,t,"title"))})(0,t),((e,t)=>{const n=B();n&&(V(n,t.closeButtonHtml||""),G(n,t,"closeButton"),ee(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),ke(e,t),he(0,t),((e,t)=>{const n=M();n&&(Q(n),ee(n,t.footer,"block"),t.footer&&le(t.footer,n),G(n,t,"footer"))})(0,t);const n=x();"function"==typeof t.didRender&&n&&t.didRender(n),a.eventEmitter.emit("didRender",n)},Me=()=>{var e;return null===(e=I())||void 0===e?void 0:e.click()},Fe=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Be=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},ze=(e,t)=>{var n;const s=z();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=x())||void 0===n||n.focus()},Le=["ArrowRight","ArrowDown"],Pe=["ArrowLeft","ArrowUp"],Ve=(e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?We(t,e):"Tab"===t.key?Ge(t):[...Le,...Pe].includes(t.key)?Ue(t.key):"Escape"===t.key&&qe(t,e,n)))},We=(e,t)=>{if(!m(t.allowEnterKey))return;const n=U(x(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;Me(),e.preventDefault()}},Ge=e=>{const t=e.target,n=z();let s=-1;for(let e=0;e{const t=R(),n=I(),s=O(),r=N();if(!(t&&n&&s&&r))return;const i=[n,s,r];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const a=Le.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;if(o){for(let e=0;e{m(t.allowEscapeKey)&&(e.preventDefault(),n(Fe.esc))};var je={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const He=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},$e="undefined"!=typeof window&&!!window.GestureEvent,Ke=()=>{const e=w();if(!e)return;let t;e.ontouchstart=e=>{t=Xe(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},Xe=e=>{const t=e.target,n=w(),s=S();return!(!n||!s)&&(!Ze(e)&&!Ye(e)&&(t===n||!ne(n)&&t instanceof HTMLElement&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&(!ne(s)||!s.contains(t))))},Ze=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Ye=e=>e.touches&&e.touches.length>1;let Qe=null;const Je=e=>{null===Qe&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Qe=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Qe+(()=>{const e=document.createElement("div");e.className=c["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)};function et(e,t,n,s){P()?lt(e,s):(o(n).then((()=>lt(e,s))),Be(a)),$e?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),L()&&(null!==Qe&&(document.body.style.paddingRight=`${Qe}px`,Qe=null),(()=>{if(W(document.body,c.iosfix)){const e=parseInt(document.body.style.top,10);$(document.body,c.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),He()),$([document.documentElement,document.body],[c.shown,c["height-auto"],c["no-backdrop"],c["toast-shown"]])}function tt(e){e=it(e);const t=je.swalPromiseResolve.get(this),n=nt(this);this.isAwaitingPromise?e.isDismissed||(rt(this),t(e)):n&&t(e)}const nt=e=>{const t=x();if(!t)return!1;const n=fe.innerParams.get(e);if(!n||W(t,n.hideClass.popup))return!1;$(t,n.showClass.popup),H(t,n.hideClass.popup);const s=w();return $(s,n.showClass.backdrop),H(s,n.hideClass.backdrop),at(e,t,n),!0};function st(e){const t=je.swalPromiseReject.get(this);rt(this),t&&t(e)}const rt=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,fe.innerParams.get(e)||e._destroy())},it=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),at=(e,t,n)=>{var s;const r=w(),i=se(t);"function"==typeof n.willClose&&n.willClose(t),null===(s=a.eventEmitter)||void 0===s||s.emit("willClose",t),i?ot(e,t,r,n.returnFocus,n.didClose):et(e,r,n.returnFocus,n.didClose)},ot=(e,t,n,s,r)=>{a.swalCloseEventFinishedCallback=et.bind(null,e,n,s,r);const i=function(e){var n;e.target===t&&(null===(n=a.swalCloseEventFinishedCallback)||void 0===n||n.call(a),delete a.swalCloseEventFinishedCallback,t.removeEventListener("animationend",i),t.removeEventListener("transitionend",i))};t.addEventListener("animationend",i),t.addEventListener("transitionend",i)},lt=(e,t)=>{setTimeout((()=>{var n;"function"==typeof t&&t.bind(e.params)(),null===(n=a.eventEmitter)||void 0===n||n.emit("didClose"),e._destroy&&e._destroy()}))},ct=e=>{let t=x();if(t||new Wn,t=x(),!t)return;const n=D();P()?Y(C()):ut(t,e),Z(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},ut=(e,t)=>{const n=R(),s=D();n&&s&&(!t&&te(I())&&(t=I()),Z(n),t&&(Y(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),H([e,n],c.loading))},ht=e=>e.checked?1:0,dt=e=>e.checked?e.value:null,pt=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,ft=(e,t)=>{const n=x();if(!n)return;const s=e=>{"select"===t.input?function(e,t,n){const s=K(e,c.select);if(!s)return;const r=(e,t,s)=>{const r=document.createElement("option");r.value=s,V(r,t),r.selected=yt(s,n.inputValue),e.appendChild(r)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,s.appendChild(e),n.forEach((t=>r(e,t[1],t[0])))}else r(s,n,t)})),s.focus()}(n,gt(e),t):"radio"===t.input&&function(e,t,n){const s=K(e,c.radio);if(!s)return;t.forEach((e=>{const t=e[0],r=e[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=c.radio,i.value=t,yt(t,n.inputValue)&&(i.checked=!0);const o=document.createElement("span");V(o,r),o.className=c.label,a.appendChild(i),a.appendChild(o),s.appendChild(a)}));const r=s.querySelectorAll("input");r.length&&r[0].focus()}(n,gt(e),t)};g(t.inputOptions)||b(t.inputOptions)?(ct(I()),y(t.inputOptions).then((t=>{e.hideLoading(),s(t)}))):"object"==typeof t.inputOptions?s(t.inputOptions):t.inputOptions},mt=(e,t)=>{const n=e.getInput();n&&(Y(n),y(t.inputValue).then((s=>{n.value="number"===t.input?`${parseFloat(s)||0}`:`${s}`,Z(n),n.focus(),e.hideLoading()})).catch((t=>{n.value="",Z(n),n.focus(),e.hideLoading()})))};const gt=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let s=e;"object"==typeof s&&(s=gt(s)),t.push([n,s])})):Object.keys(e).forEach((n=>{let s=e[n];"object"==typeof s&&(s=gt(s)),t.push([n,s])})),t},yt=(e,t)=>!!t&&t.toString()===e.toString(),bt=(e,t)=>{const n=fe.innerParams.get(e);if(!n.input)return void h(t);const s=e.getInput(),r=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return ht(n);case"radio":return dt(n);case"file":return pt(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,n);n.inputValidator?wt(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?vt(e,r):Ct(e,r)},wt=(e,t,n)=>{const s=fe.innerParams.get(e);e.disableInput();Promise.resolve().then((()=>y(s.inputValidator(t,s.validationMessage)))).then((s=>{e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?vt(e,t):Ct(e,t)}))},vt=(e,t)=>{const n=fe.innerParams.get(e||void 0);if(n.showLoaderOnDeny&&ct(O()),n.preDeny){e.isAwaitingPromise=!0;Promise.resolve().then((()=>y(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),rt(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>xt(e||void 0,t)))}else e.close({isDenied:!0,value:t})},At=(e,t)=>{e.close({isConfirmed:!0,value:t})},xt=(e,t)=>{e.rejectPromise(t)},Ct=(e,t)=>{const n=fe.innerParams.get(e||void 0);if(n.showLoaderOnConfirm&&ct(),n.preConfirm){e.resetValidationMessage(),e.isAwaitingPromise=!0;Promise.resolve().then((()=>y(n.preConfirm(t,n.validationMessage)))).then((n=>{te(T())||!1===n?(e.hideLoading(),rt(e)):At(e,void 0===n?t:n)})).catch((t=>xt(e||void 0,t)))}else At(e,t)};function kt(){const e=fe.innerParams.get(this);if(!e)return;const t=fe.domCache.get(this);Y(t.loader),P()?e.icon&&Z(C()):St(t),$([t.popup,t.actions],c.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const St=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Z(t[0],"inline-block"):te(I())||te(O())||te(N())||Y(e.actions)};function Et(){const e=fe.innerParams.get(this),t=fe.domCache.get(this);return t?U(t.popup,e.input):null}function _t(e,t,n){const s=fe.domCache.get(e);t.forEach((e=>{s[e].disabled=n}))}function Tt(e,t){const n=x();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${c.radio}"]`);for(let n=0;nObject.prototype.hasOwnProperty.call(Ft,e),Vt=e=>-1!==Bt.indexOf(e),Wt=e=>zt[e],Gt=e=>{Pt(e)||d(`Unknown parameter "${e}"`)},Ut=e=>{Lt.includes(e)&&d(`The parameter "${e}" is incompatible with toasts`)},qt=e=>{const t=Wt(e);t&&f(e,t)};function jt(e){const t=x(),n=fe.innerParams.get(this);if(!t||W(t,n.hideClass.popup))return void d("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const s=Ht(e),r=Object.assign({},n,s);Re(this,r),fe.innerParams.set(this,r),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Ht=e=>{const t={};return Object.keys(e).forEach((n=>{Vt(n)?t[n]=e[n]:d(`Invalid parameter to update: ${n}`)})),t};function $t(){const e=fe.domCache.get(this),t=fe.innerParams.get(this);t?(e.popup&&a.swalCloseEventFinishedCallback&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),a.eventEmitter.emit("didDestroy"),Kt(this)):Xt(this)}const Kt=e=>{Xt(e),delete e.params,delete a.keydownHandler,delete a.keydownTarget,delete a.currentInstance},Xt=e=>{e.isAwaitingPromise?(Zt(fe,e),e.isAwaitingPromise=!0):(Zt(je,e),Zt(fe,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},Zt=(e,t)=>{for(const n in e)e[n].delete(t)};var Yt=Object.freeze({__proto__:null,_destroy:$t,close:tt,closeModal:tt,closePopup:tt,closeToast:tt,disableButtons:Nt,disableInput:Dt,disableLoading:kt,enableButtons:It,enableInput:Ot,getInput:Et,handleAwaitingPromise:rt,hideLoading:kt,rejectPromise:st,resetValidationMessage:Mt,showValidationMessage:Rt,update:jt});const Qt=(e,t,n)=>{t.popup.onclick=()=>{e&&(Jt(e)||e.timer||e.input)||n(Fe.close)}},Jt=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let en=!1;const tn=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(en=!0)}}},nn=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(en=!0)}}},sn=(e,t,n)=>{t.container.onclick=s=>{en?en=!1:s.target===t.container&&m(e.allowOutsideClick)&&n(Fe.backdrop)}},rn=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const an=()=>{if(a.timeout)return(()=>{const e=F();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`})(),a.timeout.stop()},on=()=>{if(a.timeout){const e=a.timeout.start();return re(e),e}};let ln=!1;const cn={};const un=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in cn){const n=t.getAttribute(e);if(n)return void cn[e].fire({template:n})}};a.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const s=function(){n.removeListener(e,s);for(var r=arguments.length,i=new Array(r),a=0;a1?t-1:0),s=1;s{try{e.apply(this,n)}catch(e){}}))}removeListener(e,t){const n=this._getHandlersByEventName(e),s=n.indexOf(t);s>-1&&n.splice(s,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var hn=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||rn(e[0])?["title","html","icon"].forEach(((n,s)=>{const r=e[s];("string"==typeof r||rn(r))&&(t[n]=r)})):Object.assign(t,e[0]),t},bindClickHandler:function(){cn[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,ln||(document.body.addEventListener("click",un),ln=!0)},clickCancel:()=>{var e;return null===(e=N())||void 0===e?void 0:e.click()},clickConfirm:Me,clickDeny:()=>{var e;return null===(e=O())||void 0===e?void 0:e.click()},enableLoading:ct,fire:function(){for(var e=arguments.length,t=new Array(e),n=0;nA(c["icon-content"]),getImage:E,getInputLabel:()=>A(c["input-label"]),getLoader:D,getPopup:x,getProgressSteps:_,getTimerLeft:()=>a.timeout&&a.timeout.getTimerLeft(),getTimerProgressBar:F,getTitle:k,getValidationMessage:T,increaseTimer:e=>{if(a.timeout){const t=a.timeout.increase(e);return re(t,!0),t}},isDeprecatedParameter:Wt,isLoading:()=>{const e=x();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!(!a.timeout||!a.timeout.isRunning()),isUpdatableParameter:Vt,isValidParameter:Pt,isVisible:()=>te(x()),mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},off:(e,t)=>{e?t?a.eventEmitter.removeListener(e,t):a.eventEmitter.removeAllListeners(e):a.eventEmitter.reset()},on:(e,t)=>{a.eventEmitter.on(e,t)},once:(e,t)=>{a.eventEmitter.once(e,t)},resumeTimer:on,showLoading:ct,stopTimer:an,toggleTimer:()=>{const e=a.timeout;return e&&(e.running?an():on())}});class dn{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const pn=["swal-title","swal-html","swal-footer"],fn=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{xn(e,["name","value"]);const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]="boolean"==typeof Ft[n]?"false"!==s:"object"==typeof Ft[n]?JSON.parse(s):s)})),t},mn=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]=new Function(`return ${s}`)())})),t},gn=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{xn(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t[`${n}ButtonText`]=e.innerHTML,t[`show${h(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label")))})),t},yn=e=>{const t={},n=e.querySelector("swal-image");return n&&(xn(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t},bn=e=>{const t={},n=e.querySelector("swal-icon");return n&&(xn(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},wn=e=>{const t={},n=e.querySelector("swal-input");n&&(xn(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")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((e=>{xn(e,["value"]);const n=e.getAttribute("value");if(!n)return;const s=e.innerHTML;t.inputOptions[n]=s}))),t},vn=(e,t)=>{const n={};for(const s in t){const r=t[s],i=e.querySelector(r);i&&(xn(i,[]),n[r.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},An=e=>{const t=pn.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||d(`Unrecognized element <${n}>`)}))},xn=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&d([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,""+(t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element.")])}))},Cn=e=>{const t=w(),n=x();"function"==typeof e.willOpen&&e.willOpen(n),a.eventEmitter.emit("willOpen",n);const s=window.getComputedStyle(document.body).overflowY;_n(t,n,e),setTimeout((()=>{Sn(t,n)}),10),L()&&(En(t,e.scrollbarPadding,s),(()=>{const e=w();Array.from(document.body.children).forEach((t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))}))})()),P()||a.previousActiveElement||(a.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(n))),a.eventEmitter.emit("didOpen",n),$(t,c["no-transition"])},kn=e=>{const t=x();if(e.target!==t)return;const n=w();t.removeEventListener("animationend",kn),t.removeEventListener("transitionend",kn),n.style.overflowY="auto"},Sn=(e,t)=>{se(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",kn),t.addEventListener("transitionend",kn)):e.style.overflowY="auto"},En=(e,t,n)=>{(()=>{if($e&&!W(document.body,c.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",H(document.body,c.iosfix),Ke()}})(),t&&"hidden"!==n&&Je(n),setTimeout((()=>{e.scrollTop=0}))},_n=(e,t,n)=>{H(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),Z(t,"grid"),setTimeout((()=>{H(t,n.showClass.popup),t.style.removeProperty("opacity")}),10)):Z(t,"grid"),H([document.documentElement,document.body],c.shown),n.heightAuto&&n.backdrop&&!n.toast&&H([document.documentElement,document.body],c["height-auto"])};var Tn={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^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 In(e){!function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=Tn.email),"url"===e.input&&(e.inputValidator=Tn.url))}(e),e.showLoaderOnConfirm&&!e.preConfirm&&d("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"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(d('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
        ")),oe(e)}let Nn;var On=new WeakMap;class Dn{constructor(){if(i(this,On,void 0),"undefined"==typeof window)return;Nn=this;for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if((e=>{!1===e.backdrop&&e.allowOutsideClick&&d('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Gt(t),e.toast&&Ut(t),qt(t)})(Object.assign({},t,e)),a.currentInstance){const e=je.swalPromiseResolve.get(a.currentInstance),{isAwaitingPromise:t}=a.currentInstance;a.currentInstance._destroy(),t||e({isDismissed:!0}),L()&&He()}a.currentInstance=Nn;const n=Mn(e,t);In(n),Object.freeze(n),a.timeout&&(a.timeout.stop(),delete a.timeout),clearTimeout(a.restoreFocusTimeout);const s=Fn(Nn);return Re(Nn,n),fe.innerParams.set(Nn,n),Rn(Nn,s,n)}then(e){return r(On,this).then(e)}finally(e){return r(On,this).finally(e)}}const Rn=(e,t,n)=>new Promise(((s,r)=>{const i=t=>{e.close({isDismissed:!0,dismiss:t})};je.swalPromiseResolve.set(e,s),je.swalPromiseReject.set(e,r),t.confirmButton.onclick=()=>{(e=>{const t=fe.innerParams.get(e);e.disableButtons(),t.input?bt(e,"confirm"):Ct(e,!0)})(e)},t.denyButton.onclick=()=>{(e=>{const t=fe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?bt(e,"deny"):vt(e,!1)})(e)},t.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Fe.cancel)})(e,i)},t.closeButton.onclick=()=>{i(Fe.close)},((e,t,n)=>{e.toast?Qt(e,t,n):(tn(t),nn(t),sn(e,t,n))})(n,t,i),((e,t,n)=>{Be(e),t.toast||(e.keydownHandler=e=>Ve(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:x(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)})(a,n,i),((e,t)=>{"select"===t.input||"radio"===t.input?ft(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(g(t.inputValue)||b(t.inputValue))&&(ct(I()),mt(e,t))})(e,n),Cn(n),Bn(a,n,i),zn(t,n),setTimeout((()=>{t.container.scrollTop=0}))})),Mn=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return An(n),Object.assign(fn(n),mn(n),gn(n),yn(n),bn(n),wn(n),vn(n,pn))})(e),s=Object.assign({},Ft,t,n,e);return s.showClass=Object.assign({},Ft.showClass,s.showClass),s.hideClass=Object.assign({},Ft.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},Fn=e=>{const t={popup:x(),container:w(),actions:R(),confirmButton:I(),denyButton:O(),cancelButton:N(),loader:D(),closeButton:B(),validationMessage:T(),progressSteps:_()};return fe.domCache.set(e,t),t},Bn=(e,t,n)=>{const s=F();Y(s),t.timer&&(e.timeout=new dn((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(Z(s),G(s,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&re(t.timer)}))))},zn=(e,t)=>{if(!t.toast)return m(t.allowEnterKey)?void(Ln(e)||Pn(e,t)||ze(-1,1)):(f("allowEnterKey"),void Vn())},Ln=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&te(e))return e.focus(),!0;return!1},Pn=(e,t)=>t.focusDeny&&te(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&te(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!te(e.confirmButton))&&(e.confirmButton.focus(),!0),Vn=()=>{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)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const 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((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}Dn.prototype.disableButtons=Nt,Dn.prototype.enableButtons=It,Dn.prototype.getInput=Et,Dn.prototype.disableInput=Dt,Dn.prototype.enableInput=Ot,Dn.prototype.hideLoading=kt,Dn.prototype.disableLoading=kt,Dn.prototype.showValidationMessage=Rt,Dn.prototype.resetValidationMessage=Mt,Dn.prototype.close=tt,Dn.prototype.closePopup=tt,Dn.prototype.closeModal=tt,Dn.prototype.closeToast=tt,Dn.prototype.rejectPromise=st,Dn.prototype.update=jt,Dn.prototype._destroy=$t,Object.assign(Dn,hn),Object.keys(Yt).forEach((e=>{Dn[e]=function(){return Nn&&Nn[e]?Nn[e](...arguments):null}})),Dn.DismissReason=Fe,Dn.version="11.14.5";const Wn=Dn;Wn.default=Wn,"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:hsl(0,0%,33%);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):where(.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):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.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):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.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):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{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-visible{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:0;padding:1em 1.6em .3em;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 hsl(0,0%,85%);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:hsl(0,0%,94%);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:rgb(249.95234375,205.965625,167.74765625);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:rgb(156.7033492823,224.2822966507,246.2966507177);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:rgb(200.8064516129,217.9677419355,225.1935483871);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,.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,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.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){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n(t,n){return t.get(e(t,n))}function s(e,n,s){t(e,n),n.set(e,s)}function r(t,n,s){return t.set(e(t,n),s),s}const i=100,a={},o=()=>{a.previousActiveElement instanceof HTMLElement?(a.previousActiveElement.focus(),a.previousActiveElement=null):document.body&&document.body.focus()},l=e=>new Promise((t=>{if(!e)return t();const n=window.scrollX,s=window.scrollY;a.restoreFocusTimeout=setTimeout((()=>{o(),t()}),i),window.scrollTo(n,s)})),c="swal2-",u=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=c+t,e)),{}),h=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=c+t,e)),{}),d=e=>e.charAt(0).toUpperCase()+e.slice(1),p=e=>{},f=e=>{},m=[],g=e=>{m.includes(e)||(m.push(e),p(e))},y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;g(`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`)},b=e=>"function"==typeof e?e():e,w=e=>e&&"function"==typeof e.toPromise,v=e=>w(e)?e.toPromise():Promise.resolve(e),A=e=>e&&Promise.resolve(e)===e,x=()=>document.body.querySelector(`.${u.container}`),C=e=>{const t=x();return t?t.querySelector(e):null},k=e=>C(`.${e}`),S=()=>k(u.popup),E=()=>k(u.icon),_=()=>k(u["icon-content"]),T=()=>k(u.title),I=()=>k(u["html-container"]),N=()=>k(u.image),O=()=>k(u["progress-steps"]),D=()=>k(u["validation-message"]),R=()=>C(`.${u.actions} .${u.confirm}`),M=()=>C(`.${u.actions} .${u.cancel}`),F=()=>C(`.${u.actions} .${u.deny}`),B=()=>k(u["input-label"]),z=()=>C(`.${u.loader}`),L=()=>k(u.actions),P=()=>k(u.footer),V=()=>k(u["timer-progress-bar"]),W=()=>k(u.close),G='\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n',U=()=>{const e=S();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return n>s?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(r))].filter((e=>ce(e)))},q=()=>K(document.body,u.shown)&&!K(document.body,u["toast-shown"])&&!K(document.body,u["no-backdrop"]),j=()=>{const e=S();return!!e&&K(e,u.toast)},H=()=>{const e=S();return!!e&&e.hasAttribute("data-loading")},$=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),s=n.querySelector("head");s&&Array.from(s.childNodes).forEach((t=>{e.appendChild(t)}));const r=n.querySelector("body");r&&Array.from(r.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},K=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{Array.from(e.classList).forEach((n=>{Object.values(u).includes(n)||Object.values(h).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))},Z=(e,t,n)=>{if(X(e,t),!t.customClass)return;const s=t.customClass[n];s&&("string"==typeof s||s.forEach?ee(e,s):p(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof s}"`))},Y=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${u.popup} > .${u[t]}`);case"checkbox":return e.querySelector(`.${u.popup} > .${u.checkbox} input`);case"radio":return e.querySelector(`.${u.popup} > .${u.radio} input:checked`)||e.querySelector(`.${u.popup} > .${u.radio} input:first-child`);case"range":return e.querySelector(`.${u.popup} > .${u.range} input`);default:return e.querySelector(`.${u.popup} > .${u.input}`)}},Q=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},J=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},ee=(e,t)=>{J(e,t,!0)},te=(e,t)=>{J(e,t,!1)},ne=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style.setProperty(t,"number"==typeof n?`${n}px`:n):e.style.removeProperty(t)},re=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},ie=e=>{e&&(e.style.display="none")},ae=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver((()=>{le(e,e.innerHTML,t)})).observe(e,{childList:!0,subtree:!0})},oe=(e,t,n,s)=>{const r=e.querySelector(t);r&&r.style.setProperty(n,s)},le=function(e,t){t?re(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):ie(e)},ce=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),ue=()=>!ce(R())&&!ce(F())&&!ce(M()),he=e=>!!(e.scrollHeight>e.clientHeight),de=e=>{const 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){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=V();n&&ce(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},fe=()=>{const e=V();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`},me=()=>"undefined"==typeof window||"undefined"==typeof document,ge=`\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,""),ye=()=>{const e=x();return!!e&&(e.remove(),te([document.documentElement,document.body],[u["no-backdrop"],u["toast-shown"],u["has-column"]]),!0)},be=()=>{a.currentInstance.resetValidationMessage()},we=()=>{const e=S(),t=ne(e,u.input),n=ne(e,u.file),s=e.querySelector(`.${u.range} input`),r=e.querySelector(`.${u.range} output`),i=ne(e,u.select),a=e.querySelector(`.${u.checkbox} input`),o=ne(e,u.textarea);t.oninput=be,n.onchange=be,i.onchange=be,a.onchange=be,o.oninput=be,s.oninput=()=>{be(),r.value=s.value},s.onchange=()=>{be(),r.value=s.value}},ve=e=>"string"==typeof e?document.querySelector(e):e,Ae=e=>{const t=S();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},xe=e=>{"rtl"===window.getComputedStyle(e).direction&&ee(x(),u.rtl)},Ce=e=>{const t=ye();if(me())return void f("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=u.container,t&&ee(n,u["no-transition"]),$(n,ge);const s=ve(e.target);s.appendChild(n),Ae(e),xe(s),we()},ke=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?Se(e,t):e&&$(t,e)},Se=(e,t)=>{e.jquery?Ee(t,e):$(t,e.toString())},Ee=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},_e=(e,t)=>{const n=L(),s=z();n&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?re(n):ie(n),Z(n,t,"actions"),Te(n,s,t),$(s,t.loaderHtml||""),Z(s,t,"loader"))};function Te(e,t,n){const s=R(),r=F(),i=M();s&&r&&i&&(Ne(s,"confirm",n),Ne(r,"deny",n),Ne(i,"cancel",n),Ie(s,r,i,n),n.reverseButtons&&(n.toast?(e.insertBefore(i,s),e.insertBefore(r,s)):(e.insertBefore(i,t),e.insertBefore(r,t),e.insertBefore(s,t))))}function Ie(e,t,n,s){s.buttonsStyling?(ee([e,t,n],u.styled),s.confirmButtonColor&&(e.style.backgroundColor=s.confirmButtonColor,ee(e,u["default-outline"])),s.denyButtonColor&&(t.style.backgroundColor=s.denyButtonColor,ee(t,u["default-outline"])),s.cancelButtonColor&&(n.style.backgroundColor=s.cancelButtonColor,ee(n,u["default-outline"]))):te([e,t,n],u.styled)}function Ne(e,t,n){const s=d(t);le(e,n[`show${s}Button`],"inline-block"),$(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=u[t],Z(e,n,`${t}Button`)}const Oe=(e,t)=>{const n=W();n&&($(n,t.closeButtonHtml||""),Z(n,t,"closeButton"),le(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},De=(e,t)=>{const n=x();n&&(Re(n,t.backdrop),Me(n,t.position),Fe(n,t.grow),Z(n,t,"container"))};function Re(e,t){"string"==typeof t?e.style.background=t:t||ee([document.documentElement,document.body],u["no-backdrop"])}function Me(e,t){t&&(t in u?ee(e,u[t]):(p('The "position" parameter is not valid, defaulting to "center"'),ee(e,u.center)))}function Fe(e,t){t&&ee(e,u[`grow-${t}`])}var Be={innerParams:new WeakMap,domCache:new WeakMap};const ze=["input","file","range","select","radio","checkbox","textarea"],Le=(e,t)=>{const n=S();if(!n)return;const s=Be.innerParams.get(e),r=!s||t.input!==s.input;ze.forEach((e=>{const s=ne(n,u[e]);s&&(We(e,t.inputAttributes),s.className=u[e],r&&ie(s))})),t.input&&(r&&Pe(t),Ge(t))},Pe=e=>{if(!e.input)return;if(!$e[e.input])return void f(`Unexpected type of input! Expected ${Object.keys($e).join(" | ")}, got "${e.input}"`);const t=je(e.input);if(!t)return;const n=$e[e.input](t,e);re(t),e.inputAutoFocus&&setTimeout((()=>{Q(n)}))},Ve=e=>{for(let t=0;t{const n=S();if(!n)return;const s=Y(n,e);if(s){Ve(s);for(const e in t)s.setAttribute(e,t[e])}},Ge=e=>{if(!e.input)return;const t=je(e.input);t&&Z(t,e,"input")},Ue=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},qe=(e,t,n)=>{if(n.inputLabel){const s=document.createElement("label"),r=u["input-label"];s.setAttribute("for",e.id),s.className=r,"object"==typeof n.customClass&&ee(s,n.customClass.inputLabel),s.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",s)}},je=e=>{const t=S();if(t)return ne(t,u[e]||u.input)},He=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:A(t)||p(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},$e={};$e.text=$e.email=$e.password=$e.number=$e.tel=$e.url=$e.search=$e.date=$e["datetime-local"]=$e.time=$e.week=$e.month=(e,t)=>(He(e,t.inputValue),qe(e,e,t),Ue(e,t),e.type=t.input,e),$e.file=(e,t)=>(qe(e,e,t),Ue(e,t),e),$e.range=(e,t)=>{const n=e.querySelector("input"),s=e.querySelector("output");return He(n,t.inputValue),n.type=t.input,He(s,t.inputValue),qe(n,e,t),e},$e.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");$(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return qe(e,e,t),e},$e.radio=e=>(e.textContent="",e),$e.checkbox=(e,t)=>{const n=Y(S(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const s=e.querySelector("span");return $(s,t.inputPlaceholder||t.inputLabel),n},$e.textarea=(e,t)=>{He(e,t.inputValue),Ue(e,t),qe(e,e,t);const n=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);return setTimeout((()=>{if("MutationObserver"in window){const s=parseInt(window.getComputedStyle(S()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const r=e.offsetWidth+n(e);r>s?S().style.width=`${r}px`:se(S(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const Ke=(e,t)=>{const n=I();n&&(ae(n),Z(n,t,"htmlContainer"),t.html?(ke(t.html,n),re(n,"block")):t.text?(n.textContent=t.text,re(n,"block")):ie(n),Le(e,t))},Xe=(e,t)=>{const n=P();n&&(ae(n),le(n,t.footer,"block"),t.footer&&ke(t.footer,n),Z(n,t,"footer"))},Ze=(e,t)=>{const n=Be.innerParams.get(e),s=E();if(s){if(n&&t.icon===n.icon)return tt(s,t),void Ye(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(h).indexOf(t.icon))return f(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void ie(s);re(s),tt(s,t),Ye(s,t),ee(s,t.showClass&&t.showClass.icon)}else ie(s)}},Ye=(e,t)=>{for(const[n,s]of Object.entries(h))t.icon!==n&&te(e,s);ee(e,t.icon&&h[t.icon]),nt(e,t),Qe(),Z(e,t,"icon")},Qe=()=>{const e=S();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e\n \n
          \n
          \n',et='\n \n \n \n \n',tt=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,s="";t.iconHtml?s=st(t.iconHtml):"success"===t.icon?(s=Je,n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?s=et:t.icon&&(s=st({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==s.trim()&&$(e,s)},nt=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])oe(e,n,"background-color",t.iconColor);oe(e,".swal2-success-ring","border-color",t.iconColor)}},st=e=>`
          ${e}
          `,rt=(e,t)=>{const n=N();n&&(t.imageUrl?(re(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),se(n,"width",t.imageWidth),se(n,"height",t.imageHeight),n.className=u.image,Z(n,t,"image")):ie(n))},it=(e,t)=>{const n=x(),s=S();if(n&&s){if(t.toast){se(n,"width",t.width),s.style.width="100%";const e=z();e&&s.insertBefore(e,E())}else se(s,"width",t.width);se(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),ie(D()),at(s,t)}},at=(e,t)=>{const n=t.showClass||{};e.className=`${u.popup} ${ce(e)?n.popup:""}`,t.toast?(ee([document.documentElement,document.body],u["toast-shown"]),ee(e,u.toast)):ee(e,u.modal),Z(e,t,"popup"),"string"==typeof t.customClass&&ee(e,t.customClass),t.icon&&ee(e,u[`icon-${t.icon}`])},ot=(e,t)=>{const n=O();if(!n)return;const{progressSteps:s,currentProgressStep:r}=t;s&&0!==s.length&&void 0!==r?(re(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(((e,i)=>{const a=lt(e);if(n.appendChild(a),i===r&&ee(a,u["active-progress-step"]),i!==s.length-1){const e=ct(t);n.appendChild(e)}}))):ie(n)},lt=e=>{const t=document.createElement("li");return ee(t,u["progress-step"]),$(t,e),t},ct=e=>{const t=document.createElement("li");return ee(t,u["progress-step-line"]),e.progressStepsDistance&&se(t,"width",e.progressStepsDistance),t},ut=(e,t)=>{const n=T();n&&(ae(n),le(n,t.title||t.titleText,"block"),t.title&&ke(t.title,n),t.titleText&&(n.innerText=t.titleText),Z(n,t,"title"))},ht=(e,t)=>{it(e,t),De(e,t),ot(e,t),Ze(e,t),rt(e,t),ut(e,t),Oe(e,t),Ke(e,t),_e(e,t),Xe(e,t);const n=S();"function"==typeof t.didRender&&n&&t.didRender(n),a.eventEmitter.emit("didRender",n)},dt=()=>ce(S()),pt=()=>{var e;return null===(e=R())||void 0===e?void 0:e.click()},ft=()=>{var e;return null===(e=F())||void 0===e?void 0:e.click()},mt=()=>{var e;return null===(e=M())||void 0===e?void 0:e.click()},gt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),yt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},bt=(e,t,n)=>{yt(e),t.toast||(e.keydownHandler=e=>xt(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:S(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},wt=(e,t)=>{var n;const s=U();if(s.length)return(e+=t)===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(n=S())||void 0===n||n.focus()},vt=["ArrowRight","ArrowDown"],At=["ArrowLeft","ArrowUp"],xt=(e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Ct(t,e):"Tab"===t.key?kt(t):[...vt,...At].includes(t.key)?St(t.key):"Escape"===t.key&&Et(t,e,n)))},Ct=(e,t)=>{if(!b(t.allowEnterKey))return;const n=Y(S(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;pt(),e.preventDefault()}},kt=e=>{const t=e.target,n=U();let s=-1;for(let e=0;e{const t=L(),n=R(),s=F(),r=M();if(!(t&&n&&s&&r))return;const i=[n,s,r];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const a=vt.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;if(o){for(let e=0;e{b(t.allowEscapeKey)&&(e.preventDefault(),n(gt.esc))};var _t={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Tt=()=>{const e=x();Array.from(document.body.children).forEach((t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))}))},It=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Nt="undefined"!=typeof window&&!!window.GestureEvent,Ot=()=>{if(Nt&&!K(document.body,u.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",ee(document.body,u.iosfix),Dt()}},Dt=()=>{const e=x();if(!e)return;let t;e.ontouchstart=e=>{t=Rt(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},Rt=e=>{const t=e.target,n=x(),s=I();return!(!n||!s||Mt(e)||Ft(e)||t!==n&&(he(n)||!(t instanceof HTMLElement)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||he(s)&&s.contains(t)))},Mt=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Ft=e=>e.touches&&e.touches.length>1,Bt=()=>{if(K(document.body,u.iosfix)){const e=parseInt(document.body.style.top,10);te(document.body,u.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},zt=()=>{const e=document.createElement("div");e.className=u["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t};let Lt=null;const Pt=e=>{null===Lt&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Lt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Lt+zt()}px`)},Vt=()=>{null!==Lt&&(document.body.style.paddingRight=`${Lt}px`,Lt=null)};function Wt(e,t,n,s){j()?Zt(e,s):(l(n).then((()=>Zt(e,s))),yt(a)),Nt?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),q()&&(Vt(),Bt(),It()),Gt()}function Gt(){te([document.documentElement,document.body],[u.shown,u["height-auto"],u["no-backdrop"],u["toast-shown"]])}function Ut(e){e=$t(e);const t=_t.swalPromiseResolve.get(this),n=qt(this);this.isAwaitingPromise?e.isDismissed||(Ht(this),t(e)):n&&t(e)}const qt=e=>{const t=S();if(!t)return!1;const n=Be.innerParams.get(e);if(!n||K(t,n.hideClass.popup))return!1;te(t,n.showClass.popup),ee(t,n.hideClass.popup);const s=x();return te(s,n.showClass.backdrop),ee(s,n.hideClass.backdrop),Kt(e,t,n),!0};function jt(e){const t=_t.swalPromiseReject.get(this);Ht(this),t&&t(e)}const Ht=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,Be.innerParams.get(e)||e._destroy())},$t=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Kt=(e,t,n)=>{var s;const r=x(),i=de(t);"function"==typeof n.willClose&&n.willClose(t),null===(s=a.eventEmitter)||void 0===s||s.emit("willClose",t),i?Xt(e,t,r,n.returnFocus,n.didClose):Wt(e,r,n.returnFocus,n.didClose)},Xt=(e,t,n,s,r)=>{a.swalCloseEventFinishedCallback=Wt.bind(null,e,n,s,r);const i=function(e){var n;e.target===t&&(null===(n=a.swalCloseEventFinishedCallback)||void 0===n||n.call(a),delete a.swalCloseEventFinishedCallback,t.removeEventListener("animationend",i),t.removeEventListener("transitionend",i))};t.addEventListener("animationend",i),t.addEventListener("transitionend",i)},Zt=(e,t)=>{setTimeout((()=>{var n;"function"==typeof t&&t.bind(e.params)(),null===(n=a.eventEmitter)||void 0===n||n.emit("didClose"),e._destroy&&e._destroy()}))},Yt=e=>{let t=S();if(t||new tr,t=S(),!t)return;const n=z();j()?ie(E()):Qt(t,e),re(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},Qt=(e,t)=>{const n=L(),s=z();n&&s&&(!t&&ce(R())&&(t=R()),re(n),t&&(ie(t),s.setAttribute("data-button-to-replace",t.className),n.insertBefore(s,t)),ee([e,n],u.loading))},Jt=(e,t)=>{"select"===t.input||"radio"===t.input?rn(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(w(t.inputValue)||A(t.inputValue))&&(Yt(R()),an(e,t))},en=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return tn(n);case"radio":return nn(n);case"file":return sn(n);default:return t.inputAutoTrim?n.value.trim():n.value}},tn=e=>e.checked?1:0,nn=e=>e.checked?e.value:null,sn=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,rn=(e,t)=>{const n=S();if(!n)return;const s=e=>{"select"===t.input?on(n,cn(e),t):"radio"===t.input&&ln(n,cn(e),t)};w(t.inputOptions)||A(t.inputOptions)?(Yt(R()),v(t.inputOptions).then((t=>{e.hideLoading(),s(t)}))):"object"==typeof t.inputOptions?s(t.inputOptions):f("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},an=(e,t)=>{const n=e.getInput();n&&(ie(n),v(t.inputValue).then((s=>{n.value="number"===t.input?`${parseFloat(s)||0}`:`${s}`,re(n),n.focus(),e.hideLoading()})).catch((t=>{f(`Error in inputValue promise: ${t}`),n.value="",re(n),n.focus(),e.hideLoading()})))};function on(e,t,n){const s=ne(e,u.select);if(!s)return;const r=(e,t,s)=>{const r=document.createElement("option");r.value=s,$(r,t),r.selected=un(s,n.inputValue),e.appendChild(r)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,s.appendChild(e),n.forEach((t=>r(e,t[1],t[0])))}else r(s,n,t)})),s.focus()}function ln(e,t,n){const s=ne(e,u.radio);if(!s)return;t.forEach((e=>{const t=e[0],r=e[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=u.radio,i.value=t,un(t,n.inputValue)&&(i.checked=!0);const o=document.createElement("span");$(o,r),o.className=u.label,a.appendChild(i),a.appendChild(o),s.appendChild(a)}));const r=s.querySelectorAll("input");r.length&&r[0].focus()}const cn=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let s=e;"object"==typeof s&&(s=cn(s)),t.push([n,s])})):Object.keys(e).forEach((n=>{let s=e[n];"object"==typeof s&&(s=cn(s)),t.push([n,s])})),t},un=(e,t)=>!!t&&t.toString()===e.toString(),hn=e=>{const t=Be.innerParams.get(e);e.disableButtons(),t.input?fn(e,"confirm"):wn(e,!0)},dn=e=>{const t=Be.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?fn(e,"deny"):gn(e,!1)},pn=(e,t)=>{e.disableButtons(),t(gt.cancel)},fn=(e,t)=>{const n=Be.innerParams.get(e);if(!n.input)return void f(`The "input" parameter is needed to be set when using returnInputValueOn${d(t)}`);const s=e.getInput(),r=en(e,n);n.inputValidator?mn(e,r,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||s.validationMessage)):"deny"===t?gn(e,r):wn(e,r)},mn=(e,t,n)=>{const s=Be.innerParams.get(e);e.disableInput(),Promise.resolve().then((()=>v(s.inputValidator(t,s.validationMessage)))).then((s=>{e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===n?gn(e,t):wn(e,t)}))},gn=(e,t)=>{const n=Be.innerParams.get(e||void 0);n.showLoaderOnDeny&&Yt(F()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then((()=>v(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),Ht(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>bn(e||void 0,t)))):e.close({isDenied:!0,value:t})},yn=(e,t)=>{e.close({isConfirmed:!0,value:t})},bn=(e,t)=>{e.rejectPromise(t)},wn=(e,t)=>{const n=Be.innerParams.get(e||void 0);n.showLoaderOnConfirm&&Yt(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then((()=>v(n.preConfirm(t,n.validationMessage)))).then((n=>{ce(D())||!1===n?(e.hideLoading(),Ht(e)):yn(e,void 0===n?t:n)})).catch((t=>bn(e||void 0,t)))):yn(e,t)};function vn(){const e=Be.innerParams.get(this);if(!e)return;const t=Be.domCache.get(this);ie(t.loader),j()?e.icon&&re(E()):An(t),te([t.popup,t.actions],u.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const An=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?re(t[0],"inline-block"):ue()&&ie(e.actions)};function xn(){const e=Be.innerParams.get(this),t=Be.domCache.get(this);return t?Y(t.popup,e.input):null}function Cn(e,t,n){const s=Be.domCache.get(e);t.forEach((e=>{s[e].disabled=n}))}function kn(e,t){const n=S();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${u.radio}"]`);for(let n=0;nObject.prototype.hasOwnProperty.call(On,e),Bn=e=>-1!==Dn.indexOf(e),zn=e=>Rn[e],Ln=e=>{Fn(e)||p(`Unknown parameter "${e}"`)},Pn=e=>{Mn.includes(e)&&p(`The parameter "${e}" is incompatible with toasts`)},Vn=e=>{const t=zn(e);t&&y(e,t)},Wn=e=>{!1===e.backdrop&&e.allowOutsideClick&&p('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Ln(t),e.toast&&Pn(t),Vn(t)};function Gn(e){const t=S(),n=Be.innerParams.get(this);if(!t||K(t,n.hideClass.popup))return void p("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const s=Un(e),r=Object.assign({},n,s);ht(this,r),Be.innerParams.set(this,r),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Un=e=>{const t={};return Object.keys(e).forEach((n=>{Bn(n)?t[n]=e[n]:p(`Invalid parameter to update: ${n}`)})),t};function qn(){const e=Be.domCache.get(this),t=Be.innerParams.get(this);t?(e.popup&&a.swalCloseEventFinishedCallback&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),a.eventEmitter.emit("didDestroy"),jn(this)):Hn(this)}const jn=e=>{Hn(e),delete e.params,delete a.keydownHandler,delete a.keydownTarget,delete a.currentInstance},Hn=e=>{e.isAwaitingPromise?($n(Be,e),e.isAwaitingPromise=!0):($n(_t,e),$n(Be,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},$n=(e,t)=>{for(const n in e)e[n].delete(t)};var Kn=Object.freeze({__proto__:null,_destroy:qn,close:Ut,closeModal:Ut,closePopup:Ut,closeToast:Ut,disableButtons:En,disableInput:Tn,disableLoading:vn,enableButtons:Sn,enableInput:_n,getInput:xn,handleAwaitingPromise:Ht,hideLoading:vn,rejectPromise:jt,resetValidationMessage:Nn,showValidationMessage:In,update:Gn});const Xn=(e,t,n)=>{e.toast?Zn(e,t,n):(Jn(t),es(t),ts(e,t,n))},Zn=(e,t,n)=>{t.popup.onclick=()=>{e&&(Yn(e)||e.timer||e.input)||n(gt.close)}},Yn=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let Qn=!1;const Jn=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(Qn=!0)}}},es=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(Qn=!0)}}},ts=(e,t,n)=>{t.container.onclick=s=>{Qn?Qn=!1:s.target===t.container&&b(e.allowOutsideClick)&&n(gt.backdrop)}},ns=e=>"object"==typeof e&&e.jquery,ss=e=>e instanceof Element||ns(e),rs=e=>{const t={};return"object"!=typeof e[0]||ss(e[0])?["title","html","icon"].forEach(((n,s)=>{const r=e[s];"string"==typeof r||ss(r)?t[n]=r:void 0!==r&&f(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof r}`)})):Object.assign(t,e[0]),t};function is(){for(var e=arguments.length,t=new Array(e),n=0;na.timeout&&a.timeout.getTimerLeft(),ls=()=>{if(a.timeout)return fe(),a.timeout.stop()},cs=()=>{if(a.timeout){const e=a.timeout.start();return pe(e),e}},us=()=>{const e=a.timeout;return e&&(e.running?ls():cs())},hs=e=>{if(a.timeout){const t=a.timeout.increase(e);return pe(t,!0),t}},ds=()=>!(!a.timeout||!a.timeout.isRunning());let ps=!1;const fs={};function ms(){fs[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,ps||(document.body.addEventListener("click",gs),ps=!0)}const gs=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in fs){const n=t.getAttribute(e);if(n)return void fs[e].fire({template:n})}};class ys{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const s=function(){n.removeListener(e,s);for(var r=arguments.length,i=new Array(r),a=0;a1?t-1:0),s=1;s{try{e.apply(this,n)}catch(e){}}))}removeListener(e,t){const n=this._getHandlersByEventName(e),s=n.indexOf(t);s>-1&&n.splice(s,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}}a.eventEmitter=new ys;const bs=(e,t)=>{a.eventEmitter.on(e,t)},ws=(e,t)=>{a.eventEmitter.once(e,t)},vs=(e,t)=>{e?t?a.eventEmitter.removeListener(e,t):a.eventEmitter.removeAllListeners(e):a.eventEmitter.reset()};var As=Object.freeze({__proto__:null,argsToParams:rs,bindClickHandler:ms,clickCancel:mt,clickConfirm:pt,clickDeny:ft,enableLoading:Yt,fire:is,getActions:L,getCancelButton:M,getCloseButton:W,getConfirmButton:R,getContainer:x,getDenyButton:F,getFocusableElements:U,getFooter:P,getHtmlContainer:I,getIcon:E,getIconContent:_,getImage:N,getInputLabel:B,getLoader:z,getPopup:S,getProgressSteps:O,getTimerLeft:os,getTimerProgressBar:V,getTitle:T,getValidationMessage:D,increaseTimer:hs,isDeprecatedParameter:zn,isLoading:H,isTimerRunning:ds,isUpdatableParameter:Bn,isValidParameter:Fn,isVisible:dt,mixin:as,off:vs,on:bs,once:ws,resumeTimer:cs,showLoading:Yt,stopTimer:ls,toggleTimer:us});class xs{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const Cs=["swal-title","swal-html","swal-footer"],ks=e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return Ds(n),Object.assign(Ss(n),Es(n),_s(n),Ts(n),Is(n),Ns(n),Os(n,Cs))},Ss=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{Rs(e,["name","value"]);const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&("boolean"==typeof On[n]?t[n]="false"!==s:"object"==typeof On[n]?t[n]=JSON.parse(s):t[n]=s)})),t},Es=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),s=e.getAttribute("value");n&&s&&(t[n]=new Function(`return ${s}`)())})),t},_s=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{Rs(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t[`${n}ButtonText`]=e.innerHTML,t[`show${d(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label")))})),t},Ts=e=>{const t={},n=e.querySelector("swal-image");return n&&(Rs(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t},Is=e=>{const t={},n=e.querySelector("swal-icon");return n&&(Rs(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Ns=e=>{const t={},n=e.querySelector("swal-input");n&&(Rs(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")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach((e=>{Rs(e,["value"]);const n=e.getAttribute("value");if(!n)return;const s=e.innerHTML;t.inputOptions[n]=s}))),t},Os=(e,t)=>{const n={};for(const s in t){const r=t[s],i=e.querySelector(r);i&&(Rs(i,[]),n[r.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},Ds=e=>{const t=Cs.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||p(`Unrecognized element <${n}>`)}))},Rs=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&p([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])}))},Ms=10,Fs=e=>{const t=x(),n=S();"function"==typeof e.willOpen&&e.willOpen(n),a.eventEmitter.emit("willOpen",n);const s=window.getComputedStyle(document.body).overflowY;Ps(t,n,e),setTimeout((()=>{zs(t,n)}),Ms),q()&&(Ls(t,e.scrollbarPadding,s),Tt()),j()||a.previousActiveElement||(a.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(n))),a.eventEmitter.emit("didOpen",n),te(t,u["no-transition"])},Bs=e=>{const t=S();if(e.target!==t)return;const n=x();t.removeEventListener("animationend",Bs),t.removeEventListener("transitionend",Bs),n.style.overflowY="auto"},zs=(e,t)=>{de(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",Bs),t.addEventListener("transitionend",Bs)):e.style.overflowY="auto"},Ls=(e,t,n)=>{Ot(),t&&"hidden"!==n&&Pt(n),setTimeout((()=>{e.scrollTop=0}))},Ps=(e,t,n)=>{ee(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),re(t,"grid"),setTimeout((()=>{ee(t,n.showClass.popup),t.style.removeProperty("opacity")}),Ms)):re(t,"grid"),ee([document.documentElement,document.body],u.shown),n.heightAuto&&n.backdrop&&!n.toast&&ee([document.documentElement,document.body],u["height-auto"])};var Vs={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^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 Ws(e){e.inputValidator||("email"===e.input&&(e.inputValidator=Vs.email),"url"===e.input&&(e.inputValidator=Vs.url))}function Gs(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 Us(e){Ws(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"),Gs(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
          ")),Ce(e)}let qs;var js=new WeakMap;class Hs{constructor(){if(s(this,js,void 0),"undefined"==typeof window)return;qs=this;for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(Wn(Object.assign({},t,e)),a.currentInstance){const e=_t.swalPromiseResolve.get(a.currentInstance),{isAwaitingPromise:t}=a.currentInstance;a.currentInstance._destroy(),t||e({isDismissed:!0}),q()&&It()}a.currentInstance=qs;const n=Ks(e,t);Us(n),Object.freeze(n),a.timeout&&(a.timeout.stop(),delete a.timeout),clearTimeout(a.restoreFocusTimeout);const s=Xs(qs);return ht(qs,n),Be.innerParams.set(qs,n),$s(qs,s,n)}then(e){return n(js,this).then(e)}finally(e){return n(js,this).finally(e)}}const $s=(e,t,n)=>new Promise(((s,r)=>{const i=t=>{e.close({isDismissed:!0,dismiss:t})};_t.swalPromiseResolve.set(e,s),_t.swalPromiseReject.set(e,r),t.confirmButton.onclick=()=>{hn(e)},t.denyButton.onclick=()=>{dn(e)},t.cancelButton.onclick=()=>{pn(e,i)},t.closeButton.onclick=()=>{i(gt.close)},Xn(n,t,i),bt(a,n,i),Jt(e,n),Fs(n),Zs(a,n,i),Ys(t,n),setTimeout((()=>{t.container.scrollTop=0}))})),Ks=(e,t)=>{const n=ks(e),s=Object.assign({},On,t,n,e);return s.showClass=Object.assign({},On.showClass,s.showClass),s.hideClass=Object.assign({},On.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},Xs=e=>{const t={popup:S(),container:x(),actions:L(),confirmButton:R(),denyButton:F(),cancelButton:M(),loader:z(),closeButton:W(),validationMessage:D(),progressSteps:O()};return Be.domCache.set(e,t),t},Zs=(e,t,n)=>{const s=V();ie(s),t.timer&&(e.timeout=new xs((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(re(s),Z(s,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&pe(t.timer)}))))},Ys=(e,t)=>{if(!t.toast)return b(t.allowEnterKey)?void(Qs(e)||Js(e,t)||wt(-1,1)):(y("allowEnterKey"),void er())},Qs=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&ce(e))return e.focus(),!0;return!1},Js=(e,t)=>t.focusDeny&&ce(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ce(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ce(e.confirmButton)||(e.confirmButton.focus(),0)),er=()=>{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)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const 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((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}Hs.prototype.disableButtons=En,Hs.prototype.enableButtons=Sn,Hs.prototype.getInput=xn,Hs.prototype.disableInput=Tn,Hs.prototype.enableInput=_n,Hs.prototype.hideLoading=vn,Hs.prototype.disableLoading=vn,Hs.prototype.showValidationMessage=In,Hs.prototype.resetValidationMessage=Nn,Hs.prototype.close=Ut,Hs.prototype.closePopup=Ut,Hs.prototype.closeModal=Ut,Hs.prototype.closeToast=Ut,Hs.prototype.rejectPromise=jt,Hs.prototype.update=Gn,Hs.prototype._destroy=qn,Object.assign(Hs,As),Object.keys(Kn).forEach((e=>{Hs[e]=function(){return qs&&qs[e]?qs[e](...arguments):null}})),Hs.DismissReason=gt,Hs.version="11.14.5";const tr=Hs;return tr.default=tr,tr}(),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:()=>fa,AMSynth:()=>Ha,Abs:()=>Na,Add:()=>Aa,AmplitudeEnvelope:()=>Ua,Analyser:()=>ml,AudioToGain:()=>da,AutoFilter:()=>Do,AutoPanner:()=>Mo,AutoWah:()=>Bo,BaseContext:()=>Kr,BiquadFilter:()=>$a,BitCrusher:()=>Lo,Buffer:()=>Xl,BufferSource:()=>Yl,Buffers:()=>Zl,Channel:()=>Cl,Chebyshev:()=>Vo,Chorus:()=>jo,Clock:()=>zi,Compressor:()=>Il,Context:()=>Xr,Convolver:()=>Fl,CrossFade:()=>Io,DCMeter:()=>wl,Delay:()=>Li,Destination:()=>Vl,Distortion:()=>Ho,Draw:()=>jl,DuoSynth:()=>Ya,EQ3:()=>Ml,Emitter:()=>$r,Envelope:()=>Pa,FFT:()=>bl,FMOscillator:()=>ma,FMSynth:()=>Qa,FatOscillator:()=>ya,FeedbackCombFilter:()=>lo,FeedbackDelay:()=>Ko,Filter:()=>Ka,Follower:()=>Fo,Freeverb:()=>Jo,Frequency:()=>wi,FrequencyClass:()=>gi,FrequencyEnvelope:()=>Xa,FrequencyShifter:()=>Zo,Gain:()=>Ii,GainToAudio:()=>Oa,Gate:()=>Nl,GrainPlayer:()=>Ia,GreaterThan:()=>Fa,GreaterThanZero:()=>Ma,IntervalTimeline:()=>Hi,JCReverb:()=>sl,LFO:()=>ka,Limiter:()=>Ol,Listener:()=>Ul,Loop:()=>go,LowpassCombFilter:()=>uo,Master:()=>Wl,MembraneSynth:()=>to,Merge:()=>Go,MetalSynth:()=>eo,Meter:()=>yl,MidSideCompressor:()=>Dl,MidSideMerge:()=>ul,MidSideSplit:()=>cl,Midi:()=>Gi,MidiClass:()=>Wi,Mono:()=>kl,MonoSynth:()=>Za,MultibandCompressor:()=>Rl,MultibandSplit:()=>Sl,Multiply:()=>pa,Negate:()=>Da,Noise:()=>na,NoiseSynth:()=>no,Offline:()=>Pi,OfflineContext:()=>ei,OmniOscillator:()=>va,OnePoleFilter:()=>co,Oscillator:()=>ca,PWMOscillator:()=>ba,PanVol:()=>xl,Panner:()=>Ro,Panner3D:()=>_l,Param:()=>ki,Part:()=>yo,Pattern:()=>_o,Phaser:()=>ol,PingPongDelay:()=>il,PitchShift:()=>al,Player:()=>_a,Players:()=>Ta,PluckSynth:()=>ho,PolySynth:()=>po,Pow:()=>Ba,PulseOscillator:()=>ga,Recorder:()=>Tl,Reverb:()=>ll,Sampler:()=>fo,Scale:()=>xa,ScaleExp:()=>za,Sequence:()=>To,Signal:()=>Di,Solo:()=>Al,Split:()=>Wo,StateTimeline:()=>Ci,StereoWidener:()=>dl,Subtract:()=>Ra,SyncedSignal:()=>La,Synth:()=>qa,Ticks:()=>qi,TicksClass:()=>Ui,Time:()=>mi,TimeClass:()=>fi,Timeline:()=>Gr,ToneAudioBuffer:()=>Jr,ToneAudioBuffers:()=>Vi,ToneAudioNode:()=>Si,ToneBufferSource:()=>ta,ToneEvent:()=>mo,ToneOscillatorNode:()=>la,Transport:()=>Ll,TransportTime:()=>Ai,TransportTimeClass:()=>vi,Tremolo:()=>pl,Unit:()=>r,UserMedia:()=>aa,Vibrato:()=>fl,Volume:()=>Ki,WaveShaper:()=>ha,Waveform:()=>vl,Zero:()=>Ca,connect:()=>_i,connectSeries:()=>Ei,connectSignal:()=>Ri,context:()=>$l,dbToGain:()=>ai,debug:()=>s,defaultArg:()=>Rr,disconnect:()=>Ti,ftom:()=>ui,gainToDb:()=>oi,getContext:()=>si,getDestination:()=>Gl,getDraw:()=>Hl,getListener:()=>ql,getTransport:()=>Pl,immediate:()=>zl,intervalToFrequencyRatio:()=>li,isArray:()=>yr,isBoolean:()=>gr,isDefined:()=>dr,isFunction:()=>pr,isNote:()=>wr,isNumber:()=>fr,isObject:()=>mr,isString:()=>br,isUndef:()=>hr,loaded:()=>Kl,mtof:()=>di,now:()=>Bl,optionsFromArguments:()=>Dr,setContext:()=>ri,start:()=>ii,supported:()=>sr,version:()=>i});var s={};n.r(s),n.d(s,{assert:()=>rr,assertContextRunning:()=>ar,assertRange:()=>ir,log:()=>cr,setLogger:()=>lr,warn:()=>ur});var r={};n.r(r);const i="14.7.77",a=(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}),c=(e,t,n)=>({duration:n,startTime:t,type:"setValueCurve",values:e}),u=(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]:u(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,A=(e,t,n,{endTime:s,value:r})=>n===r?r:0n+(e-t)/(s-t)*(r-n),C=(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)),k=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&&k(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,i=h(s)?A(t,n,r,s):x(t,n,r,s),l=h(s)?a(i,t,this._currenTime):o(i,t,this._currenTime);this._automationEvents.push(l)}if(void 0!==e&&k(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)),i=n/(r-1)*s,a=e.values.slice(0,r);if(i<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)?a(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];k(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&&k(r)&&(void 0===n||!p(n)||n.insertTime>e))return u(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),i=r[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());n.push(i),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},G=(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},U=(e,t,n,s)=>{const r=W(e,t),i=G(r,(e=>e[0]===n&&e[1]===s));return 0===r.size&&e.delete(t),i},q=e=>W(D,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},ie=e=>W(_,e),ae=e=>W(I,e),oe=(e,t)=>{const{activeInputs:n}=ie(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=ae(e);void 0!==n&&n.activeInputs.forEach((([e])=>oe(e,t)))}se(e)&&$(e)},le=e=>{oe(e.destination,[])},ce=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),ue=e=>"context"in e,he=e=>ue(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 i=e.get(t);void 0===i?e.set(t,new Set([[n,s]])):de(i,[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=G(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)},Ae=e=>W(T,e),xe=e=>W(N,e),Ce=e=>R.has(e),ke=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),i=r.getChannelData(0);i[0]=1,i[1]=1;const a=e.createBufferSource();a.buffer=r,a.loop=!0,a.connect(t).connect(e.destination),a.connect(s),a.disconnect(s),t.onaudioprocess=s=>{const r=s.inputBuffer.getChannelData(0);Array.prototype.some.call(r,(e=>1===e))?n(!0):n(!1),a.stop(),t.onaudioprocess=null,a.disconnect(t),t.disconnect(e.destination)},a.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,Te=e=>{const t=new Map;e.connect=(e=>(n,s=0,r=0)=>{const i=_e(n)?e(n,s,r):e(n,s),a=t.get(n);return void 0===a?t.set(n,[{input:r,output:s}]):a.every((e=>e.input!==r||e.output!==s))&&a.push({input:r,output:s}),i})(e.connect.bind(e)),e.disconnect=(n=>(s,r,i)=>{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!==i||void 0===i)));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)},Ie=(e,t,n,s)=>{const{activeInputs:r,passiveInputs:i}=ae(t),{outputs:a}=ie(e),o=q(e),l=a=>{const o=Ae(e),l=xe(t);if(a){const t=we(i,e,n);pe(r,e,t,!1),s||Ce(e)||o.connect(l,n)}else{const t=((e,t,n)=>G(e,(e=>e[0]===t&&e[1]===n)))(r,e,n);fe(i,t,!1),s||Ce(e)||o.disconnect(l,n)}};return!!de(a,[t,n],(e=>e[0]===t&&e[1]===n),!0)&&(o.add(l),se(e)?pe(r,e,[n,l],!0):fe(i,[e,n,l],!0),!0)},Ne=(e,t,n,s,r)=>{const[i,a]=((e,t,n,s)=>{const{activeInputs:r,passiveInputs:i}=ie(t),a=ye(r[s],e,n);if(null===a)return[U(i,e,n,s)[2],!1];return[a[2],!0]})(e,n,s,r);if(null!==i&&(be(e,i),!a||t||Ce(e)||ve(Ae(e),Ae(n),s,r)),se(n)){const{activeInputs:e}=ie(n);K(n,e)}},Oe=(e,t,n,s)=>{const[r,i]=((e,t,n)=>{const{activeInputs:s,passiveInputs:r}=ae(t),i=ye(s,e,n);if(null===i)return[we(r,e,n)[1],!1];return[i[2],!0]})(e,n,s);null!==r&&(be(e,r),!i||t||Ce(e)||Ae(e).disconnect(xe(n),s))};class De{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 Re={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 i=e.getChannelData(s);if(0===t[n].byteLength)t[n]=i.slice(r,r+128);else{const e=new Float32Array(i.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,c=r.reduce(((e,t)=>e+t),0),u=0===c?null:n.createBuffer(c,o,n.sampleRate);if(void 0===i)throw new Error("Missing the processor constructor.");const h=ie(e),d=await((e,t)=>{const n=W(F,e),s=Ae(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 c=0;c0&&null!==t)for(let e=0;e{Me(t,m,e,l+n,c)}));for(let e=0;e0===h.activeInputs[t].size?[]:e)),t=a(c/n.sampleRate,n.sampleRate,(()=>d.process(e,f,m)));if(null!==u)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,i,a,o,l,c,u)=>{const h=c.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)},it=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)},at=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)},ct=(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},ut=(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 i=e.length-1;i>=0;i-=1)r=t,n=[(s=n)[0]*r[0]-s[1]*r[1],s[0]*r[1]+s[1]*r[0]],n[0]+=e[i];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},At={disableNormalization:!1},xt={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},Ct=()=>new DOMException("","UnknownError"),kt={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:i,set:a}=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,{get:n(i),set:s(a)})},Tt=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(s){if(9!==s.code)throw s;Tt(e,t,n+1e-7)}},It=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},Dt=()=>{try{new DOMException}catch{return!1}return!0},Rt=()=>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,i],a)=>{e(t[r],[n,s,i],(e=>e[0]===n&&e[1]===s),a)})(de),zt=(e=>(t,n,[s,r,i],a)=>{const o=t.get(s);void 0===o?t.set(s,new Set([[r,n,i]])):e(o,[r,n,i],(e=>e[0]===r&&e[1]===n),a)})(de),Lt=(e=>(t,n,s,r)=>e(t[r],(e=>e[0]===n&&e[1]===s)))(G),Pt=new WeakMap,Vt=(e=>t=>{var n;return null!==(n=e.get(t))&&void 0!==n?n:0})(Pt),Wt=(Gt=new Map,Ut=new WeakMap,(e,t)=>{const n=Ut.get(e);if(void 0!==n)return n;const s=Gt.get(e);if(void 0!==s)return s;try{const n=t();return n instanceof Promise?(Gt.set(e,n),n.catch((()=>!1)).then((t=>(Gt.delete(e),Ut.set(e,t),t)))):(Ut.set(e,n),n)}catch{return Ut.set(e,!1),!1}});var Gt,Ut;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})(ie),$t=((e,t,n)=>async(s,r,i)=>{const a=e(s);await Promise.all(a.activeInputs.map(((e,a)=>Array.from(e).map((async([e,o])=>{const l=t(e),c=await l.render(e,r),u=s.context.destination;n(e)||s===u&&n(s)||c.connect(i,o,a)})))).reduce(((e,t)=>[...e,...t]),[]))})(ie,Ht,Ce),Kt=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,fftSize:a.fftSize,maxDecibels:a.maxDecibels,minDecibels:a.minDecibels,smoothingTimeConstant:a.smoothingTimeConstant};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(jt,Ae,$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,i,a,o,l,c,u,h,d,p,f,m)=>class extends c{constructor(t,s,r,i){super(r),this._context=t,this._nativeAudioNode=r;const a=u(t);h(a)&&!0!==n(Se,(()=>Se(a,m)))&&Te(r),T.set(this,r),D.set(this,new Set),"closed"!==t.state&&s&&j(this),e(this,i,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 c=u(this._context),h=f(c);if(d(e)||p(e))throw i();if(ue(e)){const r=Ae(e);try{const t=ge(this._nativeAudioNode,r,n,o),s=ke(this);(h||s)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!s&&ke(e)&&j(e)}catch(e){if(12===e.code)throw i();throw e}if(t(this,e,n,o,h)){const t=l([this],e);Ee(t,s(h))}return e}const m=xe(e);if("playbackRate"===m.name&&1024===m.maxValue)throw a();try{this._nativeAudioNode.connect(m,n),(h||ke(this))&&this._nativeAudioNode.disconnect(m,n)}catch(e){if(12===e.code)throw i();throw e}if(Ie(this,e,n,h)){const t=l([this],e);Ee(t,s(h))}}disconnect(e,t,n){let s;const a=u(this._context),c=f(a);if(void 0===e)s=((e,t)=>{const n=ie(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,c);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw r();s=((e,t,n)=>{const s=ie(e),r=[];for(const i of s.outputs)i[1]===n&&(he(i)?Ne(e,t,...i):Oe(e,t,...i),r.push(i[0]),s.outputs.delete(i));return r})(this,c,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw r();if(ue(e)&&void 0!==n&&(n<0||n>=e.numberOfInputs))throw r();if(s=((e,t,n,s,r)=>{const i=ie(e);return Array.from(i.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),i.outputs.delete(n),n[0])))})(this,c,e,t,n),0===s.length)throw i()}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}=i(m),{outputs:A}=i(f),x=o(f),C=i=>{const o=l(m),c=l(f);if(i){const t=U(v,f,g,y);e(w,f,t,!1),b||h(f)||n(c,o,g,y),d(m)&&j(m)}else{const e=s(w,f,g,y);t(v,y,e,!1),b||h(f)||r(c,o,g,y);const n=a(m);if(0===n)u(m)&&K(m,w);else{const e=p.get(m);void 0!==e&&clearTimeout(e),p.set(m,setTimeout((()=>{u(m)&&K(m,w)}),1e3*n))}}};return!!c(A,[m,g,y],(e=>e[0]===m&&e[1]===g&&e[2]===y),!0)&&(x.add(C),u(f)?e(w,f,[g,y,C],!0):t(v,y,[f,g,C],!0),!0)}})(Bt,zt,ge,Lt,ve,ie,Vt,q,Ae,de,se,Ce,ke),Wt,((e,t,n,s,r,i)=>a=>(o,l)=>{const c=e.get(o);if(void 0===c){if(!a&&i(o)){const e=s(o),{outputs:i}=n(o);for(const n of i)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,c+l)})(R,ve,ie,Ae,xe,se),Q,Xe,yt,((e,t,n,s,r,i,a,o)=>(l,c)=>{const u=t.get(l);if(void 0===u)throw new Error("Missing the expected cycle count.");const h=i(l.context),d=o(h);if(u===c){if(t.delete(l),!d&&a(l)){const t=s(l),{outputs:i}=n(l);for(const n of i)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,u-c)})(ge,R,ie,Ae,xe,Xt,se,Qt),((e,t,n)=>function s(r,i){const a=ue(i)?i:n(e,i);if((e=>"delayTime"in e)(a))return[];if(r[0]===a)return[r];if(r.includes(a))return[];const{outputs:o}=t(a);return Array.from(o).map((e=>s([...r,a],e[0]))).reduce(((e,t)=>e.concat(t)),[])})(Jt,ie,W),en,Xt,nn,sn,rn,Qt,an);var ln;const cn=((e,t,n,s,r,i)=>class extends e{constructor(e,n){const a=r(e),o={...X,...n},l=s(a,o);super(e,!1,l,i(a)?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),un=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,i=0)=>{const a=e(i),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(o),u=s.length;for(let e=a<0?-a:0;e+a{const a=e(i),o=e(r);if(o>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(o),u=s.length;for(let e=a<0?-a:0;e+at=>{t.copyFromChannel=(n=>(s,r,i=0)=>{const a=e(i),o=e(r);if(a(s,r,i=0)=>{const a=e(i),o=e(r);if(a{let l=null;return class c{constructor(c){if(null===r)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:u,numberOfChannels:h,sampleRate:d}={...ee,...c};null===l&&(l=new r(1,1,44100));const p=null!==s&&t(i,i)?new s({length:u,numberOfChannels:h,sampleRate:d}):l.createBuffer(h,u,d);if(0===p.numberOfChannels)throw n();return"function"!=typeof p.copyFromChannel?(a(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)===c.prototype||e.has(t)}}})(un,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,i)=>{const a=t(s);await Promise.all(Array.from(a.activeInputs).map((async([t,s])=>{const a=e(t),o=await a.render(t,r);n(t)||o.connect(i,s)})))})(Ht,ae,Ce),wn=(e=>(t,n,s)=>e(n,t,s))(bn),vn=((e,t,n,s,r,i,a,o,l,c,u)=>(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,i)=>{if(n)throw Ke();t.call(e,s,r,i),n=!0}})(e.start)})(p),t(s,(()=>s(h)))||l(p),t(r,(()=>r(h)))||c(p,h),t(i,(()=>i(h)))||it(p),t(a,(()=>a(h)))||u(p,h),t(o,(()=>o(h)))||at(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}),It,Nt,Ot,(e=>{e.start=(t=>(n=0,s=0,r)=>{const i=e.buffer,a=null===i?s:Math.min(i.duration,s);null!==i&&a>i.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,a,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),An=((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})(ae),bn),xn=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null;return{set start(e){a=e},set stop(e){o=e},render(l,c){const u=i.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const h=Z(u,c);if(!h){const e={buffer:u.buffer,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,loop:u.loop,loopEnd:u.loopEnd,loopStart:u.loopStart,playbackRate:u.playbackRate.value};u=t(c,e),null!==a&&u.start(...a),null!==o&&u.stop(o)}return i.set(c,u),h?await e(c,l.playbackRate,u.playbackRate):await s(c,l.playbackRate,u.playbackRate),await r(l,c,u),u})(l,c)}}})(wn,vn,Ae,An,$t),Cn=((e,t,n,s,r,i,a,o,l,c,u,h,d)=>(p,f,m,g=null,y=null)=>{const b=m.value,w=new S(b),v=f?s(w):null,A={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,A.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 A},cancelScheduledValues:e=>(null===v&&w.flush(p.context.currentTime),w.add(i(e)),m.cancelScheduledValues(e),A),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(c(b,n)),m.setValueAtTime(b,n)),w.add(a(e,t)),m.exponentialRampToValueAtTime(e,t),A},linearRampToValueAtTime(e,t){const n=p.context.currentTime;return null===v&&w.flush(n),0===Array.from(w).length&&(w.add(c(b,n)),m.setValueAtTime(b,n)),w.add(o(e,t)),m.linearRampToValueAtTime(e,t),A},setTargetAtTime:(e,t,n)=>(null===v&&w.flush(p.context.currentTime),w.add(l(e,t,n)),m.setTargetAtTime(e,t,n),A),setValueAtTime:(e,t)=>(null===v&&w.flush(p.context.currentTime),w.add(c(e,t)),m.setValueAtTime(e,t),A),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,i=Math.ceil(t*r),a=Math.floor(e*r),o=a-i,l=new Float32Array(o);for(let e=0;e{kn.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,c,tn,Tt);var kn;const Sn=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,s){const o=i(e),l={...re,...s},c=r(o,l),u=a(o),h=u?t():null;super(e,!1,c,h),this._audioBufferSourceNodeRenderer=h,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=c,this._onended=null,this._playbackRate=n(this,u,c.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,xn,Cn,Ke,vn,Xt,Qt,Ft),En=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,n){const s=i(e),l=a(s),c=r(s,n,l);super(e,!1,c,l?t(o):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=c}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 i=n.destination;if(i.channelCount!==s)try{i.channelCount=s}catch{}r&&"explicit"!==i.channelCountMode&&(i.channelCountMode="explicit"),0===i.maxChannelCount&&Object.defineProperty(i,"maxChannelCount",{value:s});const a=e(n,{channelCount:s,channelCountMode:i.channelCountMode,channelInterpretation:i.channelInterpretation,gain:1});return t(a,"channelCount",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t);try{i.channelCount=t}catch(e){if(t>i.maxChannelCount)throw e}})),t(a,"channelCountMode",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelCountMode=t})),t(a,"channelInterpretation",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),i.channelInterpretation=t})),Object.defineProperty(a,"maxChannelCount",{get:()=>i.maxChannelCount}),a.connect(i),a})(pt,_t),Xt,Qt,$t),_n=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const c=Z(l,o);if(!c){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 i.set(o,l),c?(await e(o,a.Q,l.Q),await e(o,a.detune,l.detune),await e(o,a.frequency,l.frequency),await e(o,a.gain,l.gain)):(await s(o,a.Q,l.Q),await s(o,a.detune,l.detune),await s(o,a.frequency,l.frequency),await s(o,a.gain,l.gain)),await r(a,o,l),l})(a,o)}}})(wn,ct,Ae,An,$t),Tn=(e=>(t,n)=>e.set(t,n))(Pt),In=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,s){const l=i(e),c={...Le,...s},u=r(l,c),h=a(l);super(e,!1,u,h?n():null),this._Q=t(this,h,u.Q,ne,te),this._detune=t(this,h,u.detune,1200*Math.log2(ne),-1200*Math.log2(ne)),this._frequency=t(this,h,u.frequency,e.sampleRate/2,0),this._gain=t(this,h,u.gain,40*Math.log10(ne),te),this._nativeBiquadFilterNode=u,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,Cn,_n,Xe,ct,Xt,Qt,Tn),Nn=((e,t)=>(n,s,r)=>{const i=new Set;return n.connect=(r=>(a,o=0,l=0)=>{const c=0===i.size;if(t(a))return r.call(n,a,o,l),e(i,[a,o,l],(e=>e[0]===a&&e[1]===o&&e[2]===l),!0),c&&s(),a;r.call(n,a,o),e(i,[a,o],(e=>e[0]===a&&e[1]===o),!0),c&&s()})(n.connect),n.disconnect=(e=>(s,a,o)=>{const l=i.size>0;if(void 0===s)e.apply(n),i.clear();else if("number"==typeof s){e.call(n,s);for(const e of i)e[1]===s&&i.delete(e)}else{t(s)?e.call(n,s,a,o):e.call(n,s,a);for(const e of i)e[0]!==s||void 0!==a&&e[1]!==a||void 0!==o&&e[2]!==o||i.delete(e)}const c=0===i.size;l&&c&&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),Dn=((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),Rn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(Dn,Ae,$t),Mn=((e,t,n,s,r)=>class extends e{constructor(e,i){const a=s(e),o={...Pe,...i};super(e,!1,n(a,o),r(a)?t():null)}})(on,Rn,Dn,Xt,Qt),Fn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=e(i,t)}return s.set(i,a),await n(r,i,a),a})(r,i)}}})(ut,Ae,$t),Bn=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=s(e),l=i({...Ve,...a});super(e,!1,n(o,l),r(o)?t():null)}})(on,Fn,ut,Xt,Qt,(e=>({...e,channelCount:e.numberOfOutputs}))),zn=((e,t,n,s)=>(r,{offset:i,...a})=>{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}),c=n(r,{...a,gain:i}),u=o.getChannelData(0);u[0]=1,u[1]=1,l.buffer=o,l.loop=!0;const h={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get offset(){return c.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,c),(()=>l.connect(c)),(()=>l.disconnect(c)))})(yn,vn,pt,Nn),Ln=((e,t,n,s,r)=>(i,a)=>{if(void 0===i.createConstantSource)return n(i,a);const o=i.createConstantSource();return nt(o,a),rt(o,a,"offset"),t(s,(()=>s(i)))||it(o),t(r,(()=>r(i)))||at(o),e(i,o),o})(yn,Wt,zn,It,Ot),Pn=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null;return{set start(e){a=e},set stop(e){o=e},render(l,c){const u=i.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const h=Z(u,c);if(!h){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,offset:u.offset.value};u=t(c,e),null!==a&&u.start(a),null!==o&&u.stop(o)}return i.set(c,u),h?await e(c,l.offset,u.offset):await s(c,l.offset,u.offset),await r(l,c,u),u})(l,c)}}})(wn,Ln,Ae,An,$t),Vn=((e,t,n,s,r,i,a)=>class extends e{constructor(e,a){const o=r(e),l={...We,...a},c=s(o,l),u=i(o),h=u?n():null;super(e,!1,c,h),this._constantSourceNodeRenderer=h,this._nativeConstantSourceNode=c,this._offset=t(this,u,c.offset,ne,te),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(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,Cn,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),Gn=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=e(i,t)}return s.set(i,a),me(a)?await n(r,i,a.inputs[0]):await n(r,i,a),a})(r,i)}}})(Wn,Ae,$t),Un=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=s(e),l={...Ge,...a},c=n(o,l);super(e,!1,c,r(o)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=c,null!==l.buffer&&i(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,i(this,0)}else this._isBufferNullified=!1,i(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}})(on,Gn,Wn,Xt,Qt,Tn),qn=((e,t,n,s,r)=>i=>{const a=new WeakMap;return{render(o,l){const c=a.get(l);return void 0!==c?Promise.resolve(c):(async(o,l)=>{let c=n(o);const u=Z(c,l);if(!u){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,delayTime:c.delayTime.value,maxDelayTime:i};c=t(l,e)}return a.set(l,c),u?await e(l,o.delayTime,c.delayTime):await s(l,o.delayTime,c.delayTime),await r(o,l,c),c})(o,l)}}})(wn,dt,Ae,An,$t),jn=((e,t,n,s,r,i,a)=>class extends e{constructor(e,o){const l=r(e),c={...qe,...o},u=s(l,c),h=i(l);super(e,!1,u,h?n(c.maxDelayTime):null),this._delayTime=t(this,h,u.delayTime),a(this,c.maxDelayTime)}get delayTime(){return this._delayTime}})(on,Cn,qn,dt,Xt,Qt,Tn),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 i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const c=Z(l,o);if(!c){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 i.set(o,l),c?(await e(o,a.attack,l.attack),await e(o,a.knee,l.knee),await e(o,a.ratio,l.ratio),await e(o,a.release,l.release),await e(o,a.threshold,l.threshold)):(await s(o,a.attack,l.attack),await s(o,a.knee,l.knee),await s(o,a.ratio,l.ratio),await s(o,a.release,l.release),await s(o,a.threshold,l.threshold)),await r(a,o,l),l})(a,o)}}})(wn,Hn,Ae,An,$t),Kn=((e,t,n,s,r,i,a,o)=>class extends e{constructor(e,r){const l=i(e),c={...He,...r},u=s(l,c),h=a(l);super(e,!1,u,h?n():null),this._attack=t(this,h,u.attack),this._knee=t(this,h,u.knee),this._nativeDynamicsCompressorNode=u,this._ratio=t(this,h,u.ratio),this._release=t(this,h,u.release),this._threshold=t(this,h,u.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,Cn,$n,Hn,yt,Xt,Qt,Tn),Xn=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const c=Z(l,o);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(o,e)}return i.set(o,l),c?await e(o,a.gain,l.gain):await s(o,a.gain,l.gain),await r(a,o,l),l})(a,o)}}})(wn,pt,Ae,An,$t),Zn=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=r(e),l={...$e,...a},c=s(o,l),u=i(o);super(e,!1,c,u?n():null),this._gain=t(this,u,c.gain,ne,te)}get gain(){return this._gain}})(on,Cn,Xn,pt,Xt,Qt),Yn=((e,t,n,s)=>(r,i,{channelCount:a,channelCountMode:o,channelInterpretation:l,feedback:c,feedforward:u})=>{const h=ot(i,r.sampleRate),d=c instanceof Float64Array?c:new Float64Array(c),p=u instanceof Float64Array?u:new Float64Array(u),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)=>(i,a)=>{const o=new WeakMap;let l=null;const c=async(c,u)=>{let h=null,d=t(c);const p=Z(d,u);if(void 0===u.createIIRFilter?h=e(u,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):p||(d=u.createIIRFilter(a,i)),o.set(u,null===h?d:h),null!==h){if(null===l){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new n(c.context.destination.channelCount,c.context.length,u.sampleRate);l=(async()=>{await s(c,e,e.destination);return((e,t,n,s)=>{const r=n instanceof Float64Array?n:new Float64Array(n),i=s instanceof Float64Array?s:new Float64Array(s),a=r.length,o=i.length,l=Math.min(a,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,i)=>class extends e{constructor(e,a){const o=s(e),l=r(o),c={...Ze,...a},u=t(o,l?null:e.baseLatency,c);super(e,!1,u,l?n(c.feedback,c.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)})})(u),this._nativeIIRFilterNode=u,i(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}})(on,es,Jn,Xt,Qt,Tn),ns=((e,t,n,s,r,i,a,o)=>(l,c)=>{const u=c.listener,{forwardX:h,forwardY:d,forwardZ:p,positionX:f,positionY:m,positionZ:g,upX:y,upY:b,upZ:w}=void 0===u.forwardX?(()=>{const h=new Float32Array(1),d=t(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),p=a(c);let f=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const y=()=>{if(f)return;f=!0;const e=s(c,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[i(e,h,0),i(e,h,1),i(e,h,2),i(e,h,3),i(e,h,4),i(e,h,5)];t.some(((e,t)=>e!==m[t]))&&(u.setOrientation(...t),m=t);const n=[i(e,h,6),i(e,h,7),i(e,h,8)];n.some(((e,t)=>e!==g[t]))&&(u.setPosition(...n),g=n)},d.connect(e)},b=e=>t=>{t!==m[e]&&(m[e]=t,u.setOrientation(...m))},w=e=>t=>{t!==g[e]&&(g[e]=t,u.setPosition(...g))},v=(t,s,i)=>{const a=n(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:s});a.connect(d,0,t),a.start(),Object.defineProperty(a.offset,"defaultValue",{get:()=>s});const u=e({context:l},p,a.offset,ne,te);var h,f,m,g,b,w,v;return o(u,"value",(e=>()=>e.call(u)),(e=>t=>{try{e.call(u,t)}catch(e){if(9!==e.code)throw e}y(),p&&i(t)})),u.cancelAndHoldAtTime=(h=u.cancelAndHoldAtTime,p?()=>{throw r()}:(...e)=>{const t=h.apply(u,e);return y(),t}),u.cancelScheduledValues=(f=u.cancelScheduledValues,p?()=>{throw r()}:(...e)=>{const t=f.apply(u,e);return y(),t}),u.exponentialRampToValueAtTime=(m=u.exponentialRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=m.apply(u,e);return y(),t}),u.linearRampToValueAtTime=(g=u.linearRampToValueAtTime,p?()=>{throw r()}:(...e)=>{const t=g.apply(u,e);return y(),t}),u.setTargetAtTime=(b=u.setTargetAtTime,p?()=>{throw r()}:(...e)=>{const t=b.apply(u,e);return y(),t}),u.setValueAtTime=(w=u.setValueAtTime,p?()=>{throw r()}:(...e)=>{const t=w.apply(u,e);return y(),t}),u.setValueCurveAtTime=(v=u.setValueCurveAtTime,p?()=>{throw r()}:(...e)=>{const t=v.apply(u,e);return y(),t}),u};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))}})():u;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}}})(Cn,Dn,Ln,gt,yt,St,Qt,_t),ss=new WeakMap,rs=((e,t,n,s,r,i)=>class extends n{constructor(n,i){super(n),this._nativeContext=n,O.set(this,n),s(n)&&r.set(n,new Set),this._destination=new e(this,i),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?i(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),is=((e,t,n,s,r,i)=>(a,o)=>{const l=a.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(a)))||it(l),t(s,(()=>s(a)))||i(l,a),t(r,(()=>r(a)))||at(l),e(a,l),l})(yn,Wt,It,Nt,Ot,Mt),as=((e,t,n,s,r)=>()=>{const i=new WeakMap;let a=null,o=null,l=null;return{set periodicWave(e){a=e},set start(e){o=e},set stop(e){l=e},render(c,u){const h=i.get(u);return void 0!==h?Promise.resolve(h):(async(c,u)=>{let h=n(c);const d=Z(h,u);if(!d){const e={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,detune:h.detune.value,frequency:h.frequency.value,periodicWave:null===a?void 0:a,type:h.type};h=t(u,e),null!==o&&h.start(o),null!==l&&h.stop(l)}return i.set(u,h),d?(await e(u,c.detune,h.detune),await e(u,c.frequency,h.frequency)):(await s(u,c.detune,h.detune),await s(u,c.frequency,h.frequency)),await r(c,u,h),h})(c,u)}}})(wn,is,Ae,An,$t),os=((e,t,n,s,r,i,a)=>class extends e{constructor(e,a){const o=r(e),l={...wt,...a},c=n(o,l),u=i(o),h=u?s():null,d=e.sampleRate/2;super(e,!1,c,h),this._detune=t(this,u,c.detune,153600,-153600),this._frequency=t(this,u,c.frequency,d,-d),this._nativeOscillatorNode=c,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?a(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,Cn,is,as,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),cs=((e,t,n,s,r)=>(i,{curve:a,oversample:o,...l})=>{const c=i.createWaveShaper(),u=i.createWaveShaper();nt(c,l),nt(u,l);const h=n(i,{...l,gain:1}),d=n(i,{...l,gain:-1}),p=n(i,{...l,gain:1}),f=n(i,{...l,gain:-1});let m=null,g=!1,y=null;const b={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){h.channelCount=e,d.channelCount=e,c.channelCount=e,p.channelCount=e,u.channelCount=e,f.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){h.channelCountMode=e,d.channelCountMode=e,c.channelCountMode=e,p.channelCountMode=e,u.channelCountMode=e,f.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){h.channelInterpretation=e,d.channelInterpretation=e,c.channelInterpretation=e,p.channelInterpretation=e,u.channelInterpretation=e,f.channelInterpretation=e},get context(){return c.context},get curve(){return y},set curve(n){if(null!==n&&n.length<2)throw t();if(null===n)c.curve=n,u.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),i=(e+1)/2-1;for(let a=1;ah.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>h.dispatchEvent(e[0]),removeEventListener:(...e)=>h.removeEventListener(e[0],e[1],e[2])};null!==a&&(b.curve=a instanceof Float32Array?a:new Float32Array(a)),o!==b.oversample&&(b.oversample=o);return r(ht(b,p),(()=>{h.connect(c).connect(p),h.connect(d).connect(u).connect(f).connect(p),g=!0,s(y)&&(m=e(i,h))}),(()=>{h.disconnect(c),c.disconnect(p),h.disconnect(d),d.disconnect(u),u.disconnect(f),f.disconnect(p),g=!1,null!==m&&(m(),m=null)}))})(ls,Ke,pt,Et,Nn),us=((e,t,n,s,r,i,a)=>(o,l)=>{const c=o.createWaveShaper();if(null!==i&&"webkitAudioContext"===i.name&&void 0===o.createGain().gain.automationRate)return n(o,l);nt(c,l);const u=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==u&&u.length<2)throw t();tt(c,{curve:u},"curve"),tt(c,l,"oversample");let h=null,d=!1;a(c,"curve",(e=>()=>e.call(c)),(t=>n=>(t.call(c,n),d&&(s(n)&&null===h?h=e(o,c):s(n)||null===h||(h(),h=null)),n)));return r(c,(()=>{d=!0,s(c.curve)&&(h=e(o,c))}),(()=>{d=!1,null!==h&&(h(),h=null)}))})(ls,Ke,cs,Et,Nn,tn,_t),hs=((e,t,n,s,r,i,a,o,l,c)=>(u,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:p,distanceModel:f,maxDistance:m,orientationX:g,orientationY:y,orientationZ:b,panningModel:w,positionX:v,positionY:A,positionZ:x,refDistance:C,rolloffFactor:k,...S})=>{const E=u.createPanner();if(S.channelCount>2)throw a();if("max"===S.channelCountMode)throw a();nt(E,S);const _={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},T=n(u,{..._,channelInterpretation:"speakers",numberOfInputs:6}),I=s(u,{...S,gain:1}),N=s(u,{..._,gain:1}),O=s(u,{..._,gain:0}),D=s(u,{..._,gain:0}),R=s(u,{..._,gain:0}),M=s(u,{..._,gain:0}),F=s(u,{..._,gain:0}),B=r(u,256,6,1),z=i(u,{..._,curve:new Float32Array([1,1]),oversample:"none"});let L=[g,y,b],P=[v,A,x];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(D.gain,"defaultValue",{get:()=>0}),Object.defineProperty(R.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 a();I.channelCount=e,E.channelCount=e},get channelCountMode(){return E.channelCountMode},set channelCountMode(e){if("max"===e)throw a();I.channelCountMode=e,E.channelCountMode=e},get channelInterpretation(){return E.channelInterpretation},set channelInterpretation(e){I.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[I]},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 D.gain},get panningModel(){return E.panningModel},set panningModel(e){E.panningModel=e},get positionX(){return R.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)=>I.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>I.dispatchEvent(e[0]),removeEventListener:(...e)=>I.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),A!==W.positionY.value&&(W.positionY.value=A),x!==W.positionZ.value&&(W.positionZ.value=x),C!==W.refDistance&&(W.refDistance=C),k!==W.rolloffFactor&&(W.rolloffFactor=k),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 c(ht(W,E),(()=>{I.connect(E),e(I,z,0,0),z.connect(N).connect(T,0,0),z.connect(O).connect(T,0,1),z.connect(D).connect(T,0,2),z.connect(R).connect(T,0,3),z.connect(M).connect(T,0,4),z.connect(F).connect(T,0,5),T.connect(B).connect(u.destination)}),(()=>{I.disconnect(E),o(I,z,0,0),z.disconnect(N),N.disconnect(T),z.disconnect(O),O.disconnect(T),z.disconnect(D),D.disconnect(T),z.disconnect(R),R.disconnect(T),z.disconnect(M),M.disconnect(T),z.disconnect(F),F.disconnect(T),T.disconnect(B),B.disconnect(u.destination)}))})(ge,Ke,Dn,pt,gt,us,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,i,a,o,l,c)=>()=>{const u=new WeakMap;let h=null;return{render(d,p){const f=u.get(p);return void 0!==f?Promise.resolve(f):(async(d,p)=>{let f=null,m=i(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(u.set(p,null===f?m:f),null!==f){if(null===h){if(null===a)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new a(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 c(e)})()}const e=await h,i=s(p,{...g,gain:1});await l(d,p,i);const u=[];for(let t=0;te!==m[t]))||n.some(((e,t)=>e!==b[t]))){m=e,b=n;const a=t/p.sampleRate;w.gain.setValueAtTime(0,a),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,a),i.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,Dn,Ln,pt,ds,Ae,Yt,An,$t,Qn),fs=((e,t,n,s,r,i,a)=>class extends e{constructor(e,o){const l=r(e),c={...vt,...o},u=n(l,c),h=i(l);super(e,!1,u,h?s():null),this._nativePannerNode=u,this._orientationX=t(this,h,u.orientationX,ne,te),this._orientationY=t(this,h,u.orientationY,ne,te),this._orientationZ=t(this,h,u.orientationZ,ne,te),this._positionX=t(this,h,u.positionX,ne,te),this._positionY=t(this,h,u.positionY,ne,te),this._positionZ=t(this,h,u.positionZ,ne,te),a(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,Cn,ds,ps,Xt,Qt,Tn),ms=(e=>(t,{disableNormalization:n,imag:s,real:r})=>{const i=s instanceof Float32Array?s:new Float32Array(s),a=r instanceof Float32Array?r:new Float32Array(r),o=t.createPeriodicWave(a,i,{disableNormalization:n});if(Array.from(s).length<2)throw e();return o})(Q),gs=((e,t,n,s)=>class r{constructor(r,i){const a=t(r),o=s({...At,...i}),l=e(a,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,i)=>{const a=16385,o=new Float32Array([1,1]),l=Math.PI/2,c={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...c,oversample:"none"},h=(e,i,h,d,p)=>{if(1===i)return((e,t,r,i)=>{const h=new Float32Array(a),d=new Float32Array(a);for(let e=0;e{const d=new Float32Array(a),p=new Float32Array(a),f=new Float32Array(a),m=new Float32Array(a),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,{...c,gain:0}),w=s(e,{...u,curve:d}),v=n(e,{...c,gain:0}),A=s(e,{...u,curve:p}),x=s(e,{...u,curve:o}),C=n(e,{...c,gain:0}),k=s(e,{...u,curve:f}),S=n(e,{...c,gain:0}),E=s(e,{...u,curve:m});return{connectGraph(){r.connect(y),r.connect(void 0===x.inputs?x:x.inputs[0]),y.connect(b,0),y.connect(v,0),y.connect(C,1),y.connect(S,1),x.connect(i),i.connect(void 0===w.inputs?w:w.inputs[0]),i.connect(void 0===A.inputs?A:A.inputs[0]),i.connect(void 0===k.inputs?k:k.inputs[0]),i.connect(void 0===E.inputs?E:E.inputs[0]),w.connect(b.gain),A.connect(v.gain),k.connect(C.gain),E.connect(S.gain),b.connect(h,0,0),C.connect(h,0,0),v.connect(h,0,1),S.connect(h,0,1)},disconnectGraph(){r.disconnect(y),r.disconnect(void 0===x.inputs?x:x.inputs[0]),y.disconnect(b,0),y.disconnect(v,0),y.disconnect(C,1),y.disconnect(S,1),x.disconnect(i),i.disconnect(void 0===w.inputs?w:w.inputs[0]),i.disconnect(void 0===A.inputs?A:A.inputs[0]),i.disconnect(void 0===k.inputs?k:k.inputs[0]),i.disconnect(void 0===E.inputs?E:E.inputs[0]),w.disconnect(b.gain),A.disconnect(v.gain),k.disconnect(C.gain),E.disconnect(S.gain),b.disconnect(h,0,0),C.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:a,pan:o,...l})=>{if("max"===a)throw r();const c=e(t,{...l,channelCount:1,channelCountMode:a,numberOfInputs:2}),u=n(t,{...l,channelCount:s,channelCountMode:a,gain:1}),d=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:o});let{connectGraph:p,disconnectGraph:f}=h(t,s,u,d,c);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 u.channelCount},set channelCount(e){u.channelCount!==e&&(g&&f(),({connectGraph:p,disconnectGraph:f}=h(t,e,u,d,c)),g&&p()),u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw r();u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[u]},get numberOfInputs(){return u.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get pan(){return d.gain},addEventListener:(...e)=>u.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>u.dispatchEvent(e[0]),removeEventListener:(...e)=>u.removeEventListener(e[0],e[1],e[2])};let g=!1;return i(ht(m,c),(()=>{p(),g=!0}),(()=>{f(),g=!1}))}})(Dn,ut,pt,us,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 i=n.createStereoPanner();return nt(i,s),rt(i,s,"pan"),Object.defineProperty(i,"channelCountMode",{get:()=>r,set:e=>{if(e!==r)throw t()}}),i})(ys,yt),ws=((e,t,n,s,r)=>()=>{const i=new WeakMap;return{render(a,o){const l=i.get(o);return void 0!==l?Promise.resolve(l):(async(a,o)=>{let l=n(a);const c=Z(l,o);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(o,e)}return i.set(o,l),c?await e(o,a.pan,l.pan):await s(o,a.pan,l.pan),me(l)?await r(a,o,l.inputs[0]):await r(a,o,l),l})(a,o)}}})(wn,bs,Ae,An,$t),vs=((e,t,n,s,r,i)=>class extends e{constructor(e,a){const o=r(e),l={...xt,...a},c=n(o,l),u=i(o);super(e,!1,c,u?s():null),this._pan=t(this,u,c.pan)}get pan(){return this._pan}})(on,Cn,bs,ws,Xt,Qt),As=((e,t,n)=>()=>{const s=new WeakMap;return{render(r,i){const a=s.get(i);return void 0!==a?Promise.resolve(a):(async(r,i)=>{let a=t(r);if(!Z(a,i)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=e(i,t)}return s.set(i,a),me(a)?await n(r,i,a.inputs[0]):await n(r,i,a),a})(r,i)}}})(us,Ae,$t),xs=((e,t,n,s,r,i,a)=>class extends e{constructor(e,t){const o=r(e),l={...kt,...t},c=n(o,l);super(e,!0,c,i(o)?s():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=c,a(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,us,As,Xt,Qt,Tn),Cs=(e=>null!==e&&e.isSecureContext)(qt),ks=(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=Cs?((e,t,n,s,r,i,a,o,l,c,u,h,d)=>{let p=0;return(f,m,g={credentials:"omit"})=>{const y=u.get(f);if(void 0!==y&&y.has(m))return Promise.resolve();const b=c.get(f);if(void 0!==b){const e=b.get(m);if(void 0!==e)return e}const w=i(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,i]=L(e,t),c=new Blob([`${r};((AudioWorkletProcessor,registerProcessor)=>{${i}\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"}),u=URL.createObjectURL(c);return w.audioWorklet.addModule(u,g).then((()=>{if(o(w))return w;const e=a(w);return e.audioWorklet.addModule(u,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${s}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(u)))}));return void 0===b?c.set(f,new Map([[m,v]])):b.set(m,v),v.then((()=>{const e=u.get(f);void 0===e?u.set(f,new Set([m])):e.add(m)})).finally((()=>{const e=c.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 i=e.document.createElement("script"),a=new Blob([t],{type:"application/javascript"}),o=URL.createObjectURL(a),l=e.onerror,c=()=>{e.onerror=l,URL.revokeObjectURL(o)};e.onerror=(t,n,r,i,a)=>n===o||n===e.location.href&&1===r&&1===i?(c(),s(a),!1):null!==l?l(t,n,r,i,a):void 0,i.onerror=()=>{c(),s(new SyntaxError)},i.onload=()=>{c(),n()},i.src=o,i.type="module",r.appendChild(i)}})))(qt),ks,(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 i=!1,a=!1;try{await s.audioWorklet.addModule(r);const t=new e(s,"a",{numberOfOutputs:0}),n=s.createOscillator();t.port.onmessage=()=>i=!0,t.onprocessorerror=()=>a=!0,n.connect(t),n.start(0),await s.startRendering(),await new Promise((e=>setTimeout(e)))}catch{}finally{URL.revokeObjectURL(r)}return i&&!a})(an,Yt),qt):void 0,Ts=((e,t)=>n=>e(n)||t(n))(nn,Qt),Is=((e,t,n,s,r,i,a,o,l,c,u)=>(h,d)=>{const p=a(h)?h:i(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=>(Ue(d).catch((()=>{})),t(o,(()=>o(n)))||u(n),e.add(n),n))):new Promise(((t,n)=>{const r=async()=>{try{await Ue(d)}catch{}},i=e=>{n(e),r()};try{p.decodeAudioData(d,(n=>{"function"!=typeof n.copyFromChannel&&(c(n),J(n)),e.add(n),r().then((()=>t(n)))}),(e=>{i(null===e?s():e)}))}catch(e){i(e)}}))})(un,Wt,(()=>new DOMException("","DataCloneError")),(()=>new DOMException("","EncodingError")),new WeakSet,Xt,Ts,Y,Je,fn,mn),Ns=((e,t,n,s,r,i,a,o,l,c,u,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 i(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new a(this,{numberOfOutputs:e})}createConstantSource(){return new o(this)}createConvolver(){return new l(this)}createDelay(e=1){return new u(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 c(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof n&&n(e),e}))}})(_s,cn,gn,Sn,In,Mn,Bn,Vn,Un,Is,jn,Kn,Zn,ts,rs,os,fs,gs,vs,xs),Os=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e),a=t(i,r);if(s(i))throw TypeError();super(e,!0,a,null),this._nativeMediaElementAudioSourceNode=a}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(on,((e,t)=>e.createMediaElementSource(t.mediaElement)),Xt,Qt),Ds=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e);if(s(i))throw new TypeError;const a={...Qe,...r},o=t(i,a);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),Rs=((e,t,n,s)=>class extends e{constructor(e,r){const i=n(e),a=t(i,r);if(s(i))throw new TypeError;super(e,!0,a,null),this._nativeMediaStreamAudioSourceNode=a}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]),i=n.createMediaStreamSource(r);if("audio"!==s.kind)throw e();if(t(n))throw new TypeError;return i})(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,i,a,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(!ce(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:i}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===r?512/i:"interactive"===r||void 0===r?256/i:"playback"===r?1024/i:128*Math.max(2,Math.min(128,Math.round(r*i/128)))/i,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 i(this)}createMediaStreamSource(e){return new a(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,Ct,Os,Ds,Rs,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 i=t[s];if(void 0===i)throw e();return _e(n)?i.connect(n,0,r):i.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),Gs=new WeakMap,Us=((e,t)=>n=>t(e,n))(Gs,W),qs=((e,t,n,s,r,i,a,o,l,c,u,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 A=new MessageChannel,x=[],C=[];for(let e=0;evoid 0===e?0:e},maxValue:{get:()=>void 0===t?ne:t},minValue:{get:()=>void 0===n?te:n}}),k.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)),T=r(p,{channelCount:Math.max(1,w),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,w)}),I=[];for(let e=0;e{const n=k[t];return n.connect(S,0,b+t),n.start(0),[e,n.offset]})));S.connect(_);let O=g.channelInterpretation,D=null;const R=0===g.numberOfOutputs?[_]:I,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 x)t.channelInterpretation=e;O=e},get context(){return _.context},get inputs(){return x},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return D},set onprocessorerror(e){"function"==typeof D&&M.removeEventListener("processorerror",D),D="function"==typeof e?e:null,"function"==typeof D&&M.addEventListener("processorerror",D)},get parameters(){return N},get port(){return A.port2},addEventListener:(...e)=>_.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,R),disconnect:c.bind(null,R),dispatchEvent:(...e)=>_.dispatchEvent(e[0]),removeEventListener:(...e)=>_.removeEventListener(e[0],e[1],e[2])},B=new Map;var z,L;A.port1.addEventListener=(z=A.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=>{u(p.currentTime,p.sampleRate,(()=>t(e)))},B.set(t,e[1]))}}return z.call(A.port1,e[0],e[1],e[2])}),A.port1.removeEventListener=(L=A.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(A.port1,e[0],e[1],e[2])});let P=null;Object.defineProperty(A.port1,"onmessage",{get:()=>P,set:e=>{"function"==typeof P&&A.port1.removeEventListener("message",P),P="function"==typeof e?e:null,"function"==typeof P&&(A.port1.addEventListener("message",P),A.port1.start())}}),m.prototype.port=A.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 i=lt(n,s);return r.set(t,i),i})(p,M,m,g);W.then((e=>V=e));const G=Be(g.numberOfInputs,g.channelCount),U=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(T);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=u(p.currentTime+s/p.sampleRate,p.sampleRate,(()=>V.process(e,U,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(T);for(let e=0,t=0;e{j&&(Z(),H()),K=!1}))})(Ps,Q,Ke,Dn,ut,Ln,pt,gt,yt,Ws,ks,Us,Nn),js=((e,t,n,s,r)=>(i,a,o,l,c,u)=>{if(null!==o)try{const t=new o(i,l,u),s=new Map;let a=null;if(Object.defineProperties(t,{channelCount:{get:()=>u.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>a,set:e=>{"function"==typeof a&&t.removeEventListener("processorerror",a),a="function"==typeof e?e:null,"function"==typeof a&&t.addEventListener("processorerror",a)}}}),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!==u.numberOfOutputs){const e=n(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(i.destination);return r(t,(()=>e.disconnect()),(()=>e.connect(i.destination)))}return t}catch(e){if(11===e.code)throw s();throw e}var h,d;if(void 0===c)throw s();return(e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}})(u),t(i,a,c,u)})(Ke,qs,pt,yt,Nn),Hs=((e,t,n,s,r,i,a,o,l,c,u,h,d,p,f,m)=>(g,y,b)=>{const w=new WeakMap;let v=null;return{render(A,x){o(x,A);const C=w.get(x);return void 0!==C?Promise.resolve(C):(async(o,A)=>{let x=u(o),C=null;const k=Z(x,A),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(A,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),i=[];for(let e=0;e{const l=new d(n,128*Math.ceil(o.context.length/128),A.sampleRate),c=[],u=[];for(let e=0;e{const t=i(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(),A,y,S,b,c)}const e=await v,t=n(A,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,u,h]=C;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)})(Gs),Xs=Cs?((e,t,n,s,r,i,a,o,l,c,u,h,d,p)=>class extends t{constructor(t,p,f){var m;const g=o(t),y=l(g),b=u({...Re,...f});d(b);const w=M.get(g),v=null==w?void 0:w.get(p),A=y||"closed"!==g.state?g:null!==(m=a(g))&&void 0!==m?m:g,x=r(A,y?null:t.baseLatency,c,p,v,b);super(t,!0,x,y?s(p,b,v):null);const C=[];x.parameters.forEach(((e,t)=>{const s=n(this,y,e);C.push([t,s])})),this._nativeAudioWorkletNode=x,this._onprocessorerror=null,this._parameters=new De(C),y&&e(g,this);const{activeInputs:k}=i(this);h(x,k)}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,Cn,Hs,js,ie,$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,Ct,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,i,a,o)=>(l,c)=>n(l).render(l,c).then((()=>Promise.all(Array.from(s(c)).map((e=>n(e).render(e,c)))))).then((()=>r(c))).then((n=>("function"!=typeof n.copyFromChannel?(a(n),J(n)):t(i,(()=>i(n)))||o(n),e.add(n),n))))(un,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 i;if("number"==typeof e&&void 0!==n&&void 0!==r)i={length:n,numberOfChannels:e,sampleRate:r};else{if("object"!=typeof e)throw new Error("The given parameters are not valid.");i=e}const{length:a,numberOfChannels:o,sampleRate:l}={...bt,...i},c=s(o,a,l);t(Je,(()=>Je(c)))||c.addEventListener("statechange",(()=>{let e=0;const t=n=>{"running"===this._state&&(e>0?(c.removeEventListener("statechange",t),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):e+=1)};return t})()),super(c,o),this._length=a,this._nativeOfflineAudioContext=c,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))(T,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,i,a,o,l,c,u,h,d,p,f,m)=>{if(e(t,t)&&e(n,n)&&e(r,r)&&e(i,i)&&e(o,o)&&e(l,l)&&e(c,c)&&e(u,u)&&e(h,h)&&e(d,d)&&e(p,p))return(await Promise.all([e(s,s),e(a,a),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),i=URL.createObjectURL(n);let a=!1;try{await r.audioWorklet.addModule(i);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=()=>a=!0,n.connect(t),n.start(0),await r.startRendering(),a=await new Promise((e=>{s.port1.onmessage=({data:t})=>e(1===t),s.port1.postMessage(0)}))}catch{}finally{s.port1.close(),URL.revokeObjectURL(i)}return a})(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),Dt,(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),Rt);function rr(e,t){if(!e)throw new Error(t)}function ir(e,t,n=1/0){if(!(t<=e&&e<=n))throw new RangeError(`Value must be within [${t}, ${n}], got: ${e}`)}function ar(e){e.isOffline||"running"===e.state||ur('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let or=console;function lr(e){or=e}function cr(...e){or.log(...e)}function ur(...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,Ar=vr&&(vr.hasOwnProperty("AudioContext")||vr.hasOwnProperty("webkitAudioContext"));function xr(e,t,n,s){var r,i=arguments.length,a=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function Cr(e,t,n,s){return new(n||(n=Promise))((function(r,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(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(a,o)}l((s=s.apply(e,t||[])).next())}))}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;class kr{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 Tr(e){return Js(e)}function Ir(e){return e instanceof AudioBuffer}function Nr(e,t){return"value"===e||Sr(t)||Er(t)||Ir(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 Dr(e,t,n=[],s){const r={},i=Array.from(t);if(mr(i[0])&&s&&!Reflect.has(i[0],s)){Object.keys(i[0]).some((t=>Reflect.has(e,t)))||(Or(r,{[s]:i[0]}),n.splice(n.indexOf(s),1),i.shift())}if(1===i.length&&mr(i[0]))Or(r,i[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)&&cr(this,...e)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}Fr.version=i;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 Ur=[];function qr(e){Ur.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 Gr,this._timeoutIds=0,this._initialized=!1,this.isOffline=!1,this._workletModules=new Map;const e=Dr(Xr.getDefaults(),arguments,["context"]);e.context?this._context=e.context:this._context=function(e){return new Bs(e)}({latencyHint:e.latencyHint}),this._ticker=new kr(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,Ur.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(Tr(this._context),"Not available if OfflineAudioContext");return this._context.createMediaStreamSource(e)}createMediaElementSource(e){rr(Tr(this._context),"Not available if OfflineAudioContext");return this._context.createMediaElementSource(e)}createMediaStreamDestination(){rr(Tr(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 Cr(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 Cr(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 Tr(this._context)?this._context.resume():Promise.resolve()}close(){return Cr(this,void 0,void 0,(function*(){var e;Tr(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=Dr(Jr.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=e.reverse,this.onload=e.onload,e.url&&Ir(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:si().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 Cr(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=si(),i=r.createBuffer(n,s,r.sampleRate),a=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 Cr(this,void 0,void 0,(function*(){const t=new Jr;return yield t.load(e)}))}static load(e){return Cr(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 si().decodeAudioData(r)}))}static supportsType(e){const t=e.split("."),n=t[t.length-1];return""!==document.createElement("audio").canPlayType("audio/"+n)}static loaded(){return Cr(this,void 0,void 0,(function*(){for(yield Promise.resolve();Jr.downloads.length;)yield Jr.downloads[0]}))}}Jr.baseUrl="",Jr.downloads=[];class ei 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 Cr(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 Cr(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 ti=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 Cr(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 ni=ti;function si(){return ni===ti&&Ar&&ri(new Xr),ni}function ri(e){ni=Tr(e)?new Xr(e):_r(e)?new ei(e):e}function ii(){return ni.resume()}if(vr&&!vr.TONE_SILENCE_LOGGING){let e="v";"dev"===i&&(e="")}function ai(e){return Math.pow(10,e/20)}function oi(e){return Math.log(e)/Math.LN10*20}function li(e){return Math.pow(2,e/12)}let ci=440;function ui(e){return Math.round(hi(e))}function hi(e){return 69+12*Math.log2(e/ci)}function di(e){return ci*Math.pow(2,(e-69)/12)}class pi 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 pi&&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 fi extends pi{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 fi(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 fi(this.context,t[0]).toSeconds();return t.forEach((t=>{const r=new fi(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 ui(this.toFrequency())}_now(){return this.context.now()}}function mi(e,t){return new fi(si(),e,t)}class gi extends fi{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return ci}static set A4(e){!function(e){ci=e}(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(e){return"midi"===this.defaultUnits?e:gi.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method(e,t){const n=yi[e.toLowerCase()]+12*(parseInt(t,10)+1);return"midi"===this.defaultUnits?n:gi.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 gi(this.context,this.valueOf()*li(e))}harmonize(e){return e.map((e=>this.transpose(e)))}toMidi(){return ui(this.valueOf())}toNote(){const e=this.toFrequency(),t=Math.log2(e/gi.A4);let n=Math.round(12*t)+57;const s=Math.floor(n/12);s<0&&(n+=-12*s);return bi[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 di(e)}static ftom(e){return ui(e)}}const yi={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},bi=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];function wi(e,t){return new gi(si(),e,t)}class vi extends fi{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}function Ai(e,t){return new vi(si(),e,t)}class xi extends Fr{constructor(){super();const e=Dr(xi.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=e.context}static getDefaults(){return{context:si()}}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 fi(this.context,e).toSeconds()}toFrequency(e){return new gi(this.context,e).toFrequency()}toTicks(e){return new vi(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 xi?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 xi?this[t].set(e[t]):this[t]=e[t])})),this}}class Ci extends Gr{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 ir(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 i=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 Si extends xi{constructor(){super(...arguments),this.name="ToneAudioNode",this._internalChannels=[]}get numberOfInputs(){return dr(this.input)?Sr(this.input)||this.input instanceof ki?1:this.input.numberOfInputs:0}get numberOfOutputs(){return dr(this.output)?this.output.numberOfOutputs:0}_isAudioNode(e){return dr(e)&&(e instanceof Si||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 _i(this,e,t,n),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return ur("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(e,t=0,n=0){return Ti(this,e,t,n),this}chain(...e){return Ei(this,...e),this}fan(...e){return e.forEach((e=>this.connect(e))),this}dispose(){return super.dispose(),dr(this.input)&&(this.input instanceof Si?this.input.dispose():Er(this.input)&&this.input.disconnect()),dr(this.output)&&(this.output instanceof Si?this.output.dispose():Er(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function Ei(...e){const t=e.shift();e.reduce(((e,t)=>(e instanceof Si?e.connect(t):Er(e)&&_i(e,t),t)),t)}function _i(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 Si||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 Si||t instanceof ki;)dr(t.input)&&(t=t.input);for(;e instanceof Si;)dr(e.output)&&(e=e.output);Sr(t)?e.connect(t,n):e.connect(t,n,s)}function Ti(e,t,n=0,s=0){if(dr(t))for(;t instanceof Si;)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 Ii extends Si{constructor(){super(Dr(Ii.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const e=Dr(Ii.getDefaults(),arguments,["gain","units"]);this.gain=new ki({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(Si.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class Ni extends Si{constructor(e){super(e),this.onended=Qr,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new Ii({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(Si.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 Oi extends Ni{constructor(){super(Dr(Oi.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const e=Dr(Oi.getDefaults(),arguments,["offset"]);_i(this._source,this._gainNode),this.offset=new ki({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(Ni.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 Di extends Si{constructor(){super(Dr(Di.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const e=Dr(Di.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new Oi({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(Si.getDefaults(),{convert:!0,units:"number",value:0})}connect(e,t=0,n=0){return Ri(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 Ri(e,t,n,s){(t instanceof ki||Sr(t)||t instanceof Di&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof Di&&(t.overridden=!0)),_i(e,t,n,s)}class Mi extends ki{constructor(){super(Dr(Mi.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Gr(1/0),this._multiplier=1;const e=Dr(Mi.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(ki.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),i=Math.round(Math.max(1/n,1));for(let e=0;e<=i;e++){const i=n*e+t,a=this._exponentialApproach(r.time,r.value,s,n,i);this.linearRampToValueAtTime(this._toType(a),i)}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),i=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(i,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),i=this._getTicksUntilEvent(r,n);return s.ticks=Math.max(i,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)),i=(t-s.time)/r;for(let e=0;e<=r;e++){const r=i*e+s.time,a=this._exponentialInterpolate(s.time,s.value,t,n,r);this.linearRampToValueAtTime(this._toType(a),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),i=Math.sqrt(Math.pow(s,2)-2*r*(t.ticks-e)),a=(-s+i)/r;return(a>0?a:(-s-i)/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 Fi extends Di{constructor(){super(Dr(Fi.getDefaults(),arguments,["value"])),this.name="TickSignal";const e=Dr(Fi.getDefaults(),arguments,["value"]);this.input=this._param=new Mi({context:this.context,convert:e.convert,multiplier:e.multiplier,param:this._constantSource.offset,units:e.units,value:e.value})}static getDefaults(){return Object.assign(Di.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 Bi extends xi{constructor(){super(Dr(Bi.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new Ci,this._tickOffset=new Gr;const e=Dr(Bi.getDefaults(),arguments,["frequency"]);this.frequency=new Fi({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"},xi.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,i=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&&(i=n.ticks,t=n.time),"started"===r.state&&"started"!==e.state&&(i+=this.frequency.getTicksAtTime(e.time)-this.frequency.getTicksAtTime(t)),r=e})),this._state.remove(s),i}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),i=this.frequency.getTicksAtTime(r)+e-n.ticks;return this.frequency.getTimeOfTick(i)}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 i=Math.max(s.time,e),a=this.frequency.getTicksAtTime(i),o=a-this.frequency.getTicksAtTime(s.time);let l=Math.ceil(o)-o;l=Vr(l,1)?0:l;let c=this.frequency.getTimeOfTick(a+l);for(;c{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(zi);class Li extends Si{constructor(){super(Dr(Li.getDefaults(),arguments,["delayTime","maxDelay"])),this.name="Delay";const e=Dr(Li.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 ki({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(Si.getDefaults(),{delayTime:0,maxDelay:1})}get maxDelay(){return this._maxDelay}dispose(){return super.dispose(),this._delayNode.disconnect(),this.delayTime.dispose(),this}}function Pi(e,t,n=2,s=si().sampleRate){return Cr(this,void 0,void 0,(function*(){const r=si(),i=new ei(n,t,s);ri(i),yield e(i);const a=i.render();ri(r);const o=yield a;return new Jr(o)}))}class Vi extends Fr{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const e=Dr(Vi.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 Wi extends gi{constructor(){super(...arguments),this.name="MidiClass",this.defaultUnits="midi"}_frequencyToUnits(e){return ui(super._frequencyToUnits(e))}_ticksToUnits(e){return ui(super._ticksToUnits(e))}_beatsToUnits(e){return ui(super._beatsToUnits(e))}_secondsToUnits(e){return ui(super._secondsToUnits(e))}toMidi(){return this.valueOf()}toFrequency(){return di(this.toMidi())}transpose(e){return new Wi(this.context,this.toMidi()+e)}}function Gi(e,t){return new Wi(si(),e,t)}class Ui extends vi{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 qi(e,t){return new Ui(si(),e,t)}class ji extends xi{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Gr,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 ji({context:e})})),Hr((e=>{e.draw.dispose()}));class Hi 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 $i(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 $i{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 Ki extends Si{constructor(){super(Dr(Ki.getDefaults(),arguments,["volume"])),this.name="Volume";const e=Dr(Ki.getDefaults(),arguments,["volume"]);this.input=this.output=new Ii({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(Si.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 Xi extends Si{constructor(){super(Dr(Xi.getDefaults(),arguments)),this.name="Destination",this.input=new Ki({context:this.context}),this.output=new Ii({context:this.context}),this.volume=this.input.volume;const e=Dr(Xi.getDefaults(),arguments);Ei(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(Si.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),Ei(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}}qr((e=>{e.destination=new Xi({context:e})})),Hr((e=>{e.destination.dispose()}));class Zi extends Fr{constructor(e){super(),this.name="TimelineValue",this._timeline=new Gr({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 Yi{constructor(e,t){this.id=Yi._eventId++;const n=Object.assign(Yi.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}}Yi._eventId=0;class Qi extends Yi{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(Qi.getDefaults(),t);this.duration=new Ui(e.context,n.duration).valueOf(),this._interval=new Ui(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({},Yi.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 Ui(this.context,this._nextTick).toSeconds()),this._nextTick+=this._interval,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new Ui(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 Ji extends xi{constructor(){super(Dr(Ji.getDefaults(),arguments)),this.name="Transport",this._loop=new Zi(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Gr,this._repeatedEvents=new Hi,this._syncedSignals=[],this._swingAmount=0;const e=Dr(Ji.getDefaults(),arguments);this._ppq=e.ppq,this._clock=new zi({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(xi.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 Ui(this.context,2*this._swingTicks/3).toSeconds()*s}this._timeline.forEachAtTime(t,(t=>t.invoke(e)))}schedule(e,t){const n=new Yi(this,{callback:e,time:new vi(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}scheduleRepeat(e,t,n,s=1/0){const r=new Qi(this,{callback:e,duration:new fi(this.context,s).toTicks(),interval:new fi(this.context,t).toTicks(),time:new vi(this.context,n).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(e,t){const n=new Yi(this,{callback:e,once:!0,time:new vi(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 Ui(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 fi(this.context,this._loopStart,"i").toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new fi(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 Ui(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 Ui(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 Ii(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(Ji),qr((e=>{e.transport=new Ji({context:e})})),Hr((e=>{e.transport.dispose()}));class ea extends Si{constructor(e){super(e),this.input=void 0,this._state=new Ci("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 Ki({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(Si.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(Rr(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 ar(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 ta extends Ni{constructor(){super(Dr(ta.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const e=Dr(ta.getDefaults(),arguments,["url","onload"]);_i(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new ki({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(Ni.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?Rr(t,this.loopStart):Rr(t,0);let i=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(i,e)&&(i=(i-t)%n+t),Vr(i,this.buffer.duration)&&(i=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Pr(i,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,i)),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 na extends ea{constructor(){super(Dr(na.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const e=Dr(na.getDefaults(),arguments,["type"]);this._playbackRate=e.playbackRate,this.type=e.type,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(ea.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(e){if(rr(e in ia,"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=ia[this._type];this._source=new ta({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 sa=220500,ra={brown:null,pink:null,white:null},ia={get brown(){if(!ra.brown){const e=[];for(let t=0;t<2;t++){const n=new Float32Array(sa);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);_i(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 Cr(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 oa(e,t){return Cr(this,void 0,void 0,(function*(){const n=t/e.context.sampleRate,s=new ei(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 la extends Ni{constructor(){super(Dr(la.getDefaults(),arguments,["frequency","type"])),this.name="ToneOscillatorNode",this._oscillator=this.context.createOscillator(),this._internalChannels=[this._oscillator];const e=Dr(la.getDefaults(),arguments,["frequency","type"]);_i(this._oscillator,this._gainNode),this.type=e.type,this.frequency=new ki({context:this.context,param:this._oscillator.frequency,units:"frequency",value:e.frequency}),this.detune=new ki({context:this.context,param:this._oscillator.detune,units:"cents",value:e.detune}),Zr(this,["frequency","detune"])}static getDefaults(){return Object.assign(Ni.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 ca extends ea{constructor(){super(Dr(ca.getDefaults(),arguments,["frequency","type"])),this.name="Oscillator",this._oscillator=null;const e=Dr(ca.getDefaults(),arguments,["frequency","type"]);this.frequency=new Di({context:this.context,units:"frequency",value:e.frequency}),Zr(this,"frequency"),this.detune=new Di({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(ea.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:"sine"})}_start(e){const t=this.toSeconds(e),n=new la({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 ca._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=ca._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),ca._periodicWaveCache.push({imag:n,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:t,type:this._type,wave:this._wave}),ca._periodicWaveCache.length>100&&ca._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){ir(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 i=1;if("custom"===e){if(i=this._partials.length+1,this._partialCount=this._partials.length,n=i,0===this._partials.length)return[s,r]}else{const t=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);t?(i=parseInt(t[2],10)+1,this._partialCount=parseInt(t[2],10),e=t[1],i=Math.max(i,2),n=i):this._partialCount=0,this._partials=[]}for(let a=1;a>1&1?-1:1):0,this._partials[a-1]=o;break;case"custom":o=this._partials[a-1];break;default:throw new TypeError("Oscillator: invalid type: "+e)}0!==o?(s[a]=-o*Math.sin(t*a),r[a]=o*Math.cos(t*a)):(s[a]=0,r[a]=0)}return[s,r]}_inverseFFT(e,t,n){let s=0;const r=e.length;for(let i=0;it.includes(e))),"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class da extends ua{constructor(){super(...arguments),this.name="AudioToGain",this._norm=new ha({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 pa extends Di{constructor(){super(Object.assign(Dr(pa.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const e=Dr(pa.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new Ii({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(Di.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class fa extends ea{constructor(){super(Dr(fa.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new da({context:this.context}),this._modulationNode=new Ii({context:this.context});const e=Dr(fa.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ca({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 ca({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pa({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(ca.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 Cr(this,void 0,void 0,(function*(){return oa(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 ma extends ea{constructor(){super(Dr(ma.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new Ii({context:this.context,gain:0});const e=Dr(ma.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new ca({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 Di({context:this.context,units:"frequency",value:e.frequency}),this._modulator=new ca({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new pa({context:this.context,units:"positive",value:e.harmonicity}),this.modulationIndex=new pa({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(ca.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 Cr(this,void 0,void 0,(function*(){return oa(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 ga extends ea{constructor(){super(Dr(ga.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new Ii({context:this.context,gain:0}),this._thresh=new ha({context:this.context,mapping:e=>e<=0?-1:1});const e=Dr(ga.getDefaults(),arguments,["frequency","width"]);this.width=new Di({context:this.context,units:"audioRange",value:e.width}),this._triangle=new ca({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(ea.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 Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class ya extends ea{constructor(){super(Dr(ya.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const e=Dr(ya.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Di({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Di({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(ca.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(ir(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 Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach((e=>e.dispose())),this}}class ba extends ea{constructor(){super(Dr(ba.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new pa({context:this.context,value:2});const e=Dr(ba.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new ga({context:this.context,frequency:e.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new ca({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(ea.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 Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const wa={am:fa,fat:ya,fm:ma,oscillator:ca,pulse:ga,pwm:ba};class va extends ea{constructor(){super(Dr(va.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const e=Dr(va.getDefaults(),arguments,["frequency","type"]);this.frequency=new Di({context:this.context,units:"frequency",value:e.frequency}),this.detune=new Di({context:this.context,units:"cents",value:e.detune}),Zr(this,["frequency","detune"]),this.set(e)}static getDefaults(){return Object.assign(ca.getDefaults(),ma.getDefaults(),fa.getDefaults(),ya.getDefaults(),ga.getDefaults(),ba.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=wa[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 wa[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 Cr(this,void 0,void 0,(function*(){return oa(this,e)}))}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class Aa extends Di{constructor(){super(Object.assign(Dr(Aa.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new Ii({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,Ei(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Di.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class xa extends ua{constructor(){super(Object.assign(Dr(xa.getDefaults(),arguments,["min","max"]))),this.name="Scale";const e=Dr(xa.getDefaults(),arguments,["min","max"]);this._mult=this.input=new pa({context:this.context,value:e.max-e.min}),this._add=this.output=new Aa({context:this.context,value:e.min}),this._min=e.min,this._max=e.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(ua.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 Ca extends ua{constructor(){super(Object.assign(Dr(Ca.getDefaults(),arguments))),this.name="Zero",this._gain=new Ii({context:this.context}),this.output=this._gain,this.input=void 0,_i(this.context.getConstant(0),this._gain)}dispose(){return super.dispose(),Ti(this.context.getConstant(0),this._gain),this}}class ka extends Si{constructor(){super(Dr(ka.getDefaults(),arguments,["frequency","min","max"])),this.name="LFO",this._stoppedValue=0,this._units="number",this.convert=!0,this._fromType=ki.prototype._fromType,this._toType=ki.prototype._toType,this._is=ki.prototype._is,this._clampValue=ki.prototype._clampValue;const e=Dr(ka.getDefaults(),arguments,["frequency","min","max"]);this._oscillator=new ca(e),this.frequency=this._oscillator.frequency,this._amplitudeGain=new Ii({context:this.context,gain:e.amplitude,units:"normalRange"}),this.amplitude=this._amplitudeGain.gain,this._stoppedSignal=new Di({context:this.context,units:"audioRange",value:0}),this._zeros=new Ca({context:this.context}),this._a2g=new da({context:this.context}),this._scaler=this.output=new xa({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(ca.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 ki||e instanceof Di)&&(this.convert=e.convert,this.units=e.units),Ri(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 Sa(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){ir(s,e,t),n.set(this,s)}})}}function Ea(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){ir(this.toSeconds(s),e,t),n.set(this,s)}})}}class _a extends ea{constructor(){super(Dr(_a.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const e=Dr(_a.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(ea.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Qr,onerror:Qr,playbackRate:1,reverse:!1})}load(e){return Cr(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?Rr(t,this._loopStart):Rr(t,0);const s=this.toSeconds(t),r=n;n=Rr(n,Math.max(this._buffer.duration-s,0));let i=this.toSeconds(n);i/=this._playbackRate,e=this.toSeconds(e);const a=new ta({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+i),this._state.setStateAtTime("stopped",e+i,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&hr(r)?a.start(e,s):a.start(e,s,i-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&&ir(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&&ir(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}}xr([Ea(0)],_a.prototype,"fadeIn",void 0),xr([Ea(0)],_a.prototype,"fadeOut",void 0);class Ta extends Si{constructor(){super(Dr(Ta.getDefaults(),arguments,["urls","onload"],"urls")),this.name="Players",this.input=void 0,this._players=new Map;const e=Dr(Ta.getDefaults(),arguments,["urls","onload"],"urls");this._volume=this.output=new Ki({context:this.context,volume:e.volume}),this.volume=this._volume.volume,Zr(this,"volume"),this._buffers=new Vi({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(ea.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 _a({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 Ia extends ea{constructor(){super(Dr(Ia.getDefaults(),arguments,["url","onload"])),this.name="GrainPlayer",this._loopStart=0,this._loopEnd=0,this._activeSources=[];const e=Dr(Ia.getDefaults(),arguments,["url","onload"]);this.buffer=new Jr({onload:e.onload,onerror:e.onerror,reverse:e.reverse,url:e.url}),this._clock=new zi({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(ea.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=Rr(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){ir(e,.001),this._playbackRate=e,this.grainSize=this._grainSize}get loopStart(){return this._loopStart}set loopStart(e){this.buffer.loaded&&ir(this.toSeconds(e),0,this.buffer.duration),this._loopStart=this.toSeconds(e)}get loopEnd(){return this._loopEnd}set loopEnd(e){this.buffer.loaded&&ir(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);ir(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 Na extends ua{constructor(){super(...arguments),this.name="Abs",this._abs=new ha({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 Oa extends ua{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new ha({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 Da extends ua{constructor(){super(...arguments),this.name="Negate",this._multiply=new pa({context:this.context,value:-1}),this.input=this._multiply,this.output=this._multiply}dispose(){return super.dispose(),this._multiply.dispose(),this}}class Ra extends Di{constructor(){super(Object.assign(Dr(Ra.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Subtract",this._sum=new Ii({context:this.context}),this.input=this._sum,this.output=this._sum,this._neg=new Da({context:this.context}),this.subtrahend=this._param,Ei(this._constantSource,this._neg,this._sum)}static getDefaults(){return Object.assign(Di.getDefaults(),{value:0})}dispose(){return super.dispose(),this._neg.dispose(),this._sum.dispose(),this}}class Ma extends ua{constructor(){super(Object.assign(Dr(Ma.getDefaults(),arguments))),this.name="GreaterThanZero",this._thresh=this.output=new ha({context:this.context,length:127,mapping:e=>e<=0?0:1}),this._scale=this.input=new pa({context:this.context,value:1e4}),this._scale.connect(this._thresh)}dispose(){return super.dispose(),this._scale.dispose(),this._thresh.dispose(),this}}class Fa extends Di{constructor(){super(Object.assign(Dr(Fa.getDefaults(),arguments,["value"]))),this.name="GreaterThan",this.override=!1;const e=Dr(Fa.getDefaults(),arguments,["value"]);this._subtract=this.input=new Ra({context:this.context,value:e.value}),this._gtz=this.output=new Ma({context:this.context}),this.comparator=this._param=this._subtract.subtrahend,Zr(this,"comparator"),this._subtract.connect(this._gtz)}static getDefaults(){return Object.assign(Di.getDefaults(),{value:0})}dispose(){return super.dispose(),this._gtz.dispose(),this._subtract.dispose(),this.comparator.dispose(),this}}class Ba extends ua{constructor(){super(Object.assign(Dr(Ba.getDefaults(),arguments,["value"]))),this.name="Pow";const e=Dr(Ba.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new ha({context:this.context,mapping:this._expFunc(e.value),length:8192}),this._exponent=e.value}static getDefaults(){return Object.assign(ua.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 za extends xa{constructor(){super(Object.assign(Dr(za.getDefaults(),arguments,["min","max","exponent"]))),this.name="ScaleExp";const e=Dr(za.getDefaults(),arguments,["min","max","exponent"]);this.input=this._exp=new Ba({context:this.context,value:e.exponent}),this._exp.connect(this._mult)}static getDefaults(){return Object.assign(xa.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 La extends Di{constructor(){super(Dr(Di.getDefaults(),arguments,["value","units"])),this.name="SyncedSignal",this.override=!1;const e=Dr(Di.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 Oi({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 vi(this.context,e).toSeconds();return super.getValueAtTime(t)}setValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.setValueAtTime(e,n),this}linearRampToValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.linearRampToValueAtTime(e,n),this}exponentialRampToValueAtTime(e,t){const n=new vi(this.context,t).toSeconds();return super.exponentialRampToValueAtTime(e,n),this}setTargetAtTime(e,t,n){const s=new vi(this.context,t).toSeconds();return super.setTargetAtTime(e,s,n),this}cancelScheduledValues(e){const t=new vi(this.context,e).toSeconds();return super.cancelScheduledValues(t),this}setValueCurveAtTime(e,t,n,s){const r=new vi(this.context,t).toSeconds();return n=this.toSeconds(n),super.setValueCurveAtTime(e,r,n,s),this}cancelAndHoldAtTime(e){const t=new vi(this.context,e).toSeconds();return super.cancelAndHoldAtTime(t),this}setRampPoint(e){const t=new vi(this.context,e).toSeconds();return super.setRampPoint(t),this}exponentialRampTo(e,t,n){const s=new vi(this.context,n).toSeconds();return super.exponentialRampTo(e,t,s),this}linearRampTo(e,t,n){const s=new vi(this.context,n).toSeconds();return super.linearRampTo(e,t,s),this}targetRampTo(e,t,n){const s=new vi(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 Pa extends Si{constructor(){super(Dr(Pa.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Di({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const e=Dr(Pa.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(Si.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 Va)if(Va[n][t]===e)return n;return e}}_setCurve(e,t,n){if(br(n)&&Reflect.has(Va,n)){const s=Va[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),i=this.toSeconds(t);return this.triggerAttack(e,r,s),this.triggerRelease(r+i),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class Ga extends Wa{constructor(){super(Dr(Ga.getDefaults(),arguments));const e=Dr(Ga.getDefaults(),arguments);this.portamento=e.portamento,this.onsilence=e.onsilence}static getDefaults(){return Object.assign(Wa.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 gi?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}}xr([Ea(0)],Ga.prototype,"portamento",void 0);class Ua extends Pa{constructor(){super(Dr(Ua.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new Ii({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 qa extends Ga{constructor(){super(Dr(qa.getDefaults(),arguments)),this.name="Synth";const e=Dr(qa.getDefaults(),arguments);this.oscillator=new va(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 Ua(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(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.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 ja extends Ga{constructor(){super(Dr(ja.getDefaults(),arguments)),this.name="ModulationSynth";const e=Dr(ja.getDefaults(),arguments);this._carrier=new qa({context:this.context,oscillator:e.oscillator,envelope:e.envelope,onsilence:()=>this.onsilence(this),volume:-10}),this._modulator=new qa({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 Di({context:this.context,units:"frequency"}),this.detune=new Di({context:this.context,value:e.detune,units:"cents"}),this.harmonicity=new pa({context:this.context,value:e.harmonicity,minValue:0}),this._modulationNode=new Ii({context:this.context,gain:0}),Zr(this,["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"])}static getDefaults(){return Object.assign(Ga.getDefaults(),{harmonicity:3,oscillator:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.getDefaults()),"frequency","detune"]),{type:"sine"}),envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.01,decay:.01,sustain:1,release:.5}),modulation:Object.assign(Mr(va.getDefaults(),[...Object.keys(ea.getDefaults()),"frequency","detune"]),{type:"square"}),modulationEnvelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.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 Ha extends ja{constructor(){super(Dr(Ha.getDefaults(),arguments)),this.name="AMSynth",this._modulationScale=new da({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 $a extends Si{constructor(){super(Dr($a.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const e=Dr($a.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new ki({context:this.context,units:"number",value:e.Q,param:this._filter.Q}),this.frequency=new ki({context:this.context,units:"frequency",value:e.frequency,param:this._filter.frequency}),this.detune=new ki({context:this.context,units:"cents",value:e.detune,param:this._filter.detune}),this.gain=new ki({context:this.context,units:"decibels",convert:!1,value:e.gain,param:this._filter.gain}),this.type=e.type}static getDefaults(){return Object.assign(Si.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 Xa extends Pa{constructor(){super(Dr(Xa.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const e=Dr(Xa.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=e.octaves,this._baseFrequency=this.toFrequency(e.baseFrequency),this._exponent=this.input=new Ba({context:this.context,value:e.exponent}),this._scale=this.output=new xa({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(Pa.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){const t=this.toFrequency(e);ir(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 Za extends Ga{constructor(){super(Dr(Za.getDefaults(),arguments)),this.name="MonoSynth";const e=Dr(Za.getDefaults(),arguments);this.oscillator=new va(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 Ka(Object.assign(e.filter,{context:this.context})),this.filterEnvelope=new Xa(Object.assign(e.filterEnvelope,{context:this.context})),this.envelope=new Ua(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(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(Mr(Ka.getDefaults(),Object.keys(Si.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(Mr(Xa.getDefaults(),Object.keys(Si.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(Mr(va.getDefaults(),Object.keys(ea.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 Ya extends Ga{constructor(){super(Dr(Ya.getDefaults(),arguments)),this.name="DuoSynth";const e=Dr(Ya.getDefaults(),arguments);this.voice0=new Za(Object.assign(e.voice0,{context:this.context,onsilence:()=>this.onsilence(this)})),this.voice1=new Za(Object.assign(e.voice1,{context:this.context})),this.harmonicity=new pa({context:this.context,units:"positive",value:e.harmonicity}),this._vibrato=new ka({frequency:e.vibratoRate,context:this.context,min:-50,max:50}),this._vibrato.start(),this.vibratoRate=this._vibrato.frequency,this._vibratoGain=new Ii({context:this.context,units:"normalRange",gain:e.vibratoAmount}),this.vibratoAmount=this._vibratoGain.gain,this.frequency=new Di({context:this.context,units:"frequency",value:440}),this.detune=new Di({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(Ga.getDefaults(),{vibratoAmount:.5,vibratoRate:5,harmonicity:1.5,voice0:Or(Mr(Za.getDefaults(),Object.keys(Ga.getDefaults())),{filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}}),voice1:Or(Mr(Za.getDefaults(),Object.keys(Ga.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 Qa extends ja{constructor(){super(Dr(Qa.getDefaults(),arguments)),this.name="FMSynth";const e=Dr(Qa.getDefaults(),arguments);this.modulationIndex=new pa({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(ja.getDefaults(),{modulationIndex:10})}dispose(){return super.dispose(),this.modulationIndex.dispose(),this}}const Ja=[1,1.483,1.932,2.546,2.63,3.897];class eo extends Ga{constructor(){super(Dr(eo.getDefaults(),arguments)),this.name="MetalSynth",this._oscillators=[],this._freqMultipliers=[];const e=Dr(eo.getDefaults(),arguments);this.detune=new Di({context:this.context,units:"cents",value:e.detune}),this.frequency=new Di({context:this.context,units:"frequency"}),this._amplitude=new Ii({context:this.context,gain:0}).connect(this.output),this._highpass=new Ka({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 pa({context:this.context,value:Ja[t]});this._freqMultipliers[t]=s,this.frequency.chain(s,n.frequency),this.detune.connect(n.detune)}this._filterFreqScaler=new xa({context:this.context,max:7e3,min:this.toFrequency(e.resonance)}),this.envelope=new Pa({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(Ga.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.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 qa{constructor(){super(Dr(to.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const e=Dr(to.getDefaults(),arguments);this.pitchDecay=e.pitchDecay,this.octaves=e.octaves,Zr(this,["oscillator","envelope"])}static getDefaults(){return Or(Ga.getDefaults(),qa.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 gi?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}}xr([Sa(0)],to.prototype,"octaves",void 0),xr([Ea(0)],to.prototype,"pitchDecay",void 0);class no extends Wa{constructor(){super(Dr(no.getDefaults(),arguments)),this.name="NoiseSynth";const e=Dr(no.getDefaults(),arguments);this.noise=new na(Object.assign({context:this.context},e.noise)),this.envelope=new Ua(Object.assign({context:this.context},e.envelope)),this.noise.chain(this.envelope,this.output)}static getDefaults(){return Object.assign(Wa.getDefaults(),{envelope:Object.assign(Mr(Pa.getDefaults(),Object.keys(Si.getDefaults())),{decay:.1,sustain:0}),noise:Object.assign(Mr(na.getDefaults(),Object.keys(ea.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 io(e,t){const n=`registerProcessor("${e}", ${t})`;so.add(n)}class ao extends Si{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";io(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 ao{constructor(){super(Dr(lo.getDefaults(),arguments,["delayTime","resonance"])),this.name="FeedbackCombFilter";const e=Dr(lo.getDefaults(),arguments,["delayTime","resonance"]);this.input=new Ii({context:this.context}),this.output=new Ii({context:this.context}),this.delayTime=new ki({context:this.context,value:e.delayTime,units:"time",minValue:0,maxValue:1,param:this._dummyParam,swappable:!0}),this.resonance=new ki({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(Si.getDefaults(),{delayTime:.1,resonance:.5})}onReady(e){Ei(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 co extends Si{constructor(){super(Dr(co.getDefaults(),arguments,["frequency","type"])),this.name="OnePoleFilter";const e=Dr(co.getDefaults(),arguments,["frequency","type"]);this._frequency=e.frequency,this._type=e.type,this.input=new Ii({context:this.context}),this.output=new Ii({context:this.context}),this._createFilter()}static getDefaults(){return Object.assign(Si.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 Wi(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 Wi(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+i)}}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 Wa{constructor(){super(Dr(fo.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const e=Dr(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 gi(this.context,n).toMidi();t[s]=e.urls[n]}else fr(s)&&isFinite(s)&&(t[s]=e.urls[s])})),this._buffers=new Vi({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(Wa.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=hi(new gi(this.context,e).toFrequency()),r=Math.round(s),i=s-r,a=this._findClosest(r),o=r-a,l=this._buffers.get(o),c=li(a+i),u=new ta({url:l,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:c}).connect(this.output);u.start(t,0,l.duration/c,n),yr(this._activeSources.get(r))||this._activeSources.set(r,[]),this._activeSources.get(r).push(u),u.onended=()=>{if(this._activeSources&&this._activeSources.has(r)){const e=this._activeSources.get(r),t=e.indexOf(u);-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 gi(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 gi(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}}xr([Ea(0)],fo.prototype,"attack",void 0),xr([Ea(0)],fo.prototype,"release",void 0);class mo extends xi{constructor(){super(Dr(mo.getDefaults(),arguments,["callback","value"])),this.name="ToneEvent",this._state=new Ci("stopped"),this._startOffset=0;const e=Dr(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(xi.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 Ui(this.context,t));const r=new Ui(this.context,this._getLoopDuration());e.id=this.context.transport.scheduleRepeat(this._tick.bind(this),r,new Ui(this.context,n),t)}else e.id=this.context.transport.schedule(this._tick.bind(this),new Ui(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=Rr(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 Ui(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._rescheduleEvents()}get loopStart(){return new Ui(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 xi{constructor(){super(Dr(go.getDefaults(),arguments,["callback","interval"])),this.name="Loop";const e=Dr(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(xi.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(Dr(yo.getDefaults(),arguments,["callback","events"])),this.name="Part",this._state=new Ci("stopped"),this._events=new Set;const e=Dr(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=Rr(t,this._loop?this._loopStart:0),t=this._loop?Rr(t,this._loopStart):Rr(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 Ui(this.context,t))):e.startOffset>=n&&e.start(new Ui(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 vi(this.context,e).toTicks(),s=new Ui(this.context,1).toSeconds(),r=this._events.values();let i=r.next();for(;!i.done;){const e=i.value;if(Math.abs(n-e.startOffset){"started"===t.state?this._startNote(e,t.time,t.offset):e.stop(new Ui(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 Ui(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 Ui(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=Ao(t,e),yield e[t],t--}function*vo(e,t){for(;;)yield*t(e)}function Ao(e,t){return Wr(e,0,t.length-1)}function*xo(e,t){let n=t?0:e.length-1;for(;;)n=Ao(n,e),yield e[n],t?(n++,n>=e.length-1&&(t=!1)):(n--,n<=0&&(t=!0))}function*Co(e){let t=0,n=0;for(;t=0;)t=Ao(t,e),yield e[t],n++,t+=n%2?-2:1}function*So(e){const t=[];for(let n=0;n0;){const n=Ao(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*xo(e,!0);case"downUp":yield*xo(e,!1);case"alternateUp":yield*vo(e,Co);case"alternateDown":yield*vo(e,ko);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(Dr(_o.getDefaults(),arguments,["callback","values","pattern"])),this.name="Pattern";const e=Dr(_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 To extends mo{constructor(){super(Dr(To.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=Dr(To.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 Ui(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 Ui(this.context,r,"i").toSeconds();this._part.add(t,e)}}))}_indexTime(e){return new Ui(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 Io extends Si{constructor(){super(Object.assign(Dr(Io.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new Oa({context:this.context}),this.a=new Ii({context:this.context,gain:0}),this.b=new Ii({context:this.context,gain:0}),this.output=new Ii({context:this.context}),this._internalChannels=[this.a,this.b];const e=Dr(Io.getDefaults(),arguments,["fade"]);this.fade=new Di({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",_i(this._split,this.a.gain,0),_i(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(Si.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 Si{constructor(e){super(e),this.name="Effect",this._dryWet=new Io({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new Ii({context:this.context}),this.effectReturn=new Ii({context:this.context}),this.input=new Ii({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(Si.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 ka({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 Do extends Oo{constructor(){super(Dr(Do.getDefaults(),arguments,["frequency","baseFrequency","octaves"])),this.name="AutoFilter";const e=Dr(Do.getDefaults(),arguments,["frequency","baseFrequency","octaves"]);this.filter=new Ka(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 Ro extends Si{constructor(){super(Object.assign(Dr(Ro.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const e=Dr(Ro.getDefaults(),arguments,["pan"]);this.pan=new ki({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(Si.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}class Mo extends Oo{constructor(){super(Dr(Mo.getDefaults(),arguments,["frequency"])),this.name="AutoPanner";const e=Dr(Mo.getDefaults(),arguments,["frequency"]);this._panner=new Ro({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 Si{constructor(){super(Dr(Fo.getDefaults(),arguments,["smoothing"])),this.name="Follower";const e=Dr(Fo.getDefaults(),arguments,["smoothing"]);this._abs=this.input=new Na({context:this.context}),this._lowpass=this.output=new co({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(Si.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(Dr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"])),this.name="AutoWah";const e=Dr(Bo.getDefaults(),arguments,["baseFrequency","octaves","sensitivity"]);this._follower=new Fo({context:this.context,smoothing:e.follower}),this._sweepRange=new za({context:this.context,min:0,max:1,exponent:.5}),this._baseFrequency=this.toFrequency(e.baseFrequency),this._octaves=e.octaves,this._inputBoost=new Ii({context:this.context}),this._bandpass=new Ka({context:this.context,rolloff:-48,frequency:0,Q:e.Q}),this._peaking=new Ka({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 oi(1/this._inputBoost.gain.value)}set sensitivity(e){this._inputBoost.gain.value=1/ai(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";io(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(Dr(Lo.getDefaults(),arguments,["bits"])),this.name="BitCrusher";const e=Dr(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 ao{constructor(){super(Dr(Po.getDefaults(),arguments)),this.name="BitCrusherWorklet";const e=Dr(Po.getDefaults(),arguments);this.input=new Ii({context:this.context}),this.output=new Ii({context:this.context}),this.bits=new ki({context:this.context,value:e.bits,units:"positive",minValue:1,maxValue:16,param:this._dummyParam,swappable:!0})}static getDefaults(){return Object.assign(ao.getDefaults(),{bits:12})}_audioWorkletName(){return zo}onReady(e){Ei(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(Dr(Vo.getDefaults(),arguments,["order"])),this.name="Chebyshev";const e=Dr(Vo.getDefaults(),arguments,["order"]);this._shaper=new ha({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 Si{constructor(){super(Dr(Wo.getDefaults(),arguments,["channels"])),this.name="Split";const e=Dr(Wo.getDefaults(),arguments,["channels"]);this._splitter=this.input=this.output=this.context.createChannelSplitter(e.channels),this._internalChannels=[this._splitter]}static getDefaults(){return Object.assign(Si.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._splitter.disconnect(),this}}class Go extends Si{constructor(){super(Dr(Go.getDefaults(),arguments,["channels"])),this.name="Merge";const e=Dr(Go.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(e.channels)}static getDefaults(){return Object.assign(Si.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class Uo extends Si{constructor(e){super(e),this.name="StereoEffect",this.input=new Ii({context:this.context}),this.input.channelCount=2,this.input.channelCountMode="explicit",this._dryWet=this.output=new Io({context:this.context,fade:e.wet}),this.wet=this._dryWet.fade,this._split=new Wo({context:this.context,channels:2}),this._merge=new Go({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),Ei(...e),_i(e[e.length-1],this._merge,0,0)}connectEffectRight(...e){this._split.connect(e[0],1,0),Ei(...e),_i(e[e.length-1],this._merge,0,1)}static getDefaults(){return Object.assign(Si.getDefaults(),{wet:1})}dispose(){return super.dispose(),this._dryWet.dispose(),this._split.dispose(),this._merge.dispose(),this}}class qo extends Uo{constructor(e){super(e),this.feedback=new Di({context:this.context,value:e.feedback,units:"normalRange"}),this._feedbackL=new Ii({context:this.context}),this._feedbackR=new Ii({context:this.context}),this._feedbackSplit=new Wo({context:this.context,channels:2}),this._feedbackMerge=new Go({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(Uo.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(Dr(jo.getDefaults(),arguments,["frequency","delayTime","depth"])),this.name="Chorus";const e=Dr(jo.getDefaults(),arguments,["frequency","delayTime","depth"]);this._depth=e.depth,this._delayTime=e.delayTime/1e3,this._lfoL=new ka({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new ka({context:this.context,frequency:e.frequency,min:0,max:1,phase:180}),this._delayNodeL=new Li({context:this.context}),this._delayNodeR=new Li({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(Dr(Ho.getDefaults(),arguments,["distortion"])),this.name="Distortion";const e=Dr(Ho.getDefaults(),arguments,["distortion"]);this._shaper=new ha({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 Ii({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(Dr(Ko.getDefaults(),arguments,["delayTime","feedback"])),this.name="FeedbackDelay";const e=Dr(Ko.getDefaults(),arguments,["delayTime","feedback"]);this._delayNode=new Li({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 Si{constructor(e){super(e),this.name="PhaseShiftAllpass",this.input=new Ii({context:this.context}),this.output=new Ii({context:this.context}),this.offset90=new Ii({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]),Ei(this.input,...this._bank0,this._oneSampleDelay,this.output),Ei(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(Dr(Zo.getDefaults(),arguments,["frequency"])),this.name="FrequencyShifter";const e=Dr(Zo.getDefaults(),arguments,["frequency"]);this.frequency=new Di({context:this.context,units:"frequency",value:e.frequency,minValue:-this.context.sampleRate/2,maxValue:this.context.sampleRate/2}),this._sine=new la({context:this.context,type:"sine"}),this._cosine=new ca({context:this.context,phase:-90,type:"sine"}),this._sineMultiply=new pa({context:this.context}),this._cosineMultiply=new pa({context:this.context}),this._negate=new Da({context:this.context}),this._add=new Aa({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 Uo{constructor(){super(Dr(Jo.getDefaults(),arguments,["roomSize","dampening"])),this.name="Freeverb",this._combFilters=[],this._allpassFiltersL=[],this._allpassFiltersR=[];const e=Dr(Jo.getDefaults(),arguments,["roomSize","dampening"]);this.roomSize=new Di({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 uo({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 Uo{constructor(){super(Dr(sl.getDefaults(),arguments,["roomSize"])),this.name="JCReverb",this._allpassFilters=[],this._feedbackCombFilters=[];const e=Dr(sl.getDefaults(),arguments,["roomSize"]);this.roomSize=new Di({context:this.context,value:e.roomSize,units:"normalRange"}),this._scaleRoomSize=new xa({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 il extends rl{constructor(){super(Dr(il.getDefaults(),arguments,["delayTime","feedback"])),this.name="PingPongDelay";const e=Dr(il.getDefaults(),arguments,["delayTime","feedback"]);this._leftDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this._rightDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this._rightPreDelay=new Li({context:this.context,maxDelay:e.maxDelay}),this.delayTime=new Di({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 al extends $o{constructor(){super(Dr(al.getDefaults(),arguments,["pitch"])),this.name="PitchShift";const e=Dr(al.getDefaults(),arguments,["pitch"]);this._frequency=new Di({context:this.context}),this._delayA=new Li({maxDelay:1,context:this.context}),this._lfoA=new ka({context:this.context,min:0,max:.1,type:"sawtooth"}).connect(this._delayA.delayTime),this._delayB=new Li({maxDelay:1,context:this.context}),this._lfoB=new ka({context:this.context,min:0,max:.1,type:"sawtooth",phase:180}).connect(this._delayB.delayTime),this._crossFade=new Io({context:this.context}),this._crossFadeLFO=new ka({context:this.context,min:0,max:1,type:"triangle",phase:90}).connect(this._crossFade.fade),this._feedbackDelay=new Li({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=li(e-1)+1):(this._lfoA.min=this._windowSize,this._lfoA.max=0,this._lfoB.min=this._windowSize,this._lfoB.max=0,t=li(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 Uo{constructor(){super(Dr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"])),this.name="Phaser";const e=Dr(ol.getDefaults(),arguments,["frequency","octaves","baseFrequency"]);this._lfoL=new ka({context:this.context,frequency:e.frequency,min:0,max:1}),this._lfoR=new ka({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 Di({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(Uo.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(Dr(ll.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const e=Dr(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){ir(e=this.toSeconds(e),.001),this._decay=e,this.generate()}get preDelay(){return this._preDelay}set preDelay(e){ir(e=this.toSeconds(e),0),this._preDelay=e,this.generate()}generate(){return Cr(this,void 0,void 0,(function*(){const e=this.ready,t=new ei(2,this._decay+this._preDelay,this.context.sampleRate),n=new na({context:t}),s=new na({context:t}),r=new Go({context:t});n.connect(r,0,0),s.connect(r,0,1);const i=new Ii({context:t}).toDestination();r.connect(i),n.start(0),s.start(0),i.gain.setValueAtTime(0,0),i.gain.setValueAtTime(1,this._preDelay),i.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=t.render();return this.ready=a.then(Qr),yield e,this._convolver.buffer=(yield a).get(),this}))}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class cl extends Si{constructor(){super(Dr(cl.getDefaults(),arguments)),this.name="MidSideSplit",this._split=this.input=new Wo({channels:2,context:this.context}),this._midAdd=new Aa({context:this.context}),this.mid=new pa({context:this.context,value:Math.SQRT1_2}),this._sideSubtract=new Ra({context:this.context}),this.side=new pa({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 ul extends Si{constructor(){super(Dr(ul.getDefaults(),arguments)),this.name="MidSideMerge",this.mid=new Ii({context:this.context}),this.side=new Ii({context:this.context}),this._left=new Aa({context:this.context}),this._leftMult=new pa({context:this.context,value:Math.SQRT1_2}),this._right=new Ra({context:this.context}),this._rightMult=new pa({context:this.context,value:Math.SQRT1_2}),this._merge=this.output=new Go({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 ul({context:this.context}),this._midSideSplit=new cl({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(Dr(dl.getDefaults(),arguments,["width"])),this.name="StereoWidener";const e=Dr(dl.getDefaults(),arguments,["width"]);this.width=new Di({context:this.context,value:e.width,units:"normalRange"}),Zr(this,["width"]),this._twoTimesWidthMid=new pa({context:this.context,value:2}),this._twoTimesWidthSide=new pa({context:this.context,value:2}),this._midMult=new pa({context:this.context}),this._twoTimesWidthMid.connect(this._midMult.factor),this.connectEffectMid(this._midMult),this._oneMinusWidth=new Ra({context:this.context}),this._oneMinusWidth.connect(this._twoTimesWidthMid),_i(this.context.getConstant(1),this._oneMinusWidth),this.width.connect(this._oneMinusWidth.subtrahend),this._sideMult=new pa({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 Uo{constructor(){super(Dr(pl.getDefaults(),arguments,["frequency","depth"])),this.name="Tremolo";const e=Dr(pl.getDefaults(),arguments,["frequency","depth"]);this._lfoL=new ka({context:this.context,type:e.type,min:1,max:0}),this._lfoR=new ka({context:this.context,type:e.type,min:1,max:0}),this._amplitudeL=new Ii({context:this.context}),this._amplitudeR=new Ii({context:this.context}),this.frequency=new Di({context:this.context,value:e.frequency,units:"frequency"}),this.depth=new Di({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(Uo.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(Dr(fl.getDefaults(),arguments,["frequency","depth"])),this.name="Vibrato";const e=Dr(fl.getDefaults(),arguments,["frequency","depth"]);this._delayNode=new Li({context:this.context,delayTime:0,maxDelay:e.maxDelay}),this._lfo=new ka({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 Si{constructor(){super(Dr(ml.getDefaults(),arguments,["type","size"])),this.name="Analyser",this._analysers=[],this._buffers=[];const e=Dr(ml.getDefaults(),arguments,["type","size"]);this.input=this.output=this._gain=new Ii({context:this.context}),this._split=new Wo({context:this.context,channels:e.channels}),this.input.connect(this._split),ir(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 Si{constructor(){super(Dr(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(Dr(yl.getDefaults(),arguments,["smoothing"])),this.name="Meter",this._rms=0;const e=Dr(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 ur("'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:oi(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(Dr(bl.getDefaults(),arguments,["size"])),this.name="FFT";const e=Dr(bl.getDefaults(),arguments,["size"]);this.normalRange=e.normalRange,this._analyser.type="fft",this.size=e.size}static getDefaults(){return Object.assign(Si.getDefaults(),{normalRange:!1,size:1024,smoothing:.8})}getValue(){return this._analyser.getValue().map((e=>this.normalRange?ai(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(){Al._soloed.has(this.context)||Al._soloed.set(this.context,new Set),Al._soloed.get(this.context).add(this)}_removeSolo(){Al._soloed.has(this.context)&&Al._soloed.get(this.context).delete(this)}_isSoloed(){return Al._soloed.has(this.context)&&Al._soloed.get(this.context).has(this)}_noSolos(){return!Al._soloed.has(this.context)||Al._soloed.has(this.context)&&0===Al._soloed.get(this.context).size}_updateSolo(){this._isSoloed()||this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),Al._allSolos.get(this.context).delete(this),this._removeSolo(),this}}Al._allSolos=new Map,Al._soloed=new Map;class xl extends Si{constructor(){super(Dr(xl.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const e=Dr(xl.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new Ro({context:this.context,pan:e.pan,channelCount:e.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Ki({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(Si.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 Cl extends Si{constructor(){super(Dr(Cl.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const e=Dr(Cl.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Al({solo:e.solo,context:this.context}),this._panVol=this.output=new xl({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(Si.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 Cl.buses.has(e)||Cl.buses.set(e,new Ii({context:this.context})),Cl.buses.get(e)}send(e,t=0){const n=this._getBus(e),s=new Ii({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}}Cl.buses=new Map;class kl extends Si{constructor(){super(Dr(kl.getDefaults(),arguments)),this.name="Mono",this.input=new Ii({context:this.context}),this._merge=this.output=new Go({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 Si{constructor(){super(Dr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"])),this.name="MultibandSplit",this.input=new Ii({context:this.context}),this.output=void 0,this.low=new Ka({context:this.context,frequency:0,type:"lowpass"}),this._lowMidFilter=new Ka({context:this.context,frequency:0,type:"highpass"}),this.mid=new Ka({context:this.context,frequency:0,type:"lowpass"}),this.high=new Ka({context:this.context,frequency:0,type:"highpass"}),this._internalChannels=[this.low,this.mid,this.high];const e=Dr(Sl.getDefaults(),arguments,["lowFrequency","highFrequency"]);this.lowFrequency=new Di({context:this.context,units:"frequency",value:e.lowFrequency}),this.highFrequency=new Di({context:this.context,units:"frequency",value:e.highFrequency}),this.Q=new Di({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(Si.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 Si{constructor(){super(...arguments),this.name="Listener",this.positionX=new ki({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new ki({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new ki({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new ki({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new ki({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new ki({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new ki({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new ki({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new ki({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(Si.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 Si{constructor(){super(Dr(_l.getDefaults(),arguments,["positionX","positionY","positionZ"])),this.name="Panner3D";const e=Dr(_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 ki({context:this.context,param:this._panner.positionX,value:e.positionX}),this.positionY=new ki({context:this.context,param:this._panner.positionY,value:e.positionY}),this.positionZ=new ki({context:this.context,param:this._panner.positionZ,value:e.positionZ}),this.orientationX=new ki({context:this.context,param:this._panner.orientationX,value:e.orientationX}),this.orientationY=new ki({context:this.context,param:this._panner.orientationY,value:e.orientationY}),this.orientationZ=new ki({context:this.context,param:this._panner.orientationZ,value:e.orientationZ})}static getDefaults(){return Object.assign(Si.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 Tl extends Si{constructor(){super(Dr(Tl.getDefaults(),arguments)),this.name="Recorder";const e=Dr(Tl.getDefaults(),arguments);this.input=new Ii({context:this.context}),rr(Tl.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 Si.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 Cr(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 Cr(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 Il extends Si{constructor(){super(Dr(Il.getDefaults(),arguments,["threshold","ratio"])),this.name="Compressor",this._compressor=this.context.createDynamicsCompressor(),this.input=this._compressor,this.output=this._compressor;const e=Dr(Il.getDefaults(),arguments,["threshold","ratio"]);this.threshold=new ki({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 ki({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 ki({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 ki({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 ki({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(Si.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 Si{constructor(){super(Object.assign(Dr(Nl.getDefaults(),arguments,["threshold","smoothing"]))),this.name="Gate";const e=Dr(Nl.getDefaults(),arguments,["threshold","smoothing"]);this._follower=new Fo({context:this.context,smoothing:e.smoothing}),this._gt=new Fa({context:this.context,value:ai(e.threshold)}),this.input=new Ii({context:this.context}),this._gate=this.output=new Ii({context:this.context}),this.input.connect(this._gate),this.input.chain(this._follower,this._gt,this._gate.gain)}static getDefaults(){return Object.assign(Si.getDefaults(),{smoothing:.1,threshold:-40})}get threshold(){return oi(this._gt.value)}set threshold(e){this._gt.value=ai(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 Si{constructor(){super(Object.assign(Dr(Ol.getDefaults(),arguments,["threshold"]))),this.name="Limiter";const e=Dr(Ol.getDefaults(),arguments,["threshold"]);this._compressor=this.input=this.output=new Il({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(Si.getDefaults(),{threshold:-12})}get reduction(){return this._compressor.reduction}dispose(){return super.dispose(),this._compressor.dispose(),this.threshold.dispose(),this}}class Dl extends Si{constructor(){super(Object.assign(Dr(Dl.getDefaults(),arguments))),this.name="MidSideCompressor";const e=Dr(Dl.getDefaults(),arguments);this._midSideSplit=this.input=new cl({context:this.context}),this._midSideMerge=this.output=new ul({context:this.context}),this.mid=new Il(Object.assign(e.mid,{context:this.context})),this.side=new Il(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(Si.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 Rl extends Si{constructor(){super(Object.assign(Dr(Rl.getDefaults(),arguments))),this.name="MultibandCompressor";const e=Dr(Rl.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 Ii({context:this.context}),this.low=new Il(Object.assign(e.low,{context:this.context})),this.mid=new Il(Object.assign(e.mid,{context:this.context})),this.high=new Il(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(Si.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 Si{constructor(){super(Dr(Ml.getDefaults(),arguments,["low","mid","high"])),this.name="EQ3",this.output=new Ii({context:this.context}),this._internalChannels=[];const e=Dr(Ml.getDefaults(),arguments,["low","mid","high"]);this.input=this._multibandSplit=new Sl({context:this.context,highFrequency:e.highFrequency,lowFrequency:e.lowFrequency}),this._lowGain=new Ii({context:this.context,gain:e.low,units:"decibels"}),this._midGain=new Ii({context:this.context,gain:e.mid,units:"decibels"}),this._highGain=new Ii({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(Si.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 Si{constructor(){super(Dr(Fl.getDefaults(),arguments,["url","onload"])),this.name="Convolver",this._convolver=this.context.createConvolver();const e=Dr(Fl.getDefaults(),arguments,["url","onload"]);this._buffer=new Jr(e.url,(t=>{this.buffer=t,e.onload()})),this.input=new Ii({context:this.context}),this.output=new Ii({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(Si.getDefaults(),{normalize:!0,onload:Qr})}load(e){return Cr(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 si().now()}function zl(){return si().immediate()}const Ll=si().transport;function Pl(){return si().transport}const Vl=si().destination,Wl=si().destination;function Gl(){return si().destination}const Ul=si().listener;function ql(){return si().listener}const jl=si().draw;function Hl(){return si().draw}const $l=si();function Kl(){return Jr.loaded()}const Xl=Jr,Zl=Vi,Yl=ta},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)}})),i("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(" "),i=0;i(t=t||0)&&(t=Math.max(t+s,0));ti)s[n++]=i;else{if(2048>i)s[n++]=i>>6|192;else{if(55296<=i&&57343>=i){if(56319>=i&&r=a){i=1024*(i-55296)+a-56320+65536,s[n++]=i>>18|240,s[n++]=i>>12&63|128,s[n++]=i>>6&63|128,s[n++]=63&i|128;continue}r--}if(t)throw Error("Found an unpaired surrogate");i=65533}s[n++]=i>>12|224,s[n++]=i>>6&63|128}s[n++]=63&i|128}}e=s.subarray(0,n)}return e}var R={},M=null;function F(e,t){void 0===t&&(t=0),z(),t=R[t];for(var n=Array(Math.floor(e.length/3)),s=t[64]||"",r=0,i=0;r>2];a=t[(3&a)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[i++]=c+a+o+l}switch(c=0,l=s,e.length-r){case 2:l=t[(15&(c=e[r+1]))<<2]||s;case 1:e=e[r],n[i]=t[e>>2]+t[(3&e)<<4|c>>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!=a&&(t(i<<4&240|a>>2),64!=o&&t(a<<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(""));R[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}G.prototype.reset=function(){this.g=this.l},G.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)))))},G.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&&U(n,e),e=n):e=new G(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(),i=e.g.g+r;if(e.g.j=i,n(t,e),0!==(n=i-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=i,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=T)||(t=T=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(s,s+n));else{n=s+n;for(var r,i,a,o=[],l=null;s(r=e[s++])?o.push(r):224>r?s>=n?o.push(65533):(i=e[s++],194>r||128!=(192&i)?(s--,o.push(65533)):o.push((31&r)<<6|63&i)):240>r?s>=n-1?o.push(65533):128!=(192&(i=e[s++]))||224===r&&160>i||237===r&&160<=i||128!=(192&(t=e[s++]))?(s--,o.push(65533)):o.push((15&r)<<12|(63&i)<<6|63&t):244>=r?s>=n-2?o.push(65533):128!=(192&(i=e[s++]))||i-144+(r<<28)>>30||128!=(192&(t=e[s++]))||128!=(192&(a=e[s++]))?(s--,o.push(65533)):(r=(7&r)<<18|(63&i)<<12|(63&t)<<6|63&a,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&&Ae(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 xe(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 Ce(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 T=(_=Math.abs(_))>>>0;for(_=Math.floor((_-T)/4294967296),_>>>=0,S&&(_=~_>>>0,4294967295<(T=1+(~T>>>0))&&(T=0,4294967295<++_&&(_=0))),S=W=T,T=_;0>>7|T<<25)>>>0,T>>>=7;E.push(S)}if(_e(C,k),x=re(x),v.call(w,A,x),y.O)for(w=0;w_;_++)S.push(127&T|128),T>>=7;S.push(1)}ie(E,2,ge(k,2)),null!=(S=ge(k,3))&&(S=D(S),$(E.g,26),$(E.g,S.length),se(E,E.g.end()),se(E,S)),null!=(S=ge(k,4))&&(S=D(S),$(E.g,34),$(E.g,S.length),se(E,E.g.end()),se(E,S)),_e(k,E),C=re(C),A.call(v,x,C)}}f=f.data;break e;default:f={}}}switch(u=f,h=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},u),{stream:h,timestamp:s}));break;case"detections":(d=u).stream=h,d.timestamp=s,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+c.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 Ce(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"}}}},ct=[[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]],ut=[[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(ct),l(ut),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 De(this,(function e(){var t=this;return C(e,(function(e){return b(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return De(this,(function t(){var n=this;return C(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",ct),E("FACEMESH_LEFT_EYE",ut),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=[],i=0;i{e.exports=function e(t,n,s){function r(a,o){if(!n[a]){if(!t[a]){if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,(function(e){var n=t[a][1][e];return r(n||e)}),c,c.exports,e,t,n,s)}return n[a].exports}for(var i=void 0,a=0;a=43)}})).catch((function(){return!1}))}function x(e){return"boolean"==typeof m?c.resolve(m):A(e).then((function(e){return m=e}))}function C(e){var t=g[e.name],n={};n.promise=new c((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 k(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 c((function(n,s){if(g[e.name]=g[e.name]||B(),e.db){if(!t)return n(e.db);C(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var i=a.open.apply(a,r);t&&(i.onupgradeneeded=function(t){var n=i.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(f)}catch(e){if("ConstraintError"!==e.name)throw e}}),i.onerror=function(e){e.preventDefault(),s(i.error)},i.onsuccess=function(){var t=i.result;t.onversionchange=function(e){e.target.close()},n(t),k(e)}}))}function _(e){return E(e,!1)}function T(e){return E(e,!0)}function I(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 i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function N(e){return new c((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 D(e){return e&&e.__local_forage_encoded_blob}function R(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){C(e);for(var t=g[e.name],n=t.forages,s=0;s0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return c.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),T(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=R);var i=[];function a(){return c.resolve()}for(var o=0;o>4,u[l++]=(15&s)<<4|r>>2,u[l++]=(3&r)<<6|63&i;return c}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+=ie:"[object Uint16Array]"===n?r+=oe:"[object Int32Array]"===n?r+=ae:"[object Uint32Array]"===n?r+=le:"[object Float32Array]"===n?r+=ce:"[object Float64Array]"===n?r+=ue:t(new Error("Failed to get type for BinaryArray"))),t(r+fe(s))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n=Z+e.type+"~"+fe(this.result);t(Q+te+n)},i.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 i=pe(n);switch(s){case ee:return i;case te:return l([i],{type:t});case ne:return new Int8Array(i);case se:return new Uint8Array(i);case re:return new Uint8ClampedArray(i);case ie:return new Int16Array(i);case oe:return new Uint16Array(i);case ae:return new Int32Array(i);case le:return new Uint32Array(i);case ce:return new Float32Array(i);case ue:return new Float64Array(i);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 c((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,i){e.executeSql(n,s,r,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,o){o.rows.length?i(e,a):be(e,t,(function(){e.executeSql(n,s,r,i)}),i)}),i):i(e,a)}),i)}function Ae(e,t){var n=this;e=d(e);var s=new c((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 u(s,t),s}function xe(e,t){var n=this,s=new c((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 i=s.rows,a=i.length,o=0;o0)return void i(Ce.apply(r,[e,o,n,s-1]));a(t)}}))}))})).catch(a)}));return u(i,n),i}function ke(e,t,n){return Ce.apply(this,[e,t,n,1])}function Se(e,t){var n=this;e=d(e);var s=new c((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 u(s,t),s}function Ee(e){var t=this,n=new c((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 u(n,e),n}function _e(e){var t=this,n=new c((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 u(n,e),n}function Te(e,t){var n=this,s=new c((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 u(s,t),s}function Ie(e){var t=this,n=new c((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=[],i=0;i0}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,c.resolve()):c.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 u(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 u(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,i=localStorage.length,a=1,o=0;o=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):c.reject("Invalid arguments"),u(s,t),s}var $e={_driver:"localStorageWrapper",_initStorage:ze,_support:Re(),iterate:Ve,getItem:Pe,setItem:je,removeItem:qe,clear:Le,length:Ue,key:We,keys:Ge,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={},i={};function a(e,t){var n,s,a;return t?(a=0<=(e>>>=0)&&e<256)&&(s=i[e])?s:(n=l(e,(0|e)<0?-1:0,!0),a&&(i[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(s=r[e])?s:(n=l(e,e<0?-1:0,!1),a&&(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 x}else{if(e<=-f)return C;if(e+1>=f)return A}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=a,n.fromNumber=o,n.fromBits=l;var c=Math.pow;function u(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 u(e.substring(1),t,n).neg();for(var r=o(c(n,8)),i=g,a=0;a>>0:this.low},k.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},k.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((i=l).isZero())return u+a;for(;u.length<6;)u="0"+u;a=""+u+a}},k.getHighBits=function(){return this.high},k.getHighBitsUnsigned=function(){return this.high>>>0},k.getLowBits=function(){return this.low},k.getLowBitsUnsigned=function(){return this.low>>>0},k.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<=0},k.isOdd=function(){return!(1&~this.low)},k.isEven=function(){return!(1&this.low)},k.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)},k.eq=k.equals,k.notEquals=function(e){return!this.eq(e)},k.neq=k.notEquals,k.ne=k.notEquals,k.lessThan=function(e){return this.comp(e)<0},k.lt=k.lessThan,k.lessThanOrEqual=function(e){return this.comp(e)<=0},k.lte=k.lessThanOrEqual,k.le=k.lessThanOrEqual,k.greaterThan=function(e){return this.comp(e)>0},k.gt=k.greaterThan,k.greaterThanOrEqual=function(e){return this.comp(e)>=0},k.gte=k.greaterThanOrEqual,k.ge=k.greaterThanOrEqual,k.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},k.comp=k.compare,k.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(b)},k.neg=k.negate,k.add=function(e){s(e)||(e=h(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=65535&this.low,a=e.high>>>16,o=65535&e.high,c=e.low>>>16,u=0,d=0,p=0,f=0;return p+=(f+=i+(65535&e.low))>>>16,d+=(p+=r+c)>>>16,u+=(d+=n+o)>>>16,u+=t+a,l((p&=65535)<<16|(f&=65535),(u&=65535)<<16|(d&=65535),this.unsigned)},k.subtract=function(e){return s(e)||(e=h(e)),this.add(e.neg())},k.sub=k.subtract,k.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(C))return e.isOdd()?C:g;if(e.eq(C))return this.isOdd()?C: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,i=this.low>>>16,a=65535&this.low,c=e.high>>>16,u=65535&e.high,d=e.low>>>16,p=65535&e.low,f=0,y=0,b=0,w=0;return b+=(w+=a*p)>>>16,y+=(b+=i*p)>>>16,b&=65535,y+=(b+=a*d)>>>16,f+=(y+=r*p)>>>16,y&=65535,f+=(y+=i*d)>>>16,y&=65535,f+=(y+=a*u)>>>16,f+=n*p+r*d+i*u+a*c,l((b&=65535)<<16|(w&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},k.mul=k.multiply,k.divide=function(e){if(s(e)||(e=h(e)),e.isZero())throw Error("division by zero");var n,r,i;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;i=y}else{if(this.eq(C))return e.eq(b)||e.eq(v)?C:e.eq(C)?b:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:v:(r=this.sub(e.mul(n)),i=n.add(r.div(e)));if(e.eq(C))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();i=g}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),u=a<=48?1:c(2,a-48),d=o(n),p=d.mul(e);p.isNegative()||p.gt(r);)p=(d=o(n-=u,this.unsigned)).mul(e);d.isZero()&&(d=b),i=i.add(d),r=r.sub(p)}return i},k.div=k.divide,k.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))},k.mod=k.modulo,k.rem=k.modulo,k.not=function(){return l(~this.low,~this.high,this.unsigned)},k.and=function(e){return s(e)||(e=h(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},k.or=function(e){return s(e)||(e=h(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},k.xor=function(e){return s(e)||(e=h(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},k.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)},k.shr=k.shiftRight,k.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)},k.shru=k.shiftRightUnsigned,k.shr_u=k.shiftRightUnsigned,k.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},k.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},k.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},k.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]},k.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[i][a])&&(a=o);for(var l=i;l=i;h--)n[h][u]-=n[h][i]*n[i][u]/n[i][i]}for(var d=s-1;d>=0;d--){for(var p=0,f=d+1;f=0;A--)v+=A>1?y[A]+"x^"+A+" + ":1===A?y[A]+"x + ":y[A];return{string:v,points:w,predict:b,equation:[].concat(s(y)).reverse(),r2:o(i(e,w),t.precision)}}};function c(){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=c()},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),i=n(1119),a=n(147),o=n(6297),l=n(9181),c=n(7529);c.alea=s,c.xor128=r,c.xorwow=i,c.xorshift7=a,c.xor4096=o,c.tychei=l,e.exports=c},1812:function(e,t,n){var s;!function(e,r,i){function a(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 a(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,i){function a(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,i){function a(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,i){function a(e){var t=this;t.next=function(){var e,n,s=t.w,r=t.X,i=t.i;return t.w=s=s+1640531527|0,n=r[i+34&127],e=r[i=i+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=r[i]=n^e,t.i=i,n+(s^s>>>16)|0},function(e,t){var n,s,r,i,a,o=[],l=128;for(t===(0|t)?(s=t,t=null):(t+="\0",s=0,l=Math.max(l,t.length)),r=0,i=-32;i>>15,s^=s<<4,s^=s>>>13,i>=0&&(a=a+1640531527|0,r=0==(n=o[127&i]^=s+a)?r+1:0);for(r>=128&&(o[127&(t&&t.length||0)]=-1),r=127,i=512;i>0;--i)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=a,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 a(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,i){function a(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 a(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,i){function a(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 a(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,i,a){var o,l=256,c=a.pow(l,6),u=a.pow(2,52),h=2*u,d=l-1;function p(e,t,n){var s=[],d=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,b(i)]: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(i)]}}():e,3),s),p=new f(s),w=function(){for(var e=p.g(6),t=c,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),i),(t.pass||n||function(e,t,n,s){return s&&(s.S&&m(s,p),e.state=function(){return m(p,{})}),n?(a.random=e,t):e})(w,d,"global"in t?t.global:this==a,t.state)}function f(e){var t,n=e.length,s=this,r=0,i=s.i=s.j=0,a=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:()=>OH});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{CompositeArrayBuffer:()=>So,browserFiles:()=>wc,browserHTTPRequest:()=>Tc,concatenateArrayBuffers:()=>qo,copyModel:()=>Il,decodeWeights:()=>Fo,decodeWeightsStream:()=>Vo,encodeWeights:()=>Mo,fromMemory:()=>Dc,fromMemorySync:()=>Rc,getLoadHandlers:()=>tl,getModelArtifactsForJSON:()=>Ko,getModelArtifactsForJSONSync:()=>$o,getModelArtifactsInfoForJSON:()=>Xo,getSaveHandlers:()=>el,getWeightSpecs:()=>Zo,http:()=>_c,isHTTPScheme:()=>Sc,listModels:()=>_l,loadWeights:()=>xc,moveModel:()=>Nl,registerLoadRouter:()=>Jo,registerSaveRouter:()=>Qo,removeModel:()=>Tl,weightsLoaderFactory:()=>Cc,withSaveHandler:()=>Mc,withSaveHandlerSync:()=>Fc});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{assertParamsValid:()=>jc,computeFlatOffset:()=>ru,computeOutShape:()=>$c,getNormalizedAxes:()=>Yc,isSliceContinous:()=>su,maskToAxes:()=>Hc,parseSliceParams:()=>iu,sliceInfo:()=>au,startForAxis:()=>tu,startIndicesWithElidedDims:()=>Qc,stopForAxis:()=>nu,stopIndicesWithElidedDims:()=>Jc,stridesForAxis:()=>eu,stridesWithElidedDims:()=>Kc});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{conv2d:()=>vf,depthwiseConv2d:()=>Cf,matMul:()=>kf});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{collectGatherOpShapeInfo:()=>Ig,computeOutShape:()=>Tg,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:()=>Rm,RowPartitionType:()=>_m,SELU_SCALE:()=>Um,SELU_SCALEALPHA:()=>Gm,applyActivation:()=>bf,assertAndGetBroadcastShape:()=>cc,assertAxesAreInnerMostDims:()=>Rh,assertParamsConsistent:()=>Sm,assignToTypedArray:()=>tg,axesAreInnerMostDims:()=>Ih,calculateShapes:()=>$p,checkEinsumDimSizes:()=>ug,checkPadOnDimRoundingMode:()=>Mu,combineLocations:()=>Nh,combineRaggedTensorToTensorShapes:()=>Im,complexWithEvenIndex:()=>Qm,complexWithOddIndex:()=>Jm,computeConv2DInfo:()=>Cu,computeConv3DInfo:()=>ku,computeDefaultPad:()=>Su,computeDilation2DInfo:()=>vu,computeOptimalWindowSize:()=>Mm,computeOutAndReduceShapes:()=>Oh,computeOutShape:()=>Em,computePool2DInfo:()=>Au,computePool3DInfo:()=>xu,convertConv2DDataFormat:()=>Ru,decodeEinsumEquation:()=>lg,eitherStridesOrDilationsAreOne:()=>Ou,expandShapeToKeepDim:()=>Dh,exponent:()=>sg,exponents:()=>ng,fromStringArrayToUint8:()=>Og,fromUint8ToStringArray:()=>Ng,getAxesPermutation:()=>Mh,getBroadcastDims:()=>oc,getComplexWithIndex:()=>eg,getEinsumComputePath:()=>hg,getEinsumPermutation:()=>cg,getFusedBiasGradient:()=>yf,getFusedDyActivation:()=>gf,getImageCenter:()=>Fm,getInnerMostAxes:()=>Bh,getPermuted:()=>zm,getRaggedRank:()=>Om,getReductionAxes:()=>lc,getReshaped:()=>Bm,getReshapedPermuted:()=>Lm,getRowPartitionTypesHelper:()=>Nm,getSliceBeginCoords:()=>Pm,getSliceSize:()=>Vm,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>mg,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>gg,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>yg,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>vg,getSparseReshapeInputOutputMismatchErrorMessage:()=>xg,getSparseReshapeInputOutputMultipleErrorMessage:()=>Ag,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>bg,getSparseReshapeNegativeOutputDimErrorMessage:()=>wg,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>Eg,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>Cg,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>kg,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>Sg,getUndoAxesPermutation:()=>Fh,isIdentityPermutation:()=>dg,log:()=>Ui,mergeRealAndImagArrays:()=>Zm,prepareAndValidate:()=>Wm,prepareSplitSize:()=>fg,segment_util:()=>s,shouldFuse:()=>wf,slice_util:()=>t,splitRealAndImagArrays:()=>Ym,stridesOrDilationsArePositive:()=>Du,tupleValuesAreOne:()=>Nu,upcastType:()=>Xa,validateDefaultValueShape:()=>Dm,validateInput:()=>Hp,validateUpdateShape:()=>jp,warn:()=>Gi});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{json:()=>YC});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{json:()=>QC});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{json:()=>JC});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{json:()=>ek});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{json:()=>tk});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{json:()=>nk});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{json:()=>sk});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{json:()=>rk});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{json:()=>ik});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{json:()=>ak});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{json:()=>ok});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{json:()=>lk});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{json:()=>ck});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{json:()=>uk});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{json:()=>hk});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{json:()=>dk});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{json:()=>pk});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{json:()=>fk});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{json:()=>mk});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{OP_SCOPE_SUFFIX:()=>wo,abs:()=>ac,acos:()=>lu,acosh:()=>cu,add:()=>Pl,addN:()=>uu,all:()=>hu,any:()=>du,argMax:()=>pu,argMin:()=>fu,asin:()=>mu,asinh:()=>gu,atan:()=>yu,atan2:()=>bu,atanh:()=>wu,avgPool:()=>Bu,avgPool3d:()=>zu,basicLSTMCell:()=>Uu,batchNorm:()=>ju,batchNorm2d:()=>Hu,batchNorm3d:()=>$u,batchNorm4d:()=>Ku,batchToSpaceND:()=>qu,bincount:()=>Xu,bitwiseAnd:()=>Zu,booleanMaskAsync:()=>rf,broadcastArgs:()=>Yu,broadcastTo:()=>Qu,buffer:()=>Fl,cast:()=>Bl,ceil:()=>Ju,clipByValue:()=>eh,clone:()=>zl,complex:()=>Ao,concat:()=>Lu,concat1d:()=>th,concat2d:()=>nh,concat3d:()=>sh,concat4d:()=>rh,conv1d:()=>ah,conv2d:()=>ih,conv2dTranspose:()=>lh,conv3d:()=>ch,conv3dTranspose:()=>hh,cos:()=>dh,cosh:()=>ph,cosineWindow:()=>pf,cumprod:()=>fh,cumsum:()=>mh,denseBincount:()=>gh,depthToSpace:()=>yh,depthwiseConv2d:()=>bh,diag:()=>wh,dilation2d:()=>vh,div:()=>Wl,divNoNan:()=>Ch,dot:()=>kh,dropout:()=>hf,einsum:()=>Sh,elu:()=>Eh,enclosingPowerOfTwo:()=>df,ensureShape:()=>_h,equal:()=>Ah,erf:()=>Th,euclideanNorm:()=>Gh,exp:()=>Uh,expandDims:()=>qh,expm1:()=>jh,eye:()=>$h,fft:()=>Ip,fill:()=>tc,floor:()=>Kh,floorDiv:()=>Vl,fused:()=>n,gather:()=>Xh,gatherND:()=>uf,greater:()=>Zh,greaterEqual:()=>Yh,ifft:()=>Np,imag:()=>Qh,image:()=>ym,inTopKAsync:()=>ff,irfft:()=>Op,isFinite:()=>Jh,isInf:()=>ed,isNaN:()=>td,leakyRelu:()=>nd,less:()=>sd,lessEqual:()=>rd,linalg:()=>bm,linspace:()=>id,localResponseNormalization:()=>ad,log:()=>od,log1p:()=>ld,logSigmoid:()=>hd,logSoftmax:()=>dd,logSumExp:()=>pd,logicalAnd:()=>fd,logicalNot:()=>md,logicalOr:()=>gd,logicalXor:()=>yd,losses:()=>wm,lowerBound:()=>vd,matMul:()=>Pu,max:()=>zh,maxPool:()=>Ad,maxPool3d:()=>xd,maxPoolWithArgmax:()=>Cd,maximum:()=>uc,mean:()=>kd,meshgrid:()=>_d,min:()=>Lh,minimum:()=>Td,mirrorPad:()=>Id,mod:()=>Nd,moments:()=>Od,movingAverage:()=>of,mul:()=>Gl,multiRNNCell:()=>Dd,multinomial:()=>Rd,neg:()=>cd,norm:()=>Wh,notEqual:()=>Md,oneHot:()=>Fd,ones:()=>Ed,onesLike:()=>Bd,op:()=>vo,outerProduct:()=>zd,pad:()=>Ld,pad1d:()=>Pd,pad2d:()=>Vd,pad3d:()=>Wd,pad4d:()=>Gd,pool:()=>qd,pow:()=>sc,prelu:()=>jd,print:()=>Ll,prod:()=>Hd,raggedGather:()=>$d,raggedRange:()=>Kd,raggedTensorToTensor:()=>Xd,rand:()=>Zd,randomGamma:()=>tp,randomNormal:()=>np,randomStandardNormal:()=>sp,randomUniform:()=>rp,randomUniformInt:()=>ip,range:()=>ap,real:()=>op,reciprocal:()=>lp,relu:()=>cp,relu6:()=>up,reshape:()=>Fu,reverse:()=>hp,reverse1d:()=>dp,reverse2d:()=>pp,reverse3d:()=>fp,reverse4d:()=>mp,rfft:()=>Rp,round:()=>gp,rsqrt:()=>yp,scalar:()=>$l,scatterND:()=>lf,searchSorted:()=>wd,selu:()=>bp,separableConv2d:()=>wp,setdiff1dAsync:()=>vp,sigmoid:()=>Vu,sign:()=>Ap,signal:()=>gm,sin:()=>xp,sinh:()=>Cp,slice:()=>Wu,slice1d:()=>kp,slice2d:()=>Sp,slice3d:()=>Ep,slice4d:()=>_p,softmax:()=>Tp,softplus:()=>ud,spaceToBatchND:()=>Ud,sparse:()=>vm,sparseToDense:()=>cf,spectral:()=>mm,split:()=>Dp,sqrt:()=>Ul,square:()=>ql,squaredDifference:()=>Mp,squeeze:()=>Fp,stack:()=>Bp,step:()=>zp,stridedSlice:()=>Lp,string:()=>Am,sub:()=>rc,sum:()=>Ph,tan:()=>Pp,tanh:()=>Gu,tensor:()=>Co,tensor1d:()=>Vp,tensor2d:()=>Wp,tensor3d:()=>Bc,tensor4d:()=>Gp,tensor5d:()=>Up,tensor6d:()=>qp,tensorScatterUpdate:()=>Kp,tile:()=>Hh,topk:()=>Xp,transpose:()=>af,truncatedNormal:()=>Zp,unique:()=>Yp,unsortedSegmentSum:()=>Qp,unstack:()=>Jp,upperBound:()=>ef,variable:()=>tf,where:()=>xh,whereAsync:()=>sf,zeros:()=>Sd,zerosLike:()=>jl});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{mx:()=>gE,XI:()=>l_,Nk:()=>c_,f6:()=>h_,ct:()=>hE,YG:()=>m_,hH:()=>A_,z3:()=>iT,sG:()=>gT,uM:()=>AT,vS:()=>LT,qB:()=>HT,GG:()=>KT,lg:()=>JT,rq:()=>ZT,cu:()=>dI,WR:()=>cI,GE:()=>mI,px:()=>yI,jC:()=>DI,He:()=>FI,hE:()=>jI,BF:()=>Y_,Dk:()=>tN,cl:()=>cN,_B:()=>xN,ub:()=>_N,_f:()=>NN,Ku:()=>BN,qy:()=>LN,Zy:()=>ZN,bu:()=>JN,zv:()=>nE,dH:()=>SE,HS:()=>r_,yH:()=>wO,l3:()=>AO,z9:()=>CO,x6:()=>TO,_m:()=>FO,eW:()=>VO,GK:()=>UO,SP:()=>HO,yr:()=>KO,dl:()=>_T,Dw:()=>JO,xT:()=>nD,_X:()=>DE,wz:()=>oD});var E=__webpack_require__(7786),_=__webpack_require__(9043);E.A.prototype._CONST=Object.freeze({N:{VIDEO_W:{DESKTOP:208,MOBILE:144},VIDEO_MARGIN:"10px",VIDEO_MARGIN_BOTTOM:"40px",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 T=__webpack_require__(115),I=__webpack_require__.n(T),N=__webpack_require__(3389),O=__webpack_require__.n(N),D=__webpack_require__(402),R=__webpack_require__.n(D),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),G=__webpack_require__(9199);const U=(e,t,n=null,s=!0,r=["return"],i=null)=>{if(!t)return()=>{};const a=((e,t)=>e?(e.event_handlers.current.push(t),()=>{e.event_handlers.current=e.event_handlers.current.filter((e=>e!==t))}):()=>{})(t,(o=>{if(r.includes(o.name)){if(t.all_keys.current=[],i&&i.disableKeypadHandler)return;e&&e.click(),n&&n(),s&&a()}}));return a};E.A.prototype._displaySize=function(e=!1){if(!e&&!this.checkInitialized())return;const t={value:{displayWidthPx:screen.width,displayHeightPx:screen.height,windowWidthPx:window.innerWidth,windowHeightPx:window.innerHeight},timestamp:performance.now()};this.displayData.length&&I()(t.value,this.displayData[this.displayData.length-1].value)||(this.newDisplayData=t)};const q={card:O(),arrow:R(),usba:F(),usbc:z()},j={card:3.375,usba:.787402,usbc:.787402};E.A.prototype.screenSize=function(e={},t=void 0){if(!this.checkInitialized())return;(0,_.$k)();const n=Object.assign({fullscreen:!1,repeatTesting:1,decimalPlace:1,defaultObject:"card",headline:`🖥️ ${G.H.RC_screenSizeTitle[this.L]}`,description:G.H.RC_screenSizeIntro[this.L],check:!1,checkCallback:null},e);this.getFullscreen(n.fullscreen),["usba","usbc","card"].includes(n.defaultObject)||(n.defaultObject="card"),n.description+=`

          ${G.H.RC_screenSizeHave[this.L].replace("xxx",``)}`,this._addBackground(),this._addBackgroundText(n.headline,n.description),this._addCreditOnBackground(G.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),i=(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",u.setAttribute("fill",e._CONST.COLOR.ORANGE);const s=()=>{r.style.cursor="grab",u.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)}},a=e=>{i(e,"mouse")},o=e=>{i(e,"touch")};document.addEventListener("mousedown",a,!1),document.addEventListener("touchstart",o,!1);const l=K(["card","arrow","usba","usbc"],t);let c=n.defaultObject;document.getElementById("matching-obj").addEventListener("change",(e=>{X(e.target.value,l,d),c=e.target.value})),X("card",l);const u=document.getElementById("size-arrow-fill");u.setAttribute("fill",e._CONST.COLOR.LIGHT_GREY);const h={width:l.arrow.getBoundingClientRect().width,height:l.arrow.getBoundingClientRect().height},d=()=>{H(e,r,l.card,l.arrow,h),$(r,l.usba),$(r,l.usbc)};d();const p=()=>{P(r),d()},f=new ResizeObserver((()=>{d(),L(r,t),Y(l,r)}));f.observe(t);const m=U(null,e.keypadHandler,(()=>{y()}),!1,["return","space"],e),g=()=>{document.removeEventListener("mousedown",a,!1),document.removeEventListener("touchstart",o,!1),document.removeEventListener("input",p,!1),f.unobserve(t),e._removeBackground(),m(),(0,V.l)(b)},y=()=>{const t=(l[c].getBoundingClientRect().width||Number.parseInt(l[c].style.width))/j[c],r=n.decimalPlace,i=Z(t,r);e.newScreenData=i,g(),n.check?e._checkScreenSize(s,i,n.checkCallback):(0,_.nB)(s,i)};r.addEventListener("input",p,!1);const b=(0,V.m)({Escape:g,Enter:y," ":y});(0,W.F)(e.L,e.background,{go:y,cancel:g},e.params.showCancelButton),X(c,l,d)}(this,this.background,n,t)};const H=(e,t,n,s,r)=>{const i=(t.offsetWidth-30)*(t.value/100)*(window.innerWidth<480?2:1)+15;n.style.width=`${i}px`;const a=n.getBoundingClientRect();0!==a.width&&(s.style.left=`${a.left+i}px`,s.style.top=`${a.top+e.background.scrollTop+(.63*i-r.height)/2}px`)},$=(e,t)=>{t.style.width=`${(0,_.Ew)(e.value**1.5,0,1e3,50,400)}px`},K=(e,t)=>{const n=document.getElementsByClassName("size-obj");for(;n.length;)n[0].parentNode.removeChild(n[0]);const s={};for(const n of e){let e=document.createElement("div");t.appendChild(e),e.outerHTML=q[n],e=document.getElementById(`size-${n}`),e.setAttribute("preserveAspectRatio","none"),e.style.visibility="hidden",s[n]=e}return Y(s,document.querySelector("#rc-size-slider")),s},X=(e,t,n)=>{for(const n in t)t[n].style.visibility=n===e?"visible":"hidden";t.arrow.style.visibility="hidden",(0,_.nB)(n)},Z=(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},Y=(e,t)=>{for(const n in e)e[n].style.top=`${t.getBoundingClientRect().top+50}px`};var Q=__webpack_require__(4284);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]}__webpack_require__(8840);const ie=(e,{showIcon:t})=>({icon:t?"info":void 0,allowEscapeKey:!1,allowOutsideClick:!1,showConfirmButton:!0,confirmButtonText:G.H.T_proceed[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 ae;"mocha"!==E._&&(ae=__webpack_require__(477).l);function oe(e,t,n=!1,s=void 0){const r=t.control;let i=e._CONST.N.PPI_DONT_USE;e.screenPpi&&(i=e.screenPpi.value);let a=!0,o=[],l=0;const c=document.createElement("div");c.innerHTML='',e.background.appendChild(c),e._constructFloatInstructionElement("blind-spot-instruction",G.H.RC_distanceTrackingCloseL[e.L]),e._addCreditOnBackground(G.H.RC_viewingBlindSpotCredit[e.L]);const u=document.querySelector("#blind-spot-canvas"),h=u.getContext("2d"),d=document.getElementById("blind-spot-instruction");let p="left";e._setFloatInstructionElementPos(p,16);let f,m=te(p,u.width);const g=()=>{u.width=window.innerWidth,u.height=window.innerHeight,u.style.width=`${u.width}px`,u.style.height=`${u.height}px`,m=te(p,u.width),f=re(p,m,u.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,A="left"===p?1:-1,x=U(null,e.keypadHandler,(()=>{k()}),!1,["return"],e);const C=(t=!0)=>{a=!1,r&&function(e,t){document.getElementById(e).removeEventListener("mousedown",t),document.getElementById(e).removeEventListener("touchstart",t)}("blind-spot-canvas",z),y.unobserve(e.background),e._removeBackground(),!e._trackingSetupFinishedStatus.distance&&t&&(e._trackingSetupFinishedStatus.distance=!0,e.gazeTracker.checkInitialized("distance",!1)&&e.endDistance()),(0,V.l)(M),(0,V.l)(F,"keyup")},k=async()=>{if("mocha"!==E._&&ae(),l+=1,o.push({dist:(0,_.Nh)(le(b,m,i),t.decimalPlace),v:A,closedEyeSide:p,crossX:m,circleX:b,ppi:i,timestamp:performance.now()}),2===Math.floor(l/t.repeatTesting))if(function(e){const t=[],n=[];for(const 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={value:(0,_.Nh)((0,_.JZ)(ce(o)),t.decimalPlace),timestamp:performance.now(),method:e._CONST.VIEW_METHOD.B,raw:{...o}};let i;e.newViewingDistanceData=r,i=n?"trackDistance":"measureDistance",C(!1),x(),t.calibrateTrackDistanceCheckBool?await e._checkDistance(s,r,i,t.checkCallback,t.calibrateTrackDistanceCheckCm,t.callbackStatic):(0,_.nB)(s,r)}else{l=0;const t=o[0];R(t.v,t.closedEyeSide,t.crossX),o=[],Q.A.fire({...ie(e,{showIcon:!1}),icon:void 0,html:G.H.RC_viewingBlindSpotRejected[e.L],allowEnterKey:!0})}else l%t.repeatTesting==0?(x(),x=U(null,e.keypadHandler,(()=>{k()}),!1,["return"],e),"left"===p?(p="right",d.innerHTML=G.H.RC_distanceTrackingCloseR[e.L]):(p="left",d.innerHTML=G.H.RC_distanceTrackingCloseL[e.L]),e._setFloatInstructionElementPos(p,16),R(1,p,te(p,u.width),!1,!0)):(A=-A,D(p,f))};let S=!1,T=null;const I=t=>{S||(N(),S=!0,v=e._CONST.COLOR.RED,T=setInterval((()=>{"ArrowLeft"===t.key?(b-=10,O()):"ArrowRight"===t.key&&(b+=10,O())}),30))},N=()=>{S=!1,v=e._CONST.COLOR.DARK_RED,T&&(clearInterval(T),T=null)},O=()=>{w=(0,_.AU)(b,...f),b=w},D=(e,t)=>{const n=t["left"===e?0:1],s=Math.abs(t[1]-t[0])/4;let 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,i=!0)=>{A=t,p=n,m=s,f=re(p,m,u.width),r&&(d.innerHTML="left"===p?G.H.RC_distanceTrackingCloseL[e.L]:G.H.RC_distanceTrackingCloseR[e.L],e._setFloatInstructionElementPos(p,16)),i&&(b=f["left"===p?0:1],D(n,f))},M=(0,V.m)({Escape:t.showCancelButton?C:void 0,Enter:k," ":k,ArrowLeft:r?I:_.Md,ArrowRight:r?I:_.Md}),F=(0,V.m)({ArrowLeft:r?N:_.Md,ArrowRight:r?N:_.Md},"keyup");(0,W.F)(e.L,e.background,{go:k,cancel:t.showCancelButton?C:void 0,custom:{callback:()=>{Q.A.fire({...ie(e,{showIcon:!1}),icon:void 0,html:G.H.RC_viewingDistanceIntroLiMethod[e.L],allowEnterKey:!0})},content:G.H.RC_viewingDistanceIntroTitle[e.L]}},e.params.showCancelButton);const B={x:null,circleX:null},z=t=>{const n=!!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),i=b,a=u.height/2,o=s,l=r,(0,_.ll)(i,a,o,l)>1){B.x=s,B.circleX=b;const r=document.getElementById("blind-spot-canvas");v=e._CONST.COLOR.RED,r.classList.replace("cursor-grab","cursor-grabbing");const i=e=>{let s;t.preventDefault(),e.preventDefault(),s=n?e.touches[0].clientX:e.clientX,b=B.circleX+s-B.x,b=(0,_.AU)(b,...re(p,m,u.width))};n?document.addEventListener("touchmove",i):document.addEventListener("mousemove",i);const a=()=>{n?(document.removeEventListener("touchend",a),document.removeEventListener("touchmove",i)):(document.removeEventListener("mouseup",a),document.removeEventListener("mousemove",i)),B.x=null,B.circleX=null,v=e._CONST.COLOR.DARK_RED,r.classList.replace("cursor-grabbing","cursor-grab")};n?document.addEventListener("touchend",a):document.addEventListener("mouseup",a)}var i,a,o,l};r&&function(e,t){document.getElementById(e).addEventListener("mousedown",t),document.getElementById(e).addEventListener("touchstart",t)}("blind-spot-canvas",z);const L=performance.now();let P=L;const q=()=>{h.clearRect(0,0,u.width,u.height),ne(h,m,u.height/2),P=performance.now(),function(e,t,n,s,r,i,a=!0){t.beginPath(),t.arc(n,s,se>>1,0,2*Math.PI),t.closePath(),t.fillStyle=a?r%125<63?i:"#fff":i,t.fill()}(0,h,b,u.height/2,Math.round(P-L),v,t.sparkle),r||(b+=5*A,O()),a?requestAnimationFrame(q):h.clearRect(0,0,u.width,u.height)};requestAnimationFrame(q)}function le(e,t,n){return Math.abs(t-e)/n/(s=15,Math.tan(s*Math.PI/180))/.3937;var s}function ce(e){const t=[];for(const n of e)t.push(n.dist);return t}function ue(e,t={framerate:60,break:!1}){let n=0,s=0,r=0;const i=1e3/t.framerate,a=()=>{t.break||requestAnimationFrame(a),n=performance.now(),r=n-s,r>i&&(s=n-r%i,e())};requestAnimationFrame(a)}E.A.prototype.measureDistance=function(e={},t=void 0){if(!this.checkInitialized())return;let n;(0,_.$k)(),n=(e.control,G.H.RC_viewingDistanceIntroLiMethod[this.L]);const s=Object.assign({fullscreen:!1,repeatTesting:1,sparkle:!0,decimalPlace:1,control:!0,headline:`📏 ${G.H.RC_viewingDistanceTitle[this.L]}`,description:n,check:!1,checkCallback:!1,showCancelButton:!0},e);this.getFullscreen(s.fullscreen),this._addBackground(),this._replaceBackground((0,_.$O)(s.headline,null,!0,"")),oe(this,s,!1,t)};var he=__webpack_require__(2646);const de=async e=>{if(navigator.permissions?.query)return navigator.permissions.query({name:"camera"}).then((async t=>{if("prompt"===t.state)return await Q.A.fire({...ie(e,{showIcon:!1}),icon:void 0,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAFACAYAAAAszc0KAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAG9jSURBVHgB7b17sGTXVea5b95bVSpJpVfJjypkIzRYtizT3QgZcDvC2KYnosc2MDN0B9gYeoDBDmJiCAIb5q8Z7Oie+YMAzzAdMQwYHBOEZUFDu8e26I6gAZvpoQ3Y2DTYlmUbWS+XZFepJFWV6l2VnSuv1tXKdb+19j6ZeTNP3vp+EffmOfvs5zlnn/2dtR9n7fjx48MyI8PhZhRra2vb3DLEf+RP3G181h2F1X3768NkcUduUVo2jA+blauFKP82XWUwGIx/L1++vC0M2pdfCZOdd5SWL3MURuPX/Nh0rZ/a+c+uf0scUXgUnycLV8tnVBdq94xPw16j1vvVl8GGV7eM1vqIypCdl67+M7J4UTqoTKz/rP8+7xbWf5wn1v/nzxNK3x5flfq/Nk8B6EEnAj0UWuLycVi/UVzowsmJio63UHvotOQZPRBR/MhPludaeaIHcpRWDZT3Wvmy8qB8KV3ui1p5Wu+XKP7s/Ovx6IEU3fso71GaXcoUxRGFzepn9oDvEq+Nw/vL4rBuPh+Rn+y8sf6z/re4+/hZ/1n/ffq6XQvXu/o/bwtgVsAog9M8fDwtYaObZZY458ms5RdaboAoLArftdKgB96ymUfF32lqjdK0jVaXtHeibizqXM/rITmt33nA+r8zsP63pc36P73febCM+j8oUyIR6Z9PHD1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7s1MFEV5bL0eNi/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:`${G.H.RC_requestCamera[e.L]}
          ${G.H.RC_privacyCamera[e.L]}`})})).catch((e=>{}))},pe={video:!1};E.A.prototype.trackDistance=async function(e={},t=void 0,n=void 0){if(!this.checkInitialized())return;let s;(0,_.$k)(),!1===this.gazeTracker.webgazer.getTracker().modelLoaded&&this.gazeTracker.webgazer.getTracker().loadModel(),s=(void 0!==e.control&&e.control,G.H.RC_viewingDistanceIntroLiMethod[this.L]);const r=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:`📏 ${G.H.RC_distanceTrackingTitle[this.L]}`,description:G.H.RC_distanceTrackingIntroStart[this.L]+(0,he.G)(this.L)+s+(0,he.G)(this.L)+G.H.RC_distanceTrackingIntroEnd[this.L],check:!1,checkCallback:null,showCancelButton:!0,callbackStatic:t},e);try{this.viewingDistanceAllowedPreciseBool=e.viewingDistanceAllowedPreciseBool}catch(e){this.viewingDistanceAllowedPreciseBool=!1}if(this.getFullscreen(r.fullscreen),this.gazeTracker.checkInitialized("distance"))return this.gazeTracker._toFixedN=r.decimalPlace,this.showNearPoint(r.showNearPoint),this.showVideo(r.showVideo),void this.showFaceOverlay(r.showFaceOverlay);this._addBackground(),this._constructFloatInstructionElement("gaze-system-instruction",G.H.RC_starting[this.L]),await de(this);const i=(e,n=!0)=>{this.showVideo(pe.video),pe.video=!1,this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(a),n&&(0,_.nB)(t,e),ye.current=e},a=this.gazeTracker.webgazer.params.showGazeDot,o=async()=>{this._addBackground(),this._replaceBackground((0,_.$O)(r.headline,null,!0,"")),this.gazeTracker.checkInitialized("gaze",!1)&&this.showGazer(!1),oe(this,r,!0,i)};ge.pipWidthPx=r.pipWidthPx,ge.decimalPlace=r.decimalPlace,ge.framerate=r.framerate,ge.nearPoint=r.nearPoint,ge.showNearPoint=r.showNearPoint,ge.desiredDistanceCm=r.desiredDistanceCm,ge.desiredDistanceTolerance=r.desiredDistanceTolerance,ge.desiredDistanceMonitor=r.desiredDistanceMonitor,ge.desiredDistanceMonitorCancelable=r.desiredDistanceMonitorCancelable,ge.desiredDistanceMonitorAllowRecalibrate=r.desiredDistanceMonitorAllowRecalibrate,pe.video=r.showVideo,this.gazeTracker._init({toFixedN:1,showVideo:!0,showFaceOverlay:r.showFaceOverlay},"distance"),this._trackingSetupFinishedStatus.distance=!1;const l={options:r,callbackStatic:t,callbackTrack:n};r.nearPoint?fe(this,(()=>this._measurePD({},o)),n,l):fe(this,o,n,l)},E.A.prototype.setViewingDistanceAllowedPreciseBool=function(e=!0){this.viewingDistanceAllowedPreciseBool=e};const fe=async(e,t,n,s)=>{await e.gazeTracker.webgazer.getTracker().loadModel(),e.gazeTracker.beginVideo({pipWidthPx:ge.pipWidthPx},(()=>{e._removeFloatInstructionElement(),(0,_.nB)(t),Ee(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=null,we=null,ve=null;const Ae={framerate:20,break:!0};let xe=null,Ce=!1,ke=0,Se=1;const Ee=async(e,t,n,s)=>{(0,_.yy)(1e3).then((async()=>{let r;ke=0,Se=1;const i=await e.gazeTracker.webgazer.getTracker().model,a=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"})),Ce=!1;const{desiredDistanceCm:o,desiredDistanceTolerance:l,desiredDistanceMonitor:c,desiredDistanceMonitorCancelable:u,desiredDistanceMonitorAllowRecalibrate:h}=t;e._distanceTrackNudging.distanceCorrectEnabled=!0,e._distanceTrackNudging.distanceDesired=o,e._distanceTrackNudging.distanceAllowedRatio=l,ve=async()=>{we||(we=document.getElementById("webgazerVideoCanvas"));const l=performance.now();if(r=await i.estimateFaces(we),r.length){e._trackingVideoFrameTimestamps.distance+=l;const i=r[0].keypoints;if(5===Se){if(ke+=me(i[133],i[362]),ke/=5,e._trackingVideoFrameTimestamps.distance/=5,null!==ye.current){if(!be){const t=Te(a),n=Math.sqrt(ye.current.value**2-t**2);ye.current.value=n,be=ke*ye.current.value,!0!==s.options.calibrateTrackDistanceCheckBool&&e._removeBackground(),e._trackingSetupFinishedStatus.distance=!0,Ce=!0}const r=performance.now(),l=Math.round(r-e._trackingVideoFrameTimestamps.distance),d={value:(0,_.Nh)(be/ke,t.decimalPlace),timestamp:r,method:e._CONST.VIEW_METHOD.F,latencyMs:l};let p;e.newViewingDistanceData=d,(Ce||c)&&(o&&e.nudgeDistance(u,h,s),Ce=!1),t.nearPoint&&(p=_e(e,t,we,i,ke,r,a,l)),n&&"function"==typeof n&&(e.gazeTracker.defaultDistanceTrackCallback=n,n({value:{viewingDistanceCm:d.value,nearPointCm:p?p.value:[null,null],latencyMs:l},timestamp:r,method:e._CONST.VIEW_METHOD.F}))}ke=0,Se=1,e._trackingVideoFrameTimestamps.distance=0}else ke+=me(i[133],i[362]),++Se}},Ae.break=!1,Ae.framerate=5*t.framerate,ue(ve,Ae)}))},_e=(e,t,n,s,r,i,a,o)=>{const 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}));const c={value:{x:(0,_.Nh)(l[0],t.decimalPlace),y:(0,_.Nh)(l[1]+screen.height/2*2.54/a,t.decimalPlace),latencyMs:o},timestamp:i};e.newNearPointData=c;if(t.showNearPoint){const e=c.value.x*a/2.54,t=c.value.y*a/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 c};E.A.prototype.pauseDistance=function(){return this.gazeTracker.checkInitialized("distance",!0)&&!this._trackingPaused.distance?(Ae.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?(Ae.break=!1,xe&&(xe.style.display="block"),ke=0,Se=1,this._trackingVideoFrameTimestamps.distance=0,ue(ve,Ae),this._trackingPaused.distance=!1,this.resumeNudger(),this):null},E.A.prototype.endDistance=function(e=!1,t=!0){return this.gazeTracker.checkInitialized("distance",!0)?(Ae.break=!0,Ae.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,ve=null,Ce=!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)||!Ae.break)return;const t=e||this.gazeTracker.defaultDistanceTrackCallback,n=document.querySelector("#webgazerVideoFeed"),s=await this.gazeTracker.webgazer.getTracker().model,r=performance.now(),i=await s.estimateFaces(n);if(i.length){const e=i[0].scaledMesh,s=me(e[133],e[362]),a=performance.now(),o=a-r;this.newViewingDistanceData={value:(0,_.Nh)(be/s,ge.decimalPlace),timestamp:a,method:this._CONST.VIEW_METHOD.F,latencyMs:o};const l=this.newViewingDistanceData;let c;return ge.nearPoint&&(c=_e(this,ge,n,e,s,a,this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE,o)),(0,_.nB)(t,{value:{viewingDistanceCm:l.value,nearPointCm:c?c.value:null,latencyMs:o},timestamp:a,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 Te=e=>2.54*(window.screen.height/2/e);E.A.prototype.nudgeDistance=function(e,t,n){if(this.checkInitialized()&&this._distanceTrackNudging.distanceDesired){if(this.viewingDistanceCm&&this.viewingDistanceCm.method===this._CONST.VIEW_METHOD.F){if(!Ie(this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired,this._distanceTrackNudging.distanceAllowedRatio)){const s=()=>{this._removeNudger(),clearInterval(this._distanceTrackNudging.distanceCorrecting),this._distanceTrackNudging.distanceCorrecting=null,(0,V.l)(i)},r=async()=>{this.endDistance(),this._addBackground(),await(0,_.yy)(2e3),this.trackDistance(n.options,n.callbackStatic,n.callbackTrack)},i=(0,V.m)(e?{Escape:this.endNudger}:{});if(null===this._distanceTrackNudging.distanceCorrecting&&this._distanceTrackNudging.distanceCorrectEnabled){const[n,a,o,l]=Ne(this);let c=e?{cancel:()=>{this.endNudger()}}:{};t&&(c={...c,custom:{callback:r,content:G.H.RC_distanceTrackingRedo[this.L]}}),(e||t)&&(0,W.F)(this.L,this.nudger,c,this.params.showCancelButton);const u=()=>{n.innerHTML=Oe(this,this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired),a.innerHTML=this.viewingDistanceAllowedPreciseBool?this.viewingDistanceCm.value.toFixed(1):Math.round(this.viewingDistanceCm.value),o.innerHTML=Math.round(this._distanceTrackNudging.distanceDesired),this._distanceTrackNudging.needEasyEyesKeypadBeyondCm&&this._distanceTrackNudging.distanceDesired>this._distanceTrackNudging.needEasyEyesKeypadBeyondCm?l.innerHTML=` ${G.H.RC_canUsePhoneKeypad[this.L]}`:l.innerHTML=""};u(),this._distanceTrackNudging.distanceCorrecting=setInterval((()=>{u(),Ie(this.viewingDistanceCm.value,this._distanceTrackNudging.distanceDesired,this._distanceTrackNudging.distanceAllowedRatio)&&(s(),(0,V.l)(i))}),200)}else this._distanceTrackNudging.distanceCorrecting&&!this._distanceTrackNudging.distanceCorrectEnabled&&s();return!1}return!0}return!1}};const Ie=(e,t,n)=>{if(!De(n))return!1;const s=t*n,r=t/n;return e<=Math.max(s,r)&&e>=Math.min(s,r)},Ne=e=>(e._addNudger(`
          \n

          \n

          ${G.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"),document.querySelector("#rc-can-use-keypad")]),Oe=(e,t,n)=>t>=n?G.H.RC_distanceTrackingMoveCloser[e.L]:G.H.RC_distanceTrackingMoveFurther[e.L],De=e=>!Number.isNaN(e)&&(e>0&&1!==e);E.A.prototype.setDistanceDesired=function(e,t=null,n=null){return this._distanceTrackNudging.distanceDesired=e,n&&(this._distanceTrackNudging.needEasyEyesKeypadBeyondCm=n),t&&De(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(){const 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){const i=setInterval((()=>{const a=document.getElementById("webgazerVideoContainer");a&&(clearInterval(i),a.style.height=t/Number.parseInt(a.style.width)*Number.parseInt(a.style.height)+"px",a.style.width=`${t}px`,a.style.opacity=n,s.setVideoViewerSize(Number.parseInt(a.style.width),Number.parseInt(a.style.height)),Me(e,a),setTimeout((()=>{e.videoOpacity(),e.isMobile.value?a.style.transition="right 0.5s, top 0.5s, width 0.5s, height 0.5s, border-radius 0.5s":a.style.transition="left 0.5s, bottom 0.5s, width 0.5s, height 0.5s, border-radius 0.5s",(0,_.nB)(r)}),700))}),100)}function Me(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_BOTTOM)}const Fe={video:!1,videoWidth:0,videoHeight:0,opacity:1,gaze:!1,faceOverlay:!1},Be=.9;E.A.prototype._measurePD=async function(e={},t=void 0){if(!this.checkInitialized())return;(0,_.$k)();const n=Object.assign({fullscreen:!1,headline:`👁️ ${G.H.RC_nearPointTitle[this.L]}`,description:G.H.RC_nearPointIntro[this.L],shortDescription:G.H.RC_nearPointIntro[this.L]},e);this.getFullscreen(n.fullscreen),await(0,_.yy)(1e3),this._replaceBackground(),this._replaceBackground((0,_.$O)(n.headline,n.shortDescription,!0));const s=this.screenPpi?this.screenPpi.value:this._CONST.N.PPI_DONT_USE,[r,i]=ze(this),[a,o]=Ve(this,s,r,i),l=(e=!0)=>{a.removeEventListener("mousedown",o),this._removeBackground(),this.showVideo(Fe.video),this.showGazer(Fe.gaze),this.showFaceOverlay(Fe.faceOverlay),this.gazeTracker.webgazer.showFaceFeedbackBox(!0),Object.assign(document.querySelector("#webgazerVideoContainer").style,{height:Fe.videoHeight,width:Fe.videoWidth,opacity:Fe.opacity,borderRadius:"5px"}),Me(this,document.querySelector("#webgazerVideoContainer")),Object.assign(document.querySelector("#webgazerVideoFeed").style,{height:Fe.videoHeight,width:Fe.videoWidth,top:"unset",transform:"scale(-1, 1)",transformOrigin:"unset"}),Fe.video=!1,Fe.videoWidth=0,Fe.videoHeight=0,Fe.opacity=1,Fe.gaze=!1,Fe.faceOverlay=!1,!this._trackingSetupFinishedStatus.distance&&e&&(this._trackingSetupFinishedStatus.distance=!0,this.endDistance()),(0,V.l)(u)},c=()=>{if(-100!==Pe){const e={value:2.54*Pe/s,timestamp:performance.now()};return this.newPDData=e,l(!1),(0,_.nB)(t,e)}},u=(0,V.m)({Escape:l,Enter:c," ":c});(0,W.F)(this.L,this.background,{go:c,cancel:l},this.params.showCancelButton),setTimeout((()=>{Q.A.fire({...ie(this,{showIcon:!1}),icon:void 0,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAADwCAIAAABXFyDtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGx2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuZGFiYWNiYiwgMjAyMS8wNC8xNC0wMDozOTo0NCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIyLjQgKE1hY2ludG9z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IXjcYuFlyUplUgihhn3owAgJt17qrSxacVttyVjUcFmc5eVEkL3v7rpxNYdkMHIxB7w3vKdzz/d3xe8/avf1iLnNO3Syr+yzuQFT8F7yra88qyK+A/ecWcwHhjSF9Fldx4/c6KjvaWystzmdF3Mvk9V1BJnia/E8+prW5Cz/FIQwtCUeUJBodc4AJRC8q8plX9RHCMD1svJg0EIJUmcO2PqXzZue+rl16vKSoxn/39nE9KqgqMETAAAAABJRU5ErkJggg==",imageWidth:480,imageAlt:"Measurement Instruction",html:n.description})}),700)};const ze=e=>{const t=document.querySelector("#webgazerVideoFeed");if(t)return Le(e,t,document.querySelector("#webgazerVideoCanvas"),document.querySelector("#webgazerVideoContainer"))},Le=(e,t,n,s,r=null)=>{const i=.3*window.innerWidth/Number.parseInt(t.style.width)*Number.parseInt(t.style.height);Fe.videoWidth=s.style.width,Fe.videoHeight=s.style.height,Fe.opacity=s.style.opacity;const a={height:`${Math.round(i)}px`,width:`${Math.round(window.innerWidth*Be)}px`,opacity:1,borderRadius:"15px"};Object.assign(s.style,a),e.isMobile.value?Object.assign(s.style,{right:`${Math.round(.5*window.innerWidth*.09999999999999998)}px`,top:`${Math.round(.5*(window.innerHeight-i))}px`}):Object.assign(s.style,{left:`${Math.round(.5*window.innerWidth*.09999999999999998)}px`,bottom:`${Math.round(.5*(window.innerHeight-i))}px`});const o={height:`${Math.round(i*Be/.3)}px`,width:`${Math.round(window.innerWidth*Be)}px`,top:`${Math.round(.6000000000000001*-i)}px`,transform:"scale(-2, 2)",transformOrigin:"center"};return Object.assign(t.style,o),Fe.video=e.gazeTracker.webgazer.params.showVideo,Fe.gaze=e.gazeTracker.webgazer.params.showGazeDot,Fe.faceOverlay=e.gazeTracker.webgazer.params.showFaceOverlay,Fe.video||e.showVideo(!0),Fe.gaze&&e.showGazer(!1),Fe.faceOverlay&&e.showFaceOverlay(!1),e.gazeTracker.webgazer.showFaceFeedbackBox(!1),[window.innerWidth*Be,i]};let Pe=-100;const Ve=(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 i=document.createElement("div");i.id="rc-ruler-scales",r.appendChild(i);const a=2.54*(r.clientWidth-60)/t;for(let n=0;n<=10*(0,_.Nh)(a,1);n++){const 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,i.appendChild(s),n%10==0){const t=document.createElement("p");t.className="rc-ruler-scale-text",t.style.left=r,t.innerHTML=n/10,i.appendChild(t),0===n&&(t.style.color=e._CONST.COLOR.DARK_RED)}}let o=document.createElement("div");i.appendChild(o),o.outerHTML=R(),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=>{Pe=e.offsetX-30,o.style.left=`${Pe}px`;const t=e=>{Pe=e.offsetX-30,o.style.left=`${Pe}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 We(e){return We="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},We(e)}var Ge=/^\s+/,Ue=/\s+$/;function qe(e,t){if(t=t||{},(e=e||"")instanceof qe)return e;if(!(this instanceof qe))return new qe(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,s=null,r=null,i=null,a=!1,o=!1;"string"==typeof e&&(e=function(e){e=e.replace(Ge,"").replace(Ue,"").toLowerCase();var t,n=!1;if(ot[e])e=ot[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=vt.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=vt.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=vt.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=vt.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=vt.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=vt.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=vt.hex8.exec(e))return{r:dt(t[1]),g:dt(t[2]),b:dt(t[3]),a:gt(t[4]),format:n?"name":"hex8"};if(t=vt.hex6.exec(e))return{r:dt(t[1]),g:dt(t[2]),b:dt(t[3]),format:n?"name":"hex"};if(t=vt.hex4.exec(e))return{r:dt(t[1]+""+t[1]),g:dt(t[2]+""+t[2]),b:dt(t[3]+""+t[3]),a:gt(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=vt.hex3.exec(e))return{r:dt(t[1]+""+t[1]),g:dt(t[2]+""+t[2]),b:dt(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==We(e)&&(At(e.r)&&At(e.g)&&At(e.b)?(l=e.r,c=e.g,u=e.b,t={r:255*ut(l,255),g:255*ut(c,255),b:255*ut(u,255)},a=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):At(e.h)&&At(e.s)&&At(e.v)?(s=ft(e.s),r=ft(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,i=n*(1-t),a=n*(1-r*t),o=n*(1-(1-r)*t),l=s%6,c=[n,a,i,i,o,n][l],u=[o,n,n,a,i,i][l],h=[i,i,o,n,n,a][l];return{r:255*c,g:255*u,b:255*h}}(e.h,s,r),a=!0,o="hsv"):At(e.h)&&At(e.s)&&At(e.l)&&(s=ft(e.s),i=ft(e.l),t=function(e,t,n){var s,r,i;function a(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=i=n;else{var o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;s=a(l,o,e+1/3),r=a(l,o,e),i=a(l,o,e-1/3)}return{r:255*s,g:255*r,b:255*i}}(e.h,s,i),a=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a));var l,c,u;return n=ct(n),{ok:a,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 je(e,t,n){e=ut(e,255),t=ut(t,255),n=ut(n,255);var s,r,i=Math.max(e,t,n),a=Math.min(e,t,n),o=(i+a)/2;if(i==a)s=r=0;else{var l=i-a;switch(r=o>.5?l/(2-i-a):l/(i+a),i){case e:s=(t-n)/l+(t>1)+720)%360;--t;)s.h=(s.h+r)%360,i.push(qe(s));return i}function at(e,t){t=t||6;for(var n=qe(e).toHsv(),s=n.h,r=n.s,i=n.v,a=[],o=1/t;t--;)a.push(qe({h:s,s:r,v:i})),i=(i+o)%1;return a}qe.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=ct(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=He(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=He(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=je(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString: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.l);return 1==this._a?"hsl("+t+", "+n+"%, "+s+"%)":"hsla("+t+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(e){return $e(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 i=[pt(Math.round(e).toString(16)),pt(Math.round(t).toString(16)),pt(Math.round(n).toString(16)),pt(mt(s))];if(r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.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)&&(lt[$e(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+Ke(this._r,this._g,this._b,this._a),n=t,s=this._gradientType?"GradientType = 1, ":"";if(e){var r=qe(e);n="#"+Ke(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 qe(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(Qe,arguments)},brighten:function(){return this._applyModification(Je,arguments)},darken:function(){return this._applyModification(et,arguments)},desaturate:function(){return this._applyModification(Xe,arguments)},saturate:function(){return this._applyModification(Ze,arguments)},greyscale:function(){return this._applyModification(Ye,arguments)},spin:function(){return this._applyModification(tt,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(it,arguments)},complement:function(){return this._applyCombination(nt,arguments)},monochromatic:function(){return this._applyCombination(at,arguments)},splitcomplement:function(){return this._applyCombination(rt,arguments)},triad:function(){return this._applyCombination(st,[3])},tetrad:function(){return this._applyCombination(st,[4])}},qe.fromRatio=function(e,t){if("object"==We(e)){var n={};for(var s in e)e.hasOwnProperty(s)&&(n[s]="a"===s?e[s]:ft(e[s]));e=n}return qe(e,t)},qe.equals=function(e,t){return!(!e||!t)&&qe(e).toRgbString()==qe(t).toRgbString()},qe.random=function(){return qe.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},qe.mix=function(e,t,n){n=0===n?0:n||50;var s=qe(e).toRgb(),r=qe(t).toRgb(),i=n/100;return qe({r:(r.r-s.r)*i+s.r,g:(r.g-s.g)*i+s.g,b:(r.b-s.b)*i+s.b,a:(r.a-s.a)*i+s.a})},qe.readability=function(e,t){var n=qe(e),s=qe(t);return(Math.max(n.getLuminance(),s.getLuminance())+.05)/(Math.min(n.getLuminance(),s.getLuminance())+.05)},qe.isReadable=function(e,t,n){var s,r,i=qe.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=i>=4.5;break;case"AAlarge":r=i>=3;break;case"AAAsmall":r=i>=7}return r},qe.mostReadable=function(e,t,n){var s,r,i,a,o=null,l=0;r=(n=n||{}).includeFallbackColors,i=n.level,a=n.size;for(var c=0;cl&&(l=s,o=qe(t[c]));return qe.isReadable(e,o,{level:i,size:a})||!r?o:(n.includeFallbackColors=!1,qe.mostReadable(e,["#fff","#000"],n))};var ot=qe.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"},lt=qe.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(ot);function ct(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 ht(e){return Math.min(1,Math.max(0,e))}function dt(e){return parseInt(e,16)}function pt(e){return 1==e.length?"0"+e:""+e}function ft(e){return e<=1&&(e=100*e+"%"),e}function mt(e){return Math.round(255*parseFloat(e)).toString(16)}function gt(e){return dt(e)/255}var yt,bt,wt,vt=(bt="[\\s|\\(]+("+(yt="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+yt+")[,|\\s]+("+yt+")\\s*\\)?",wt="[\\s|\\(]+("+yt+")[,|\\s]+("+yt+")[,|\\s]+("+yt+")[,|\\s]+("+yt+")\\s*\\)?",{CSS_UNIT:new RegExp(yt),rgb:new RegExp("rgb"+bt),rgba:new RegExp("rgba"+wt),hsl:new RegExp("hsl"+bt),hsla:new RegExp("hsla"+wt),hsv:new RegExp("hsv"+bt),hsva:new RegExp("hsva"+wt),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 At(e){return!!vt.CSS_UNIT.exec(e)}var xt=__webpack_require__(782);const Ct=e=>e/2.54,kt={video:!1,gazer:!1};function St(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",G.H.RC_starting[e.L])}E.A.prototype.calibrateGaze=function(e={},t=void 0){if(!this.gazeTracker.checkInitialized("gaze",!0))return;(0,_.$k)();const n=Object.assign({greedyLearner:!1,calibrationCount:1,headline:`👀 ${G.H.RC_gazeTrackingTitle[this.L]}`,description:G.H.RC_gazeTrackingIntro[this.L]},e);n.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=n.greedyLearner,St(this,n);const s=Et(this,n,(()=>{this._removeBackground(),(0,V.l)(r),(0,_.nB)(t,{timestamp:performance.now()})})),r=(0,V.m)({Escape:()=>{s.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)(r)}})};const Et=(e,t,n)=>(e._removeFloatInstructionElement(),new _t(e,document.body,t,kt,n));class _t{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 i=document.createElement("div"),a=document.createElement("div");this.div.className="rc-crosshair",this.div.id="rc-crosshair",i.className="rc-crosshair-component rc-crosshair-vertical",a.className="rc-crosshair-component rc-crosshair-horizontal",a.style.height=i.style.width=`${ee}px`,a.style.width=i.style.height=`${J}px`,this.div.style.background=e.params.backgroundColor;const o=qe(e.params.backgroundColor).toRgb();this.div.style.background=`rgba(${o.r}, ${o.g}, ${o.b}, 0.75)`,this.div.appendChild(i),this.div.appendChild(a),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}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));const e=document.querySelectorAll(".leader-line");e&&e.map((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:i,bottom:a}=this.div.getBoundingClientRect(),o=(s+i)/2,l=(r+a)/2;return t>=o-5&&t<=o+5&&n>=l-5&&n<=l+5}_randomOrder(){this.order=[];for(const e of[0,1,2])for(const 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,i=this.RC.viewingDistanceCm?this.RC.viewingDistanceCm.value:this.RC._CONST.N.VIEW_DIST_DONT_USE,Ct(r)*i*Math.tan(s*(Math.PI/180)));var s,r,i;return t?Math.min(n,t):n}}E.A.prototype.trackGaze=async function(e={},t=null,n=null){if(!this.checkInitialized())return;(0,_.$k)(),!1===this.gazeTracker.webgazer.getTracker().modelLoaded&&this.gazeTracker.webgazer.getTracker().loadModel();const s=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:`👀 ${G.H.RC_gazeTrackingTitle[this.L]}`,description:G.H.RC_gazeTrackingIntro[this.L]},e);if(this.getFullscreen(s.fullscreen),this.gazeTracker.checkInitialized("gaze"))return this.gazeTracker._toFixedN=s.decimalPlace,this.showGazer(s.showGazer),this.showVideo(s.showVideo),this.showFaceOverlay(s.showFaceOverlay),this.gazeTracker.attachNewCallback(n),void(this.gazeTracker.defaultGazeCallback=n);this._addBackground(),await de(this),this.gazeTracker._init({greedyLearner:s.greedyLearner,framerate:s.framerate,toFixedN:s.decimalPlace,showVideo:s.showVideo,showFaceOverlay:s.showFaceOverlay,showGazer:s.showGazer},"gaze"),St(this,s);const r={pipWidthPx:s.pipWidthPx},i={greedyLearner:s.greedyLearner,calibrationCount:s.calibrationCount,headline:s.headline,description:s.description};this.gazeTracker.begin(r,(()=>{this._trackingSetupFinishedStatus.gaze=!1,this.calibrateGaze(i,a)}));const a=e=>{(0,_.nB)(t,e),this.gazeTracker.webgazer.params.greedyLearner||this.gazeTracker.stopLearning({click:!0,move:!0});return s.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;const n=Object.assign({wait:0,frames:5},e),s=t||this.gazeTracker.defaultGazeCallback;return await this.gazeTracker.getGazeNow(n,s)},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,t){const n=Object.assign({click:!0,move:!0},t);e?this.gazeTracker.startLearning(n):this.gazeTracker.stopLearning(n)},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 Tt=__webpack_require__(7158),It=__webpack_require__.n(Tt);const Nt={gazer:!1,gazeLearning:!1,gazePaused:!1},Ot={current:null};E.A.prototype.nudgeGaze=function(e={},t=void 0){if(!this.checkInitialized()||!this.gazeTracker.checkInitialized("gaze",!0))return;const n=Object.assign({showOffset:!0},e);if(this._gazeTrackNudging.isCorrectingGaze)return;this._gazeTrackNudging.isCorrectingGaze=!0;let s=document.getElementById("gaze-nudger");s||(s=document.createElement("div"),s.id="gaze-nudger",s.className=`gaze-nudger rc-lang-${this.LD.toLowerCase()}`,document.body.classList.add("lock-view"),document.body.appendChild(s),s.style.background=this.params.backgroundColor);const r=`

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

          `;s.innerHTML+=r;const i=Dt(this,s,t);if(this._nudger.gazeElement=s,n.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),Ot.current=new(It())(It().pointAnchor(e,{x:"50%",y:"50%"}),It().pointAnchor(i,{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"}Nt.gazePaused=this._trackingPaused.gaze,Nt.gazer=this.gazeTracker.webgazer.params.showGazeDot,Nt.gazeLearning=this.gazeTracker._learning,Nt.gazePaused&&this.resumeGaze(),Nt.gazer||this.showGazer(!0),Nt.gazeLearning||this.gazeLearning(!0,{click:!0,move:!1})};const Dt=(e,t,n)=>new _t(e,t,{greedyLearner:!1,calibrationCount:1,nudge:!0},Nt,(()=>{t.remove(),t=null,e._nudgerElement=null,document.body.classList.remove("lock-view"),Nt.gazePaused&&e.pauseGaze(),Nt.gazePaused=!1,Ot.current&&(Ot.current.remove(),Ot.current=null),e._gazeTrackNudging.isCorrectingGaze=!1,(0,_.nB)(n)}));var Rt=__webpack_require__(4948),Mt=__webpack_require__.n(Rt);let Ft=!1;E.A.prototype.getGazeAccuracy=function(e={},t=void 0,n=void 0){if(!this.checkInitialized())return!1;(0,_.$k)();const s=this.screenPpi,r=this.viewingDistanceCm;if(!s||!r)return!1;const i=Object.assign({backgroundColor:"#eee",thresholdDeg:10,decimalPlace:3},e);this._addBackground();const a=document.createElement("div");a.innerHTML='',this.background.appendChild(a);const o=document.querySelector("#gaze-accuracy-canvas"),l=o.getContext("2d"),c=()=>{o.width=window.innerWidth,o.height=window.innerHeight,o.style.width=`${o.width}px`,o.style.height=`${o.height}px`},u=new ResizeObserver((()=>{c()}));return u.observe(this.background),c(),Mt().fire({...ie(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((()=>{Ft=!0,Bt(o,l,i),this.gazeTracker.startStoringPoints(),(0,_.yy)(5e3).then((()=>{Ft=!1,this.gazeTracker.stopStoringPoints();const e=this.gazeTracker.webgazer.getStoredPoints(),a=zt({x:o.width/2,y:o.height/2},e,s.value,r.value);this.newGazeAccuracyData={value:(0,_.Nh)(a,i.decimalPlace),timestamp:performance.now()},a{const s=()=>{t.fillStyle=n.backgroundColor,t.fillRect(0,0,e.width,e.height),ne(t,e.width/2,e.height/2),Ft&&requestAnimationFrame(s)};requestAnimationFrame(s)},zt=(e,t,n,s)=>{let r=0;for(let i=0;i0;)n=Math.random()*t|0,t--,qt(e,t,n)}function Gt(e,t,n){return Math.max(e,Math.min(t,n))}function Ut(e){return e%2==0?e:e+1}function qt(e,t,n){const s=e[t];e[t]=e[n],e[n]=s}function jt(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function Ht(e,t,n=""){jt(Xt(e,t),(()=>n+` Shapes ${e} and ${t} must match`))}function $t(e){jt(null!=e,(()=>"The input to the tensor constructor must be a non-null value."))}function Kt(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n0),n,s){return new Promise(((r,i)=>{let a=0;const o=()=>{if(e())return void r();a++;const l=t(a);null!=n&&a>=n?i():null!=s?s(o,l):setTimeout(o,l)};o()}))}function en(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 tn(e,t){const n=t.length;return jt((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}`)),jt(e.every((e=>Zt(e))),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function nn(e,t){const n=[],s=[],r=null!=t&&Array.isArray(t)&&0===t.length,i=null==t||r?null:tn(t,e).sort();let a=0;for(let t=0;tt)&&1===e[t]&&(n.push(e[t]),s.push(t)),i[a]<=t&&a++}1!==e[t]&&(n.push(e[t]),s.push(t))}return{newShape:n,keptDims:s}}function sn(e,t){return rn(e,t)}function rn(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 an(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function on(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 ln(e){return"string"==typeof e||e instanceof String}function cn(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":cn(e)?"float32":ln(e)?"string":"boolean"==typeof e?"bool":"float32"}function hn(e){return!!(e&&e.constructor&&e.call&&e.apply)}function dn(e,t){for(let n=t;n=0;--s)n[s]=n[s+1]*e[s+1];return n}function fn(e,t,n,s=!1){const r=new Array;if(1===t.length){const i=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 fn(0,e,t,n)}function gn(e,t){const n=yn(e,t);for(let e=0;ee*t),1);if(null==t||"float32"===t)return mn(e,new Float32Array(n));if("int32"===t)return mn(e,new Int32Array(n));if("bool"===t)return mn(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function wn(e){e.forEach((t=>{jt(Number.isInteger(t)&&t>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`))}))}function vn(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 Sn(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 En(){return Tn}let _n,Tn=null;function In(){if(null==_n){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}_n=e}return _n}function Nn(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 On="Abs",Dn="Acos",Rn="Acosh",Mn="Add",Fn="AddN",Bn="All",zn="Any",Ln="ArgMax",Pn="ArgMin",Vn="Asin",Wn="Asinh",Gn="Atan",Un="Atanh",qn="Atan2",jn="AvgPool",Hn="AvgPoolGrad",$n="AvgPool3D",Kn="AvgPool3DGrad",Xn="BatchMatMul",Zn="BatchToSpaceND",Yn="Bincount",Qn="BitwiseAnd",Jn="BroadcastArgs",es="Cast",ts="Ceil",ns="ClipByValue",ss="Complex",rs="ComplexAbs",is="Concat",as="Conv2D",os="Conv2DBackpropFilter",ls="Conv2DBackpropInput",cs="Conv3D",us="Conv3DBackpropFilterV2",hs="Conv3DBackpropInputV2",ds="Cos",ps="Cosh",fs="Cumprod",ms="Cumsum",gs="CropAndResize",ys="DenseBincount",bs="DepthToSpace",ws="DepthwiseConv2dNative",vs="DepthwiseConv2dNativeBackpropFilter",As="DepthwiseConv2dNativeBackpropInput",xs="Diag",Cs="Dilation2D",ks="Dilation2DBackpropInput",Ss="Dilation2DBackpropFilter",Es="Draw",_s="RealDiv",Ts="Einsum",Is="Elu",Ns="EluGrad",Os="Erf",Ds="Equal",Rs="Exp",Ms="ExpandDims",Fs="Expm1",Bs="FFT",zs="Fill",Ls="FlipLeftRight",Ps="Floor",Vs="FloorDiv",Ws="FusedBatchNorm",Gs="GatherV2",Us="GatherNd",qs="Greater",js="GreaterEqual",Hs="Identity",$s="IFFT",Ks="Imag",Xs="IsFinite",Zs="IsInf",Ys="IsNan",Qs="LeakyRelu",Js="Less",er="LessEqual",tr="LinSpace",nr="Log",sr="Log1p",rr="LogicalAnd",ir="LogicalNot",ar="LogicalOr",or="LRN",lr="LRNGrad",cr="Max",ur="Maximum",hr="MaxPool",dr="MaxPoolGrad",pr="MaxPool3D",fr="MaxPool3DGrad",mr="MaxPoolWithArgmax",gr="Mean",yr="Min",br="Minimum",wr="MirrorPad",vr="Mod",Ar="Multinomial",xr="Multiply",Cr="Neg",kr="NotEqual",Sr="NonMaxSuppressionV3",Er="NonMaxSuppressionV4",_r="NonMaxSuppressionV5",Tr="OnesLike",Ir="OneHot",Nr="Pack",Or="PadV2",Dr="Pow",Rr="Prelu",Mr="Prod",Fr="RaggedGather",Br="RaggedRange",zr="RaggedTensorToTensor",Lr="Range",Pr="Real",Vr="Reciprocal",Wr="Relu",Gr="Reshape",Ur="ResizeNearestNeighbor",qr="ResizeNearestNeighborGrad",jr="ResizeBilinear",Hr="ResizeBilinearGrad",$r="Relu6",Kr="Reverse",Xr="Round",Zr="Rsqrt",Yr="ScatterNd",Qr="TensorScatterUpdate",Jr="SearchSorted",ei="Select",ti="Selu",ni="Slice",si="Sin",ri="Sinh",ii="Sign",ai="Sigmoid",oi="Softplus",li="Sqrt",ci="Sum",ui="SpaceToBatchND",hi="SplitV",di="Softmax",pi="SparseFillEmptyRows",fi="SparseReshape",mi="SparseSegmentMean",gi="SparseSegmentSum",yi="SparseToDense",bi="SquaredDifference",wi="Square",vi="StaticRegexReplace",Ai="StridedSlice",xi="StringNGrams",Ci="StringSplit",ki="StringToHashBucketFast",Si="Sub",Ei="Tan",_i="Tanh",Ti="Tile",Ii="TopK",Ni="Transform",Oi="Transpose",Di="Unique",Ri="Unpack",Mi="UnsortedSegmentSum",Fi="ZerosLike",Bi="Step",zi="FromPixels",Li="RotateWithOffset",Pi="_FusedMatMul",Vi="FusedConv2D",Wi="FusedDepthwiseConv2D";function Gi(...e){!En().getBool("IS_TEST")&&En().getBool("PROD")}function Ui(...e){!En().getBool("IS_TEST")&&En().getBool("PROD")}const qi=Nn("kernelRegistry",(()=>new Map)),ji=Nn("gradRegistry",(()=>new Map));function Hi(e,t){const n=Yi(e,t);return qi.get(n)}function $i(e){return ji.get(e)}function Ki(e){const t=qi.entries(),n=[];for(;;){const{done:s,value:r}=t.next();if(s)break;const[i,a]=r,[o]=i.split("_");o===e&&n.push(a)}return n}function Xi(e){const{kernelName:t,backendName:n}=e,s=Yi(t,n);qi.has(s)&&Gi(),qi.set(s,e)}function Zi(e){const{kernelName:t}=e;ji.has(t)&&En().getBool("DEBUG")&&Gi(),ji.set(t,e)}function Yi(e,t){return`${t}_${e}`}function Qi(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}var Ji=__webpack_require__(3122);const ea=__webpack_require__.n(Ji)()||Ji;function ta(e){return ea.fromString(e,!0,16)}const na=ta("c3a5c85c97cb3127"),sa=ta("b492b66fbe98f273"),ra=ta("9ae16a3b2f90404f");function ia(e){return e.xor(e.shru(47))}function aa(e,t,n){const s=e.slice(t,t+n);return ea.fromBytes(Array.from(s),!0,!0)}function oa(e,t){return aa(e,t,8)}function la(e,t){return aa(e,t,4)}function ca(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function ua(e,t,n=ta("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 ha(e,t,n,s){return function(e,t,n,s,r,i){r=r.add(e),i=ca(i.add(r).add(s),21);const a=r;return r=(r=r.add(t)).add(n),i=i.add(ca(r,44)),[r.add(s),i.add(a)]}(oa(e,t),oa(e,t+8),oa(e,t+16),oa(e,t+24),n,s)}function da(e,t=e.length){const n=ea.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=ra.add(2*t),s=oa(e,0).add(ra),r=oa(e,t-8);return ua(ca(r,37).mul(n).add(s),ca(s,25).add(r).mul(n),n)}if(t>=4){const n=ra.add(2*t);return ua(la(e,0).shl(3).add(t),la(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),s=t+(e[t-1]<<2);return ia(ra.mul(n).xor(na.mul(s))).mul(ra)}return ra}(e,t):function(e,t=e.length){const n=ra.add(2*t),s=oa(e,0).mul(sa),r=oa(e,8),i=oa(e,t-8).mul(n),a=oa(e,t-16).mul(ra);return ua(ca(s.add(r),43).add(ca(i,30)).add(a),s.add(ca(r.add(ra),18)).add(i),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=ra.add(2*t),s=oa(e,0).mul(ra),r=oa(e,8),i=oa(e,t-8).mul(n),a=oa(e,t-16).mul(ra),o=ca(s.add(r),43).add(ca(i,30)).add(a),l=ua(o,s.add(ca(r.add(ra),18)).add(i),n),c=oa(e,16).mul(n),u=oa(e,24),h=o.add(oa(e,t-32)).mul(n),d=l.add(oa(e,t-24)).mul(n);return ua(ca(c.add(u),43).add(ca(h,30)).add(d),c.add(ca(u.add(s),18)).add(h),n)}(e,t);let s=n,r=n.mul(sa).add(113),i=ia(r.mul(ra).add(113)).mul(ra),a=[ea.UZERO,ea.UZERO],o=[ea.UZERO,ea.UZERO];s=s.mul(ra).add(oa(e,0));let l=0;const c=64*(t-1>>6),u=c+(t-1&63)-63;do{s=ca(s.add(r).add(a[0]).add(oa(e,l+8)),37).mul(sa),r=ca(r.add(a[1]).add(oa(e,l+48)),42).mul(sa),s=s.xor(o[1]),r=r.add(a[0]).add(oa(e,l+40)),i=ca(i.add(o[0]),33).mul(sa),a=ha(e,l,a[1].mul(sa),s.add(o[0])),o=ha(e,l+32,i.add(o[1]),r.add(oa(e,l+16))),[i,s]=[s,i],l+=64}while(l!==c);const h=sa.add(i.and(255).shl(1));return l=u,o[0]=o[0].add(t-1&63),a[0]=a[0].add(o[0]),o[0]=o[0].add(a[0]),s=ca(s.add(r).add(a[0]).add(oa(e,l+8)),37).mul(h),r=ca(r.add(a[1]).add(oa(e,l+48)),42).mul(h),s=s.xor(o[1].mul(9)),r=r.add(a[0].mul(9).add(oa(e,l+40))),i=ca(i.add(o[0]),33).mul(h),a=ha(e,l,a[1].mul(h),s.add(o[0])),o=ha(e,l+32,i.add(o[1]),r.add(oa(e,l+16))),[i,s]=[s,i],ua(ua(a[0],o[0],h).add(ia(r).mul(na)).add(i),ua(a[1],o[1],h).add(s),h)}function pa(e,t){return"string"===t?ga(e):fa([e],t)}function fa(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=wa(e)),En().getBool("DEBUG")&&function(e,t){for(let n=0;n{s=n()};let i;const a=ma();if(this.backendTimer.timerAvailable())i=this.backendTimer.time(r);else{r();for(const e of s)e.dataSync();i=Promise.resolve({kernelMs:ma()-a})}if(En().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t{Aa(t,n.dtype,e)}))}return{kernelName:e,outputs:s,inputs:t,timeMs:i.then((e=>e.kernelMs)),extraInfo:i.then((e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""))}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:s,inputs:r,extraInfo:i}=e;n.forEach((e=>{Promise.all([e.data(),s,i]).then((n=>{this.logger.logKernelProfile(t,e,n[0],n[1],r,n[2])}))}))}}function Aa(e,t,n){if("float32"!==t)return!1;for(let t=0;t0?s:""} `}}}}const Ca=20,ka=3,Sa=7;function Ea(e,t,n,s){const r=pn(t),i=function(e,t,n,s){const r=Kt(t),i=s[s.length-1],a=new Array(i).fill(0),o=t.length,l="complex64"===n?Na(e):e;if(o>1)for(let e=0;e" "+e)).join("\n")),l.join("\n")}function _a(e,t,n){let s;return s=Array.isArray(e)?`${parseFloat(e[0].toFixed(Sa))} + ${parseFloat(e[1].toFixed(Sa))}j`:ln(e)?`'${e}'`:"bool"===n?Ta(e):parseFloat(e.toFixed(Sa)).toString(),Qt(s,t)}function Ta(e){return 0===e?"false":"true"}function Ia(e,t,n,s,r,i=!0){const a="complex64"===n?2:1,o=t[0],l=t.length;if(0===l){if("complex64"===n){return[_a(Na(e)[0],0,n)]}return"bool"===n?[Ta(e[0])]:[e[0].toString()]}if(1===l){if(o>Ca){const t=ka*a;let s=Array.from(e.slice(0,t)),i=Array.from(e.slice((o-ka)*a,o*a));return"complex64"===n&&(s=Na(s),i=Na(i)),["["+s.map(((e,t)=>_a(e,r[t],n))).join(", ")+", ..., "+i.map(((e,t)=>_a(e,r[o-ka+t],n))).join(", ")+"]"]}return["["+("complex64"===n?Na(e):Array.from(e)).map(((e,t)=>_a(e,r[t],n))).join(", ")+"]"]}const c=t.slice(1),u=s.slice(1),h=s[0]*a,d=[];if(o>Ca){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||rn(t,this.size),this.strides=pn(e)}set(e,...t){0===t.length&&(t=[0]),jt(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;tya(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(),Da().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=Da().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>ya(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 Da().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),Da().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Ra.print(this,e)}clone(){return this.throwIfDisposed(),Ra.clone(this)}toString(e=!1){return Ea(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Ra.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),Da().makeVariable(this,e,t,n)}}function Ba(){return Nn("Tensor",(()=>Fa))}Object.defineProperty(Fa,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),Ba();class za extends Fa{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(!Xt(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);Da().disposeTensor(this),this.dataId=e.dataId,Da().incRef(this,null)}dispose(){Da().disposeVariable(this),this.isDisposedInternal=!0}}var La,Pa,Va,Wa,Ga,Ua,qa,ja,Ha,$a;Object.defineProperty(za,Symbol.hasInstance,{value:e=>e instanceof Fa&&null!=e.assign&&e.assign instanceof Function}),(Pa=La||(La={})).R0="R0",Pa.R1="R1",Pa.R2="R2",Pa.R3="R3",Pa.R4="R4",Pa.R5="R5",Pa.R6="R6",(Wa=Va||(Va={})).float32="float32",Wa.int32="int32",Wa.bool="int32",Wa.complex64="complex64",(Ua=Ga||(Ga={})).float32="float32",Ua.int32="int32",Ua.bool="bool",Ua.complex64="complex64",(ja=qa||(qa={})).float32="float32",ja.int32="float32",ja.bool="float32",ja.complex64="complex64",($a=Ha||(Ha={})).float32="complex64",$a.int32="complex64",$a.bool="complex64",$a.complex64="complex64";const Ka={float32:qa,int32:Va,bool:Ga,complex64:Ha};function Xa(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return Ka[e][t]}function Za(e){return Xa(e,"int32")}function Ya(e){return null!=e&&"object"==typeof e&&"texture"in e&&e.texture instanceof WebGLTexture}function Qa(e){return"undefined"!=typeof GPUBuffer&&null!=e&&"object"==typeof e&&"buffer"in e&&e.buffer instanceof GPUBuffer}function Ja(e,t){if(e.dtype===t.dtype)return[e,t];const n=Xa(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function eo(e,t){return t.some((t=>t.id===e.id))}function to(e){const t=[];return no(e,t,new Set),t}function no(e,t,n){if(null==e)return;if(e instanceof Fa)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),no(s,t,n))}}function so(e){return null!=e.kernelName}class ro{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 io{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new ro}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){Ki(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 Pt||"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 io.nextTensorId++}nextVariableId(){return io.nextVariableId++}clone(e){const t=oo.runKernel(Hs,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(e=>({x:()=>{const t={x:e},n={dtype:"float32"};return oo.runKernel(es,t,n)}})),[],{}),t}runKernel(e,t,n){null==this.backendName&&this.backend;if(!(null!=Hi(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 i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],a=s-t-r-i;if(a>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${a} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const s=this.isTapeOn(),r=this.state.numBytes,i=this.state.numTensors;let a,o;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const l=so(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(so(e)){const{kernelName:t,inputs:r,attrs:i}=e;null==this.backendName&&this.backend;const l=Hi(t,this.backendName);jt(null!=l,(()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`)),a=()=>{const e=this.backend.numDataIds();o=l.kernelFunc({inputs:r,attrs:i,backend:this.backend});const a=Array.isArray(o)?o:[o];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,a);const c=a.map((e=>null!=e.rank?e:this.makeTensorFromTensorInfo(e)));if(s){const e=this.getTensorsForGradient(t,r,c);n=this.saveTensorsForBackwardMode(e)}return c}}else{const{forwardFunc:t}=e,r=e=>{s&&(n=e.map((e=>this.keep(this.clone(e)))))};a=()=>{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:c,attrs:u}=e,h=so(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,c,(()=>a())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs):t=a()})),s&&this.addTapeNode(l,c,t,h,n,u),this.state.profiling&&this.state.activeProfile.kernels.push({name:l,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-i,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map((e=>null!=c[e]?c[e].shape:null)),outputShapes:t.map((e=>e.shape)),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(o)?t:t[0]}saveTensorsForBackwardMode(e){return e.map((e=>this.keep(this.clone(e))))}getTensorsForGradient(e,t,n){const s=$i(e);if(null!=s){const e=s.inputsToSave||[],r=s.outputsToSave||[];let i;s.saveAllInputs?(jt(Array.isArray(t),(()=>"saveAllInputs is true, expected inputs to be an array.")),i=Object.keys(t).map((e=>t[e]))):i=e.map((e=>t[e]));const a=n.filter(((e,t)=>r[t]));return i.concat(a)}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&&ln(e[0])&&(r=e.map((e=>ga(e))));const i=s.write(r,t,n),a=new Fa(t,n,i,this.nextTensorId());if(this.trackTensor(a,s),"string"===n){const e=this.state.tensorInfo.get(i),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 a}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,i=new Fa(s,r,n,this.nextTensorId());return this.trackTensor(i,t),i}makeVariable(e,t=!0,n,s){n=n||this.nextVariableId().toString(),null!=s&&s!==e.dtype&&(e=e.cast(s));const r=new za(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*on(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 za||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*on(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,i){const a={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},o=$i(e);null!=o&&(s=o.gradFunc),null!=s&&(a.gradient=e=>(e=e.map(((e,t)=>{if(null==e){const e=n[t],s=yn(e.size,e.dtype);return this.makeTensor(s,e.shape,e.dtype)}return e})),s(e.length>1?e:e[0],r,i))),this.state.activeTape.push(a)}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=to(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(jt(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)));jt(r instanceof Fa,(()=>"The result y returned by f() must be a tensor."));const i=function(e,t,n){const s={},r={};for(let e=0;es[e.id]=!0)),o=!0,r[i.id]=!0;break}if(o)break}}const i={};i[n.id]=!0;const a={};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=gn(Kt(e),"float32");return oo.makeTensor(t,e,"float32")}(r.shape):n,function(e,t,n,s){for(let r=t.length-1;r>=0;r--){const i=t[r],a=[];if(i.outputs.forEach((t=>{const n=e[t.id];null!=n?a.push(n):a.push(null)})),null==i.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${i.kernelName}.`);const o=i.gradient(a);for(const t in i.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 ${i.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${r.dtype}'`);const a=i.inputs[t];if(!Xt(r.shape,a.shape))throw new Error(`Error in gradient for op ${i.kernelName}. The gradient of input '${t}' has shape '${r.shape}', which does not match the shape of the input '${a.shape}'`);if(null==e[a.id])e[a.id]=r;else{const t=e[a.id];e[a.id]=s(t,r),t.dispose()}}}}(e,i,(e=>this.tidy(e)),lo);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 jt(hn(e),(()=>"The f passed in customGrad(f) must be a function.")),(...t)=>{let n;jt(t.every((e=>e instanceof Fa)),(()=>"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),jt(n.value instanceof Fa,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),jt(hn(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),i=Array.isArray(r)?r:[r];jt(i.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(...).")),jt(i.every((e=>e instanceof Fa)),(()=>"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 a={};return i.forEach(((e,t)=>{a[t]=()=>e})),a},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=ma(),n=await this.backend.time(e);return n.wallMs=ma()-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 ro;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 ao(){const e=In();if(null==e._tfengine){const t=new kn(e);e._tfengine=new io(t)}var t;return t=e._tfengine.ENV,Tn=t,Da=()=>e._tfengine,e._tfengine}io.nextTensorId=0,io.nextVariableId=0;const oo=ao();function lo(e,t){const n={a:e,b:t};return oo.runKernel(Mn,n)}let co;function uo(e){if(void 0!==co)return co;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 ho(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}const po=En();function fo(e,t){let n=e;if(ba(e))return"string"===t?[]:[e.length];if(Ya(e)){const t=e.channels||"RGBA";return[e.height,e.width*t.length]}if(Qa(e))return[e.buffer.size/(null==t?4:on(t))];if(!Array.isArray(e))return[];const s=[];for(;Array.isArray(n)||ba(n)&&"string"!==t;)s.push(n.length),n=n[0];return Array.isArray(e)&&En().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&mo(e,s,[]),s}function mo(e,t,n){if(n=n||[],!Array.isArray(e)&&!ba(e))return void jt(0===t.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`));jt(t.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`)),jt(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),go(s,r,t,n),null==e||!ba(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 i=fo(e,r);ba(e)||Array.isArray(e)||(e=[e]);const a="string"!==r?fa(e,r):wa(e,[],!0);return oo.makeTensor(a,i,r)}function bo(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)=>yo(e,`${t}[${r}]`,n,s)))}po.registerFlag("DEBUG",(()=>!1),(e=>{})),po.registerFlag("IS_BROWSER",(()=>ho())),po.registerFlag("IS_NODE",(()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node)),po.registerFlag("IS_CHROME",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))),po.registerFlag("IS_SAFARI",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor))),po.registerFlag("PROD",(()=>!1)),po.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(()=>po.getBool("DEBUG"))),po.registerFlag("DEPRECATION_WARNINGS_ENABLED",(()=>!0)),po.registerFlag("IS_TEST",(()=>!1)),po.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(()=>po.getBool("DEBUG"))),po.registerFlag("WRAP_TO_IMAGEBITMAP",(()=>!1)),po.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",(()=>!1)),po.registerFlag("USE_SETTIMEOUTCUSTOM",(()=>!1));const wo="__op";function vo(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+=wo;const r=(...e)=>{oo.startScope(n);try{const t=s(...e);return xn(t),oo.endScope(t),t}catch(e){throw oo.endScope(null),e}};return Object.defineProperty(r,"name",{value:n,configurable:!0}),r}const Ao=vo({complex_:function(e,t){const n=yo(e,"real","complex"),s=yo(t,"imag","complex");Ht(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 oo.runKernel(ss,r)}});function xo(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(Qa(e)||Ya(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 oo.backend.createTensorFromGPUData(e,t||n,s)}if(!ba(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){wn(t);const e=Kt(t),s=Kt(n);jt(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 ba(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==s?fa(e,s):wa(e,[],!0),oo.makeTensor(e,t,s)}function Co(e,t,n){return xo(e,t,fo(e,n),n)}const ko={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};class So{static join(e){return new So(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,null==e)return;if(e instanceof Array||(e=[e]),0===(e=e.map((e=>ba(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,i=t(e[r]);if(0===i)return r;i<0?s=r:n=r+1}return-1}(this.shards,t);return-1===n?-1:(this.previousShardIndex=n,this.previousShardIndex)}}function Eo(){return oo}function _o(){return oo.memory()}function To(e,t){return oo.tidy(e,t)}function Io(e){to(e).forEach((e=>e.dispose()))}function No(e){return oo.keep(e)}function Oo(e,t,n=1){return oo.registerBackend(e,t,n)}function Do(){return oo.backend}Ma=function(e){En().getBool("DEPRECATION_WARNINGS_ENABLED")};const Ro=4;async function Mo(e,t){const n=[],s=[],r=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);for(let i=0;i{const t=await o.bytes(),n=t.reduce(((e,t)=>e+t.length),0)+Ro*t.length,s=new Uint8Array(n);let r=0;for(let e=0;en.slice(r+e,r+t)));s[e.name]=Lo(e,n.slice(r,r+t)),r+=t}return s}function Bo(e,t){const n=Kt(e.shape);let s;if("quantization"in e){const t=e.quantization;s=ko[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),i=new Uint32Array(r);for(let r=0;r>10]+(1023&a)]+t[a>>10];i[r]=o}return new Float32Array(r)}}();a=e(c)}}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.`);a=new Int32Array(c.length);for(let e=0;e(r=await Po(s,r,t),r.slice(e,t))));r=await Po(s,r,t);const i=r.slice(0,t);r=r.slice(t);const a=Lo(e,i);if(n[e.name]=a,"webgpu"===oo.backendName){const e=Do();"uploadToGPU"in e&&Kt(a.shape)>=En().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&e.uploadToGPU(a.dataId)}}return n}function Wo(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 Go="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function Uo(e){return Go?Buffer.byteLength(e,"utf8"):new Blob([e]).size}function qo(e){return So.join(e)}function jo(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function Ho(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 $o(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 Ko(e,t){let n,s;return null!=e.weightsManifest&&([n,s]=await t(e.weightsManifest)),$o(e,n,s)}function Xo(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:Uo(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:Uo(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:new So(e.weightData).byteLength}}function Zo(e){const t=[];for(const n of e)t.push(...n.weights);return t}class Yo{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==Yo.instance&&(Yo.instance=new Yo),Yo.instance}static registerSaveRouter(e){Yo.getInstance().saveRouters.push(e)}static registerLoadRouter(e){Yo.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return Yo.getHandlers(e,"save")}static getLoadHandlers(e,t){return Yo.getHandlers(e,"load",t)}static getHandlers(e,t,n){const s=[];return("load"===t?Yo.getInstance().loadRouters:Yo.getInstance().saveRouters).forEach((t=>{const r=t(e,n);null!==r&&s.push(r)})),s}}const Qo=e=>Yo.registerSaveRouter(e),Jo=e=>Yo.registerLoadRouter(e),el=e=>Yo.getSaveHandlers(e),tl=(e,t)=>Yo.getLoadHandlers(e,t),nl="tensorflowjs",sl="models_store",rl="model_info_store";function il(){if(!En().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 al(e){const t=e.result;t.createObjectStore(sl,{keyPath:"modelPath"}),t.createObjectStore(rl,{keyPath:"modelPath"})}class ol{constructor(e){if(this.indexedDB=il(),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(nl,1);s.onupgradeneeded=()=>al(s),s.onsuccess=()=>{const r=s.result;if(null==t){const t=r.transaction(sl,"readonly"),s=t.objectStore(sl).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=So.join(t.weightData);const s=Xo(t),i=r.transaction(rl,"readwrite");let a,o,l=i.objectStore(rl);try{a=l.put({modelPath:this.modelPath,modelArtifactsInfo:s})}catch(e){return n(e)}a.onsuccess=()=>{o=r.transaction(sl,"readwrite");const a=o.objectStore(sl);let c;try{c=a.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:s})}catch(e){return n(e)}c.onsuccess=()=>e({modelArtifactsInfo:s}),c.onerror=e=>{l=i.objectStore(rl);const t=l.delete(this.modelPath);t.onsuccess=()=>(r.close(),n(c.error)),t.onerror=e=>(r.close(),n(c.error))}},a.onerror=e=>(r.close(),n(a.error)),i.oncomplete=()=>{null==o?r.close():o.oncomplete=()=>r.close()}}},s.onerror=e=>n(s.error)}))}}ol.URL_SCHEME="indexeddb://";const ll=e=>{return En().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(ol.URL_SCHEME)?(t=e.slice(ol.URL_SCHEME.length),new ol(t)):null;var t};Yo.registerSaveRouter(ll),Yo.registerLoadRouter(ll);class cl{constructor(){this.indexedDB=il()}async listModels(){return new Promise(((e,t)=>{const n=this.indexedDB.open(nl,1);n.onupgradeneeded=()=>al(n),n.onsuccess=()=>{const s=n.result,r=s.transaction(rl,"readonly"),i=r.objectStore(rl).getAll();i.onsuccess=()=>{const t={};for(const e of i.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},i.onerror=e=>(s.close(),t(i.error)),r.oncomplete=()=>s.close()},n.onerror=e=>t(n.error)}))}async removeModel(e){var t;return e=(t=e).startsWith(ol.URL_SCHEME)?t.slice(ol.URL_SCHEME.length):t,new Promise(((t,n)=>{const s=this.indexedDB.open(nl,1);s.onupgradeneeded=()=>al(s),s.onsuccess=()=>{const r=s.result,i=r.transaction(rl,"readwrite"),a=i.objectStore(rl),o=a.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=a.delete(e),i=()=>{l=r.transaction(sl,"readwrite");const s=l.objectStore(sl).delete(e);s.onsuccess=()=>t(o.result.modelArtifactsInfo),s.onerror=e=>n(o.error)};s.onsuccess=i,s.onerror=e=>(i(),r.close(),n(o.error))}},o.onerror=e=>(r.close(),n(o.error)),i.oncomplete=()=>{null==l?r.close():l.oncomplete=()=>r.close()}},s.onerror=e=>n(s.error)}))}}const ul="/",hl="tensorflowjs_models",dl="info",pl="model_topology",fl="weight_specs",ml="weight_data",gl="model_metadata";function yl(e){return{info:[hl,e,dl].join(ul),topology:[hl,e,pl].join(ul),weightSpecs:[hl,e,fl].join(ul),weightData:[hl,e,ml].join(ul),modelMetadata:[hl,e,gl].join(ul)}}function bl(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function wl(e){const t=e.split(ul);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(ul)}class vl{constructor(e){if(!En().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=yl(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=Xo(e),r=So.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(Go)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let n="";for(let e=0,s=t.length;e{return En().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(vl.URL_SCHEME)?(t=e.slice(vl.URL_SCHEME.length),new vl(t)):null;var t};Yo.registerSaveRouter(Al),Yo.registerLoadRouter(Al);class xl{constructor(){jt(En().getBool("IS_BROWSER"),(()=>"Current environment is not a web browser")),jt("undefined"==typeof window||void 0!==window.localStorage,(()=>"Current browser does not appear to support localStorage")),this.LS=window.localStorage}async listModels(){const e={},t=hl+ul,n=ul+dl;for(let s=0;s"scheme must not be undefined or null.")),e.endsWith(Cl)&&(e=e.slice(0,e.indexOf(Cl))),jt(e.length>0,(()=>"scheme must not be an empty string."));const n=kl.getInstance();jt(null==n.managers[e],(()=>`A model store manager is already registered for scheme '${e}'.`)),n.managers[e]=t}static getManager(e){const t=kl.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(kl.getInstance().managers)}}function Sl(e){if(-1===e.indexOf(Cl))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${kl.getSchemes().join(",")}`);return{scheme:e.split(Cl)[0],path:e.split(Cl)[1]}}async function El(e,t,n=!1){jt(e!==t,(()=>`Old path and new path are the same: '${e}'`));const s=Yo.getLoadHandlers(e);jt(s.length>0,(()=>`Copying failed because no load handler is found for source URL ${e}.`)),jt(s.length<2,(()=>`Copying failed because more than one (${s.length}) load handlers for source URL ${e}.`));const r=s[0],i=Yo.getSaveHandlers(t);jt(i.length>0,(()=>`Copying failed because no save handler is found for destination URL ${t}.`)),jt(i.length<2,(()=>`Copying failed because more than one (${s.length}) save handlers for destination URL ${t}.`));const a=i[0],o=Sl(e).scheme,l=Sl(e).path,c=o===Sl(e).scheme,u=await r.load();n&&c&&await kl.getManager(o).removeModel(l);const h=await a.save(u);return n&&!c&&await kl.getManager(o).removeModel(l),h.modelArtifactsInfo}async function _l(){const e=kl.getSchemes(),t={};for(const n of e){const e=await kl.getManager(n).listModels();for(const s in e){t[n+Cl+s]=e[s]}}return t}async function Tl(e){const t=Sl(e);return kl.getManager(t.scheme).removeModel(t.path)}async function Il(e,t){return El(e,t,!1)}async function Nl(e,t){return El(e,t,!0)}class Ol{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&&En().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 Qi(e)}}if(En().get("IS_BROWSER")){En().setPlatform("browser",new Ol);try{kl.registerManager(vl.URL_SCHEME,new xl)}catch(e){}try{kl.registerManager(ol.URL_SCHEME,new cl)}catch(e){}}const Dl=()=>__webpack_require__(8273);let Rl;class Ml{constructor(){this.util=__webpack_require__(9830),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=En().global.fetch?En().global.fetch(e,t):(null==Rl&&(Rl=Dl()),Rl(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 Fl(e,t="float32",n){return t=t||"float32",wn(e),new Oa(e,t,n)}En().get("IS_NODE")&&!En().get("IS_BROWSER")&&En().setPlatform("node",new Ml);const Bl=vo({cast_:function(e,t){const n=yo(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 oo.runKernel(es,s,r)}});const zl=vo({clone_:function(e){const t={x:yo(e,"x","clone","string_or_numeric")};return oo.runKernel(Hs,t)}});function Ll(e,t=!1){}ao();Ra={buffer:Fl,cast:Bl,clone:zl,print:Ll};const Pl=vo({add_:function(e,t){let n=yo(e,"a","add"),s=yo(t,"b","add");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(Mn,r)}});const Vl=vo({floorDiv_:function(e,t){let n=yo(e,"a","floorDiv"),s=yo(t,"b","floorDiv");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(Vs,r)}});const Wl=vo({div_:function(e,t){let n=yo(e,"a","div"),s=yo(t,"b","div");if([n,s]=Ja(n,s),"int32"===n.dtype&&"int32"===s.dtype)return Vl(n,s);const r={a:n,b:s};return oo.runKernel(_s,r,{})}});const Gl=vo({mul_:function(e,t){let n=yo(e,"a","mul"),s=yo(t,"b","mul");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(xr,r)}});const Ul=vo({sqrt_:function(e){const t={x:yo(e,"x","sqrt","float32")};return oo.runKernel(li,t)}});const ql=vo({square_:function(e){const t=yo(e,"x","square");return oo.runKernel("Square",{x:t},{})}});const jl=vo({zerosLike_:function(e){const t={x:yo(e,"x","zerosLike")};return oo.runKernel(Fi,t)}});function Hl(e){return oo.customGrad(e)}function $l(e,t){if((ba(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&&ba(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return xo(e,[],[],t)}const Kl=new Map,Xl=new Map;class Zl{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class Yl{constructor(){this.classNameMap={}}static getMap(){return null==Yl.instance&&(Yl.instance=new Yl),Yl.instance}static register(e){Yl.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Ql(e,t,n){jt(null!=e.className,(()=>"Class being registered does not have the static className property defined.")),jt("string"==typeof e.className,(()=>"className is required to be a string, but got type "+typeof e.className)),jt(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 Yl.register(e),Kl.set(s,e),Xl.set(e,s),e}class Jl extends Zl{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 Io(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){jt(hn(e),(()=>"The f passed in variableGrads(f) must be a function")),jt(null==t||Array.isArray(t)&&t.every((e=>e instanceof za)),(()=>"The varList passed in variableGrads(f, varList) must be an array of variables"));const n=null!=t;if(!n){t=[];for(const e in oo.registeredVariables)t.push(oo.registeredVariables[e])}const s=n?t.filter((e=>!e.trainable)):null,r=t.length;jt((t=t.filter((e=>e.trainable))).length>0,(()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${r} variables is trainable.`));const{value:i,grads:a}=oo.gradients(e,t,null,!0);jt(a.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().")),jt(0===i.rank,(()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`));const o={};return t.forEach(((e,t)=>{null!=a[t]&&(o[e.name]=a[t])})),null!=s&&s.forEach((e=>o[e.name]=null)),{value:i,grads:o}}(e,t)}dispose(){null!=this.iterations_&&Io(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:$l(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(Jl,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});class ec extends Jl{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=oo.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=oo.registeredVariables[t],r=!1;null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:To((()=>jl(s).variable(r)))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:To((()=>jl(s).variable(r)))});const i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const a=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;To((()=>{const e=Pl(Gl(a,this.rho),Gl(ql(i),1-this.rho)),t=Gl(Wl(Ul(Pl(o,this.epsilon)),Ul(Pl(a,this.epsilon))),i),n=Pl(Gl(o,this.rho),Gl(ql(t),1-this.rho));a.assign(e),o.assign(n);const r=Pl(Gl(t,-this.learningRate),s);s.assign(r)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&(Io(this.accumulatedGrads.map((e=>e.variable))),Io(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 tc(e,t,n){wn(e);const s={shape:e,value:t,dtype:n=n||un(t)};return oo.runKernel(zs,{},s)}class nc extends Jl{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=oo.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:To((()=>tc(s.shape,this.initialAccumulatorValue).variable(e)))}}const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const i=this.accumulatedGrads[n].variable;To((()=>{const e=Pl(i,ql(r));i.assign(e);const t=Pl(Gl(Wl(r,Ul(Pl(e,oo.backend.epsilon()))),-this.learningRate),s);s.assign(t)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&Io(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 sc=vo({pow_:function(e,t){let n=yo(e,"base","pow"),s=yo(t,"exp","pow");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(Dr,r)}});const rc=vo({sub_:function(e,t){let n=yo(e,"a","sub"),s=yo(t,"b","sub");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(Si,r)}});class ic extends Jl{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=[],To((()=>{this.accBeta1=$l(t).variable(),this.accBeta2=$l(n).variable()})),null==s&&(this.epsilon=oo.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);To((()=>{const n=rc(1,this.accBeta1),s=rc(1,this.accBeta2);t.forEach(((t,r)=>{const i=oo.registeredVariables[t],a=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:To((()=>jl(i).variable(a)))}),null==this.accumulatedSecondMoment[r]&&(this.accumulatedSecondMoment[r]={originalName:`${t}/v`,variable:To((()=>jl(i).variable(a)))});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,c=this.accumulatedSecondMoment[r].variable,u=Pl(Gl(l,this.beta1),Gl(o,1-this.beta1)),h=Pl(Gl(c,this.beta2),Gl(ql(o),1-this.beta2)),d=Wl(u,n),p=Wl(h,s);l.assign(u),c.assign(h);const f=Pl(Gl(Wl(d,Pl(Ul(p),this.epsilon)),-this.learningRate),i);i.assign(f)})),this.accBeta1.assign(Gl(this.accBeta1,this.beta1)),this.accBeta2.assign(Gl(this.accBeta2,this.beta2))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&Io(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedSecondMoment&&Io(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),To((()=>{this.accBeta1.assign(sc(this.beta1,this.iterations_+1)),this.accBeta2.assign(sc(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 ac=vo({abs_:function(e){const t=yo(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return oo.runKernel(rs,e)}{const e={x:t};return oo.runKernel(On,e)}}});function oc(e,t){const n=e.length,s=[];for(let r=0;r1&&1===a&&s.unshift(i)}return s}function lc(e,t){const n=[];for(let s=0;s1)&&n.unshift(i)}return n}function cc(e,t){const n=Math.max(e.length,t.length),s=new Array(n);for(let r=0;r{this.iteration=$l(0).variable(),this.accBeta1=$l(t).variable()})),null==s&&(this.epsilon=oo.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);To((()=>{const n=rc(1,this.accBeta1),s=Wl(-this.learningRate,Pl(Gl(this.iteration,this.decay),1));t.forEach(((t,r)=>{const i=oo.registeredVariables[t],a=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:jl(i).variable(a)}),null==this.accumulatedWeightedInfNorm[r]&&(this.accumulatedWeightedInfNorm[r]={originalName:`${t}/v`,variable:jl(i).variable(a)});const o=Array.isArray(e)?e[r].tensor:e[t];if(null==o)return;const l=this.accumulatedFirstMoment[r].variable,c=this.accumulatedWeightedInfNorm[r].variable,u=Pl(Gl(l,this.beta1),Gl(o,1-this.beta1)),h=Gl(c,this.beta2),d=ac(o),p=uc(h,d);l.assign(u),c.assign(p);const f=Pl(Gl(Wl(s,n),Wl(u,Pl(p,this.epsilon))),i);i.assign(f)})),this.iteration.assign(Pl(this.iteration,1)),this.accBeta1.assign(Gl(this.accBeta1,this.beta1))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&Io(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedWeightedInfNorm&&Io(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 dc extends Jl{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=oo.registeredVariables[t];To((()=>{const e=Pl(Gl(this.c,s),r);r.assign(e)}))})),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=No($l(-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 pc extends dc{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=$l(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const s=oo.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:To((()=>jl(s).variable(e)))}}const r=this.accumulations[n].variable,i=Array.isArray(e)?e[n].tensor:e[t];null!=i&&To((()=>{let e;const t=Pl(Gl(this.m,r),i);e=this.useNesterov?Pl(Gl(this.c,Pl(i,Gl(t,this.m))),s):Pl(Gl(this.c,t),s),r.assign(t),s.assign(e)}))})),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&Io(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 fc extends Jl{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=oo.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=oo.registeredVariables[t],r=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:To((()=>jl(s).variable(r)))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:To((()=>jl(s).variable(r)))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:To((()=>jl(s).variable(r)))});const i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const a=this.accumulatedMeanSquares[n].variable,o=this.accumulatedMoments[n].variable;To((()=>{const e=Pl(Gl(a,this.decay),Gl(ql(i),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,r=Pl(Gl(t,this.decay),Gl(i,1-this.decay)),l=Wl(Gl(i,this.learningRate),Ul(rc(e,Pl(ql(r),this.epsilon)))),c=Pl(Gl(o,this.momentum),l);a.assign(e),t.assign(r),o.assign(c);const u=rc(s,c);s.assign(u)}else{const e=Pl(Gl(a,this.decay),Gl(ql(i),1-this.decay)),t=Pl(Gl(o,this.momentum),Wl(Gl(i,this.learningRate),Ul(Pl(e,this.epsilon))));a.assign(e),o.assign(t);const n=rc(s,t);s.assign(n)}}))})),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&Io(this.accumulatedMeanSquares.map((e=>e.variable))),null!=this.accumulatedMeanGrads&&this.centered&&Io(this.accumulatedMeanGrads.map((e=>e.variable))),null!=this.accumulatedMoments&&Io(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 mc=[ec,nc,ic,hc,pc,fc,dc];function gc(e){return new Promise((e=>setTimeout(e))).then(e)}class yc{constructor(e){if(!En().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(yc.URL_SCHEME)&&(e=e.slice(yc.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=So.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=Ho(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 gc((()=>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 gc((()=>e.dispatchEvent(new MouseEvent("click"))))}return{modelArtifactsInfo:Xo(e)}}}}yc.URL_SCHEME="downloads://";class bc{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 i=Ko(s,(e=>this.loadWeights(e)));e(i)},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=>jo(e.name))),s={};for(const r of e)r.paths.forEach((e=>{const r=jo(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 wc(e){return new bc(e)}function vc(e,t,n,s){!function(e){jt(null!=e&&Array.isArray(e)&&e.length>0,(()=>"promises must be a none empty array"))}(e),function(e,t){jt(e>=0&&e<=1,(()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`)),jt(t>=0&&t<=1,(()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`)),jt(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((i=>(i.then((i=>{const a=n+ ++r/e.length*(s-n);return t(a),i})),i))))}async function Ac(e,t){null==t&&(t={});const n=null==t.fetchFunc?En().platform.fetch:t.fetchFunc,s=e.map((e=>n(e,t.requestInit,{isBinary:!0}))),r=(null==t.onProgress?await Promise.all(s):await vc(s,t.onProgress,0,.5)).map((e=>e.arrayBuffer()));return null==t.onProgress?await Promise.all(r):await vc(r,t.onProgress,.5,1)}async function xc(e,t="",n,s){return Cc((e=>Ac(e,{requestInit:s})))(e,t,n)}function Cc(e){return async(t,n="",s)=>{const r=t.map((()=>!1)),i={},a=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,c=ko[l]*Kt(e.shape),u=()=>{r[t]=!0,null==i[t]&&(i[t]=[]),i[t].push({manifestEntry:e,groupOffset:n,sizeBytes:c})};null!=s?s.forEach(((t,n)=>{t===e.name&&(u(),a[n]=!0)})):u(),o.push(e.name),n+=c}))})),!a.every((e=>e))){const e=s.filter(((e,t)=>!a[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)),[]),c=[];l.forEach((e=>{t[e].paths.forEach((e=>{const t=n+(n.endsWith("/")?"":"/")+e;c.push(t)}))}));const u=await e(c),h={};let d=0;return l.forEach((e=>{const n=t[e].paths.length,s=new So(u.slice(d,d+n));i[e].forEach((e=>{const t=Fo(s.slice(e.groupOffset,e.groupOffset+e.sizeBytes),[e.manifestEntry]);for(const e in t)h[e]=t[e]})),d+=n})),h}}Yo.registerSaveRouter((e=>En().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(yc.URL_SCHEME)?function(e="model"){return new yc(e)}(e.slice(yc.URL_SCHEME.length)):null));class kc{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?(jt("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=En().platform.fetch,jt(null!=e&&e.length>0,(()=>"URL path for http must not be null, undefined or empty.")),Array.isArray(e)&&jt(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=Ho(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=So.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:Xo(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 Ko(await this.loadModelJSON(),(e=>this.loadWeights(e)))}async loadStream(){const e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),n=Zo(e.weightsManifest);return Object.assign(Object.assign({},e),{weightSpecs:n,getWeightStream:()=>function(e,t){var n;const s=null==t.fetchFunc?En().platform.fetch:t.fetchFunc;let r,i=0;return null===(n=t.onProgress)||void 0===n||n.call(t,0),new ReadableStream({pull:async n=>{for(var a;it?e.substring(n):"";return[s+"/",r]}(t),r=this.weightPathPrefix||n,i=[],a=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?a.push(this.weightUrlConverter(e)):i.push(r+e+s);return this.weightUrlConverter&&i.push(...await Promise.all(a)),i}async loadWeights(e){const t=await this.getWeightUrls(e);return[Zo(e),await Ac(t,this.loadOptions)]}}function Sc(e){return null!=e.match(kc.URL_SCHEME_REGEX)}kc.URL_SCHEME_REGEX=/^https?:\/\//;const Ec=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every((e=>Sc(e))):Sc(e),n)return _c(e,t)}return null};function _c(e,t){return new kc(e,t)}function Tc(e,t){return _c(e,t)}Yo.registerSaveRouter(Ec),Yo.registerLoadRouter(Ec);class Ic{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class Nc{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class Oc{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function Dc(e,t,n,s){return new Oc(Rc(...arguments))}function Rc(e,t,n,s){if(1===arguments.length){const t=null!=e.modelTopology||null!=e.weightSpecs;return new Ic(t?e:{modelTopology:e})}return new Ic({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:s})}function Mc(e){return new Nc(e)}function Fc(e){return new Nc(e)}function Bc(e,t,n){if($t(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const s=fo(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 xo(e,t,s,n)}let zc,Lc=!1;function Pc(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,i=!1,a=!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)i=!0;else if(null!=e.getContext)a=!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!=Hi(zi,oo.backendName)){const n={pixels:e},s={numChannels:t};return oo.runKernel(zi,n,s)}const[l,c]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height];let u,h;if(a)u=e.getContext("2d").getImageData(0,0,l,c).data;else if(s||n)u=e.data;else if(i||r||o){if(null==zc)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.");zc=new OffscreenCanvas(1,1).getContext("2d")}else zc=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});zc.canvas.width=l,zc.canvas.height=c,zc.drawImage(e,0,0,l,c),u=zc.getImageData(0,0,l,c).data}if(4===t)h=new Int32Array(u);else{const e=l*c;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 Wc(e,t){let n=yo(e,"img","toPixels");if(!(e instanceof Fa)){const e=n;n=Bl(e,"int32"),e.dispose()}Vc(n);const[s,r]=n.shape.slice(0,2),i=2===n.rank?1:n.shape[2],a=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===i?(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(!Lc){null!=Hi(Es,oo.backendName)&&(Lc=!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 Gc=vo({fromPixels_:Pc}),Uc=-2,qc=-1;function jc(e,t,n){const s=e.shape.length;jt(s===t.length,(()=>`Error in slice${s}D: Length of begin ${t} must match the rank of the array (${s}).`)),jt(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 Hc(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function $c(e,t,n){const s=[];for(let r=0;r0){const l=t[0],c=n+1;u=Qc(a,l,c,s,e),h=Jc(o,l,c,r,e),d=Kc(i,l,c,e)}else for(let t=0;t-1)i[r]=0;else{const a=Xc(t,n,r);let o=s[a];e&1<-1)i[r]=Number.MAX_SAFE_INTEGER;else{const a=Xc(t,n,r);let o=s[a];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const l=s[r];return a<0&&(a+=l),a=Gt(0,a,l-1),a}function nu(e,t,n,s,r,i){let a=t[r];const o=n[r]||1;(e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const l=s[r];return a<0&&(a+=l),a=o>0?Gt(0,a,l):Gt(-1,a,l-1),a}function su(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 ru(e,t){let n=e.length>0?e[e.length-1]:1;for(let s=0;s{jt(-1!==e,(()=>"slice() does not support negative begin indexing."))})),i=null==n?new Array(r).fill(-1):"number"==typeof n?[n,...new Array(r-1).fill(-1)]:n.lengtht>=0?t:(jt(-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,i]}function au(e,t,n,s,r,i,a,o,l){let c;if(null==s?(c=new Array(t.length),c.fill(1)):c=s,null!=a&&a&a-1)throw new Error("Multiple ellipses in slice is not allowed.");let u=!1;const h={dims:c.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:n.slice(),strides:c.slice(),beginMask:r,endMask:i,ellipsisMask:a,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 a=!!(d.beginMask&1<=s)throw Error(`slice index ${d.begin[t]} of dimension ${t} out of bounds.`)}else d.begin[t]=ou(d.begin[t],0,d.strides[t],s,r,i),d.end[t]=ou(d.end[t],1,d.strides[t],s,r,i);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]&&a,f=f&&(0===t&&1===d.strides[t]||a);let o,l=!1;if(d.beginValid&&d.endValid?(o=d.end[t]-d.begin[t],l=!0):n?(o=1,l=!0):a&&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===Uc&&y.push(1)}return{finalShapeSparse:y.filter(((e,t)=>d.finalShapeGatherIndices[t]!==Uc)),finalShape:y,isIdentity:p,sliceDim0:f,isSimpleSlice:m,begin:d.begin,end:d.end,strides:d.strides}}function ou(e,t,n,s,r,i){if(r[t])return n>0?i[t]:i[t+1&1];{const t=e<0?s+e:e;return ti[1]?i[1]:t}}const lu=vo({acos_:function(e){const t={x:yo(e,"x","acos")};return oo.runKernel(Dn,t)}});const cu=vo({acosh_:function(e){const t={x:yo(e,"x","acosh")};return oo.runKernel(Rn,t)}});const uu=vo({addN_:function(e){jt(Array.isArray(e),(()=>"The argument passed to tf.addN() must be a list of tensors")),jt(e.length>=1,(()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`));const t=e.map(((e,t)=>yo(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(!Xt(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));const s=t;return oo.runKernel(Fn,s)}});const hu=vo({all_:function(e,t=null,n=!1){const s={x:yo(e,"x","all","bool")},r={axis:t,keepDims:n};return oo.runKernel(Bn,s,r)}});const du=vo({any_:function(e,t=null,n=!1){const s={x:yo(e,"x","any","bool")},r={axis:t,keepDims:n};return oo.runKernel(zn,s,r)}});const pu=vo({argMax_:function(e,t=0){const n={x:yo(e,"x","argMax")},s={axis:t};return oo.runKernel(Ln,n,s)}});const fu=vo({argMin_:function(e,t=0){const n={x:yo(e,"x","argMin")},s={axis:t};return oo.runKernel(Pn,n,s)}});const mu=vo({asin_:function(e){const t={x:yo(e,"x","asin")};return oo.runKernel(Vn,t)}});const gu=vo({asinh_:function(e){const t={x:yo(e,"x","asinh")};return oo.runKernel(Wn,t)}});const yu=vo({atan_:function(e){const t={x:yo(e,"x","atan")};return oo.runKernel(Gn,t)}});const bu=vo({atan2_:function(e,t){let n=yo(e,"a","atan2"),s=yo(t,"b","atan2");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(qn,r)}});const wu=vo({atanh_:function(e){const t={x:yo(e,"x","atanh")};return oo.runKernel(Un,t)}});function vu(e,t,n,s,r="NHWC",i){return Cu(e,[...t,e[3]],n,i,s,null,null,Ru(r))}function Au(e,t,n,s,r,i,a="channelsLast"){const[o,l]=Eu(t);let c;if("channelsLast"===a)c=[o,l,e[3],e[3]];else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);c=[o,l,e[1],e[1]]}return Cu(e,c,n,s,r,i,!1,a)}function xu(e,t,n,s,r,i,a="NDHWC"){const[o,l,c]=_u(t);let u,h;if("NDHWC"===a)h="channelsLast",u=[o,l,c,e[4],e[4]];else{if("NCDHW"!==a)throw new Error(`Unknown dataFormat ${a}`);h="channelsFirst",u=[o,l,c,e[1],e[1]]}return ku(e,u,n,s,r,!1,h,i)}function Cu(e,t,n,s,r,i,a=!1,o="channelsLast"){let[l,c,u,h]=[-1,-1,-1,-1];if("channelsLast"===o)[l,c,u,h]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,h,c,u]=e}const[d,p,,f]=t,[m,g]=Eu(n),[y,b]=Eu(s),w=Tu(d,y),v=Tu(p,b),{padInfo:A,outHeight:x,outWidth:C}=function(e,t,n,s,r,i,a,o,l){let c,u,h;if("number"==typeof e){c={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const r=function(e,t,n,s,r){null==s&&(s=Su(e,t,n));const i=e[0],a=e[1],o=Iu((i-t+2*s)/n+1,r),l=Iu((a-t+2*s)/n+1,r);return[o,l]}([t,n],i,s,e,o);u=r[0],h=r[1]}else if("same"===e){u=Math.ceil(t/s),h=Math.ceil(n/r);const e=Math.max(0,(u-1)*s+i-t),o=Math.max(0,(h-1)*r+a-n),l=Math.floor(e/2),d=e-l,p=Math.floor(o/2);c={top:l,bottom:d,left:p,right:o-p,type:"SAME"}}else if("valid"===e)c={top:0,bottom:0,left:0,right:0,type:"VALID"},u=Math.ceil((t-i+1)/s),h=Math.ceil((n-a+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];c={top:d,bottom:p,left:f,right:m,type:0===d&&0===p&&0===f&&0===m?"VALID":"EXPLICIT"},u=Iu((t-i+d+p)/s+1,o),h=Iu((n-a+f+m)/r+1,o)}}return{padInfo:c,outHeight:u,outWidth:h}}(r,c,u,m,g,w,v,i,o),k=a?f*h:f;let S;return"channelsFirst"===o?S=[l,k,x,C]:"channelsLast"===o&&(S=[l,x,C,k]),{batchSize:l,dataFormat:o,inHeight:c,inWidth:u,inChannels:h,outHeight:x,outWidth:C,outChannels:k,padInfo:A,strideHeight:m,strideWidth:g,filterHeight:d,filterWidth:p,effectiveFilterHeight:w,effectiveFilterWidth:v,dilationHeight:y,dilationWidth:b,inShape:e,outShape:S,filterShape:t}}function ku(e,t,n,s,r,i=!1,a="channelsLast",o){let[l,c,u,h,d]=[-1,-1,-1,-1,-1];if("channelsLast"===a)[l,c,u,h,d]=e;else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);[l,d,c,u,h]=e}const[p,f,m,,g]=t,[y,b,w]=_u(n),[v,A,x]=_u(s),C=Tu(p,v),k=Tu(f,A),S=Tu(m,x),{padInfo:E,outDepth:_,outHeight:T,outWidth:I}=function(e,t,n,s,r,i,a,o,l,c,u){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,i){null==r&&(r=Su(e,t[0],s[0]));const a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*r>=t[n]&&(a[n]=Iu((e[n]-t[n]+2*r)/s[n]+1,i));return a}([t,n,s,1],[o,l,c],1,[r,i,a],e,u);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/i),f=Math.ceil(s/a);const e=(d-1)*r+o-t,u=(p-1)*i+l-n,m=(f-1)*a+c-s,g=Math.floor(e/2),y=e-g,b=Math.floor(u/2),w=u-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,c,u,h,y,b,w,C,k,S,o),N=i?g*d:g;let O;return"channelsFirst"===a?O=[l,N,_,T,I]:"channelsLast"===a&&(O=[l,_,T,I,N]),{batchSize:l,dataFormat:a,inDepth:c,inHeight:u,inWidth:h,inChannels:d,outDepth:_,outHeight:T,outWidth:I,outChannels:N,padInfo:E,strideDepth:y,strideHeight:b,strideWidth:w,filterDepth:p,filterHeight:f,filterWidth:m,effectiveFilterDepth:C,effectiveFilterHeight:k,effectiveFilterWidth:S,dilationDepth:v,dilationHeight:A,dilationWidth:x,inShape:e,outShape:O,filterShape:t}}function Su(e,t,n,s=1){const r=Tu(t,s);return Math.floor((e[0]*(n-1)-n+r)/2)}function Eu(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function _u(e){return"number"==typeof e?[e,e,e]:e}function Tu(e,t){return t<=1?e:e+(e-1)*(t-1)}function Iu(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 Nu(e){const[t,n,s]=Eu(e);return 1===t&&1===n&&1===s}function Ou(e,t){return Nu(e)||Nu(t)}function Du(e){return Eu(e).every((e=>e>0))}function Ru(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function Mu(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)jt(Zt(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=>{jt(Zt(t),(()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`))}))}))}}}const Fu=vo({reshape_:function(e,t){const n={x:yo(e,"x","reshape","string_or_numeric")},s={shape:t};return oo.runKernel(Gr,n,s)}});const Bu=vo({avgPool_:function(e,t,n,s,r){const i=yo(e,"x","avgPool","float32");jt(Ou(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let a=i,o=!1;3===i.rank&&(o=!0,a=Fu(i,[1,i.shape[0],i.shape[1],i.shape[2]])),jt(4===a.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${a.rank}.`)),Mu("avgPool",s,r);const l={x:a},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r};let u=oo.runKernel(jn,l,c);return u=Bl(u,i.dtype),o?Fu(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const zu=vo({avgPool3d_:function(e,t,n,s,r,i="NDHWC"){const a=yo(e,"x","avgPool3d","float32");let o=a,l=!1;4===a.rank&&(l=!0,o=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),jt(5===o.rank,(()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`)),jt("NDHWC"===i,(()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`)),jt("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}'`)),Mu("avgPool3d",s,r);const c={x:o},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:i};let h=oo.runKernel($n,c,u);return h=Bl(h,o.dtype),l?Fu(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const Lu=vo({concat_:function(e,t=0){jt(e.length>=1,(()=>"Pass at least one tensor to concat"));const n=bo(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 zl(n[0]);const s=n,r={axis:t};return oo.runKernel(is,s,r)}});const Pu=vo({matMul_:function(e,t,n=!1,s=!1){let r=yo(e,"a","matMul"),i=yo(t,"b","matMul");[r,i]=Ja(r,i);const a={a:r,b:i},o={transposeA:n,transposeB:s};return oo.runKernel(Xn,a,o)}});const Vu=vo({sigmoid_:function(e){const t={x:yo(e,"x","sigmoid","float32")};return oo.runKernel(ai,t)}});const Wu=vo({slice_:function(e,t,n){const s=yo(e,"x","slice","string_or_numeric");if(0===s.rank)throw new Error("Slicing scalar is not possible");const r={x:s},i={begin:t,size:n};return oo.runKernel(ni,r,i)}});const Gu=vo({tanh_:function(e){const t={x:yo(e,"x","tanh","float32")};return oo.runKernel(_i,t)}});const Uu=vo({basicLSTMCell_:function(e,t,n,s,r,i){const a=yo(e,"forgetBias","basicLSTMCell"),o=yo(t,"lstmKernel","basicLSTMCell"),l=yo(n,"lstmBias","basicLSTMCell"),c=yo(s,"data","basicLSTMCell"),u=yo(r,"c","basicLSTMCell"),h=yo(i,"h","basicLSTMCell"),d=Lu([c,h],1),p=Pu(d,o),f=Pl(p,l),m=f.shape[0],g=f.shape[1]/4,y=[m,g],b=Wu(f,[0,0],y),w=Wu(f,[0,g],y),v=Wu(f,[0,2*g],y),A=Wu(f,[0,3*g],y),x=Pl(Gl(Vu(b),Gu(w)),Gl(u,Vu(Pl(a,v))));return[x,Gl(Gu(x),Vu(A))]}});const qu=vo({batchToSpaceND_:function(e,t,n){const s=yo(e,"x","batchToSpaceND"),r=t.reduce(((e,t)=>e*t));jt(s.rank>=1+t.length,(()=>`input rank is ${s.rank} but should be > than blockShape.length ${t.length}`)),jt(n.length===t.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`)),jt(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 i={x:s},a={blockShape:t,crops:n};return oo.runKernel(Zn,i,a)}});const ju=vo({batchNorm_:function(e,t,n,s,r,i){null==i&&(i=.001);const a=yo(e,"x","batchNorm"),o=yo(t,"mean","batchNorm"),l=yo(n,"variance","batchNorm");let c,u;null!=r&&(c=yo(r,"scale","batchNorm")),null!=s&&(u=yo(s,"offset","batchNorm")),jt(o.rank===l.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),jt(null==u||o.rank===u.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),jt(null==c||o.rank===c.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?Fu(e,[1,1,1,e.size]):2===e.rank?Fu(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?Fu(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(a),scale:c,offset:u,mean:o,variance:l},d={varianceEpsilon:i},p=oo.runKernel(Ws,h,d);return Fu(p,a.shape)}});const Hu=vo({batchNorm2d_:function(e,t,n,s,r,i){const a=yo(e,"x","batchNorm"),o=yo(t,"mean","batchNorm"),l=yo(n,"variance","batchNorm");let c,u;return null!=r&&(c=yo(r,"scale","batchNorm")),null!=s&&(u=yo(s,"offset","batchNorm")),jt(2===a.rank,(()=>`Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`)),jt(2===o.rank||1===o.rank,(()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`)),jt(2===l.rank||1===l.rank,(()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`)),null!=c&&jt(2===c.rank||1===c.rank,(()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${c.rank}.`)),null!=u&&jt(2===u.rank||1===u.rank,(()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${u.rank}.`)),ju(a,o,l,u,c,i)}});const $u=vo({batchNorm3d_:function(e,t,n,s,r,i){const a=yo(e,"x","batchNorm"),o=yo(t,"mean","batchNorm"),l=yo(n,"variance","batchNorm");let c,u;return null!=r&&(c=yo(r,"scale","batchNorm")),null!=s&&(u=yo(s,"offset","batchNorm")),jt(3===a.rank,(()=>`Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`)),jt(3===o.rank||1===o.rank,(()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`)),jt(3===l.rank||1===l.rank,(()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`)),null!=c&&jt(3===c.rank||1===c.rank,(()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${c.rank}.`)),null!=u&&jt(3===u.rank||1===u.rank,(()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${u.rank}.`)),ju(a,o,l,u,c,i)}});const Ku=vo({batchNorm4d_:function(e,t,n,s,r,i){const a=yo(e,"x","batchNorm"),o=yo(t,"mean","batchNorm"),l=yo(n,"variance","batchNorm");let c,u;return null!=r&&(c=yo(r,"scale","batchNorm")),null!=s&&(u=yo(s,"offset","batchNorm")),jt(4===a.rank,(()=>`Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`)),jt(4===o.rank||1===o.rank,(()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`)),jt(4===l.rank||1===l.rank,(()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`)),null!=c&&jt(4===c.rank||1===c.rank,(()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${c.rank}.`)),null!=u&&jt(4===u.rank||1===u.rank,(()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${u.rank}.`)),ju(a,o,l,u,c,i)}});const Xu=vo({bincount_:function(e,t,n){const s=yo(e,"x","bincount"),r=yo(t,"weights","bincount");jt("int32"===s.dtype,(()=>`Error in bincount: input dtype must be int32, but got ${s.dtype}`)),jt(n>=0,(()=>`size must be non-negative, but got ${n}.`)),jt(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 i={x:s,weights:r},a={size:n};return oo.runKernel(Yn,i,a)}});const Zu=vo({bitwiseAnd_:function(e,t){const n=yo(e,"x","bitwiseAnd"),s=yo(t,"y","bitwiseAnd");if(!Xt(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 oo.runKernel(Qn,r)}});const Yu=vo({broadcastArgs_:function(e,t){const n=yo(e,"s0","broadcastArgs","int32"),s=yo(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 oo.runKernel(Jn,r)}});const Qu=vo({broadcastTo_:function(e,t){let n=yo(e,"broadcastTo","x");const s=n.shape;if(wn(t),t.lengthn.rank){const e=n.shape.slice();for(;e.length=0;e--)if(r[e]===t[e])i[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${s}] cannot be broadcast to [${t}].`);if(0===i.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return zl(n);const a={x:n},o={reps:i};return oo.runKernel(Ti,a,o)}});const Ju=vo({ceil_:function(e){const t={x:yo(e,"x","ceil","float32")};return oo.runKernel(ts,t)}});const eh=vo({clipByValue_:function(e,t,n){const s=yo(e,"x","clipByValue");if(jt(t<=n,(()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`)),t===n)return tc(s.shape,t,s.dtype);const r={x:s},i={clipValueMin:t,clipValueMax:n};return oo.runKernel(ns,r,i)}});const th=vo({concat1d_:function(e){return Lu(e,0)}});const nh=vo({concat2d_:function(e,t){return Lu(e,t)}});const sh=vo({concat3d_:function(e,t){return Lu(e,t)}});const rh=vo({concat4d_:function(e,t){return Lu(e,t)}});const ih=vo({conv2d_:function(e,t,n,s,r="NHWC",i=[1,1],a){const o=yo(e,"x","conv2d","float32"),l=yo(t,"filter","conv2d","float32");let c=o,u=!1;3===o.rank&&(u=!0,c=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2]])),jt(4===c.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${c.rank}.`)),jt(4===l.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`)),Mu("conv2d",s,a);const h="NHWC"===r?c.shape[3]:c.shape[1];jt(h===l.shape[2],(()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${l.shape[2]}.`)),jt(Ou(n,i),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),jt(Du(i),(()=>"Error in conv2D: Dilated rates should be larger than 0.")),jt(Du(n),(()=>"Error in conv2D: Strides should be larger than 0."));const d={x:c,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a},f=oo.runKernel(as,d,p);return u?Fu(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const ah=vo({conv1d_:function(e,t,n,s,r="NWC",i=1,a){const o=yo(e,"x","conv1d"),l=yo(t,"filter","conv1d");let c=o,u=!1;2===o.rank&&(u=!0,c=Fu(o,[1,o.shape[0],o.shape[1]])),jt(3===c.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${c.rank}.`)),jt(3===l.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`)),Mu("conv1d",s,a),jt(c.shape[2]===l.shape[1],(()=>`Error in conv1d: depth of input (${c.shape[2]}) must match input depth for filter ${l.shape[1]}.`)),jt(Ou(n,i),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${i}'`)),jt(Du(i),(()=>"Error in conv1D: Dilated rates should be larger than 0.")),jt(Du(n),(()=>"Error in conv1D: Stride should be larger than 0.")),jt("NWC"===r,(()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`));const h=Fu(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=Fu(c,[c.shape[0],1,c.shape[1],c.shape[2]]),p=ih(d,h,[1,n],s,"NHWC",[1,i],a);return Fu(p,u?[p.shape[2],p.shape[3]]:[p.shape[0],p.shape[2],p.shape[3]])}});const oh=vo({conv2DBackpropInput_:function(e,t,n,s,r,i="NHWC",a){jt(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let o=e,l=t,c=!1;3===t.rank&&(c=!0,l=Fu(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),jt(4===o.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`)),jt(4===l.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`)),jt(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const u="NHWC"===i?o[3]:o[1],h="NHWC"===i?l.shape[3]:l.shape[1];jt(u===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[2]}.`)),jt(h===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${h}) must match output depth for filter ${n.shape[3]}.`)),Mu("conv2dDerInput",r,a);const d={dy:l,filter:n},p={strides:s,pad:r,dataFormat:i,dimRoundingMode:a,inputShape:o},f=oo.runKernel(ls,d,p);return c?Fu(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const lh=vo({conv2dTranspose_:function(e,t,n,s,r,i){const a=yo(e,"x","conv2dTranspose"),o=yo(t,"filter","conv2dTranspose");return oh(n,a,o,s,r,"NHWC",i)}});const ch=vo({conv3d_:function(e,t,n,s,r="NDHWC",i=[1,1,1]){const a=yo(e,"x","conv3d"),o=yo(t,"filter","conv3d");let l=a,c=!1;4===a.rank&&(c=!0,l=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),jt(5===l.rank,(()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`)),jt(5===o.rank,(()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`)),jt(l.shape[4]===o.shape[3],(()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`)),jt(Ou(n,i),(()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),jt("NDHWC"===r,(()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`)),jt(Du(i),(()=>"Error in conv3D: Dilated rates should be larger than 0.")),jt(Du(n),(()=>"Error in conv3D: Strides should be larger than 0."));const u={x:l,filter:o},h={strides:n,pad:s,dataFormat:r,dilations:i},d=oo.runKernel(cs,u,h);return c?Fu(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const uh=vo({conv3DBackpropInput_:function(e,t,n,s,r){jt(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let i=e,a=t,o=!1;4===t.rank&&(o=!0,a=Fu(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),i=[1,e[0],e[1],e[2],e[3]]);const l=i[4],c=a.shape[4];jt(5===i.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${i.length}.`)),jt(5===a.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`)),jt(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),jt(l===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`)),jt(c===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${c}) must match output depth for filter ${n.shape[4]}.`));const u={dy:a,filter:n},h={pad:r,strides:s,inputShape:i},d=oo.runKernel(hs,u,h);return o?Fu(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const hh=vo({conv3dTranspose_:function(e,t,n,s,r){const i=yo(e,"x","conv3dTranspose"),a=yo(t,"filter","conv3dTranspose");return uh(n,i,a,s,r)}});const dh=vo({cos_:function(e){const t={x:yo(e,"x","cos","float32")};return oo.runKernel(ds,t)}});const ph=vo({cosh_:function(e){const t={x:yo(e,"x","cosh","float32")};return oo.runKernel(ps,t)}});const fh=vo({cumprod_:function(e,t=0,n=!1,s=!1){const r={x:yo(e,"x","cumprod")},i={axis:t,exclusive:n,reverse:s};return oo.runKernel(fs,r,i)}});const mh=vo({cumsum_:function(e,t=0,n=!1,s=!1){const r={x:yo(e,"x","cumsum")},i={axis:t,exclusive:n,reverse:s};return oo.runKernel(ms,r,i)}});const gh=vo({denseBincount_:function(e,t,n,s=!1){const r=yo(e,"x","denseBincount"),i=yo(t,"weights","denseBincount");jt("int32"===r.dtype,(()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`)),jt(r.rank<=2,(()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`)),jt(n>=0,(()=>`size must be non-negative, but got ${n}.`)),jt(i.size===r.size||0===i.size,(()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${i.shape}.`));const a={x:r,weights:i},o={size:n,binaryOutput:s};return oo.runKernel(ys,a,o)}});const yh=vo({depthToSpace_:function(e,t,n="NHWC"){const s=yo(e,"x","depthToSpace","float32"),r="NHWC"===n?s.shape[1]:s.shape[2],i="NHWC"===n?s.shape[2]:s.shape[3],a="NHWC"===n?s.shape[3]:s.shape[1];jt(t>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`)),jt(r*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${r} and ${t} for depthToSpace with input shape\n ${s.shape}`)),jt(i*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${i} and ${t} for depthToSpace with input shape\n ${s.shape}`)),jt(a%(t*t)==0,(()=>`Dimension size must be evenly divisible by ${t*t} but is ${a} for depthToSpace with input shape ${s.shape}`));const o={x:s},l={blockSize:t,dataFormat:n};return oo.runKernel(bs,o,l)}});const bh=vo({depthwiseConv2d_:function(e,t,n,s,r="NHWC",i=[1,1],a){const o=yo(e,"x","depthwiseConv2d","float32"),l=yo(t,"filter","depthwiseConv2d","float32");let c=o,u=!1;3===o.rank&&(u=!0,c=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2]])),jt(4===c.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${c.rank}.`)),jt(4===l.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`));const h="NHWC"===r?c.shape[3]:c.shape[1];jt(h===l.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${h}) must match the inChannels dimension in filter ${l.shape[2]}.`)),Mu("depthwiseConv2d",s,a);const d={x:c,filter:l},p={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a},f=oo.runKernel(ws,d,p);return u?Fu(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});const wh=vo({diag_:function(e){const t={x:yo(e,"x","diag")};return oo.runKernel(xs,t)}});const vh=vo({dilation2d_:function(e,t,n,s,r=[1,1],i="NHWC"){const a=yo(e,"x","dilation2d"),o=yo(t,"filter","dilation2d");jt(3===a.rank||4===a.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`)),jt(3===o.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`)),jt("NHWC"===i,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${i}`));let l=a,c=!1;3===a.rank&&(l=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2]]),c=!0),jt(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 u={x:l,filter:o},h={strides:n,pad:s,dilations:r},d=oo.runKernel(Cs,u,h);return c?Fu(d,[d.shape[1],d.shape[2],d.shape[3]]):d}});const Ah=vo({equal_:function(e,t){let n=yo(e,"a","equal","string_or_numeric"),s=yo(t,"b","equal","string_or_numeric");[n,s]=Ja(n,s),cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(Ds,r)}});const xh=vo({where_:function(e,t,n){const s=yo(t,"a","where"),r=yo(n,"b","where"),i=yo(e,"condition","where","bool"),a=cc(cc(i.shape,s.shape),r.shape),o={condition:Qu(i,a),t:Qu(s,a),e:Qu(r,a)};return oo.runKernel(ei,o)}});const Ch=vo({divNoNan_:function(e,t){let n=yo(e,"a","div"),s=yo(t,"b","div");[n,s]=Ja(n,s);const r=Wl(n,s),i=jl(r),a=Ah(s,i);return xh(a,i,r)}});const kh=vo({dot_:function(e,t){const n=yo(e,"t1","dot"),s=yo(t,"t2","dot");jt(!(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],i=1===s.rank?s.size:s.shape[0];if(jt(r===i,(()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${i}.`)),1===n.rank&&1===s.rank){const e=Fu(n,[1,-1]),t=Fu(s,[-1,1]),r=Pu(e,t);return Fu(r,[])}if(1===n.rank&&2===s.rank){const e=Fu(n,[1,-1]),t=Fu(s,[s.shape[0],s.shape[1]]),r=Pu(e,t);return Fu(r,[r.size])}if(2===n.rank&&1===s.rank){const e=Fu(s,[-1,1]),t=Pu(n,e);return Fu(t,[t.size])}{const e=Fu(s,[s.shape[0],s.shape[1]]);return Pu(n,e)}}});const Sh=vo({einsum_:function(e,...t){const n=t.map(((e,t)=>yo(e,`tensors${t}`,"einsum"))),s={equation:e};return oo.runKernel(Ts,n,s)}});const Eh=vo({elu_:function(e){const t={x:yo(e,"x","elu","float32")};return oo.runKernel(Is,t)}});const _h=vo({ensureShape_:function(e,t){const n=yo(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=Bl(t,"float32"));const n={x:t};return oo.runKernel(Os,n)}});function Ih(e,t){for(let n=0;ne[t]))]}function Dh(e,t){return Nh(e,t.map((e=>1)),t)}function Rh(e,t,n){jt(Ih(t,n),(()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`))}function Mh(e,t){if(Ih(e,t))return null;const n=[];for(let s=0;sn.push(e))),n}function Fh(e){return e.map(((e,t)=>[t,e])).sort(((e,t)=>e[1]-t[1])).map((e=>e[0]))}function Bh(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 oo.runKernel(Ms,s,r)}});const jh=vo({expm1_:function(e){const t={x:yo(e,"x","expm1")};return oo.runKernel(Fs,t)}});const Hh=vo({tile_:function(e,t){const n=yo(e,"x","tile","string_or_numeric");jt(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 oo.runKernel(Ti,s,r)}});const $h=vo({eye_:function(e,t,n,s="float32"){null==t&&(t=e);const r=Fl([e,t],s),i=e<=t?e:t;for(let e=0;e`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${i.rank}.`)),jt(Zt(t),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`));let a=i,o=!1;3===i.rank&&(o=!0,a=Fu(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const l={x:a},c={depthRadius:t,bias:n,alpha:s,beta:r},u=oo.runKernel(or,l,c);return o?Fu(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const od=vo({log_:function(e){const t={x:yo(e,"x","log","float32")};return oo.runKernel(nr,t)}});const ld=vo({log1p_:function(e){const t={x:yo(e,"x","log1p")};return oo.runKernel(sr,t)}});const cd=vo({neg_:function(e){const t={x:yo(e,"x","neg")};return oo.runKernel(Cr,t)}});const ud=vo({softplus_:function(e){const t={x:yo(e,"x","softplus")};return oo.runKernel(oi,t)}});const hd=vo({logSigmoid_:function(e){const t=yo(e,"x","logSigmoid");return Hl((e=>({value:cd(ud(cd(e))),gradFunc:t=>Gl(t,Vu(cd(e)))})))(t)}});const dd=vo({logSoftmax_:function(e,t=-1){const n=yo(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}`);return Hl(((e,n)=>{const s=zh(e,t,!0),r=rc(e,s),i=rc(Bl(r,"float32"),od(Ph(Uh(r),t,!0)));n([i]);return{value:i,gradFunc:(e,n)=>{const[s]=n,r=Uh(s);return rc(e,Gl(Ph(e,t,!0),r))}}}))(n)}});const pd=vo({logSumExp_:function(e,t=null,n=!1){const s=yo(e,"x","logSumExp"),r=tn(t,s.shape),i=zh(s,r,!0),a=rc(s,i),o=Uh(a),l=Ph(o,r),c=od(l),u=Pl(Fu(i,c.shape),c);if(n){const e=Dh(u.shape,r);return Fu(u,e)}return u}});const fd=vo({logicalAnd_:function(e,t){const n=yo(e,"a","logicalAnd","bool"),s=yo(t,"b","logicalAnd","bool");cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(rr,r)}});const md=vo({logicalNot_:function(e){const t={x:yo(e,"x","logicalNot","bool")};return oo.runKernel(ir,t)}});const gd=vo({logicalOr_:function(e,t){const n=yo(e,"a","logicalOr","bool"),s=yo(t,"b","logicalOr","bool");cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(ar,r)}});const yd=vo({logicalXor_:function(e,t){const n=yo(e,"a","logicalXor","bool"),s=yo(t,"b","logicalXor","bool");return cc(n.shape,s.shape),fd(gd(e,t),md(fd(e,t)))}}),bd=2147483648;const wd=vo({searchSorted_:function(e,t,n="left"){const s=yo(e,"sortedSequence","searchSorted"),r=yo(t,"values","searchSorted"),i=s.shape[s.shape.length-1],a=r.shape[r.shape.length-1],o=Fu(s,[-1,i]),l=Fu(r,[-1,a]);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(Kt(l.shape)>=bd)throw new Error("values tensor size must less than 2147483648");if(o.shape[1]>=bd)throw new Error(`trailing dim_size must less than 2147483648 for int32 output type, was ${o.shape[1]}`);const c={sortedSequence:o,values:l},u={side:n};return oo.runKernel(Jr,c,u)}});function vd(e,t){return wd(e,t,"left")}const Ad=vo({maxPool_:function(e,t,n,s,r){const i=yo(e,"x","maxPool");let a=i,o=!1;3===i.rank&&(o=!0,a=Fu(i,[1,i.shape[0],i.shape[1],i.shape[2]])),jt(4===a.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${a.rank}.`)),jt(Ou(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),Mu("maxPool",s,r);const l={x:a},c={filterSize:t,strides:n,pad:s,dimRoundingMode:r},u=oo.runKernel(hr,l,c);return o?Fu(u,[u.shape[1],u.shape[2],u.shape[3]]):u}});const xd=vo({maxPool3d_:function(e,t=[1,1,1],n,s,r,i="NDHWC"){const a=yo(e,"x","maxPool3d");let o=a,l=!1;4===a.rank&&(l=!0,o=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),jt(5===o.rank,(()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`)),jt("NDHWC"===i,(()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`)),Mu("maxPool3d",s,r);const c={x:o},u={filterSize:t,strides:n,pad:s,dimRoundingMode:r,dataFormat:i},h=oo.runKernel(pr,c,u);return l?Fu(h,[h.shape[1],h.shape[2],h.shape[3],h.shape[4]]):h}});const Cd=vo({maxPoolWithArgmax_:function(e,t,n,s,r=!1){const i={x:yo(e,"x","maxPoolWithArgmax")},a={filterSize:t,strides:n,pad:s,includeBatchInIndex:r},o=oo.runKernel(mr,i,a);return{result:o[0],indexes:o[1]}}});const kd=vo({mean_:function(e,t=null,n=!1){const s={x:yo(e,"x","mean")},r={axis:t,keepDims:n};return oo.runKernel(gr,s,r)}});function Sd(e,t="float32"){if(wn(e),"complex64"===t){const t=Sd(e,"float32"),n=Sd(e,"float32");return Ao(t,n)}const n=yn(Kt(e),t);return oo.makeTensor(n,e,t)}function Ed(e,t="float32"){if(wn(e),"complex64"===t){const t=Ed(e,"float32"),n=Sd(e,"float32");return Ao(t,n)}const n=gn(Kt(e),t);return oo.makeTensor(n,e,t)}function _d(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=yo(e,"x","meshgrid",e instanceof Fa?e.dtype:"float32");if(void 0===t)return[s];let r=yo(t,"y","meshgrid",t instanceof Fa?t.dtype:"float32");const i=Kt(s.shape),a=Kt(r.shape);return"xy"===n?(s=Fu(s,[1,-1]),r=Fu(r,[-1,1]),[Pu(Ed([a,1],s.dtype),s),Pu(r,Ed([1,i],r.dtype))]):(s=Fu(s,[-1,1]),r=Fu(r,[1,-1]),[Pu(s,Ed([1,a],s.dtype)),Pu(Ed([i,1],r.dtype),r)])}const Td=vo({minimum_:function(e,t){let n=yo(e,"a","minimum"),s=yo(t,"b","minimum");[n,s]=Ja(n,s),"bool"===n.dtype&&(n=Bl(n,"int32"),s=Bl(s,"int32")),cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(br,r)}});const Id=vo({mirrorPad_:function(e,t,n){jt("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const s=yo(e,"x","mirrorPad");if(0===s.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");jt(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.")),jt(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 i={paddings:t,mode:n},a={x:s};return oo.runKernel(wr,a,i)}});const Nd=vo({mod_:function(e,t){let n=yo(e,"a","mod"),s=yo(t,"b","mod");[n,s]=Ja(n,s);const r={a:n,b:s};return oo.runKernel(vr,r)}});const Od=vo({moments_:function(e,t=null,n=!1){const s=tn(t,(e=yo(e,"x","moments")).shape),r=kd(e,s,n);let i=r.shape;n||(i=Dh(r.shape,s));const a=ql(rc(Bl(e,"float32"),Fu(r,i)));return{mean:r,variance:kd(a,s,n)}}});const Dd=vo({multiRNNCell_:function(e,t,n,s){const r=yo(t,"data","multiRNNCell"),i=bo(n,"c","multiRNNCell"),a=bo(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 ${a}`);n=n||Math.random();const o={logits:1===a?Fu(r,[1,-1]):r},l={numSamples:t,seed:n,normalized:s},c=oo.runKernel(Ar,o,l);return 1===a?Fu(c,[c.size]):c}});const Md=vo({notEqual_:function(e,t){let n=yo(e,"a","notEqual","string_or_numeric"),s=yo(t,"b","notEqual","string_or_numeric");[n,s]=Ja(n,s),cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(kr,r)}});const Fd=vo({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 i={indices:yo(e,"indices","oneHot","int32")},a={dtype:r,depth:t,onValue:n,offValue:s};return oo.runKernel(Ir,i,a)}});const Bd=vo({onesLike_:function(e){const t={x:yo(e,"x","onesLike")};return oo.runKernel(Tr,t)}});const zd=vo({outerProduct_:function(e,t){const n=yo(e,"v1","outerProduct"),s=yo(t,"v2","outerProduct");jt(1===n.rank&&1===s.rank,(()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${s.rank}.`));const r=Fu(n,[-1,1]),i=Fu(s,[1,-1]);return Pu(r,i)}});const Ld=vo({pad_:function(e,t,n=0){const s=yo(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},i={x:s};return oo.runKernel(Or,i,r)}});const Pd=vo({pad1d_:function(e,t,n=0){return jt(2===t.length,(()=>"Invalid number of paddings. Must be length of 2.")),Ld(e,[t],n)}});const Vd=vo({pad2d_:function(e,t,n=0){return jt(2===t.length&&2===t[0].length&&2===t[1].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),Ld(e,t,n)}});const Wd=vo({pad3d_:function(e,t,n=0){return jt(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.")),Ld(e,t,n)}});const Gd=vo({pad4d_:function(e,t,n=0){return jt(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.")),Ld(e,t,n)}});const Ud=vo({spaceToBatchND_:function(e,t,n){const s=yo(e,"x","spaceToBatchND");jt(s.rank>=1+t.length,(()=>`input rank ${s.rank} should be > than [blockShape] ${t.length}`)),jt(n.length===t.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`)),jt(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},i={blockShape:t,paddings:n};return oo.runKernel(ui,r,i)}});const qd=vo({pool_:function(e,t,n,s,r,i,a){null==r&&(r=[1,1]),null==i&&(i=1),0===s&&(s="valid");const o=yo(e,"x","maxPool");let l=o,c=!1;3===o.rank&&(c=!0,l=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2]])),jt(Ou(i,r),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${i} and dilations '${r}'`));const u=Au(l.shape,t,i,r,s),h=[u.dilationHeight,u.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))),i=s.map(((e,t)=>e-r[t]));return s.map(((e,t)=>[r[t],i[t]]))}([u.filterHeight,u.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])),i=e.concat(s,r),a=t.map(((e,t)=>(e-i[t]%e)%e)),o=r.map(((e,t)=>e+a[t])),l=t.map(((e,t)=>[s[t],o[t]])),c=t.map(((e,t)=>[0,a[t]]));return[l,c]}([u.inHeight,u.inWidth],h,d),g=p?s:"valid",y=p?l:Ud(l,h,f),b=("avg"===n?()=>Bu(y,t,i,g,a):()=>Ad(y,t,i,g,a))(),w=p?b:qu(b,h,m);return c?Fu(w,[w.shape[1],w.shape[2],w.shape[3]]):w}});const jd=vo({prelu_:function(e,t){const n={x:yo(e,"x","prelu"),alpha:yo(t,"alpha","prelu")};return oo.runKernel(Rr,n)}});const Hd=vo({prod_:function(e,t=null,n=!1){let s=yo(e,"x","prod");"bool"===s.dtype&&(s=Bl(s,"int32"));const r={x:s},i={axis:t,keepDims:n};return oo.runKernel(Mr,r,i)}});const $d=vo({raggedGather_:function(e,t,n,s){const r={paramsNestedSplits:e.map(((e,t)=>yo(e,`tensors${t}`,"raggedGather","int32"))),paramsDenseValues:yo(t,"paramsDenseValues","raggedGather"),indices:yo(n,"indices","raggedGather","int32")},i={outputRaggedRank:s},a=oo.runKernel(Fr,r,i);return{outputNestedSplits:a.slice(0,a.length-1),outputDenseValues:a[a.length-1]}}});const Kd=vo({raggedRange_:function(e,t,n){const s=yo(e,"starts","raggedRange"),r={starts:s,limits:yo(t,"limits","raggedRange",s.dtype),deltas:yo(n,"deltas","raggedRange",s.dtype)},i=oo.runKernel(Br,r);return{rtNestedSplits:i[0],rtDenseValues:i[1]}}});const Xd=vo({raggedTensorToTensor_:function(e,t,n,s,r){const i=yo(e,"shape","raggedTensorToTensor","int32"),a=yo(t,"values","raggedTensorToTensor"),o={shape:i,values:a,defaultValue:yo(n,"defaultValue","raggedTensorToTensor",a.dtype),rowPartitionTensors:s.map(((e,t)=>yo(e,`tensors${t}`,"raggedTensorToTensor","int32")))},l={rowPartitionTypes:r};return oo.runKernel(zr,o,l)}});const Zd=vo({rand_:function(e,t,n){wn(e);const s=Kt(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===i);const a=Math.sqrt(-2*Math.log(i)/i);e=this.mean+this.stdDev*s*a,t=this.mean+this.stdDev*r*a,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 Jd{constructor(e,t,n,s){this.alpha=e,this.beta=1/t,this.dtype=n;const r=s||Math.random();this.randu=Yd.alea(r.toString()),this.randn=new Qd(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,i;for(;;){do{s=this.randn.nextValue(),i=1+this.c*s}while(i<=0);if(i*=i*i,e=s*s,t=1-.331*e*e,n=.5*e+this.d*(1-i+Math.log(i)),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=Yd.alea(s)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const tp=vo({randomGamma_:function(e,t,n=1,s="float32",r){if(wn(e),null==n&&(n=1),null==s&&(s="float32"),"float32"!==s&&"int32"!==s)throw new Error(`Unsupported data type ${s}`);const i=new Jd(t,n,s,r),a=Fl(e,s);for(let e=0;e`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`)),hp(t,0)}});const pp=vo({reverse2d_:function(e,t){const n=yo(e,"x","reverse");return jt(2===n.rank,(()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`)),hp(n,t)}});const fp=vo({reverse3d_:function(e,t){const n=yo(e,"x","reverse");return jt(3===n.rank,(()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`)),hp(n,t)}});const mp=vo({reverse4d_:function(e,t){const n=yo(e,"x","reverse");return jt(4===n.rank,(()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`)),hp(n,t)}});const gp=vo({round_:function(e){const t={x:yo(e,"x","round")};return oo.runKernel(Xr,t)}});const yp=vo({rsqrt_:function(e){const t={x:yo(e,"x","rsqrt","float32")};return oo.runKernel(Zr,t)}});const bp=vo({selu_:function(e){const t={x:yo(e,"x","selu")};return oo.runKernel(ti,t)}});const wp=vo({separableConv2d_:function(e,t,n,s,r,i=[1,1],a="NHWC"){const o=yo(e,"x","separableConv2d"),l=yo(t,"depthwiseFilter","separableConv2d"),c=yo(n,"pointwiseFilter","separableConv2d");let u=o,h=!1;if(3===o.rank&&(h=!0,u=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2]])),"NCHW"===a)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");jt(4===u.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${u.rank}.`)),jt(4===l.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`)),jt(4===c.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`)),jt(1===c.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${c.shape[0]}.`)),jt(1===c.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${c.shape[1]}.`));const d=l.shape[2],p=l.shape[3];jt(c.shape[2]===d*p,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*p}, but got ${c.shape[2]}.`));const f=bh(u,l,s,r,a,i),m=ih(f,c,1,"valid",a);return h?Fu(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const vp=async function(e,t){const n=yo(e,"x","setdiff1d"),s=yo(t,"y","setdiff1d");jt(n.dtype===s.dtype,(()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${s.dtype}).`)),jt(1===n.rank,(()=>`x should be 1D tensor, but got x (${n.shape}).`)),jt(1===s.rank,(()=>`y should be 1D tensor, but got y (${s.shape}).`));const r=await n.data(),i=await s.data(),a=new Set(i);let o=0;for(let e=0;e`slice1d expects a rank-1 tensor, but got a rank-${s.rank} tensor`)),Wu(s,[t],[n])}});const Sp=vo({slice2d_:function(e,t,n){const s=yo(e,"x","slice2d");return jt(2===s.rank,(()=>`slice2d expects a rank-2 tensor, but got a rank-${s.rank} tensor`)),Wu(s,t,n)}});const Ep=vo({slice3d_:function(e,t,n){const s=yo(e,"x","slice3d");return jt(3===s.rank,(()=>`slice3d expects a rank-3 tensor, but got a rank-${s.rank} tensor`)),Wu(s,t,n)}});const _p=vo({slice4d_:function(e,t,n){const s=yo(e,"x","slice4d");return jt(4===s.rank,(()=>`slice4d expects a rank-4 tensor, but got a rank-${s.rank} tensor`)),Wu(s,t,n)}});const Tp=vo({softmax_:function(e,t=-1){const n=yo(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 oo.runKernel(di,s,r)}});const Ip=vo({fft_:function(e){jt("complex64"===e.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`));const t={input:e};return oo.runKernel(Bs,t)}});const Np=vo({ifft_:function(e){jt("complex64"===e.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`));const t={input:e};return oo.runKernel($s,t)}});const Op=vo({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let s;if(t<=2){const r=Fu(e,[n,t]);s=Np(r)}else{const r=[n,2*(t-1)],i=Fu(op(e),[n,t]),a=Fu(Qh(e),[n,t]),o=hp(Wu(i,[0,1],[n,t-2]),1),l=Gl(hp(Wu(a,[0,1],[n,t-2]),1),$l(-1)),c=Lu([i,o],1),u=Lu([a,l],1),h=Fu(Ao(c,u),[r[0],r[1]]);s=Np(h)}if(s=op(s),3===e.rank&&0!==e.shape[0]){const t=s,n=e.shape[0];s=Fu(s,[n,s.shape[0]/n,s.shape[1]]),t.dispose()}return s}});const Dp=vo({split_:function(e,t,n=0){const s={x:yo(e,"x","split")},r={numOrSizeSplits:t,axis:n};return oo.runKernel(hi,s,r)}});const Rp=vo({rfft_:function(e,t){jt("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)),i=e.shape.map((e=>e));i[e.shape.length-1]=t,r=Wu(e,s,i),n=t}else if(null!=t&&t>n){const s=e.shape.map((e=>e));s[e.shape.length-1]=t-n,r=Lu([e,Sd(s)],e.shape.length-1),n=t}else r=e;const i=jl(r),a=Fu(Ao(r,i),[s,n]),o=Ip(a),l=Math.floor(n/2)+1,c=op(o),u=Qh(o),h=Dp(c,[l,n-l],c.shape.length-1),d=Dp(u,[l,n-l],u.shape.length-1),p=r.shape.slice();return p[r.shape.length-1]=l,Fu(Ao(h[0],d[0]),p)}});const Mp=vo({squaredDifference_:function(e,t){let n=yo(e,"a","squaredDifference"),s=yo(t,"b","squaredDifference");[n,s]=Ja(n,s),cc(n.shape,s.shape);const r={a:n,b:s};return oo.runKernel(bi,r,{})}});const Fp=vo({squeeze_:function(e,t){const n=yo(e,"x","squeeze","string_or_numeric");return Fu(n,nn(n.shape,t).newShape)}});const Bp=vo({stack_:function(e,t=0){const n=bo(e,"tensors","stack","string_or_numeric");jt(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&jt(t<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const s=n,r={axis:t};return oo.runKernel(Nr,s,r)}});const zp=vo({step_:function(e,t=0){const n={x:yo(e,"x","step")},s={alpha:t};return oo.runKernel(Bi,n,s)}});const Lp=vo({stridedSlice_:function(e,t,n,s,r=0,i=0,a=0,o=0,l=0){const c={x:yo(e,"x","stridedSlice","string_or_numeric")},u={begin:t,end:n,strides:s,beginMask:r,endMask:i,ellipsisMask:a,newAxisMask:o,shrinkAxisMask:l};return oo.runKernel(Ai,c,u)}});const Pp=vo({tan_:function(e){const t={x:yo(e,"x","tan","float32")};return oo.runKernel(Ei,t)}});function Vp(e,t){$t(e);const n=fo(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return xo(e,null,n,t)}function Wp(e,t,n){if($t(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const s=fo(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 xo(e,t,s,n)}function Gp(e,t,n){if($t(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const s=fo(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 xo(e,t,s,n)}function Up(e,t,n){if($t(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const s=fo(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 xo(e,t,s,n)}function qp(e,t,n){if($t(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const s=fo(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 xo(e,t=t||s,s,n)}function jp(e,t,n){const s=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,i=`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,i=n.length;let a=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 i={x:s},a={k:t,sorted:n},[o,l]=oo.runKernel(Ii,i,a);return{values:o,indices:l}}});const Zp=vo({truncatedNormal_:function(e,t=0,n=1,s,r){if(wn(e),null!=s&&"bool"===s)throw new Error("Unsupported data type $ { dtype }");const i=new Qd(t,n,s,!0,r),a=Fl(e,s);for(let e=0;e0,(()=>"The input tensor must be at least 1D"));const s={x:n},r={axis:t},[i,a]=oo.runKernel(Di,s,r);return{values:i,indices:a}}});const Qp=vo({unsortedSegmentSum_:function(e,t,n){const s=yo(e,"x","unsortedSegmentSum"),r=yo(t,"segmentIds","unsortedSegmentSum","int32");jt(Zt(n),(()=>"numSegments must be of dtype int"));const i={x:s,segmentIds:r},a={numSegments:n};return oo.runKernel(Mi,i,a)}});const Jp=vo({unstack_:function(e,t=0){const n=yo(e,"x","unstack","string_or_numeric");jt(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`));const s={value:n},r={axis:t};return oo.runKernel(Ri,s,r)}});function ef(e,t){return wd(e,t,"right")}function tf(e,t=!0,n,s){return oo.makeVariable(e,t,n,s)}function nf(e,t){const n=[];for(let e=0;e0,(()=>"mask cannot be scalar")),Ht(o.slice(i,i+a),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let e=i;et)).reverse()),jt(s.rank===t.length,(()=>`Error in transpose: rank of input ${s.rank} must match length of perm ${t}.`)),t.forEach((e=>{jt(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},i={perm:t};return"complex64"===s.dtype?To((()=>{let e=op(s),t=Qh(s);return e=oo.runKernel(Oi,{x:e},i),t=oo.runKernel(Oi,{x:t},i),n&&(t=cd(t)),Ao(e,t)})):oo.runKernel(Oi,r,i)}});const of=vo({movingAverage_:function(e,t,n,s,r=!0){const i=yo(e,"v","movingAverage"),a=yo(t,"x","movingAverage"),o=yo(n,"decay","movingAverage");var l,c;c=a,jt((l=i).dtype===c.dtype,(()=>`The dtypes of the first(${l.dtype}) and second(${c.dtype}) input must match`)),jt(Xt(i.shape,a.shape),(()=>"Shape mismatch in v and x"));const u=$l(1),h=rc(u,o);let d=Gl(rc(a,i),h);if(r){jt(null!=s,(()=>"When using zeroDebias: true, step is required."));const e=yo(s,"step","movingAverage");d=Wl(d,rc(u,sc(o,e)))}return Pl(i,d)}});const lf=vo({scatterND_:function(e,t,n){wn(n);const s=yo(e,"indices","scatterND","int32"),r=yo(t,"updates","scatterND");Hp(r,s,n);const i={indices:s,updates:r},a={shape:n};return oo.runKernel(Yr,i,a)}});const cf=vo({sparseToDense_:function(e,t,n,s=0){wn(n);const r=yo(e,"sparseIndices","sparseToDense","int32"),i=yo(t,"sparseValues","sparseToDense","string_or_numeric"),a=yo(s,"defaultValue","sparseToDense",i.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,i=e.rank>1?e.shape[1]:1;if(n.length!==i)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${i}.`);const a=t.size;if(0!==t.rank&&(1!==t.rank||a!==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,i,n,a);const o={sparseIndices:r,sparseValues:i,defaultValue:a},l={outputShape:n};return oo.runKernel(yi,o,l)}});const uf=vo({gatherND_:function(e,t){const n=yo(t,"indices","gatherND","int32"),s={params:yo(e,"x","gatherND","string_or_numeric"),indices:n};return oo.runKernel(Us,s)}});const hf=vo({dropout_:function(e,t,n,s){const r=yo(e,"x","dropout");if(jt("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.`)),jt(t>=0&&t<1,(()=>`rate must be a float in the range [0, 1), but got ${t}.`)),0===t)return e instanceof Fa?r.clone():r;const i=function(e,t){if(null==t)return e.shape.slice();if(Xt(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}`)),jt(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}`)),Ht(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 i=s.shape[s.shape.length-1];jt(n>0&&n<=i,(()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${i}), but got ${n}`));const a=await s.data(),o=await r.data(),[l,c]=[a.length/i,i],u=sn("bool",l);for(let e=0;et.value-e.value)),u[e]=0;for(let t=0;t`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`)),jt(4===l.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`)),jt(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const c="NHWC"===i?o.shape[3]:o.shape[1],u="NHWC"===i?l.shape[3]:l.shape[1];jt(c===n[2],(()=>`Error in conv2dDerFilter: depth of input ${c}) must match input depth in filter (${n[2]}.`)),jt(u===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${u}) must match output depth for filter (${n[3]}).`)),Mu("conv2dDerFilter",r,a);const h={x:o,dy:l},d={strides:s,pad:r,dataFormat:i,dimRoundingMode:a,filterShape:n};return oo.runKernel(os,h,d)}});function gf(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return Gl(e,zp(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function yf(e,t){let n=t;const s=lc(e.shape,t.shape);return s.length>0&&(n=Ph(n,s)),Fu(n,e.shape)}function bf(e,t,n,s){if("linear"===t)return e;if("relu"===t)return cp(e);if("elu"===t)return Eh(e);if("relu6"===t)return up(e);if("prelu"===t)return jd(e,n);if("leakyrelu"===t)return nd(e,s);if("sigmoid"===t)return Vu(e);throw new Error(`Unknown fused activation ${t}.`)}const wf=(e,t)=>!(e>0)||"linear"===t;const vf=vo({fusedConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:o,activation:l="linear",preluActivationWeights:c,leakyreluAlpha:u}){if(l=l||"linear",!1===wf(oo.state.gradientDepth,l)){jt("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=ih(e,t,n,s,r,i,a);return null!=o&&(h=Pl(h,o)),bf(h,l,c,u)}const h=yo(e,"x","conv2d","float32"),d=yo(t,"filter","conv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=Fu(h,[1,h.shape[0],h.shape[1],h.shape[2]])),jt(4===p.rank,(()=>`Error in fused conv2d: input must be rank 4, but got rank ${p.rank}.`)),jt(4===d.rank,(()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`)),Mu("fused conv2d",s,a);const m="NHWC"===r?p.shape[3]:p.shape[1];jt(d.shape[2]===m,(()=>`Error in conv2d: depth of input (${m}) must match input depth for filter ${d.shape[2]}.`)),jt(Ou(n,i),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`));const g=Cu(p.shape,d.shape,n,i,s,a);let y,b;if(null!=o&&(y=yo(o,"bias","fused conv2d"),[y]=Ja(y,h),"NHWC"===r?cc(g.outShape,y.shape):(jt(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}.`)),jt(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!=c){const e=c.shape;if(jt(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)jt(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{cc(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=yo(c,"prelu weights","fused conv2d")}const w=(e,t)=>{jt("NHWC"===r,(()=>`Error in gradient of fused conv2D: got dataFormat of ${r} but only NHWC is currently supported.`));const[a,o,c,u]=t,h=gf(e,c,l);jt(Nu(i),(()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`));const d=[oh(o.shape,h,a,n,s),mf(o,h,a.shape,n,s)];if(null!=u){const e=yf(u,h);d.push(e)}return d},v={x:p,filter:d,bias:y,preluActivationWeights:b},A={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:u};if(null==o){const e=Hl(((e,t,n)=>{let s=oo.runKernel(Vi,v,A);return n([t,e,s]),f&&(s=Fu(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:w}}));return e(p,d)}{const e=Hl(((e,t,n,s)=>{let r=oo.runKernel(Vi,v,A);return s([t,e,r,n]),f&&(r=Fu(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:w}}));return e(p,d,y)}}});const Af=vo({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,s,r,i=[1,1],a){let o=e;3===e.rank&&(o=Fu(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;3===l.rank&&(l=Fu(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const c={x:o,dy:l},u={strides:s,pad:r,dimRoundingMode:a,dilations:i,filterShape:n};return oo.runKernel(vs,c,u)}});const xf=vo({depthwiseConv2dNativeBackpropInput_:function(e,t,n,s,r,i=[1,1],a){let o=t,l=!1;3===t.rank&&(l=!0,o=Fu(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const c={dy:o,filter:n},u={strides:s,pad:r,dimRoundingMode:a,dilations:i,inputShape:e},h=oo.runKernel(As,c,u);return l?Fu(h,[h.shape[1],h.shape[2],h.shape[3]]):h}});const Cf=vo({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:s,dataFormat:r="NHWC",dilations:i=[1,1],dimRoundingMode:a,bias:o,activation:l="linear",preluActivationWeights:c,leakyreluAlpha:u}){if(!1===wf(oo.state.gradientDepth,l)){let h=bh(e,t,n,s,r,i,a);return null!=o&&(h=Pl(h,o)),bf(h,l,c,u)}const h=yo(e,"x","depthwiseConv2d","float32"),d=yo(t,"filter","depthwiseConv2d","float32");let p=h,f=!1;3===h.rank&&(f=!0,p=Fu(h,[1,h.shape[0],h.shape[1],h.shape[2]])),jt(4===p.rank,(()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${p.rank}.`)),jt(4===d.rank,(()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`)),jt(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==i&&(i=[1,1]),jt(Ou(n,i),(()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`)),Mu("fused depthwiseConv2d",s,a);const m=Cu(p.shape,d.shape,n,i,s,a,!0);let g,y;null!=o&&(g=yo(o,"bias","fused conv2d"),[g]=Ja(g,h),cc(m.outShape,g.shape)),null!=c&&(y=yo(c,"prelu weights","fused depthwiseConv2d"));const b=(e,t)=>{jt(Nu(i),(()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${i}'`));const[r,o,c,u]=t,h=gf(e,c,l),d=xf(o.shape,h,r,n,s,i,a),p=Af(o,h,r.shape,n,s,i,a);if(null!=u){return[d,p,yf(g,h)]}return[d,p]},w={x:p,filter:d,bias:g,preluActivationWeights:y},v={strides:n,pad:s,dataFormat:r,dilations:i,dimRoundingMode:a,activation:l,leakyreluAlpha:u};if(null==o){const e=Hl(((e,t,n)=>{let s=oo.runKernel(Wi,w,v);return n([t,e,s]),f&&(s=Fu(s,[s.shape[1],s.shape[2],s.shape[3]])),{value:s,gradFunc:b}}));return e(p,d)}{const e=Hl(((e,t,n,s)=>{let r=oo.runKernel(Wi,w,v);return s([t,e,r,n]),f&&(r=Fu(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:b}}));return e(p,d,g)}}});const kf=vo({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:s=!1,bias:r,activation:i="linear",preluActivationWeights:a,leakyreluAlpha:o=.2}){if(!1===wf(oo.state.gradientDepth,i)){let l=Pu(e,t,n,s);return null!=r&&(l=Pl(l,r)),bf(l,i,a,o)}let l=yo(e,"a","fused matMul"),c=yo(t,"b","fused matMul");[l,c]=Ja(l,c);const u=n?l.shape[l.rank-2]:l.shape[l.rank-1],h=s?c.shape[c.rank-1]:c.shape[c.rank-2],d=n?l.shape[l.rank-1]:l.shape[l.rank-2],p=s?c.shape[c.rank-2]:c.shape[c.rank-1],f=l.shape.slice(0,-2),m=c.shape.slice(0,-2),g=Kt(f),y=Kt(m);jt(u===h,(()=>`Error in fused matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${l.shape} and ${c.shape} and transposeA=${n} and transposeB=${s} must match.`));const b=cc(l.shape.slice(0,-2),c.shape.slice(0,-2)).concat([d,p]),w=Fu(l,n?[g,u,d]:[g,d,u]),v=Fu(c,s?[y,p,h]:[y,h,p]);let A,x;null!=r&&(A=yo(r,"bias","fused matMul"),[A]=Ja(A,l),cc(b,A.shape)),null!=a&&(x=yo(a,"prelu weights","fused matMul"));const C=(e,t)=>{const[a,o,l,c]=t,u=gf(Fu(e,l.shape),l,i);let h,d;if(n||s?!n&&s?(h=Pu(u,o,!1,!1),d=Pu(u,a,!0,!1)):n&&!s?(h=Pu(o,u,!1,!0),d=Pu(a,u,!1,!1)):(h=Pu(o,u,!0,!0),d=Pu(u,a,!0,!0)):(h=Pu(u,o,!1,!0),d=Pu(a,u,!0,!1)),null!=r){return[h,d,yf(c,u)]}return[h,d]},k={a:w,b:v,bias:A,preluActivationWeights:x},S={transposeA:n,transposeB:s,activation:i,leakyreluAlpha:o};if(null==r){const e=Hl(((e,t,n)=>{const s=oo.runKernel(Pi,k,S);return n([e,t,s]),{value:Fu(s,b),gradFunc:C}}));return e(w,v)}{const e=Hl(((e,t,n,s)=>{const r=oo.runKernel(Pi,k,S);return s([e,t,r,n]),{value:Fu(r,b),gradFunc:C}}));return e(w,v,A)}}});const Sf=vo({hammingWindow_:function(e){return pf(e,.54,.46)}});const Ef=vo({hannWindow_:function(e){return pf(e,.5,.5)}});const _f=vo({frame_:function(e,t,n,s=!1,r=0){let i=0;const a=[];for(;i+t<=e.size;)a.push(Wu(e,i,t)),i+=n;if(s)for(;i`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`)),jt(2===o.rank&&4===o.shape[1],(()=>`Error in cropAndResize: boxes must be have size [${c},4] but had shape ${o.shape}.`)),jt(1===l.rank&&l.shape[0]===c,(()=>`Error in cropAndResize: boxInd must be have size [${c}] but had shape ${o.shape}.`)),jt(2===s.length,(()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${s.length}.`)),jt(s[0]>=1&&s[1]>=1,(()=>`cropSize must be atleast [1,1], but was ${s}`)),jt("bilinear"===r||"nearest"===r,(()=>`method must be bilinear or nearest, but was ${r}`));const u={image:a,boxes:o,boxInd:l},h={method:r,extrapolationValue:i,cropSize:s};return oo.runKernel(gs,u,h)}});const Nf=vo({flipLeftRight_:function(e){const t=yo(e,"image","flipLeftRight","float32");jt(4===t.rank,(()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`));const n={image:t};return oo.runKernel(Ls,n,{})}});const Of=vo({grayscaleToRGB_:function(e){const t=yo(e,"image","grayscaleToRGB"),n=t.rank-1,s=t.shape[n];jt(t.rank>=2,(()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`)),jt(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,Hh(t,r)}});const Df=vo({rgbToGrayscale_:function(e){const t=yo(e,"image","RGBToGrayscale"),n=t.rank-1,s=t.shape[n];jt(t.rank>=2,(()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`)),jt(3===s,(()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${s}.`));const r=t.dtype,i=Bl(t,"float32"),a=Vp([.2989,.587,.114]);let o;switch(t.rank){case 2:o=Sh("ij,j->i",i,a);break;case 3:o=Sh("ijk,k->ij",i,a);break;case 4:o=Sh("ijkl,l->ijk",i,a);break;case 5:o=Sh("ijklm,m->ijkl",i,a);break;case 6:o=Sh("ijklmn,n->ijklm",i,a);break;default:throw new Error("Not a valid tensor rank.")}return o=qh(o,-1),Bl(o,r)}});const Rf=vo({rotateWithOffset_:function(e,t,n=0,s=.5){const r=yo(e,"image","rotateWithOffset","float32");jt(4===r.rank,(()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`));const i={image:r},a={radians:t,fillValue:n,center:s};return oo.runKernel(Li,i,a)}});function Mf(e,t,n,s,r,i){null==s&&(s=.5),null==r&&(r=Number.NEGATIVE_INFINITY),null==i&&(i=0);const a=e.shape[0];return n=Math.min(n,a),jt(0<=s&&s<=1,(()=>`iouThreshold must be in [0, 1], but was '${s}'`)),jt(2===e.rank,(()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`)),jt(4===e.shape[1],(()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`)),jt(1===t.rank,(()=>"scores must be a 1D tensor")),jt(t.shape[0]===a,(()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${t.shape[0]}`)),jt(0<=i&&i<=1,(()=>`softNmsSigma must be in [0, 1], but was '${i}'`)),{maxOutputSize:n,iouThreshold:s,scoreThreshold:r,softNmsSigma:i}}const Ff=vo({nonMaxSuppression_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const i=yo(e,"boxes","nonMaxSuppression","float32"),a=yo(t,"scores","nonMaxSuppression","float32"),o=Mf(i,a,n,s,r),l={maxOutputSize:n=o.maxOutputSize,iouThreshold:s=o.iouThreshold,scoreThreshold:r=o.scoreThreshold};return oo.runKernel(Sr,{boxes:i,scores:a},l)}});function Bf(e,t,n){const s=function(e,t,n){return function(e,t,n){let s=0,r=e.length,i=0,a=!1;for(;s>>1);const o=n(t,e[i]);o>0?s=i+1:(r=i,a=!o)}return a?s:-s-1}(e,t,n||zf)}(e,t,n),r=s<0?-(s+1):s;e.splice(r,0,t)}function zf(e,t){return e>t?1:er&&c.push({score:t[e],boxIndex:e,suppressBeginIndex:0});c.sort(qf);const u=i>0?-.5/i:0,h=[],d=[];for(;h.length0;){const t=c.pop(),{score:n,boxIndex:i,suppressBeginIndex:a}=t;if(n=a;--n){const a=Gf(e,i,h[n]);if(a>=s){o=!0;break}if(t.score=t.score*Uf(s,u,a),t.score<=r)break}t.suppressBeginIndex=h.length,o||(t.score===n?(h.push(i),d.push(t.score)):t.score>r&&Bf(c,t,qf))}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 a&&(m.selectedScores=d),l&&(m.validOutputs=p),m}function Gf(e,t,n){const s=e.subarray(4*t,4*t+4),r=e.subarray(4*n,4*n+4),i=Math.min(s[0],s[2]),a=Math.min(s[1],s[3]),o=Math.max(s[0],s[2]),l=Math.max(s[1],s[3]),c=Math.min(r[0],r[2]),u=Math.min(r[1],r[3]),h=Math.max(r[0],r[2]),d=Math.max(r[1],r[3]),p=(o-i)*(l-a),f=(h-c)*(d-u);if(p<=0||f<=0)return 0;const m=Math.max(i,c),g=Math.max(a,u),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 Uf(e,t,n){const s=Math.exp(t*n*n);return n<=e?s:0}function qf(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}const jf=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY){const i=yo(e,"boxes","nonMaxSuppressionAsync"),a=yo(t,"scores","nonMaxSuppressionAsync"),o=Mf(i,a,n,s,r);n=o.maxOutputSize,s=o.iouThreshold,r=o.scoreThreshold;const l=await Promise.all([i.data(),a.data()]),c=l[0],u=l[1],{selectedIndices:h}=Lf(c,u,n,s,r);return i!==e&&i.dispose(),a!==t&&a.dispose(),Vp(h,"int32")};const Hf=vo({nonMaxSuppressionWithScore_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=0){const a=yo(e,"boxes","nonMaxSuppression"),o=yo(t,"scores","nonMaxSuppression"),l=Mf(a,o,n,s,r,i),c={boxes:a,scores:o},u={maxOutputSize:n=l.maxOutputSize,iouThreshold:s=l.iouThreshold,scoreThreshold:r=l.scoreThreshold,softNmsSigma:i=l.softNmsSigma},h=oo.runKernel(_r,c,u);return{selectedIndices:h[0],selectedScores:h[1]}}});const $f=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=0){const a=yo(e,"boxes","nonMaxSuppressionAsync"),o=yo(t,"scores","nonMaxSuppressionAsync"),l=Mf(a,o,n,s,r,i);n=l.maxOutputSize,s=l.iouThreshold,r=l.scoreThreshold,i=l.softNmsSigma;const c=await Promise.all([a.data(),o.data()]),u=c[0],h=c[1],{selectedIndices:d,selectedScores:p}=Vf(u,h,n,s,r,i);return a!==e&&a.dispose(),o!==t&&o.dispose(),{selectedIndices:Vp(d,"int32"),selectedScores:Vp(p)}};const Kf=vo({nonMaxSuppressionPadded_:function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=!1){const a=yo(e,"boxes","nonMaxSuppression"),o=yo(t,"scores","nonMaxSuppression"),l=Mf(a,o,n,s,r,null),c={boxes:a,scores:o},u={maxOutputSize:l.maxOutputSize,iouThreshold:l.iouThreshold,scoreThreshold:l.scoreThreshold,padToMaxOutputSize:i},h=oo.runKernel(Er,c,u);return{selectedIndices:h[0],validOutputs:h[1]}}});const Xf=async function(e,t,n,s=.5,r=Number.NEGATIVE_INFINITY,i=!1){const a=yo(e,"boxes","nonMaxSuppressionAsync"),o=yo(t,"scores","nonMaxSuppressionAsync"),l=Mf(a,o,n,s,r,null),c=l.maxOutputSize,u=l.iouThreshold,h=l.scoreThreshold,[d,p]=await Promise.all([a.data(),o.data()]),{selectedIndices:f,validOutputs:m}=Pf(d,p,c,u,h,i);return a!==e&&a.dispose(),o!==t&&o.dispose(),{selectedIndices:Vp(f,"int32"),validOutputs:$l(m,"int32")}};const Zf=vo({resizeBilinear_:function(e,t,n=!1,s=!1){const r=yo(e,"images","resizeBilinear");jt(3===r.rank||4===r.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`)),jt(2===t.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`)),jt(!1===s||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let i=r,a=!1;3===r.rank&&(a=!0,i=Fu(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:i},l={alignCorners:n,halfPixelCenters:s,size:t},c=oo.runKernel(jr,o,l);return a?Fu(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Yf=vo({resizeNearestNeighbor_:function(e,t,n=!1,s=!1){const r=yo(e,"images","resizeNearestNeighbor");jt(3===r.rank||4===r.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`)),jt(2===t.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`)),jt("float32"===r.dtype||"int32"===r.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),jt(!1===s||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let i=r,a=!1;3===r.rank&&(a=!0,i=Fu(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const[]=t,o={images:i},l={alignCorners:n,halfPixelCenters:s,size:t},c=oo.runKernel(Ur,o,l);return a?Fu(c,[c.shape[1],c.shape[2],c.shape[3]]):c}});const Qf=vo({threshold_:function(e,t="binary",n=!1,s=.5){const r=yo(e,"image","threshold"),i=r.shape[0]*r.shape[1];let a,o,l,c,u=Gl(Vp([s]),255);if(jt(3===r.rank,(()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`)),jt(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]}.`)),jt("int32"===r.dtype||"float32"===r.dtype,(()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`)),jt("otsu"===t||"binary"===t,(()=>`Method must be binary or otsu, but was ${t}`)),3===r.shape[2]){[a,o,l]=Dp(r,[1,1,1],-1);const e=Gl(a,.2989),t=Gl(o,.587),n=Gl(l,.114);c=Pl(Pl(e,t),n)}else c=e;if("otsu"===t){u=function(e,t){let n,s,r,i,a,o,l=Vp([-1]),c=Vp([0]),u=Vp([0]);for(let h=0;h`Error in transform: image must be rank 4,but got rank ${a.rank}.`)),jt(2===o.rank&&(o.shape[0]===a.shape[0]||1===o.shape[0])&&8===o.shape[1],(()=>"Error in transform: Input transform should be batch x 8 or 1 x 8")),jt(null==i||2===i.length,(()=>`Error in transform: outputShape must be [height, width] or null, but got ${i}.`));const l={image:a,transforms:o},c={interpolation:n,fillMode:s,fillValue:r,outputShape:i};return oo.runKernel(Ni,l,c)}});const em=vo({bandPart_:function(e,t,n){const s=yo(e,"a","bandPart");jt(s.rank>=2,(()=>`bandPart(): Rank must be at least 2, got ${s.rank}.`));const r=s.shape,[i,a]=s.shape.slice(-2);let o,l;"number"==typeof t?(jt(t%1==0,(()=>`bandPart(): numLower must be an integer, got ${t}.`)),jt(t<=i,(()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${i}).`)),o=yo(t<0?i:t,"numLower","bandPart")):(jt("int32"===t.dtype,(()=>"bandPart(): numLower's dtype must be an int32.")),o=xh(sd(t,0),i,Td(t,i))),"number"==typeof n?(jt(n%1==0,(()=>`bandPart(): numUpper must be an integer, got ${n}.`)),jt(n<=a,(()=>`bandPart(): numUpper (${n}) must not be greater than the number of columns (${a}).`)),l=yo(n<0?a:n,"numUpper","bandPart")):(jt("int32"===n.dtype,(()=>"bandPart(): numUpper's dtype must be an int32.")),l=xh(sd(n,0),a,Td(n,a)));const c=Fu(ap(0,i,1,"int32"),[-1,1]),u=ap(0,a,1,"int32"),h=rc(c,u),d=fd(rd(h,o),Yh(h,cd(l))),p=Sd([i,a],s.dtype);return Fu(Bp(Jp(Fu(s,[-1,i,a])).map((e=>xh(d,e,p)))),r)}});const tm=vo({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,jt(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=Dp(e,e.shape[0],0).map((e=>Fp(e,[0])));jt(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{jt(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=$h(n),i=zl(e);const a=Wp([[1]],[1,1]);let o=zl(a);const l=n>=s?s:n;for(let e=0;e{const t=Wu(i,[e,e],[n-e,1]),l=Wh(t),c=Wu(i,[e,e],[1,1]),u=xh(Zh(c,0),Wp([[-1]]),Wp([[1]])),h=rc(c,Gl(u,l)),d=Wl(t,h);o=1===d.shape[0]?zl(a):Lu([a,Wu(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);const p=cd(Wl(Pu(u,h),l)),f=Wu(i,[e,0],[n-e,s]),m=Gl(p,o),g=af(o);if(0===e)i=rc(f,Pu(m,Pu(g,f)));else{const t=rc(f,Pu(m,Pu(g,f)));i=Lu([Wu(i,[0,0],[e,s]),t],0)}const y=af(m),b=Wu(r,[0,e],[n,r.shape[1]-e]);if(0===e)r=rc(b,Pu(Pu(b,o),y));else{const t=rc(b,Pu(Pu(b,o),y));r=Lu([Wu(r,[0,0],[n,e]),t],1)}return[o,i,r]})),Io([t,l,c])}return!t&&n>s&&(r=Wu(r,[0,0],[n,s]),i=Wu(i,[0,0],[s,s])),[r,i]}))}const sm=vo({qr_:function(e,t=!1){if(jt(e.rank>=2,(()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`)),2===e.rank)return nm(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce(((e,t)=>e*t)),s=Jp(Fu(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],i=[];s.forEach((e=>{const[n,s]=nm(e,t);r.push(n),i.push(s)}));return[Fu(Bp(r,0),e.shape),Fu(Bp(i,0),e.shape)]}}});var rm,im;(im=rm||(rm={}))[im.NONE=0]="NONE",im[im.MEAN=1]="MEAN",im[im.SUM=2]="SUM",im[im.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS";const am=vo({computeWeightedLoss_:function(e,t,n=rm.SUM_BY_NONZERO_WEIGHTS){const s=yo(e,"losses","computeWeightedLoss");let r=null;null!=t&&(r=yo(t,"weights","computeWeightedLoss"));const i=null==r?s:Gl(s,r);if(n===rm.NONE)return i;if(n===rm.SUM)return Ph(i);if(n===rm.MEAN){if(null==r)return kd(i);{const e=s.size/r.size,t=Wl(Ph(i),Ph(r));return e>1?Wl(t,$l(e)):t}}if(n===rm.SUM_BY_NONZERO_WEIGHTS){if(null==r)return Wl(Ph(i),$l(s.size));{const e=Gl(r,Ed(s.shape)),t=Bl(Ph(Md(e,$l(0))),"float32");return Wl(Ph(i),t)}}throw Error(`Unknown reduction: ${n}`)}});const om=vo({absoluteDifference_:function(e,t,n,s=rm.SUM_BY_NONZERO_WEIGHTS){const r=yo(e,"labels","absoluteDifference"),i=yo(t,"predictions","absoluteDifference");let a=null;null!=n&&(a=yo(n,"weights","absoluteDifference")),Ht(r.shape,i.shape,"Error in absoluteDifference: ");const o=ac(rc(r,i));return am(o,a,s)}});const lm=vo({cosineDistance_:function(e,t,n,s,r=rm.SUM_BY_NONZERO_WEIGHTS){const i=yo(e,"labels","cosineDistance"),a=yo(t,"predictions","cosineDistance");let o=null;null!=s&&(o=yo(s,"weights","cosineDistance")),Ht(i.shape,a.shape,"Error in cosineDistance: ");const l=$l(1),c=rc(l,Ph(Gl(i,a),n,!0));return am(c,o,r)}});const cm=vo({hingeLoss_:function(e,t,n,s=rm.SUM_BY_NONZERO_WEIGHTS){let r=yo(e,"labels","hingeLoss");const i=yo(t,"predictions","hingeLoss");let a=null;null!=n&&(a=yo(n,"weights","hingeLoss")),Ht(r.shape,i.shape,"Error in hingeLoss: ");const o=$l(1);r=rc(Gl($l(2),r),o);const l=cp(rc(o,Gl(r,i)));return am(l,a,s)}});const um=vo({huberLoss_:function(e,t,n,s=1,r=rm.SUM_BY_NONZERO_WEIGHTS){const i=yo(e,"labels","huberLoss"),a=yo(t,"predictions","huberLoss");let o=null;null!=n&&(o=yo(n,"weights","huberLoss")),Ht(i.shape,a.shape,"Error in huberLoss: ");const l=$l(s),c=ac(rc(a,i)),u=Td(c,l),h=rc(c,u),d=Pl(Gl($l(.5),ql(u)),Gl(l,h));return am(d,o,r)}});const hm=vo({logLoss_:function(e,t,n,s=1e-7,r=rm.SUM_BY_NONZERO_WEIGHTS){const i=yo(e,"labels","logLoss"),a=yo(t,"predictions","logLoss");let o=null;null!=n&&(o=yo(n,"weights","logLoss")),Ht(i.shape,a.shape,"Error in logLoss: ");const l=$l(1),c=$l(s),u=cd(Gl(i,od(Pl(a,c)))),h=Gl(rc(l,i),od(Pl(rc(l,a),c))),d=rc(u,h);return am(d,o,r)}});const dm=vo({meanSquaredError_:function(e,t,n,s=rm.SUM_BY_NONZERO_WEIGHTS){const r=yo(e,"labels","meanSquaredError"),i=yo(t,"predictions","meanSquaredError");let a=null;null!=n&&(a=yo(n,"weights","meanSquaredError")),Ht(r.shape,i.shape,"Error in meanSquaredError: ");const o=Mp(r,i);return am(o,a,s)}});const pm=vo({sigmoidCrossEntropy_:function(e,t,n,s=0,r=rm.SUM_BY_NONZERO_WEIGHTS){let i=yo(e,"multiClassLabels","sigmoidCrossEntropy");const a=yo(t,"logits","sigmoidCrossEntropy");let o=null;if(null!=n&&(o=yo(n,"weights","sigmoidCrossEntropy")),Ht(i.shape,a.shape,"Error in sigmoidCrossEntropy: "),s>0){const e=$l(s),t=$l(1),n=$l(.5);i=Pl(Gl(i,rc(t,e)),Gl(n,e))}const l=function(e,t){const n=yo(e,"labels","sigmoidCrossEntropyWithLogits"),s=yo(t,"logits","sigmoidCrossEntropyWithLogits");Ht(n.shape,s.shape,"Error in sigmoidCrossEntropyWithLogits: ");const r=cp(s),i=Gl(s,n),a=ld(Uh(cd(ac(s))));return Pl(rc(r,i),a)}(i,a);return am(l,o,r)}});const fm=vo({softmaxCrossEntropy_:function(e,t,n,s=0,r=rm.SUM_BY_NONZERO_WEIGHTS){let i=yo(e,"onehotLabels","softmaxCrossEntropy");const a=yo(t,"logits","softmaxCrossEntropy");let o=null;if(null!=n&&(o=yo(n,"weights","softmaxCrossEntropy")),Ht(i.shape,a.shape,"Error in softmaxCrossEntropy: "),s>0){const e=$l(s),t=$l(1),n=$l(i.shape[1]);i=Pl(Gl(i,rc(t,e)),Wl(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=Hl(((e,t,s)=>{const r=pd(t,[n],!0),i=rc(Bl(t,"float32"),r);s([e,i]);const a=cd(Gl(i,e));return{value:Ph(a,[n]),gradFunc:(e,t)=>{const[s,r]=t,i=Dh(e.shape,[n]);return[Gl(Fu(e,i),rc(Bl(s,"float32"),Uh(r))),Gl(Fu(e,i),rc(Uh(r),Bl(s,"float32")))]}}}));return s(e,t)}(i,a);return am(l,o,r)}});const mm={fft:Ip,ifft:Np,rfft:Rp,irfft:Op},gm={hammingWindow:Sf,hannWindow:Ef,frame:_f,stft:Tf},ym={flipLeftRight:Nf,grayscaleToRGB:Of,resizeNearestNeighbor:Yf,resizeBilinear:Zf,rgbToGrayscale:Df,rotateWithOffset:Rf,cropAndResize:If,nonMaxSuppression:Ff,nonMaxSuppressionAsync:jf,nonMaxSuppressionWithScore:Hf,nonMaxSuppressionWithScoreAsync:$f,nonMaxSuppressionPadded:Kf,nonMaxSuppressionPaddedAsync:Xf,threshold:Qf,transform:Jf},bm={bandPart:em,gramSchmidt:tm,qr:sm},wm={absoluteDifference:om,computeWeightedLoss:am,cosineDistance:lm,hingeLoss:cm,huberLoss:um,logLoss:hm,meanSquaredError:dm,sigmoidCrossEntropy:pm,softmaxCrossEntropy:fm},vm={sparseFillEmptyRows:vo({sparseFillEmptyRows_:function(e,t,n,s){const r=yo(e,"indices","sparseFillEmptyRows","int32"),i=yo(t,"values","sparseFillEmptyRows"),a=yo(n,"denseShape","sparseFillEmptyRows","int32"),o=yo(s,"defaultValue","sparseFillEmptyRows",i.dtype);if(2!==r.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==i.rank)throw new Error(`Values should be Tensor1D but received shape ${i.shape}`);if(1!==a.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(0!==o.rank)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);const l={indices:r,values:i,denseShape:a,defaultValue:o},c=oo.runKernel(pi,l);return{outputIndices:c[0],outputValues:c[1],emptyRowIndicator:c[2],reverseIndexMap:c[3]}}}),sparseReshape:vo({sparseReshape_:function(e,t,n){const s=yo(e,"inputIndices","sparseReshape","int32"),r=yo(t,"inputShape","sparseReshape","int32"),i=yo(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!==i.rank)throw new Error(`New shape should be Tensor1D but received shape ${i.shape}`);const a={inputIndices:s,inputShape:r,newShape:i},o=oo.runKernel(fi,a);return{outputIndices:o[0],outputShape:o[1]}}}),sparseSegmentMean:vo({sparseSegmentMean_:function(e,t,n){const s=yo(e,"data","sparseSegmentMean"),r=yo(t,"indices","sparseSegmentMean","int32"),i=yo(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!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${i.shape}`);const a={data:s,indices:r,segmentIds:i};return oo.runKernel(mi,a)}}),sparseSegmentSum:vo({sparseSegmentSum_:function(e,t,n){const s=yo(e,"data","sparseSegmentSum"),r=yo(t,"indices","sparseSegmentSum","int32"),i=yo(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!==i.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${i.shape}`);const a={data:s,indices:r,segmentIds:i};return oo.runKernel(gi,a)}})},Am={stringNGrams:vo({stringNGrams_:function(e,t,n,s,r,i,a,o){const l=yo(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 c=yo(t,"dataSplits","stringNGrams");if("int32"!==c.dtype)throw new Error("Data splits must be of datatype int32");const u={separator:n,nGramWidths:s,leftPad:r,rightPad:i,padWidth:a,preserveShortSequences:o},h={data:l,dataSplits:c},d=oo.runKernel(xi,h,u);return{nGrams:d[0],nGramsSplits:d[1]}}}),stringSplit:vo({stringSplit_:function(e,t,n=!0){const s=yo(e,"input","stringSplit","string"),r=yo(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 i={skipEmpty:n},a={input:s,delimiter:r},o=oo.runKernel(Ci,a,i);return{indices:o[0],values:o[1],shape:o[2]}}}),stringToHashBucketFast:vo({stringToHashBucketFast_:function(e,t){const n=yo(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 oo.runKernel(ki,r,s)}}),staticRegexReplace:vo({staticRegexReplace_:function(e,t,n,s=!0){const r=yo(e,"input","staticRegexReplace","string"),i={pattern:t,rewrite:n,replaceGlobal:s};return oo.runKernel(vi,{x:r},i)}})};const xm=class{static sgd(e){return new dc(e)}static momentum(e,t,n=!1){return new pc(e,t,n)}static rmsprop(e,t=.9,n=0,s=null,r=!1){return new fc(e,t,n,s,r)}static adam(e=.001,t=.9,n=.999,s=null){return new ic(e,t,n,s)}static adadelta(e=.001,t=.95,n=null){return new ec(e,t,n)}static adamax(e=.002,t=.9,n=.999,s=null,r=0){return new hc(e,t,n,s,r)}static adagrad(e,t=.1){return new nc(e,t)}},Cm="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function km(){return new Promise((e=>Cm((()=>e()))))}function Sm(e,t){const n=e[0].length;e.forEach(((e,t)=>{jt(e.length===n,(()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`))})),jt(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 i=0;i`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 Em(e,t){const n=e[0].slice();for(let s=1;s=0)if(o>=0){if(o!==i)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${r+e}] = ${i} but shape[${r+e}] = ${o}`)}else s[a]=i}return s}function Nm(e){const t={FIRST_DIM_SIZE:_m.FIRST_DIM_SIZE,VALUE_ROWIDS:_m.VALUE_ROWIDS,ROW_LENGTHS:_m.ROW_LENGTHS,ROW_SPLITS:_m.ROW_SPLITS,ROW_LIMITS:_m.ROW_LIMITS,ROW_STARTS:_m.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]===_m.FIRST_DIM_SIZE?e.length-1:e.length}function Dm(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}`)}}(Tm=_m||(_m={}))[Tm.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",Tm[Tm.VALUE_ROWIDS=1]="VALUE_ROWIDS",Tm[Tm.ROW_LENGTHS=2]="ROW_LENGTHS",Tm[Tm.ROW_SPLITS=3]="ROW_SPLITS",Tm[Tm.ROW_LIMITS=4]="ROW_LIMITS",Tm[Tm.ROW_STARTS=5]="ROW_STARTS";const Rm=30;function Mm(e){return e<=Rm?e:dn(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===Kt(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const r=t.shape,i=r[r.length-1];let a=1;for(let e=0;ee/c)),1].slice(0,i);return[l,a,c,u]}const Gm=1.7580993408473768,Um=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,ag=",",og="...";function lg(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(ig,"").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);jt(-1===s.indexOf(og),(()=>`The ellipsis notation ("${og}") is not supported yet.`));const i=s.split(ag),a=i.length;if(t!==a)throw new Error(`Expected ${a} input tensors, received ${t}`);if(a>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 ug(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{jt(t.reduce(((e,t)=>(-1===t&&(e+=1),e)),0)<=1,(()=>"There should be only one negative value in split array."));const r=t.indexOf(-1);if(-1!==r){const s=t.reduce(((e,t)=>t>0?e+t:e));t[r]=e.shape[n]-s}jt(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 Ag(e,t){return`Input to reshape is a SparseTensor with ${Kt(e)}\n dense values, but the requested shape requires a multiple of ${Kt(t)}. inputShape=${e} outputShape= ${t}`}function xg(e,t){return`Input to reshape is a tensor with ${Kt(e)} dense values, but the requested shape has ${Kt(t)}. inputShape=${e} outputShape=${t}`}function Cg(){return"segment ids must be >= 0"}function kg(){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<=Rm?(n=e,s=!0):n=dn(e,Math.floor(Math.sqrt(e)));!s;)n>t||n===e?s=!0:n=dn(e,n+1);return n}function Tg(e,t,n){const s=[],r=e.length;for(let i=0;ir))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${s}`);if(s<0&&(s+=r),s>i)throw new Error(`batchDims (${s}) must be less than rank(x) (\n ${i}).`);if(nya(e)))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function Og(e){return e.map((e=>ga(e)))}!function(){for(const e of mc)Ql(e)}();const Dg={kernelName:On,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,zp(Bl(n,"float32"),-1))}}},Rg={kernelName:Dn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=ql(Bl(n,"float32")),s=Ul(rc($l(1),t));return cd(Wl(e,s))}}}},Mg={kernelName:Rn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Ul(rc(ql(Bl(n,"float32")),1));return Wl(e,t)}}}},Fg={kernelName:Mn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{let t=e;const s=lc(n.shape,r);return s.length>0&&(t=Ph(t,s)),Fu(t,n.shape)},b:()=>{let t=e;const n=lc(s.shape,r);return n.length>0&&(t=Ph(t,n)),Fu(t,s.shape)}}}},Bg={kernelName:Fn,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach(((t,s)=>{n[s]=()=>e.clone()})),n}},zg={kernelName:Ln,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>jl(n)}}},Lg={kernelName:Pn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>jl(n)}}},Pg={kernelName:Vn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,Ul(rc($l(1),ql(Bl(n,"float32")))))}}},Vg={kernelName:Wn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Ul(Pl($l(1),ql(Bl(n,"float32"))));return Wl(e,t)}}}},Wg={kernelName:qn,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{const t=Pl(ql(n),ql(s));let i=Gl(e,Wl(s,t));const a=lc(n.shape,r);return a.length>0&&(i=Ph(i,a)),Fu(i,n.shape)},b:()=>{const t=Pl(ql(n),ql(s));let i=cd(Gl(e,Wl(n,t)));const a=lc(s.shape,r);return a.length>0&&(i=Ph(i,a)),Fu(i,s.shape)}}}},Gg={kernelName:Gn,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,Pl(ql(Bl(n,"float32")),1))}}},Ug={kernelName:Un,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,rc($l(1),ql(Bl(n,"float32"))))}}};const qg=vo({avgPool3dGrad_:function(e,t,n,s,r,i){const a=yo(e,"dy","avgPool3dGrad"),o=yo(t,"input","avgPool3dGrad");let l=a,c=o,u=!1;4===o.rank&&(u=!0,l=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]]),c=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),jt(5===l.rank,(()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`)),jt(5===c.rank,(()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${c.rank}.`)),Mu("avgPool3dGrad",r,i);const h={dy:l,input:c},d={filterSize:n,strides:s,pad:r,dimRoundingMode:i},p=oo.runKernel(Kn,h,d);return u?Fu(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),jg={kernelName:$n,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:i,pad:a,dimRoundingMode:o}=n;return{x:()=>qg(e,s,r,i,a,o)}}};const Hg=vo({avgPoolGrad_:function(e,t,n,s,r){const i=yo(e,"dy","avgPoolGrad"),a=yo(t,"input","avgPoolGrad");jt(a.rank===i.rank,(()=>`Rank of input (${a.rank}) does not match rank of dy (${i.rank})`));let o=a,l=i,c=!1;3===a.rank&&(c=!0,o=Fu(a,[1,a.shape[0],a.shape[1],a.shape[2]]),l=Fu(i,[1,i.shape[0],i.shape[1],i.shape[2]])),jt(4===l.rank,(()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`)),jt(4===o.rank,(()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${o.rank}.`));const u={dy:l,input:o},h={filterSize:n,strides:s,pad:r},d=oo.runKernel(Hn,u,h);return c?Fu(d,[d.shape[1],d.shape[2],d.shape[3]]):d}}),$g={kernelName:jn,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{filterSize:r,strides:i,pad:a}=n;return{x:()=>Hg(e,s,r,i,a)}}},Kg={kernelName:Xn,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[s,r]=t,{transposeA:i,transposeB:a}=n;return i||a?!i&&a?{a:()=>Pu(e,r,!1,!1),b:()=>Pu(e,s,!0,!1)}:i&&!a?{a:()=>Pu(r,e,!1,!0),b:()=>Pu(s,e,!1,!1)}:{a:()=>Pu(r,e,!0,!0),b:()=>Pu(e,s,!0,!0)}:{a:()=>Pu(e,r,!1,!0),b:()=>Pu(s,e,!0,!1)}}},Xg={kernelName:Zn,gradFunc:(e,t,n)=>{const{blockShape:s,crops:r}=n;return{x:()=>Ud(e,s,r)}}},Zg={kernelName:"BroadcastTo",gradFunc:(e,t,n)=>{const s=n,r=s.inputShape,i=s.shape,a=Array.from(i);for(let e=r.length-1;e>=0;e--)if(r[e]===i[e])a[e]=1;else if(1!==r[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${i}].`);const o=[];for(let e=0;e1&&o.push(e);return{x:()=>Ph(e,o,!0)}}},Yg={kernelName:es,gradFunc:e=>({x:()=>e.clone()})},Qg={kernelName:ts,gradFunc:e=>({x:()=>jl(e)})},Jg={kernelName:ns,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{clipValueMin:r,clipValueMax:i}=n;return{x:()=>xh(fd(Yh(s,r),rd(s,i)),e,jl(e))}}},ey={kernelName:rs,inputsToSave:["x"],gradFunc:Dg.gradFunc},ty={kernelName:is,saveAllInputs:!0,gradFunc:(e,t,n)=>{const s=t.map((e=>e.shape)),{axis:r}=n,i=tn(r,t[0].shape)[0],a=s.map((e=>e[i]));return Dp(e,a,i).map((e=>()=>e))}},ny={kernelName:as,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{dilations:i,strides:a,pad:o,dataFormat:l}=n;return jt(Nu(i),(()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`)),{x:()=>oh(s.shape,e,r,a,o,l),filter:()=>mf(s,e,r.shape,a,o,l)}}},sy={kernelName:ls,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,{strides:i,pad:a,dataFormat:o,dimRoundingMode:l}=n;return{dy:()=>ih(e,r,i,a,o,1,l),filter:()=>mf(e,s,r.shape,i,a,o,l)}}};const ry=vo({conv3DBackpropFilter_:function(e,t,n,s,r){let i=e;4===e.rank&&(i=Fu(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let a=t;4===a.rank&&(a=Fu(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),jt(5===i.rank,(()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${i.shape}.`)),jt(5===a.rank,(()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${a.shape}.`)),jt(5===n.length,(()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`)),jt(i.shape[4]===n[3],(()=>`Error in conv3dDerFilter: depth of input ${i.shape[4]}) must match input depth in filter (${n[3]}.`)),jt(a.shape[4]===n[4],(()=>`Error in conv3dDerFilter: depth of dy (${a.shape[4]}) must match output depth for filter (${n[4]}).`));const o={x:i,dy:a},l={strides:s,pad:r,filterShape:n};return oo.runKernel(us,o,l)}}),iy={kernelName:cs,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:i}=n;jt(Nu(s),(()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`));const[a,o]=t;return{x:()=>uh(a.shape,e,o,r,i),filter:()=>ry(a,e,o.shape,r,i)}}},ay={kernelName:ds,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(cd(xp(Bl(n,"float32"))),e)}}},oy={kernelName:ps,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(Cp(Bl(n,"float32")),e)}}},ly={kernelName:ms,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r,exclusive:i,reverse:a}=n;return{x:()=>{const t=Mh([r],s.rank);let n=mh(e,r,i,!a);return null!=t&&(n=af(n,t)),n}}}},cy={kernelName:ws,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:s,strides:r,pad:i,dimRoundingMode:a}=n,o=null==s?[1,1]:s;jt(Nu(o),(()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${o}'`));const[l,c]=t;return jt(4===l.rank,(()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`)),jt(4===c.rank,(()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${c.rank}.`)),jt(l.shape[3]===c.shape[2],(()=>`Error in gradient of depthwiseConv2d: number of input channels (${l.shape[3]}) must match the inChannels dimension in filter ${c.shape[2]}.`)),jt(Ou(r,o),(()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${o}'.`)),Mu("depthwiseConv2d",i,a),{x:()=>xf(l.shape,e,c,r,i,o,a),filter:()=>Af(l,e,c.shape,r,i,o,a)}}},uy={kernelName:Cs,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[s,r]=t,i={x:s,filter:r,dy:e},a={x:s,filter:r,dy:e};return{x:()=>oo.runKernel(ks,i,n),filter:()=>oo.runKernel(Ss,a,n)}}},hy={kernelName:Is,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,s={dy:e,y:n};return{x:()=>oo.runKernel(Ns,s)}}},dy={kernelName:Os,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Gl(Uh(cd(ql(n))),2/Math.sqrt(Math.PI));return{x:()=>Gl(e,s)}}},py={kernelName:Rs,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,n)}}},fy={kernelName:Ms,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>Fu(e,n.shape)}}},my={kernelName:Fs,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,Uh(n))}}},gy={kernelName:Ps,gradFunc:e=>({x:()=>jl(e)})},yy={kernelName:Vs,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{const t=Wl(e,Bl(s,"float32")),i=lc(n.shape,r);return i.length>0?Fu(Ph(t,i),n.shape):t},b:()=>{let t=Gl(e,Bl(n,"float32"));const i=lc(s.shape,r);i.length>0&&(t=Fu(Ph(t,i),s.shape));const a=ql(s);return cd(Wl(t,Bl(a,"float32")))}}}},by={kernelName:Ws,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:s}=n,[r,i,a,o]=t,l=null==o?$l(1):o,c=lc(i.shape,r.shape),u=[];if(1===i.rank){for(let e=0;e1===i.rank?Fu(Gl(Gl(e,Hh(Fu(p,[1,1,1,i.shape[0]]),u)),l),r.shape):Fu(Gl(Gl(e,p),l),r.shape),mean:()=>{let e=Gl(Gl(p,$l(-1)),d);return 1===i.rank&&(e=Ph(e,c)),Fu(e,i.shape)},variance:()=>{let e=Gl(Gl(f,h),d);return 1===i.rank&&(e=Ph(e,c)),Fu(e,i.shape)},scale:()=>{const t=Gl(h,p);let n=Gl(e,t);return 1===i.rank&&(n=Ph(n,c)),Fu(n,i.shape)},offset:()=>{let t=e;return 1===i.rank&&(t=Ph(t,c)),Fu(t,i.shape)}}}},wy={kernelName:Gs,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{const[s,r]=t,{axis:i,batchDims:a}=n,o=tn(i,s.shape)[0],l=(e,t,n)=>()=>{const s=e.shape,r=t.size,a=s.slice(0,o),l=a.length,c=s.slice(i,s.length).slice(1),u=c.length,h=vy(0,l),d=vy(l+1,l+1+u),p=Ay([a,[r],c]),f=Fu(n,p),m=Fu(t,[r]),g=Ay([[l],h,d]),y=af(f,g);let b=Qp(y,m,e.shape[o]);const w=Fh(g);return b=af(b,w),b};if(1===a){const t=s.shape[0],n=s.split(t,0);return{x:()=>{const t=Bp(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:()=>jl(n),b:()=>jl(s)}}},Cy={kernelName:Hs,gradFunc:e=>({x:()=>Bl(e,"float32")})},ky={kernelName:Xs,gradFunc:e=>({x:()=>jl(e)})},Sy={kernelName:Zs,gradFunc:e=>({x:()=>jl(e)})},Ey={kernelName:Ys,gradFunc:e=>({x:()=>jl(e)})},_y={kernelName:Qs,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{alpha:r}=n,i=Zh(s,0);return{x:()=>xh(i,e,Gl(e,r))}}},Ty={kernelName:sr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,Pl(n,1))}}},Iy={kernelName:nr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,Bl(n,"float32"))}}},Ny={kernelName:"LogSoftmax",inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;return{logits:()=>{const t=Uh(s);return rc(e,Gl(Ph(e,r,!0),t))}}}};const Oy=vo({localResponseNormalizationBackprop_:function(e,t,n,s=5,r=1,i=1,a=.5){const o={x:e,y:t,dy:n},l={depthRadius:s,bias:r,alpha:i,beta:a};return oo.runKernel(lr,o,l)}}),Dy={kernelName:or,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{depthRadius:i,bias:a,alpha:o,beta:l}=n;return{x:()=>Oy(s,r,e,i,a,o,l)}}};function Ry(e,t,n,s){return t.rankGl(e,Bl(Ah(n,t),e.dtype))}}const My={kernelName:cr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{reductionIndices:r}=s,i=t[0],a=Ry(e,t[1],i,tn(r,i.shape));return{x:()=>a.x()}}},Fy={kernelName:ur,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Gl(e,Bl(Yh(n,s),"float32")),b:()=>Gl(e,Bl(sd(n,s),"float32"))}}};const By=vo({maxPool3dGrad_:function(e,t,n,s,r,i,a){const o=yo(e,"dy","maxPool3dGrad"),l=yo(t,"input","maxPool3dGrad"),c=yo(n,"output","maxPool3dGrad");let u=o,h=l,d=c,p=!1;4===l.rank&&(p=!0,u=Fu(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),h=Fu(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),d=Fu(c,[1,c.shape[0],c.shape[1],c.shape[2],c.shape[3]])),jt(5===u.rank,(()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${u.rank}.`)),jt(5===h.rank,(()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${h.rank}.`)),jt(5===d.rank,(()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${d.rank}.`)),Mu("maxPool3dGrad",i,a);const f={dy:u,input:h,output:d},m={filterSize:s,strides:r,pad:i,dimRoundingMode:a},g=oo.runKernel(fr,f,m);return p?Fu(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),zy={kernelName:pr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=n;return{x:()=>By(e,s,r,i,a,o,l)}}};const Ly=vo({maxPoolGrad_:function(e,t,n,s,r,i,a){const o=yo(e,"dy","maxPoolGrad"),l=yo(t,"input","maxPoolGrad"),c=yo(n,"output","maxPoolGrad");jt(l.rank===o.rank,(()=>`Rank of input (${l.rank}) does not match rank of dy (${o.rank})`)),jt(4===o.rank,(()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${o.rank}.`)),jt(4===l.rank,(()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`)),Mu("maxPoolGrad",i,a);const u={dy:o,input:l,output:c},h={filterSize:s,strides:r,pad:i,dimRoundingMode:a};return oo.runKernel(dr,u,h)}}),Py={kernelName:Nr,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:s}=n;return Jp(e,s).map((e=>()=>e))}},Vy={kernelName:Or,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,i=r.map((e=>e[0]));return{x:()=>Wu(e,i,s.shape)}}};function Wy(e,t,n){const s=e.shape.length,r=s-n.length,i=Mh(n,s);let a=e;null!=i&&(a=af(e,i));const o=a.shape.slice(),l=o.splice(s-n.length,n.length).reduce(((e,t)=>e*t),1);o.push(l);let c=function(e,t,n){const s=e.shape.slice();s[n]=1;const r=Fu(t,s),i=fh(e,n,!0,!1),a=fh(e,n,!0,!0),o=Gl(i,a);return Gl(r,o)}(a.reshape(o),t,r);if(c=c.reshape(a.shape),null!=i){const e=Fh(i);c=af(c,e)}return c}const Gy={kernelName:ui,gradFunc:(e,t,n)=>{const{blockShape:s,paddings:r}=n;return{x:()=>qu(e,s,r)}}},Uy={kernelName:hi,gradFunc:(e,t,n)=>{const{axis:s}=n;return{x:()=>Lu(e,s)}}};const qy=[Dg,Rg,Mg,Fg,Bg,zg,Lg,Pg,Vg,Wg,Gg,Ug,jg,$g,Kg,Xg,Zg,Yg,Qg,Jg,ey,ty,sy,ny,iy,ay,oy,ly,cy,uy,{kernelName:_s,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{const t=Wl(e,Bl(s,"float32")),i=lc(n.shape,r);return i.length>0?Fu(Ph(t,i),n.shape):t},b:()=>{let t=Gl(e,Bl(n,"float32"));const i=lc(s.shape,r);i.length>0&&(t=Fu(Ph(t,i),s.shape));const a=ql(s);return cd(Wl(t,Bl(a,"float32")))}}}},hy,dy,py,fy,my,yy,gy,by,wy,xy,Cy,ky,Sy,Ey,_y,Ty,Iy,Ny,Dy,My,My,Fy,zy,{kernelName:hr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s,r]=t,{filterSize:i,strides:a,pad:o}=n;return{x:()=>Ly(e,s,r,i,a,o)}}},{kernelName:gr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n,i=tn(r,s.shape),a=Kt(Oh(s.shape,i)[1]);return{x:()=>{const t=s.shape.slice();i.forEach((e=>{t[e]=1}));const n=Fu(e,t);return Wl(Gl(n,Ed(s.shape,"float32")),a)}}}},{kernelName:yr,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const s=n,{axis:r}=s,[i,a]=t,o=Ry(e,a,i,tn(r,i.shape));return{x:()=>o.x()}}},{kernelName:br,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t;return{a:()=>Gl(e,Bl(rd(n,s),"float32")),b:()=>Gl(e,Bl(Zh(n,s),"float32"))}}},{kernelName:wr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const s=t[0],{paddings:r}=n,i=r.map((e=>e[0]));return{x:()=>Wu(e,i,s.shape)}}},{kernelName:vr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{const t=lc(n.shape,r);return t.length>0?Fu(Ph(e,t),n.shape):e},b:()=>{const t=Gl(e,cd(Kh(Wl(n,s)))),i=lc(s.shape,r);return i.length>0?Fu(Ph(t,i),s.shape):t}}}},{kernelName:xr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{const t=Gl(e,Bl(s,"float32")),i=lc(n.shape,r);return i.length>0?Fu(Ph(t,i),n.shape):t},b:()=>{const t=Gl(e,Bl(n,"float32")),i=lc(s.shape,r);return i.length>0?Fu(Ph(t,i),s.shape):t}}}},{kernelName:Cr,gradFunc:e=>({x:()=>cd(e)})},{kernelName:Ir,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>Sd(n.shape,"float32")}}},{kernelName:Tr,gradFunc:e=>({x:()=>jl(e)})},Py,Vy,Vy,{kernelName:Dr,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,s,r]=t,i=n,a=s,o=cc(i.shape,a.shape);return{a:()=>{const t=Bl(a,"float32");let n=Gl(e,Gl(t,sc(i,rc(t,$l(1)))));const s=lc(i.shape,o);return s.length>0&&(n=Ph(n,s)),Fu(n,i.shape)},b:()=>{const t=Zh(i,0),n=xh(t,od(i),jl(i));let s=Gl(e,Gl(r,n));const l=lc(a.shape,o);return l.length>0&&(s=Ph(s,l)),Fu(s,a.shape)}}}},{kernelName:Rr,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,s]=t,r=Zh(n,0);return{x:()=>xh(r,e,Gl(e,s)),alpha:()=>{let t=xh(r,jl(e),Gl(e,n));const i=lc(s.shape,e.shape);return i.length>0&&(t=Ph(t,i)),Fu(t,s.shape)}}}},{kernelName:Mr,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{axis:r}=n;let i=[];return i=null==r?s.shape.map(((e,t)=>t)):"number"==typeof r?[r]:r,{x:()=>Wy(s,e,i)}}},{kernelName:Vr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,cd(ql(n)))}}},{kernelName:$r,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,s=Gl(rd(n,6),zp(n));return{x:()=>Gl(e,Bl(s,"float32"))}}},{kernelName:Wr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,Bl(zp(n),"float32"))}}},{kernelName:Gr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Fu(e,n.shape)}}},{kernelName:jr,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>oo.runKernel(Hr,r,n)}}},{kernelName:Ur,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[s]=t,r={dy:e,images:s};return{images:()=>oo.runKernel(qr,r,n)}}},{kernelName:Kr,gradFunc:(e,t,n)=>{const{dims:s}=n,r=tn(s,e.shape);return{x:()=>hp(e,r)}}},{kernelName:Xr,gradFunc:e=>({x:()=>jl(e)})},{kernelName:Zr,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>cd(Wl(e,Gl(sc(n,1.5),2)))}}},{kernelName:ei,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>Bl(jl(n),"float32"),t:()=>Gl(e,Bl(n,e.dtype)),e:()=>Gl(e,Bl(md(n),e.dtype))}}},{kernelName:ti,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=Zh(n,$l(0)),s=$l(Gm),r=$l(Um),i=Gl(e,r),a=Gl(Gl(e,s),Uh(Bl(n,"float32")));return xh(t,i,a)}}}},{kernelName:ai,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,Gl(n,rc($l(1),n)))}}},{kernelName:ii,gradFunc:e=>({x:()=>jl(e)})},{kernelName:si,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(dh(Bl(n,"float32")),e)}}},{kernelName:ri,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(ph(Bl(n,"float32")),e)}}},{kernelName:ni,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{begin:r,size:i}=n,a=s.shape,[o,l]=iu(s,r,i),c=[];for(let t=0;tLd(e,c)}}},{kernelName:di,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[s]=t,{dim:r}=n,i=Gl(e,s);return{logits:()=>rc(i,Gl(Ph(i,[r],true),s))}}},{kernelName:oi,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,Vu(n))}}},Gy,Gy,Uy,Uy,{kernelName:li,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,Gl(Ul(Bl(n,"float32")),2))}}},{kernelName:bi,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=$l(2);return{a:()=>Gl(e,Gl(r,rc(n,s))),b:()=>Gl(e,Gl(r,rc(s,n)))}}},{kernelName:wi,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(e,Gl(Bl(n,"float32"),2))}}},{kernelName:Bi,gradFunc:e=>({x:()=>jl(e)})},{kernelName:Si,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,s]=t,r=cc(n.shape,s.shape);return{a:()=>{let t=e;const s=lc(n.shape,r);return s.length>0&&(t=Ph(t,s)),Fu(t,n.shape)},b:()=>{let t=e;const n=lc(s.shape,r);return n.length>0&&(t=Ph(t,n)),Fu(cd(t),s.shape)}}}},{kernelName:ci,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,r=s.shape.slice(),{axis:i}=n;tn(i,s.shape).forEach((e=>{r[e]=1}));const a=Fu(e,r),o=Gl(a,Ed(s.shape,"float32"));return{x:()=>o}}},{kernelName:Ei,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Wl(e,ql(dh(n)))}}},{kernelName:_i,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>Gl(rc($l(1),ql(n)),e)}}},{kernelName:Ti,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[s]=t,{reps:r}=n;return{x:()=>{let t=jl(s);if(1===s.rank)for(let n=0;n{const s=n,{perm:r}=s,i=Fh(r);return{x:()=>af(e,i)}}},{kernelName:Ri,gradFunc:(e,t,n)=>{const s=n,{axis:r}=s;return{value:()=>Bp(e,r)}}},{kernelName:Mi,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>function(e,t){const n=uc(t,jl(t)),s=Xh(e,n);let r=Yh(t,$l(0,"int32"));const i=s.rank-r.rank;for(let e=0;e({x:()=>jl(e)})}];for(const e of qy)Zi(e);Ba().prototype.abs=function(){return this.throwIfDisposed(),ac(this)},Ba().prototype.acos=function(){return this.throwIfDisposed(),lu(this)},Ba().prototype.acosh=function(){return this.throwIfDisposed(),cu(this)},Ba().prototype.add=function(e){return this.throwIfDisposed(),Pl(this,e)},Ba().prototype.all=function(e,t){return this.throwIfDisposed(),hu(this,e,t)},Ba().prototype.any=function(e,t){return this.throwIfDisposed(),du(this,e,t)},Ba().prototype.argMax=function(e){return this.throwIfDisposed(),pu(this,e)},Ba().prototype.argMin=function(e){return this.throwIfDisposed(),fu(this,e)},Ba().prototype.asScalar=function(){return this.throwIfDisposed(),jt(1===this.size,(()=>"The array must have only 1 element.")),Fu(this,[])},Ba().prototype.asType=function(e){return this.throwIfDisposed(),Bl(this,e)},Ba().prototype.as1D=function(){return this.throwIfDisposed(),Fu(this,[this.size])},Ba().prototype.as2D=function(e,t){return this.throwIfDisposed(),Fu(this,[e,t])},Ba().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),Fu(this,[e,t,n])},Ba().prototype.as4D=function(e,t,n,s){return this.throwIfDisposed(),Fu(this,[e,t,n,s])},Ba().prototype.as5D=function(e,t,n,s,r){return this.throwIfDisposed(),Fu(this,[e,t,n,s,r])},Ba().prototype.asin=function(){return this.throwIfDisposed(),mu(this)},Ba().prototype.asinh=function(){return this.throwIfDisposed(),gu(this)},Ba().prototype.atan=function(){return this.throwIfDisposed(),yu(this)},Ba().prototype.atan2=function(e){return this.throwIfDisposed(),bu(this,e)},Ba().prototype.atanh=function(){return this.throwIfDisposed(),wu(this)},Ba().prototype.avgPool=function(e,t,n,s){return this.throwIfDisposed(),Bu(this,e,t,n,s)},Ba().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),qu(this,e,t)},Ba().prototype.batchNorm=function(e,t,n,s,r){return this.throwIfDisposed(),ju(this,e,t,n,s,r)},Ba().prototype.broadcastTo=function(e){return this.throwIfDisposed(),Qu(this,e)},Ba().prototype.cast=function(e){return this.throwIfDisposed(),Bl(this,e)},Ba().prototype.ceil=function(){return this.throwIfDisposed(),Ju(this)},Ba().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),eh(this,e,t)},Ba().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof Fa&&(e=[e]),Lu([this,...e],t)},Ba().prototype.conv1d=function(e,t,n,s,r,i){return this.throwIfDisposed(),ah(this,e,t,n,s,r,i)},Ba().prototype.conv2dTranspose=function(e,t,n,s,r){return this.throwIfDisposed(),lh(this,e,t,n,s,r)},Ba().prototype.conv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),ih(this,e,t,n,s,r,i)},Ba().prototype.cos=function(){return this.throwIfDisposed(),dh(this)},Ba().prototype.cosh=function(){return this.throwIfDisposed(),ph(this)},Ba().prototype.cumprod=function(e,t,n){return this.throwIfDisposed(),fh(this,e,t,n)},Ba().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),mh(this,e,t,n)},Ba().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),yh(this,e,t)},Ba().prototype.depthwiseConv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),bh(this,e,t,n,s,r,i)},Ba().prototype.dilation2d=function(e,t,n,s,r){return this.throwIfDisposed(),vh(this,e,t,n,s,r)},Ba().prototype.divNoNan=function(e){return this.throwIfDisposed(),Ch(this,e)},Ba().prototype.div=function(e){return this.throwIfDisposed(),Wl(this,e)},Ba().prototype.dot=function(e){return this.throwIfDisposed(),kh(this,e)},Ba().prototype.elu=function(){return this.throwIfDisposed(),Eh(this)},Ba().prototype.equal=function(e){return this.throwIfDisposed(),Ah(this,e)},Ba().prototype.erf=function(){return this.throwIfDisposed(),Th(this)},Ba().prototype.euclideanNorm=function(e,t){return this.throwIfDisposed(),Gh(this,e,t)},Ba().prototype.exp=function(){return this.throwIfDisposed(),Uh(this)},Ba().prototype.expandDims=function(e){return this.throwIfDisposed(),qh(this,e)},Ba().prototype.expm1=function(){return this.throwIfDisposed(),jh(this)},Ba().prototype.fft=function(){return this.throwIfDisposed(),Ip(this)},Ba().prototype.flatten=function(){return this.throwIfDisposed(),Fu(this,[this.size])},Ba().prototype.floor=function(){return this.throwIfDisposed(),Kh(this)},Ba().prototype.floorDiv=function(e){return this.throwIfDisposed(),Vl(this,e)},Ba().prototype.gather=function(e,t,n){return this.throwIfDisposed(),Xh(this,e,t,n)},Ba().prototype.greaterEqual=function(e){return this.throwIfDisposed(),Yh(this,e)},Ba().prototype.greater=function(e){return this.throwIfDisposed(),Zh(this,e)},Ba().prototype.ifft=function(){return this.throwIfDisposed(),Np(this)},Ba().prototype.irfft=function(){return this.throwIfDisposed(),Op(this)},Ba().prototype.isFinite=function(){return this.throwIfDisposed(),Jh(this)},Ba().prototype.isInf=function(){return this.throwIfDisposed(),ed(this)},Ba().prototype.isNaN=function(){return this.throwIfDisposed(),td(this)},Ba().prototype.leakyRelu=function(e){return this.throwIfDisposed(),nd(this,e)},Ba().prototype.lessEqual=function(e){return this.throwIfDisposed(),rd(this,e)},Ba().prototype.less=function(e){return this.throwIfDisposed(),sd(this,e)},Ba().prototype.localResponseNormalization=function(e,t,n,s){return this.throwIfDisposed(),ad(this,e,t,n,s)},Ba().prototype.logSigmoid=function(){return this.throwIfDisposed(),hd(this)},Ba().prototype.logSoftmax=function(e){return this.throwIfDisposed(),dd(this,e)},Ba().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),pd(this,e,t)},Ba().prototype.log=function(){return this.throwIfDisposed(),od(this)},Ba().prototype.log1p=function(){return this.throwIfDisposed(),ld(this)},Ba().prototype.logicalAnd=function(e){return this.throwIfDisposed(),fd(this,e)},Ba().prototype.logicalNot=function(){return this.throwIfDisposed(),md(this)},Ba().prototype.logicalOr=function(e){return this.throwIfDisposed(),gd(this,e)},Ba().prototype.logicalXor=function(e){return this.throwIfDisposed(),yd(this,e)},Ba().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),Pu(this,e,t,n)},Ba().prototype.maxPool=function(e,t,n,s){return this.throwIfDisposed(),Ad(this,e,t,n,s)},Ba().prototype.max=function(e,t){return this.throwIfDisposed(),zh(this,e,t)},Ba().prototype.maximum=function(e){return this.throwIfDisposed(),uc(this,e)},Ba().prototype.mean=function(e,t){return this.throwIfDisposed(),kd(this,e,t)},Ba().prototype.min=function(e,t){return this.throwIfDisposed(),Lh(this,e,t)},Ba().prototype.minimum=function(e){return this.throwIfDisposed(),Td(this,e)},Ba().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),Id(this,e,t)},Ba().prototype.mod=function(e){return this.throwIfDisposed(),Nd(this,e)},Ba().prototype.mul=function(e){return this.throwIfDisposed(),Gl(this,e)},Ba().prototype.neg=function(){return this.throwIfDisposed(),cd(this)},Ba().prototype.norm=function(e,t,n){return this.throwIfDisposed(),Wh(this,e,t,n)},Ba().prototype.notEqual=function(e){return this.throwIfDisposed(),Md(this,e)},Ba().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),Fd(this,e,t,n)},Ba().prototype.onesLike=function(){return this.throwIfDisposed(),Bd(this)},Ba().prototype.pad=function(e,t){return this.throwIfDisposed(),Ld(this,e,t)},Ba().prototype.pool=function(e,t,n,s,r,i){return this.throwIfDisposed(),qd(this,e,t,n,s,r,i)},Ba().prototype.pow=function(e){return this.throwIfDisposed(),sc(this,e)},Ba().prototype.prelu=function(e){return this.throwIfDisposed(),jd(this,e)},Ba().prototype.prod=function(e,t){return this.throwIfDisposed(),Hd(this,e,t)},Ba().prototype.reciprocal=function(){return this.throwIfDisposed(),lp(this)},Ba().prototype.relu=function(){return this.throwIfDisposed(),cp(this)},Ba().prototype.relu6=function(){return this.throwIfDisposed(),up(this)},Ba().prototype.reshapeAs=function(e){return this.throwIfDisposed(),Fu(this,e.shape)},Ba().prototype.reshape=function(e){return this.throwIfDisposed(),Fu(this,e)},Ba().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),Zf(this,e,t,n)},Ba().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),Yf(this,e,t,n)},Ba().prototype.reverse=function(e){return this.throwIfDisposed(),hp(this,e)},Ba().prototype.rfft=function(){return this.throwIfDisposed(),Rp(this)},Ba().prototype.round=function(){return this.throwIfDisposed(),gp(this)},Ba().prototype.rsqrt=function(){return this.throwIfDisposed(),yp(this)},Ba().prototype.selu=function(){return this.throwIfDisposed(),bp(this)},Ba().prototype.separableConv2d=function(e,t,n,s,r,i){return this.throwIfDisposed(),wp(this,e,t,n,s,r,i)},Ba().prototype.sigmoid=function(){return this.throwIfDisposed(),Vu(this)},Ba().prototype.sign=function(){return this.throwIfDisposed(),Ap(this)},Ba().prototype.sin=function(){return this.throwIfDisposed(),xp(this)},Ba().prototype.sinh=function(){return this.throwIfDisposed(),Cp(this)},Ba().prototype.slice=function(e,t){return this.throwIfDisposed(),Wu(this,e,t)},Ba().prototype.softmax=function(e){return this.throwIfDisposed(),Tp(this,e)},Ba().prototype.softplus=function(){return this.throwIfDisposed(),ud(this)},Ba().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),Ud(this,e,t)},Ba().prototype.split=function(e,t){return this.throwIfDisposed(),Dp(this,e,t)},Ba().prototype.sqrt=function(){return this.throwIfDisposed(),Ul(this)},Ba().prototype.square=function(){return this.throwIfDisposed(),ql(this)},Ba().prototype.squaredDifference=function(e){return this.throwIfDisposed(),Mp(this,e)},Ba().prototype.squeeze=function(e){return this.throwIfDisposed(),Fp(this,e)},Ba().prototype.stack=function(e,t){this.throwIfDisposed();const n=e instanceof Fa?[this,e]:[this,...e];return Bp(n,t)},Ba().prototype.step=function(e){return this.throwIfDisposed(),zp(this,e)},Ba().prototype.stridedSlice=function(e,t,n,s,r,i,a,o){return this.throwIfDisposed(),Lp(this,e,t,n,s,r,i,a,o)},Ba().prototype.sub=function(e){return this.throwIfDisposed(),rc(this,e)},Ba().prototype.sum=function(e,t){return this.throwIfDisposed(),Ph(this,e,t)},Ba().prototype.tan=function(){return this.throwIfDisposed(),Pp(this)},Ba().prototype.tanh=function(){return this.throwIfDisposed(),Gu(this)},Ba().prototype.tile=function(e){return this.throwIfDisposed(),Hh(this,e)},Ba().prototype.toBool=function(){return this.throwIfDisposed(),Bl(this,"bool")},Ba().prototype.toFloat=function(){return this.throwIfDisposed(),Bl(this,"float32")},Ba().prototype.toInt=function(){return this.throwIfDisposed(),Bl(this,"int32")},Ba().prototype.topk=function(e,t){return this.throwIfDisposed(),Xp(this,e,t)},Ba().prototype.transpose=function(e){return this.throwIfDisposed(),af(this,e)},Ba().prototype.unique=function(e){return this.throwIfDisposed(),Yp(this,e)},Ba().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),Qp(this,e,t)},Ba().prototype.unstack=function(e){return this.throwIfDisposed(),Jp(this,e)},Ba().prototype.where=function(e,t){return this.throwIfDisposed(),xh(e,this,t)},Ba().prototype.zerosLike=function(){return this.throwIfDisposed(),jl(this)};class jy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,jy.prototype)}}class Hy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Hy.prototype)}}class $y extends Error{constructor(e){super(e),Object.setPrototypeOf(this,$y.prototype)}}class Ky extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Ky.prototype)}}class Xy extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Xy.prototype)}}Error;class Zy{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 rb={};function ib(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function ab(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach((e=>ab(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?ab(t):e[n]=t.value)}}}function ob(e,t={},n={},s="object",r=!1){if("string"==typeof e){const r=e;let i;if(r in n)i=n[r];else if(r in rb)i=rb[r];else if(i=t[r],null==i)throw new $y(`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 i}{const i=e;if(null==i.className||null==i.config)throw new $y(`${s}: Improper config format: ${JSON.stringify(i)}.\n'className' and 'config' must set.`);const a=i.className;let o,l;if(a in n?[o,l]=n[a]:a in rb?[o,l]=rb.className:a in t&&([o,l]=t[a]),null==o)throw new $y(`Unknown ${s}: ${a}. 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(rb))e[t]=rb[t];for(const t of Object.keys(n))e[t]=n[t];i.config.customObjects=e;const t=Object.assign({},rb);for(const e of Object.keys(n))rb[e]=n[e];ab(i.config);const s=l(o,i.config,n,r);return rb=Object.assign({},t),s}{const e=Object.assign({},rb);for(const e of Object.keys(n))rb[e]=n[e];const t=new o(i.config);return rb=Object.assign({},e),t}}}function lb(e,t){return-1*function(e,t){return et?1:0}(e,t)}function cb(e){if(null==e)return e;const t=[];for(const n of e)-1===t.indexOf(n)&&t.push(n);return t}function ub(e){if(null==e)throw new $y(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function hb(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new $y(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function db(e,t,n=0,s=1/0){return Qy(n>=0),Qy(s>=n),Array.isArray(e)&&e.length>=n&&e.length<=s&&e.every((e=>typeof e===t))}function pb(e,t){Array.isArray(e)?(jt(e.length>0,(()=>`${t} is unexpectedly an empty array.`)),e.forEach(((e,n)=>pb(e,`element ${n+1} of ${t}`)))):jt(Number.isInteger(e)&&e>0,(()=>`Expected ${t} to be a positive integer, but got ${fb(e)}.`))}function fb(e){return null===e?"null":Array.isArray(e)?"["+e.map((e=>fb(e))).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function mb(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}let gb=0;function yb(){return gb++}const bb={};function wb(e=""){return e in bb||(bb[e]=0),bb[e]+=1,e+bb[e].toString()}const vb=["channelsFirst","channelsLast"],Ab=["nearest","bilinear"],xb=["valid","same","causal"],Cb=["max","avg"],kb=["sum","mul","concat","ave"],Sb=new Map;function Eb(e){hb(vb,"DataFormat",e)}function _b(e){hb(xb,"PaddingMode",e)}function Tb(e){hb(Cb,"PoolMode",e)}const Ib=[],Nb="/";function Ob(e,t){Ib.push(e);try{const e=t();return Ib.pop(),e}catch(e){throw Ib.pop(),e}}function Db(e){if(!Fb(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===Ib.length?"":Ib.join(Nb)+Nb)+e}function Rb(e){if(!Fb(e))throw new Error("Not a valid tensor name: '"+e+"'");Sb.has(e)||Sb.set(e,0);const t=Sb.get(e);if(Sb.set(e,Sb.get(e)+1),t>0){const n=`${e}_${t}`;return Sb.set(n,1),n}return e}const Mb=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function Fb(e){return!!e.match(Mb)}function Bb(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 Pb(e,t){if(t{switch(e.rank){case 1:return kp(e,t,n);case 2:return Sp(e,[t,0],[n,e.shape[1]]);case 3:return Ep(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return _p(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return Wu(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return Wu(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 $y(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function jb(e,t,n){return To((()=>{switch(e.rank){case 1:return kp(e,t,n);case 2:return Sp(e,[0,t],[e.shape[0],n]);case 3:return Ep(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return _p(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new $y(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function Hb(e,t,n,s){return To((()=>{switch(e.rank){case 1:return kp(e,t,n);case 2:switch(s){case 1:return qb(e,t,n);case 2:return jb(e,t,n);default:throw new $y(`The axis is not within the rank of the tensor ${s}`)}case 3:switch(s){case 1:return qb(e,t,n);case 2:return Ep(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return jb(e,t,n);default:throw new $y(`The axis is not within the rank of the tensor ${s}`)}case 4:switch(s){case 1:return qb(e,t,n);case 2:return _p(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return _p(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return jb(e,t,n);default:throw new $y(`The axis is not within the rank of the tensor ${s}`)}default:throw new $y(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}}))}function $b(e,t=-1){let n;return t<0&&(n=e[0].rank,t=0!==n?n:0),t===e[0].rank&&(t=-1),Lu(e,t)}function Kb(e,t){switch(e.rank){case 1:return th([e,t]);case 2:return nh([e,t],0);case 3:return sh([e,t],0);case 4:return rh([e,t],0);default:throw new $y(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function Xb(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new $y(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return Hh(e,t)}function Zb(e,t=0,n=1,s,r){return np(e,t,n,s,r)}function Yb(e,t,n,s){if(e.rank<2||t.rank<2)throw new Ky(`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 Ky(`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 kf({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?ew(e.rank,s,"channelsLast"):null,activation:n})}{const r=e.shape.slice(),i=r.pop();e=Fu(e,[-1,i]);const a=t.shape.slice(),o=a.pop(),l=a.pop(),c=[...a,o],u=Array.from({length:t.rank},((e,n)=>0===n?t.rank-2:n<=t.rank-2?n-1:n));t=Fu(af(t,u),[l,-1]);const h=[...r,...c];return Fu(kf({a:e,b:t,transposeA:!1,transposeB:!1,bias:s?ew(e.rank,s,"channelsLast"):null,activation:n}),h)}}function Qb(e,t,n){return To((()=>(t=Array.isArray(t)?Vp(t,"int32"):Bl(t,"int32"),Xh(e,t,n))))}function Jb(e){return Gl(e,e)}function ew(e,t,n){const s=t.shape;if(1!==t.rank&&t.rank!==e)throw new $y(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===n)return 1===s.length?Fu(t,[1,s[0],1,1,1]):Fu(t,[1,s[3],s[0],s[1],s[2]]);if("channelsLast"===n)return 1===s.length?Fu(t,[1,1,1,1,s[0]]):Fu(t,[1].concat(s))}else if(4===e){if("channelsFirst"===n)return 1===s.length?Fu(t,[1,s[0],1,1]):Fu(t,[1,s[2],s[0],s[1]]);if("channelsLast"===n)return 1===s.length?Fu(t,[1,1,1,s[0]]):Fu(t,[1].concat(s))}else if(3===e){if("channelsFirst"===n)return 1===s.length?Fu(t,[1,s[0],1]):Fu(t,[1,s[1],s[0]]);if("channelsLast"===n)return 1===s.length?Fu(t,[1,1,s[0]]):Fu(t,[1].concat(s))}else if(e<3)return t;throw new $y(`Unsupported input rank by biasAdd: ${t.rank}`)}function tw(e,t,n){return To((()=>(null==n&&(n="channelsLast"),Eb(n),Pl(e,ew(e.rank,t,n)))))}function nw(e,t,n,s){return To((()=>hf(e,t,n,s)))}function sw(e,t,n=!1){return n?e():t()}const rw=["fanIn","fanOut","fanAvg"],iw=["normal","uniform","truncatedNormal"];class aw extends Zl{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class ow extends aw{apply(e,t){return Sd(e,t)}}ow.className="Zeros",Ql(ow);class lw extends aw{apply(e,t){return Ed(e,t)}}lw.className="Ones",Ql(lw);class cw extends aw{constructor(e){if(super(),"object"!=typeof e)throw new $y(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new $y(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return To((()=>Gl($l(this.value),Ed(e,t))))}getConfig(){return{value:this.value}}}cw.className="Constant",Ql(cw);class uw extends aw{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 rp(e,this.minval,this.maxval,t,this.seed)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}uw.className="RandomUniform",Ql(uw);class hw extends aw{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 Ky(`randomNormal does not support dType ${t}.`);return Zb(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}hw.className="RandomNormal",Ql(hw);class dw extends aw{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 Ky(`truncatedNormal does not support dType ${t}.`);return Zp(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}dw.className="TruncatedNormal",Ql(dw);class pw extends aw{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return To((()=>{if(2!==e.length||e[0]!==e[1])throw new $y("Identity matrix initializer can only be used for 2D square matrices.");return Gl(this.gain,$h(e[0]))}))}getConfig(){return{gain:this.gain}}}pw.className="Identity",Ql(pw);class fw extends aw{constructor(e){if(super(),e.scale<0)throw new $y(`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,hb(rw,"FanMode",t),this.distribution=null==e.distribution?"normal":e.distribution,function(e){hb(iw,"Distribution",e)}(this.distribution),this.seed=e.seed}apply(e,t){const n=function(e,t="channelsLast"){let n,s;if(Eb(t),2===e.length)n=e[0],s=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===t){const t=Bb(e,2);n=e[1]*t,s=e[0]*t}else if("channelsLast"===t){const t=Bb(e,0,e.length-2);n=e[e.length-2]*t,s=e[e.length-1]*t}}else{const t=Bb(e);n=Math.sqrt(t),s=Math.sqrt(t)}return[n,s]}(e),s=n[0],r=n[1];let i=this.scale;if("fanIn"===this.mode?i/=Math.max(1,s):"fanOut"===this.mode?i/=Math.max(1,r):i/=Math.max(1,(s+r)/2),"normal"===this.distribution){const n=Math.sqrt(i);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new Ky(`${this.getClassName()} does not support dType ${t}.`);return Zp(e,0,n,t,this.seed)}{const n=Math.sqrt(3*i);return rp(e,-n,n,t,this.seed)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}fw.className="VarianceScaling",Ql(fw);class mw extends fw{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return fw.className}}mw.className="GlorotUniform",Ql(mw);class gw extends fw{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return fw.className}}gw.className="GlorotNormal",Ql(gw);class yw extends fw{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return fw.className}}yw.className="HeNormal",Ql(yw);class bw extends fw{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return fw.className}}bw.className="HeUniform",Ql(bw);class ww extends fw{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return fw.className}}ww.className="LeCunNormal",Ql(ww);class vw extends fw{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return fw.className}}vw.className="LeCunUniform",Ql(vw);class Aw extends aw{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 To((()=>{if(e.length<2)throw new Ky("Shape must be at least 2D.");if("int32"!==t&&"float32"!==t&&void 0!==t)throw new TypeError(`Unsupported data type ${t}.`);const n=Kt(e.slice(0,-1)),s=e[e.length-1];this.ELEMENTS_WARN_SLOW;const r=Zb([Math.max(s,n),Math.min(s,n)],0,1,t,this.seed),i=bm.qr(r,!1);let a=i[0];const o=i[1].flatten().stridedSlice([0],[Math.min(s,n)*Math.min(s,n)],[Math.min(s,n)+1]);return a=Gl(a,o.sign()),ne*t));return t}const Ow="Variable";class Dw{constructor(e,t="float32",n=Ow,s=!0,r=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=yb(),n=null==n?Ow:n,this.originalName=Db(n),this.name=Rb(this.originalName),this.trainable_=s,this.constraint=r,this.val=tf(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 Rw(e){return e.map((e=>e.read()))}function Mw(e){e.forEach((e=>{e[0].write(e[1])}))}class Fw{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 Bw{constructor(e,t,n,s,r,i,a){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=s,this.callArgs=r,this.outputTensorIndex=a,this.id=yb(),null!=i&&(this.originalName=Db(i),this.name=Rb(this.originalName)),this.rank=t.length}}let zw=0;class Lw{constructor(e,t){this.callArgs=t,this.id=zw++,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 Pw=0;class Vw extends Zl{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=Pw++,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=nb(e)+"_"+wb(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 Hy(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new $y(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return eb(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return eb(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new jy(`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 jy(`Layer ${this.name} is not connected, no input to return.`);return eb(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new jy(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new jy(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return eb(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=tb(e);if(null==this.inputSpec||0===this.inputSpec.length)return;const n=tb(this.inputSpec);if(t.length!==n.length)throw new $y(`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 $y(`Input ${e} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${i}`);if(null!=r.minNDim&&i=0?t[s]:t[t.length+s];if(null!=i&&-1===[i,null].indexOf(a))throw new $y(`Input ${e} is incompatible with layer ${this.name}: expected axis ${s} of input shape to have value ${i} 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 tb(e))t.push(n.shape);this.build(eb(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=tb(s),i=[];for(let e of r)-1!==n.indexOf(e)&&(e=e.clone()),i.push(e);if(s=eb(i),null!=this.activityRegularizer)throw new Ky("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return s}{const n=function(e){e=tb(e);const t=[];for(const n of e)t.push(n.shape);return eb(t)}(e),s=this.computeOutputShape(n);let r;const i="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 Bw(i,n,this,tb(e),t,this.name,s))):new Bw(i,s,this,tb(e),t,this.name),this.addInboundNode(e,r,null,null,n,s,t),this._refCount++,null!=this.activityRegularizer)throw new Ky("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 jy(`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 jy(`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 Hy(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return Nw(this.weights)}build(e){this.built=!0}getWeights(e=!1){return Rw(e?this.trainableWeights:this.weights)}setWeights(e){To((()=>{const t=this.weights;if(t.length!==e.length)throw new $y(`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=Rw(t);for(let r=0;rr.apply(c.read()))),null==i&&(i=!0),i?this._trainableWeights.push(c):this._nonTrainableWeights.push(c),c}setFastWeightInitDuringBuild(e){this.fastWeightInitDuringBuild=e}addLoss(e){null==e||Array.isArray(e)&&0===e.length||(e=tb(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=tb(t),i=tb(s);if(r.length!==i.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 Ww(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=[],c=t.names();for(const e of o)-1!==c.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=s&&(s.maxNumTensors=-1/0,s.minNumTensors=1/0);const u=o.join(",")+"|"+t.names().sort().join(",");let h,d=qw.get(u);if(null==d){const e=function(e,t){jt(null!=e&&e.length>0,(()=>"Expected at least one fetch, got none"));let n=[],s={};if(1===e.length){const r=Kw(e[0],t);n=r.sorted,s=r.recipientMap}else{const r=new Set;for(const i of e){const{sorted:e,recipientMap:a}=Kw(i,t);for(const t of e)r.has(t.name)||(n.push(t),r.add(t.name));for(const e in a)null==s[e]&&(s[e]=new Set),a[e].forEach((t=>s[e].add(t)))}}return{sorted:n,recipientCounts:$w(s)}}(a,t);d=e.sorted,h=e.recipientCounts,qw.put(u,d),jw.put(u,h)}h={},r||Object.assign(h,jw.get(u));const p=new Uw(t);for(let e=0;es.maxNumTensors&&(s.maxNumTensors=e),e0;){const e=i[i.length-1];if(n.has(e.name)){i.pop();continue}const t=a[a.length-1]===i.length-1;if(0===e.inputs.length||t)i.pop(),s.push(e),n.add(e.name),t&&a.pop();else{a.push(i.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)||i.push(t)}}return{sorted:s,recipientMap:r}}function Xw(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let n=null;for(let t=0;tUl(Ph(Gl(e,e),t,!0))))}En().registerFlag("TOPOLOGICAL_SORT_CACHE_MAX_ENTRIES",(()=>100),(function(e){null!=qw&&qw.setMaxEntries(e),null!=jw&&jw.setMaxEntries(e)}));class Yw extends Zl{getConfig(){return{}}}class Qw extends Yw{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 To((()=>{const t=Zw(e,this.axis),n=eh(t,0,this.maxValue);return Gl(e,Wl(n,Pl(Wb(),t)))}))}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}Qw.className="MaxNorm",Ql(Qw);class Jw extends Yw{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return To((()=>Wl(e,Pl(Wb(),Zw(e,this.axis)))))}getConfig(){return{axis:this.axis}}}Jw.className="UnitNorm",Ql(Jw);class ev extends Yw{apply(e){return cp(e)}}ev.className="NonNeg",Ql(ev);class tv extends Yw{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 To((()=>{const t=Zw(e,this.axis),n=Pl(Gl(this.rate,eh(t,this.minValue,this.maxValue)),Gl(1-this.rate,t));return Gl(e,Wl(n,Pl(Wb(),t)))}))}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}tv.className="MinMaxNorm",Ql(tv);const nv={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function sv(e){return ib(e)}function rv(e,t={}){return ob(e,Yl.getMap().classNameMap,t,"constraint")}function iv(e){if(null==e)return null;if("string"==typeof e){return rv({className:e in nv?nv[e]:e,config:{}})}return e instanceof Yw?e:rv(e)}async function av(e){if(null==e)return;const t=[],n=[],s=[];for(const r in e){const i=e[r];if("number"!=typeof i){const e=i;t.push(e.data()),n.push(r),s.push(e)}}if(t.length>0){const r=await Promise.all(t);for(let t=0;tPl(this.totals[e],Gl(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:To((()=>{const n=Gl(Wl(1,this.seen),this.totals[e]);t[e]=n,this.totals[e].dispose(),No(t[e])})))}}class pv extends uv{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 i=0;i{const a=null!=n?n():ma();return a-rnew fv(e,t)))}class gv{constructor(){}static registerCallbackConstructor(e,t){jt(e>=0&&Number.isInteger(e),(()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`)),gv.checkForDuplicate(t),null==gv.constructors[e]&&(gv.constructors[e]=[]),gv.constructors[e].push(t)}static checkForDuplicate(e){for(const t in gv.constructors){gv.constructors[+t].forEach((t=>{if(t===e)throw new $y("Duplicate callback constructor.")}))}}static clear(){gv.constructors={}}static createCallbacks(e){const t=[];for(const n in gv.constructors){const s=+n;e>=s&&t.push(...gv.constructors[s])}return t.map((e=>new e))}}function yv(e,t,n,s,r,i,a,o,l){const c=new pv,u=[new dv,...gv.createCallbacks(t)];null!=e&&u.push(...e),u.push(c);const h=new hv(u);return h.setParams({epochs:n,initialEpoch:s,samples:r,steps:i,batchSize:a,verbose:t,doValidation:o,metrics:l}),{callbackList:h,history:c}}function bv(e,t={},n=!1){return ob(e,Yl.getMap().classNameMap,t,"layer",n)}function wv(e,t){return To((()=>{"float32"!==e.dtype&&(e=Bl(e,"float32"));const n=Ph(Jb(e),t,!0),s=tc(n.shape,Wb()),r=Ul(uc(n,s));return Wl(e,r)}))}function vv(e,t){return To((()=>kd(Jb(rc(t,e)),-1)))}function Av(e,t){return To((()=>kd(ac(rc(t,e)),-1)))}function xv(e,t){return To((()=>{const n=rc(e,t),s=eh(ac(e),Wb(),Number.MAX_VALUE),r=ac(Wl(n,s));return Gl(100,kd(r,-1))}))}function Cv(e,t){return To((()=>{const n=eh(t,Wb(),Number.MAX_VALUE),s=od(Pl(1,n)),r=eh(e,Wb(),Number.MAX_VALUE),i=od(Pl(1,r));return kd(Jb(rc(s,i)),-1)}))}function kv(e,t,n=!1){return To((()=>{if(n)t=Tp(t);else{const e=Ph(t,t.shape.length-1,!0);t=Wl(t,e)}return t=eh(t,Wb(),1-Wb()),cd(Ph(Gl(Bl(e,"float32"),od(t)),t.shape.length-1))}))}function Sv(e,t,n=!1){return To((()=>{const s=Bl(Kh(function(e){const t=[Bb(e.shape)];return Fu(e,t)}(e)),"int32"),r=(t=eh(t,Wb(),1-Wb())).shape;return kv(Fu(Fd(s,r[r.length-1]),r),t,n)}))}function Ev(e,t){return To((()=>{let n;return n=eh(t,Wb(),1-Wb()),n=od(Wl(n,rc(1,n))),kd(function(e,t){if(!Xt(e.shape,t.shape))throw new $y(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return To((()=>{const n=cp(t),s=cd(ac(t));return Pl(rc(n,Gl(t,e)),ld(Uh(s)))}))}(e,n),-1)}))}function _v(e,t){return To((()=>{const n=eh(e,Wb(),1),s=eh(t,Wb(),1);return Ph(Gl(e,od(Wl(n,s))),-1)}))}function Tv(e,t){return To((()=>{const n=wv(e,-1),s=wv(t,-1),r=Gl(n,s);return cd(Ph(r,-1))}))}gv.constructors={};const Iv={meanSquaredError:vv,meanAbsoluteError:Av,meanAbsolutePercentageError:xv,meanSquaredLogarithmicError:Cv,squaredHinge:function(e,t){return To((()=>{const n=uc(0,rc(1,Gl(e,t)));return kd(Jb(n),-1)}))},hinge:function(e,t){return To((()=>{const n=uc(0,rc(1,Gl(e,t)));return kd(n,-1)}))},categoricalHinge:function(e,t){return To((()=>{const n=Ph(Gl(e,t),-1),s=zh(Gl(rc(1,e),t),-1);return uc(0,Pl(1,rc(s,n)))}))},logcosh:function(e,t){return To((()=>{const n=Math.log(2),s=rc(t,e),r=rc(Pl(s,ud(Gl(-2,s))),n);return kd(r,-1)}))},categoricalCrossentropy:kv,sparseCategoricalCrossentropy:Sv,binaryCrossentropy:Ev,kullbackLeiblerDivergence:_v,poisson:function(e,t){return To((()=>{const n=od(Pl(Wb(),t));return kd(rc(t,Gl(e,n)),-1)}))},cosineProximity:Tv};function Nv(e){if("string"==typeof e){if(e in Iv)return Iv[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 $y(t)}return e}function Ov(e,t){return To((()=>{const n=Gl(.5,Bd(t)),s=Gb(Zh(t,n),e.dtype);return kd(Ah(e,s),-1)}))}function Dv(e,t){return To((()=>Gb(Ah(pu(e,-1),pu(t,-1)),"float32")))}function Rv(e,t){return To((()=>Bl(Ph(fd(Ah(e,1),Ah(t,1))),"float32")))}function Mv(e,t){return Ev(e,t)}function Fv(e,t){return e.rank===t.rank&&(e=Fp(e,[e.rank-1])),(t=pu(t,-1)).dtype!==e.dtype&&(t=Bl(t,e.dtype)),Bl(Ah(e,t),"float32")}const Bv=kv,zv=Sv,Lv={binaryAccuracy:Ov,categoricalAccuracy:Dv,precision:function(e,t){return To((()=>{const n=Rv(e,t),s=function(e,t){return To((()=>Bl(Ph(fd(Ah(e,0),Ah(t,1))),"float32")))}(e,t),r=Pl(n,s);return Bl(xh(Zh(r,0),Wl(n,r),0),"float32")}))},categoricalCrossentropy:Bv,sparseCategoricalCrossentropy:zv,mse:vv,MSE:vv,mae:Av,MAE:Av,mape:xv,MAPE:xv,cosine:Tv};function Pv(e){if("string"==typeof e&&e in Lv)return Lv[e];if("string"!=typeof e&&null!=e)return e;throw new $y(`Unknown metric ${e}`)}function Vv(e){if(Qy(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const n of Object.keys(Iv))if(Iv[n]===e){t=n;break}if(void 0!==t)return t;for(const n of Object.keys(Lv))if(Lv[n]===e){t=n;break}return void 0!==t?t:e.name}}function Wv(e,t,n=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!Gv(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){JSON.stringify(e).length}}function Gv(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(!Gv(e[n]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!Gv(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}}function Uv(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),i=["Layer (type)","Input Shape","Output shape","Param #"];let a;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){i.push("Receives inputs"),a=[];for(const t in e.nodesByDepth)a.push(...e.nodesByDepth[t])}s("_".repeat(t)),qv(i,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 jv(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"}qv([`${e.name} (${e.getClassName()})`,r,s,e.countParams().toString()],t,n)}function Hv(e,t,n,s){let r,i;try{i=e.inboundNodes.map((e=>JSON.stringify(e.inputShapes))).join(",")}catch(e){i="multiple"}try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}const a=[];for(const t of e.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(t)))for(let e=0;ee.name))}`);cb(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;Qy(0===n,"input layer has >1 nodes"),Qy(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={},i={},a=[],o=(e,t,n,s,r,l)=>{null!=s&&null!=r&&null!=l||(s=e.sourceLayer,r=e.nodeIndex,l=e.tensorIndex);const c=s.inboundNodes[r];if(-1!==n.indexOf(c))throw new Hy(`The tensor ${e.name} at layer "${s.name}" is part of a cycle.`);if(-1!==t.indexOf(c))return;this.containerNodes.add(Yv.nodeKey(s,r)),s.id in i||(i[s.id]=Object.keys(i).length),-1===n.indexOf(c)&&n.push(c);const u=c.inboundLayers.length;for(let e=0;e=0;)n.splice(n.indexOf(c),1);a.push(c)},l=[],c=[];for(const e of this.outputs)o(e,l,c);const u=a.slice().reverse();for(const e of u){n[e.id]=e,e.id in t||(t[e.id]=0);let i=t[e.id];const a=null==s[e.outboundLayer.id]?0:s[e.outboundLayer.id];i=Math.max(i,a),s[e.outboundLayer.id]=i,r[e.outboundLayer.id]=e.outboundLayer,t[e.id]=i;for(let s=0;sparseInt(e,10))).sort(lb);this.layers=[];for(const e of p){const t=d[e];t.sort(((e,t)=>{const n=i[e.id],s=i[t.id];return ns?1:0}));for(const e of t)e instanceof Yv&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=d,p=Object.keys(h).map((e=>parseInt(e,10))).sort(lb);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 Hy(`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 Hy(`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 Lw({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 $y("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,i]of e.weights.entries()){const e=r?`${i.name.split("/").slice(0,-1).join("/")+"/"}${t}`:i.originalName;if(null!=n[e])throw new $y(`Duplicate weight name: ${e}`);n[e]=i,s++}const i=[];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])i.push([n[r],e[s]]);else if(t)throw new $y(`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 $y(`${e.length} of ${s} weights are not set: ${e}`)}Mw(i)}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 ${Zv}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const n=Xv(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return To((()=>{e=tb(e);const n=new Uw;for(let t=0;t{let n;return e=tb(e),n=null==t?Yy(null,e.length):tb(t),this.runInternalGraph(e,n)[1]}))}computeOutputShape(e){const t=_w(e);if(t.length!==this.inputLayers.length)throw new $y(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let e=0;eparseInt(e,10))).sort(lb);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(lb);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,i=new Array;for(const e of s)e.id in n&&i.push(n[e.id]);if(i.length===s.length){let s,a,o,l,c={};if(null!=e.callArgs&&(c=e.callArgs),1===i.length){const[e,n]=i[0];null==c.mask&&(c.mask=n),o=tb(t.call(e,c)),l=tb(t.computeMask(e,n)),s=[e],a=[n]}else s=i.map((e=>e[0])),a=i.map((e=>e[1])),null==c.mask&&(c.mask=a),o=tb(t.call(s,c)),l=tb(t.computeMask(s,a));if(t.activityRegularizer)throw new Ky("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(eb(n),s)}function l(e){const n=e.name,i=bv(e,null!=t.customObjects?t.customObjects:{});i.setFastWeightInitDuringBuild(s),r[n]=i;e.inboundNodes.forEach((e=>{if(!(e instanceof Array))throw new $y(`Corrupted configuration, expected array for nodeData: ${e}`);a(i,e)}))}const c=t.name,u=t.layers;for(const e of u)l(e);for(;!ub(i);)for(const e of u){const t=r[e.name];if(t.name in i){const e=i[t.name];delete i[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];Qy(t in r);const i=r[t].inboundNodes[n].outputTensors;h.push(i[s])}const f=t.outputLayers;for(const e of f){const t=e[0],n=e[1],s=e[2];Qy(t in r);const i=r[t].inboundNodes[n].outputTensors;d.push(i[s])}return new e({inputs:h,outputs:d,name:c})}get stateful(){if(this._stateful)throw new $y("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(){To((()=>{this.layers.forEach((e=>{e.stateful&&e.resetStates()}))}))}}function Qv(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 Jv(e,t){return Qv(e,t,"classWeight")}async function eA(e,t,n,s){if(null!=t||null!=s)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const t=To((()=>{if(1===e.shape.length)return zl(e);if(2===e.shape.length){if(e.shape[1]>1){return pu(e,1)}if(1===e.shape[1])return Fu(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());Io(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])})),Vp(r,"float32")}return null}function tA(e,t){return Gl(e,t)}function nA(e,t){let n,s;const r=t;n=r.xs,s=r.ys,jt(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 i=sA("input",e.inputNames,n),a=sA("output",e.outputNames,s),o=i[0].shape[0];jt(i.length===e.inputs.length,(()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${i.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`)),jt(a.length===e.outputs.length,(()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${a.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`));for(let t=0;t`Batch size mismatch: input ${e.inputNames[t]} has ${i[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));for(let t=0;t`Batch size mismatch: output ${e.outputNames[t]} has ${a[t].shape[0]}; expected ${o} based on input ${e.inputNames[0]}.`));return{xs:i,ys:a}}function sA(e,t,n){if(n instanceof Fa)return[n];if(Array.isArray(n))return jt(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 $y(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);s.push(n[r])}return s}}async function rA(e,t,n){const s=null!=n.batchesPerEpoch;if(jt(null!=e.optimizer,(()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig).")),jt(null!=n,(()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call.")),jt(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}`)),jt(!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}`)),jt(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 i,a;if(r)if(iA(n.validationData))jt(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 Ky("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData);i=e.xs,a=e.ys}const o=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let c;c=r?l.slice().concat(l.map((e=>"val_"+e))):l.slice();const u=mv(n.callbacks,n.yieldEvery),h=null==n.verbose?1:n.verbose,{callbackList:d,history:p}=yv(u,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,c);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=iA(n.validationData)?tb(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):tb(e.evaluate(i,a,{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 oA(e,t,n){return null==e?[null]:Array.isArray(e)?e.map((e=>qb(e,t,n-t))):qb(e,t,n-t)}function lA(e,t){return To((()=>null==e?null:Array.isArray(e)?e.map((e=>lA(e,t))):Qb(e,"int32"===t.dtype?t:Bl(t,"int32"))))}function cA(e,t){const n=[];let s=0,r=null;for(;s=e&&(r=e),n.push([s,r]),s=r;return n}function uA(e){const t=[];e instanceof Fa&&(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 Fa)-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 dA(e){return Array.isArray(e)}function pA(e){return!function(e){return e instanceof Fa}(e)&&!dA(e)}function fA(e,t,n,s=!0,r=""){if(null==t||0===t.length){if(null!=e){let t=!1;if(dA(e)&&e.length>0)t=!0;else if(pA(e)){for(const n in e)if(e.hasOwnProperty(n)){t=!0;break}}else t=!0;if(t)throw new $y(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(null==e)return t.map((e=>null));let i;if(pA(e)){i=[];for(const n of t){if(null==e[n])throw new $y(`No data provided for "${n}". Need data for each key in: ${t}`);i.push(e[n])}}else if(dA(e)){if(e.length!==t.length)throw new $y(`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}`);i=e}else{if(t.length>1)throw new $y(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);i=[e]}if(i=uA(i),null!=n)for(let e=0;e=0&&i!==o)throw new $y(`${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 ${a.shape[0]} examples, each with shape [${a.shape.slice(1,a.shape.length)}] (tensor shape [${a.shape}])`)}}return i}function mA(e,t,n,s=!0,r=""){let i;if(Array.isArray(e)){if(e.length!==t.length)throw new $y(`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).`);i=e}else{if(t.length>1)throw new $y(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);i=[e]}if(null!=n)for(let e=0;exm.adagrad(.01),Adadelta:()=>xm.adadelta(1,.95,Wb()),Adam:()=>xm.adam(.001,.9,.999,Wb()),Adamax:()=>xm.adamax(.002,.9,.999,Wb(),0),RMSProp:()=>xm.rmsprop(.001,.9,0,Wb()),SGD:()=>xm.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 $y(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof Jl))throw new $y("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 $y(`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=>Nv(e)))}else{const n=Nv(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 $y(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)e.loss[n],t.push(Nv(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])};Ob("metric",(()=>{for(let e=0;e{let n,s,i;for(const a of t){if("string"==typeof a&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(a)){const t=this.internalOutputShapes[e];let r;1===t[t.length-1]||this.lossFunctions[e]===Ev?-1!==["accuracy","acc"].indexOf(a)?s=Ov:-1!==["crossentropy","ce"].indexOf(a)&&(s=Mv):this.lossFunctions[e]===Sv?-1!==["accuracy","acc"].indexOf(a)?s=Fv:-1!==["crossentropy","ce"].indexOf(a)&&(s=zv):-1!==["accuracy","acc"].indexOf(a)?s=Dv:-1!==["crossentropy","ce"].indexOf(a)&&(s=Bv),-1!==["accuracy","acc"].indexOf(a)?r="acc":-1!==["crossentropy","ce"].indexOf(a)&&(r="ce"),i=s,n=""+r}else{const e=Pv(a);i=e,n=""+Vv(a)}let t;Ob(n,(()=>{t=i})),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;aA(s);const r=this.standardizeUserDataXY(e,t,!0,s);try{const e=r[0].concat(r[1]);this.makeTestFunction();const t=this.testFunction;return eb(this.testLoop(t,e,s,n.verbose,n.steps))}finally{hA(r[0],e),hA(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 i=[];if(n.verbose>0)throw new Ky("Verbose mode is not implemented yet.");jt(!s||n.batches>0&&Number.isInteger(n.batches),(()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`));const a="function"==typeof t.next?t:await t.iterator();let o=0,l=0;for(;!s||l{if(t.value){const{xs:n,ys:s}=nA(e,t.value),a=n.concat(s),c=To((()=>r(a)));if(Io(a),0===l)for(let e=0;ePl(i[e],Gl(u,t)))),l>0&&Io(n)}Io(c),o+=u,++l}return i})),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 $y(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return t}predictLoop(e,t=32,n=!1){return To((()=>{const s=this.checkNumSamples(e);if(n)throw new Ky("Verbose predictLoop() is not implemented yet.");const r=cA(s,t),i=this.outputs.map((e=>[]));for(let t=0;t{const n=r[t][0],s=r[t][1],i=oA(e,n,s),a=[];if(Array.isArray(i))for(let e=0;ei[t].push(e)))}return eb(i.map((e=>Lu(e,0))))}))}predict(e,t={}){const n=uA(e);mA(n,this.inputNames,this.feedInputShapes,!1);try{const e=null==t.batchSize?32:t.batchSize;return aA(e),this.predictLoop(n,e)}finally{hA(n,e)}}predictOnBatch(e){mA(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 Hy("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=cb(t.map((e=>e.shape[0])));if(r.sort(),s.length>1)throw new $y(`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 $y(`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&&!Xt(s,r))throw new $y(`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=fA(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=fA(t,this.feedOutputNames,r,!1,"target")),function(e,t,n){const s=[vv,Ev,kv];for(let r=0;r0&&e[0].shape[0]%s!=0)throw new $y(`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,i){const[a,o]=this.standardizeUserDataXY(e,t,r,i);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=s){const e=Jv(s,this.outputNames);l=[];for(let t=0;t{const i=this.checkNumSamples(t,n,r,"steps"),a=[];if(s>0)throw new Ky("Verbose mode is not implemented yet.");if(null!=r)throw new Ky("steps mode in testLoop() is not implemented yet");{const s=cA(i,n),r=Vp(Pb(0,i));for(let n=0;n1){r+=`_${Jy(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),i=[],a=this.collectedTrainableWeights.map((e=>e.read()));return[this.optimizer_.minimize((()=>{const e=[];for(let t=0;t1&&e{l=Pl(l,e)})),l}),!0,a)].concat(i)}}makeTestFunction(){this.testFunction=e=>To((()=>{const t=[];let n;const s=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),i=[];for(let e=0;e0){if(g=!0,2!==n.validationData.length)throw 3===n.validationData.length?new Ky("validationData including sample weights is not supported yet."):new $y(`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);c=t[0],u=t[1],m=c.concat(u)}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];c=oA(s,e,t),i=s,s=oA(s,0,e),u=oA(r,e,t),a=r,r=oA(r,0,e),m=c.concat(u)}else null!=n.validationSteps&&(g=!0);const y=s.concat(r).concat(h);this.checkTrainableWeightsConsistency();const b=this.makeTrainFunction(),w=this.getDedupedMetricsNames();let v,A;g?(this.makeTestFunction(),v=this.testFunction,A=w.slice().concat(w.map((e=>"val_"+e)))):(v=null,m=[],A=w.slice());const x=mv(n.callbacks,n.yieldEvery);return await this.fitLoop(b,y,w,d,n.epochs,n.verbose,x,v,m,n.shuffle,A,n.initialEpoch,null,null)}finally{this.isTraining=!1,hA(s,e),hA(r,t),hA(i,e),hA(a,t),hA(c,o),hA(u,l),null!=h&&Io(h)}}async fitLoop(e,t,n,s,r,i,a,o,l,c,u,h,d,p){null==s&&(s=32),null==r&&(r=1),null==c&&(c=!0),null==h&&(h=0);let f=!1;if(null!=o&&null!=l&&(f=!0),null!=p&&(f=!0,null==d))throw new $y("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=Pb(0,m)),null==i&&(i=1);const{callbackList:y,history:b}=yv(a,i,r,h,m,d,s,f,u);y.setModel(this),this.history=b,await y.onTrainBegin(),this.stopTraining_=!1;for(let i=h;i{const h=a[c][0],d=a[c][1],p=qb(i,h,d-h);u.batch=c,u.size=d-h;const m=lA(t,p),g=e(m);for(let e=0;enb(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]=nb(n[s])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[nb(Vv(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map((e=>nb(Vv(e))));{const e={};for(const t in this.metrics)e[t]=nb(Vv(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=bv(Kv(e.optimizer_config));let n,s;if("string"==typeof e.loss)n=sb(e.loss);else if(Array.isArray(e.loss))n=e.loss.map((e=>sb(e)));else if(null!=e.loss){n={};for(const t in e.loss)n[t]=sb(e.loss[t])}if(Array.isArray(e.metrics))s=e.metrics.map((e=>sb(e)));else if(null!=e.metrics){s={};for(const t in e.metrics)s[t]=sb(e.metrics[t])}this.compile({loss:n,metrics:s,optimizer:t})}async save(e,t){if("string"==typeof e){const t=el(e);if(0===t.length)throw new $y(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new $y(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new $y("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await Mo(this.getNamedWeights(t)),s={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${Zv}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){s.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:r}=await Mo(await this.optimizer.getWeights(),e);n.specs.push(...r),n.data=qo([n.data,t])}if(null!=this.userDefinedMetadata){const e=!0;Wv(this.userDefinedMetadata,this.name,e),s.userDefinedMetadata=this.userDefinedMetadata}return s.weightData=n.data,s.weightSpecs=n.specs,e.save(s)}setUserDefinedMetadata(e){Wv(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}gA.className="Model",Ql(gA);class yA extends gA{}yA.className="Functional",Ql(yA);class bA extends gA{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:wb("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 $y(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof bA||e instanceof gA;let n;if(t){if(n=e,1!==n.outputs.length)throw new $y("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 $y("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 $y("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 $y("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 Gw({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 $y(`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 $y("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=Ww(this.outputs[0])}this.inboundNodes=[],new Lw({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:Yy(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(Iw(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 gA({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 Hy("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 Hy("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 Hy("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 Hy("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,i={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new $y("Legacy serialization format not supported yet.");r=t}else jt(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,i=t;const a=new e(i);if(!(a instanceof bA))throw new Ky(`Sequential.fromConfig called on non-Sequential input: ${a}`);for(const e of r){const t=bv(e,void 0,s);s&&t.setFastWeightInitDuringBuild(!0),a.add(t)}return a}set stopTraining(e){if(null==this.model)throw new $y("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 $y("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}}}bA.className="Sequential",Ql(bA);class wA extends Zl{getConfig(){return{}}}class vA extends wA{apply(e,t=1){return function(e,t=1){if(1!==t)throw new Ky(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return Eh(e)}(e,t)}}vA.className="elu",Ql(vA);class AA extends wA{apply(e){return bp(e)}}AA.className="selu",Ql(AA);class xA extends wA{apply(e){return cp(e)}}xA.className="relu",Ql(xA);class CA extends wA{apply(e){return To((()=>Td(6,cp(e))))}}CA.className="relu6",Ql(CA);class kA extends wA{apply(e){return e}}kA.className="linear",Ql(kA);class SA extends wA{apply(e){return Vu(e)}}SA.className="sigmoid",Ql(SA);class EA extends wA{apply(e){return function(e){return To((()=>{const t=Pl(.5,Gl(.2,e));return eh(t,0,1)}))}(e)}}EA.className="hardSigmoid",Ql(EA);class _A extends wA{apply(e){return ud(e)}}_A.className="softplus",Ql(_A);class TA extends wA{apply(e){return function(e){return To((()=>Wl(e,Pl(ac(e),1))))}(e)}}TA.className="softsign",Ql(TA);class IA extends wA{apply(e){return Gu(e)}}IA.className="tanh",Ql(IA);class NA extends wA{apply(e,t=-1){return Tp(e,t)}}NA.className="softmax",Ql(NA);class OA extends wA{apply(e,t=-1){return dd(e,t)}}OA.className="logSoftmax",Ql(OA);class DA extends wA{apply(e){return To((()=>To((()=>{const t=Math.sqrt(2),n=Gl(.5,Pl(1,Th(Wl(e,t))));return Gl(e,n)}))))}}DA.className="gelu",Ql(DA);class RA extends wA{apply(e){return To((()=>Gl(.5,Gl(e,Pl(1,Gu(Gl(Ul(Wl(2,Math.PI)),Pl(e,Gl(.044715,sc(e,3))))))))))}}RA.className="gelu_new",Ql(RA);class MA extends wA{apply(e){return To((()=>Gl(e,Gu(ud(e)))))}}MA.className="mish",Ql(MA);class FA extends wA{apply(e,t=1){return To((()=>Gl(Vu(Gl(e,t)),e)))}}function BA(e){return e.getClassName()}function zA(e,t={}){return ob(e,Yl.getMap().classNameMap,t,"activation")}function LA(e){if(null==e){const e={className:"linear",config:{}};return zA(e)}if("string"==typeof e){const t={};return t.className=e,t.config={},zA(t)}return e instanceof wA?e:zA(e)}function PA(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}`)}FA.className="swish",Ql(FA);class VA extends Zl{}class WA extends VA{constructor(e){super(),PA(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 To((()=>{let t=Sd([1]);return this.hasL1&&(t=Pl(t,Ph(Gl(this.l1,ac(e))))),this.hasL2&&(t=Pl(t,Ph(Gl(this.l2,Jb(e))))),Fu(t,[])}))}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}WA.className="L1L2",Ql(WA);const GA={l1l2:"L1L2"};function UA(e){return ib(e)}function qA(e,t={}){return ob(e,Yl.getMap().classNameMap,t,"regularizer")}function jA(e){if(null==e)return null;if("string"==typeof e){return qA({className:e in GA?GA[e]:e,config:{}})}return e instanceof VA?e:qA(e)}class HA extends Vw{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=Tw(e);let n=cp(e);return null!=this.maxValue&&(n=eh(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}HA.className="ReLU",Ql(HA);class $A extends Vw{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=Tw(e);return nd(n,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}$A.className="LeakyReLU",Ql($A);class KA extends Vw{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=Sw(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=jA(e.alphaRegularizer),this.alphaConstraint=iv(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 $y(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=Iw(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=Tw(e);const s=t.mask;if(null!=s){const e=Gl(rc(Ed(n.shape),Bl(s,n.dtype)),$l(-1e9));n=Pl(n,e)}return this.axis instanceof Array?this.axis.length>1?Uh(rc(n,pd(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 QA(e,t,n){if("number"==typeof e)return Yy(e,t);if(e.length!==t)throw new $y(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${e.length} elements.`);for(let r=0;r(Eb(t),"channelsFirst"===t?af(e,[0,2,3,1]):e)))}function nx(e,t){return To((()=>(Eb(t),"channelsFirst"===t?af(e,[0,2,3,4,1]):e)))}function sx(e,t,n,s=1,r="valid",i,a=1){return To((()=>{if(null==i&&(i="channelsLast"),Eb(i),3!==e.shape.length)throw new $y(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new $y(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new $y(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if("channelsFirst"===i&&(e=af(e,[0,2,1])),"causal"===r)throw new Ky("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let o=ah(e,t,s,"same"===r?"same":"valid","NWC",a);return null!=n&&(o=tw(o,n)),o}))}function rx(e,t,n,s=[1,1],r="valid",i,a,o=null){return To((()=>{if(null==i&&(i="channelsLast"),Eb(i),3!==e.rank&&4!==e.rank)throw new $y(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new $y(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=tx(e,i);if("causal"===r)throw new Ky("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=vf({x:l,filter:t,strides:s,pad:"same"===r?"same":"valid",dilations:a,dataFormat:"NHWC",bias:n,activation:o}),"channelsFirst"===i&&(l=af(l,[0,3,1,2])),l}))}function ix(e,t,n,s=[1,1,1],r="valid",i,a){return To((()=>{if(null==i&&(i="channelsLast"),Eb(i),4!==e.rank&&5!==e.rank)throw new $y(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new $y(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let o=nx(e,i);if("causal"===r)throw new Ky("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return o=ch(o,t,s,"same"===r?"same":"valid","NDHWC",a),null!=n&&(o=tw(o,n)),"channelsFirst"===i&&(o=af(o,[0,4,1,2,3])),o}))}YA.className="Softmax",Ql(YA);class ax extends Vw{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",ax.verifyArgs(t),this.rank=e,pb(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new Ky(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=QA(t.kernelSize,e,"kernelSize"),this.strides=QA(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,_b(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,Eb(this.dataFormat),this.activation=LA(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=Sw(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=iv(t.biasConstraint),this.biasRegularizer=jA(t.biasRegularizer),this.activityRegularizer=jA(t.activityRegularizer),this.dilationRate=QA(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new $y(`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 $y(`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 $y(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if(Qy("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!db(e.kernelSize,"number",1,3))throw new $y(`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:BA(this.activation),useBias:this.useBias,biasInitializer:kw(this.biasInitializer),biasRegularizer:UA(this.biasRegularizer),activityRegularizer:UA(this.activityRegularizer),biasConstraint:sv(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class ox extends ax{constructor(e,t){super(e,t),this.kernel=null,ox.verifyArgs(t),this.filters=t.filters,pb(this.filters,"filters"),this.kernelInitializer=Sw(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=iv(t.kernelConstraint),this.kernelRegularizer=jA(t.kernelRegularizer)}build(e){e=Iw(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new $y(`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 To((()=>{let t;e=Tw(e);const n=null==this.bias?null:this.bias.read(),s=mb(this.activation.getClassName());if(null!=s&&2===this.rank)t=rx(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,s);else{if(1===this.rank)t=sx(e,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=rx(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new Ky("convolutions greater than 3D are not implemented yet.");t=ix(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=Iw(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 lx extends ox{constructor(e){super(2,e),lx.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!db(e.kernelSize,"number",1,2))throw new $y(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}lx.className="Conv2D",Ql(lx);class cx extends ox{constructor(e){super(3,e),cx.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 $y(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}cx.className="Conv3D",Ql(cx);class ux extends lx{constructor(e){if(super(e),this.inputSpec=[new Fw({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new $y(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=Iw(e)).length)throw new $y("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 $y("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 Fw({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return To((()=>{let t=Tw(e);if(4!==t.shape.length)throw new $y(`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,i;"channelsFirst"===this.dataFormat?(r=2,i=3):(r=1,i=2);const a=n[r],o=n[i],l=this.kernelSize[0],c=this.kernelSize[1],u=this.strides[0],h=this.strides[1],d=[s,ex(a,u,l,this.padding),ex(o,h,c,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=af(t,[0,2,3,1]));let p=lh(t,this.kernel.read(),d,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(p=af(p,[0,3,1,2])),null!=this.bias&&(p=tw(p,this.bias.read(),this.dataFormat)),null!=this.activation&&(p=this.activation.apply(p)),p}))}computeOutputShape(e){const t=(e=Iw(e)).slice();let n,s,r;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3):(n=3,s=1,r=2);const i=this.kernelSize[0],a=this.kernelSize[1],o=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[s]=ex(t[s],o,i,this.padding),t[r]=ex(t[r],l,a,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}ux.className="Conv2DTranspose",Ql(ux);class hx extends cx{constructor(e){if(super(e),this.inputSpec=[new Fw({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new $y(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=Iw(e)).length)throw new $y("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 $y("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 Fw({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return To((()=>{let t=Tw(e);if(5!==t.shape.length)throw new $y(`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,i,a;"channelsFirst"===this.dataFormat?(a=2,r=3,i=4):(a=1,r=2,i=3);const o=n[a],l=n[r],c=n[i],u=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,ex(o,p,u,this.padding),ex(l,f,h,this.padding),ex(c,m,d,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=af(t,[0,2,3,4,1]));let y=hh(t,this.kernel.read(),g,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(y=af(y,[0,4,1,2,3])),null!==this.bias&&(y=tw(y,this.bias.read(),this.dataFormat)),null!==this.activation&&(y=this.activation.apply(y)),y}))}computeOutputShape(e){const t=(e=Iw(e)).slice();let n,s,r,i;"channelsFirst"===this.dataFormat?(n=1,s=2,r=3,i=4):(n=4,s=1,r=2,i=3);const a=this.kernelSize[0],o=this.kernelSize[1],l=this.kernelSize[2],c=this.strides[0],u=this.strides[1],h=this.strides[2];return t[n]=this.filters,t[s]=ex(t[s],c,a,this.padding),t[r]=ex(t[r],u,o,this.padding),t[i]=ex(t[i],h,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}hx.className="Conv3DTranspose",Ql(hx);class dx extends ox{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 $y("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new $y("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 $y(`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=Sw(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=jA(t.depthwiseRegularizer),this.depthwiseConstraint=iv(t.depthwiseConstraint),this.pointwiseInitializer=Sw(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=jA(t.pointwiseRegularizer),this.pointwiseConstraint=iv(t.pointwiseConstraint)}build(e){if((e=Iw(e)).length{let t;if(e=Tw(e),1===this.rank)throw new Ky("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=af(e,[0,2,3,1])),t=wp(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=tw(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=af(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=kw(this.depthwiseInitializer),e.pointwiseInitializer=kw(this.pointwiseInitializer),e.depthwiseRegularizer=UA(this.depthwiseRegularizer),e.pointwiseRegularizer=UA(this.pointwiseRegularizer),e.depthwiseConstraint=sv(this.depthwiseConstraint),e.pointwiseConstraint=sv(this.pointwiseConstraint),e}}dx.className="SeparableConv";class px extends dx{constructor(e){super(2,e)}}px.className="SeparableConv2D",Ql(px);class fx extends ox{constructor(e){super(1,e),fx.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&&!db(e.kernelSize,"number",1,1))throw new $y(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}fx.className="Conv1D",Ql(fx);class mx extends Vw{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 To((()=>{if(e=Tw(e),"channelsLast"===this.dataFormat){const t=Hb(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return Hb(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=Hb(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return Hb(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}}mx.className="Cropping2D",Ql(mx);class gx extends Vw{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,Eb(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,hb(Ab,"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 To((()=>{let t=Tw(e);const n=t.shape;if("channelsFirst"===this.dataFormat){t=af(t,[0,2,3,1]);const e=this.size[0]*n[2],s=this.size[1]*n[3],r="nearest"===this.interpolation?ym.resizeNearestNeighbor(t,[e,s]):ym.resizeBilinear(t,[e,s]);return af(r,[0,3,1,2])}{const e=this.size[0]*n[1],s=this.size[1]*n[2];return"nearest"===this.interpolation?ym.resizeNearestNeighbor(t,[e,s]):ym.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}}gx.className="UpSampling2D",Ql(gx);class yx extends ax{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=Sw(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=iv(e.depthwiseConstraint),this.depthwiseRegularizer=jA(e.depthwiseRegularizer)}build(e){if((e=Iw(e)).length<4)throw new $y(`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 $y(`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 To((()=>{let t=function(e,t,n=[1,1],s="valid",r,i){return To((()=>{null==r&&(r="channelsLast"),Eb(r);let a=tx(e,r);if(4!==e.rank)throw new $y(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new $y(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return a=bh(a,t,n,"same"===s?"same":"valid","NHWC",i),"channelsFirst"===r&&(a=af(a,[0,3,1,2])),a}))}(e=Tw(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=tw(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t}))}computeOutputShape(e){e=Iw(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=JA(t,this.kernelSize[0],this.padding,this.strides[0]),i=JA(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],s,r,i]:[e[0],r,i,s]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=kw(this.depthwiseInitializer),e.depthwiseRegularizer=UA(this.depthwiseRegularizer),e.depthwiseConstraint=sv(this.depthwiseRegularizer),e}}function bx(e,t,n,s){if(Array.isArray(e)){if(null!=t||null!=n)throw new $y("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 wx(e,t,n,s=!1,r,i,a=!1,o=!1){return To((()=>{const a=t.shape.length;if(a<3)throw new $y(`Input should be at least 3D, but is ${a}D.`);const l=[1,0].concat(Pb(2,a));if(t=af(t,l),null!=i)throw new Ky("The rnn() functoin of the deeplearn.js backend does not support constants yet.");null!=r&&((r=Bl(Bl(r,"bool"),"float32")).rank===a-1&&(r=qh(r,-1)),r=af(r,l)),s&&(t=hp(t,0),null!=r&&(r=hp(r,0)));const c=[];let u,h=n;const d=t.shape[0],p=Jp(t);let f,m;null!=r&&(f=Jp(r));for(let t=0;te(n,h)));if(null==r)u=s[0],h=s[1];else{const e=To((()=>{const e=f[t],n=rc(Bd(e),e);return{output:Pl(Gl(s[0],e),Gl(h[0],n)),newStates:h.map(((t,r)=>Pl(Gl(s[1][r],e),Gl(t,n))))}}));u=e.output,h=e.newStates}o&&c.push(u)}if(o){m=Bp(c,1)}return[u,m,h]}))}yx.className="DepthwiseConv2D",Ql(yx);class vx extends Vw{constructor(e){let t;if(super(e),null==e.cell)throw new $y("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new Tx({cells:e.cell}):e.cell,null==t.stateSize)throw new $y("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 Fw({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return Pb(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map((e=>null))}return this.states_}setStates(e){this.states_=e}computeOutputShape(e){Ew(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 To((()=>{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 $y(`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 Fw({shape:[null,e]})));this.stateful&&this.resetStates()}resetStates(e,t=!1){To((()=>{if(!this.stateful)throw new jy("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape[0];if(null==n)throw new $y("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=>Sd([n,e]))):this.states_=[Sd([n,this.cell.stateSize])];else if(null==e)Io(this.states_),null!=this.keptStates&&(Io(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((e=>Sd([n,e]))):this.states_[0]=Sd([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new $y(`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()):Io(this.states_);for(let t=0;tNo(e.clone())))}))}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=bx(e,n,s,this.numConstants);e=r.inputs,n=r.initialState,s=r.constants;let i=[],a=[];if(null!=n){t.initialState=n,i=i.concat(n),this.stateSpec=[];for(const e of n)this.stateSpec.push(new Fw({shape:e.shape}));a=a.concat(this.stateSpec)}null!=s&&(t.constants=s,i=i.concat(s),this.numConstants=s.length);if(i[0]instanceof Bw){const n=[e].concat(i),s=this.inputSpec.concat(a),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 To((()=>{const n=null==t?null:t.mask,s=null==t?null:t.training;let r=null==t?null:t.initialState;e=Tw(e),null==r&&(r=this.stateful?this.states_:this.getInitialState(e));const i=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==i)throw new $y(`RNN Layer has ${i} state(s) but was passed ${r.length} initial state(s).`);this.unroll;const a={training:s},o=wx(((e,t)=>{const n=this.cell.call([e].concat(t),a);return[n[0],n.slice(1)]}),e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=o[0],c=o[1],u=o[2];this.stateful&&this.resetStates(u,s);const h=this.returnSequences?c:l;return this.returnState?[h].concat(u):h}))}getInitialState(e){return To((()=>{let t=Sd(e.shape);return t=Ph(t,[1,2]),t=Ub(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map((e=>e>1?Xb(t,[1,e]):t)):this.cell.stateSize>1?[Xb(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()===vx.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=bv(t.cell,n);return new e(Object.assign(t,{cell:s}))}}vx.className="RNN",Ql(vx);class Ax extends Vw{}class xx extends Ax{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,pb(this.units,"units"),this.activation=LA(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Sw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Sw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Sw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=jA(e.kernelRegularizer),this.recurrentRegularizer=jA(e.recurrentRegularizer),this.biasRegularizer=jA(e.biasRegularizer),this.kernelConstraint=iv(e.kernelConstraint),this.recurrentConstraint=iv(e.recurrentConstraint),this.biasConstraint=iv(e.biasConstraint),this.dropout=zb([1,Lb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=zb([1,Lb([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=Iw(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 To((()=>{if(2!==e.length)throw new $y(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];const s=null!=t.training&&t.training;let r;0Bd(e),rate:this.dropout,training:s,dropoutFunc:this.dropoutFunc})),0Bd(n),rate:this.recurrentDropout,training:s,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,a=this.recurrentDropoutMask;r=Yb(null!=i?Gl(e,i):e,this.kernel.read()),null!=this.bias&&(r=tw(r,this.bias.read())),null!=a&&(n=Gl(n,a));let o=Pl(r,Yb(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:BA(this.activation),useBias:this.useBias,kernelInitializer:kw(this.kernelInitializer),recurrentInitializer:kw(this.recurrentInitializer),biasInitializer:kw(this.biasInitializer),kernelRegularizer:UA(this.kernelRegularizer),recurrentRegularizer:UA(this.recurrentRegularizer),biasRegularizer:UA(this.biasRegularizer),activityRegularizer:UA(this.activityRegularizer),kernelConstraint:sv(this.kernelConstraint),recurrentConstraint:sv(this.recurrentConstraint),biasConstraint:sv(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign(Object.assign({},e),t)}}xx.className="SimpleRNNCell",Ql(xx);class Cx extends vx{constructor(e){e.cell=new xx(e),super(e)}call(e,t){return To((()=>{null!=this.cell.dropoutMask&&(Io(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Io(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)}}Cx.className="SimpleRNN",Ql(Cx);class kx extends Ax{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 $y("GRUCell does not support reset_after parameter set to true.");this.units=e.units,pb(this.units,"units"),this.activation=LA(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=LA(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Sw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Sw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Sw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=jA(e.kernelRegularizer),this.recurrentRegularizer=jA(e.recurrentRegularizer),this.biasRegularizer=jA(e.biasRegularizer),this.kernelConstraint=iv(e.kernelConstraint),this.recurrentConstraint=iv(e.recurrentConstraint),this.biasConstraint=iv(e.biasConstraint),this.dropout=zb([1,Lb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=zb([1,Lb([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=Iw(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 To((()=>{if(2!==e.length)throw new $y(`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],0Bd(e),rate:this.dropout,training:n,count:3,dropoutFunc:this.dropoutFunc})),0Bd(s),rate:this.recurrentDropout,training:n,count:3,dropoutFunc:this.dropoutFunc}));const r=this.dropoutMask,i=this.recurrentDropoutMask;let a,o,l;0{null!=this.cell.dropoutMask&&(Io(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Io(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)}}Sx.className="GRU",Ql(Sx);class Ex extends Ax{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,pb(this.units,"units"),this.activation=LA(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=LA(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=Sw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=Sw(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=Sw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=jA(e.kernelRegularizer),this.recurrentRegularizer=jA(e.recurrentRegularizer),this.biasRegularizer=jA(e.biasRegularizer),this.kernelConstraint=iv(e.kernelConstraint),this.recurrentConstraint=iv(e.recurrentConstraint),this.biasConstraint=iv(e.biasConstraint),this.dropout=zb([1,Lb([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=zb([1,Lb([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=Iw(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 aw{apply(t,s){const r=e.apply([n]),i=(new lw).apply([n]),a=e.apply([2*n]);return Kb(Kb(r,i),a)}}).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 To((()=>{const n=null!=t.training&&t.training;if(3!==e.length)throw new $y(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let s=e[1];const r=e[2];e=e[0],0Bd(e),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc})),0Bd(s),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const i=this.dropoutMask,a=this.recurrentDropoutMask;let o,l,c,u;0{null!=this.cell.dropoutMask&&(Io(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Io(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)}}_x.className="LSTM",Ql(_x);class Tx extends Ax{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 To((()=>{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 i;for(let a=0;a{Ob(`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(bv(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 Rw(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!=i?i(t(),n):nw(t(),n),o=()=>sw(a,t,s);if(!r||r<=1)return No(o().clone());return Array(r).fill(void 0).map(o).map((e=>No(e.clone())))}Tx.className="StackedRNNCells",Ql(Tx);var Nx=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&&(Io(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(Io(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new $y("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 To((()=>{const{stateSize:t}=this.cell,n=e.shape,s=this.computeSingleOutputShape(n),r=Sd([s[0],...s.slice(2)]);return Array.isArray(t)?Array(t.length).fill(r):[r]}))}resetStates(e,t=!1){To((()=>{if(!this.stateful)throw new jy("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 $y("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((()=>Sd(r))):this.states_=[Sd(r)];else if(null==e)Io(this.states_),null!=this.keptStates&&(Io(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map((()=>Sd(r))):this.states_[0]=Sd(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new $y(`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()):Io(this.states_);for(let t=0;tNo(e.clone())))}))}computeSingleOutputShape(e){const{dataFormat:t,filters:n,kernelSize:s,padding:r,strides:i,dilationRate:a}=this.cell,o="channelsFirst"===t,l=e[o?3:2],c=e[o?4:3],u=JA(l,s[0],r,i[0],a[0]),h=JA(c,s[1],r,i[1],a[1]);return[...e.slice(0,2),...o?[n,u,h]:[u,h,n]]}}Ox.className="ConvRNN2D";class Dx extends Ex{constructor(e){const{filters:t,kernelSize:n,strides:s,padding:r,dataFormat:i,dilationRate:a}=e;super(Object.assign(Object.assign({},e),{units:t})),this.filters=t,pb(this.filters,"filters"),this.kernelSize=QA(n,2,"kernelSize"),this.kernelSize.forEach((e=>pb(e,"kernelSize"))),this.strides=QA(s||1,2,"strides"),this.strides.forEach((e=>pb(e,"strides"))),this.padding=r||"valid",_b(this.padding),this.dataFormat=i||"channelsLast",Eb(this.dataFormat),this.dilationRate=QA(a||1,2,"dilationRate"),this.dilationRate.forEach((e=>pb(e,"dilationRate")))}build(e){var t;e=Iw(e);const n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new $y(`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 i=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",i,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 aw{apply(e,t){return $b([n.apply([s]),Ed([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 To((()=>{if(3!==e.length)throw new $y(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const n=t.training||!1,s=e[0],r=e[1],i=e[2];0Bd(s),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const a=this.dropoutMask,o=(e,t,n)=>t&&t[n]?Gl(t[n],e):e;let l=o(s,a,0),c=o(s,a,1),u=o(s,a,2),h=o(s,a,3);0Bd(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]=Dp(this.kernel.read(),4,3),[A,x,C,k]=this.useBias?Dp(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,y,A,this.padding),c=this.inputConv(c,b,x,this.padding),u=this.inputConv(u,w,C,this.padding),h=this.inputConv(h,v,k,this.padding);const[S,E,_,T]=Dp(this.recurrentKernel.read(),4,3);p=this.recurrentConv(p,S),f=this.recurrentConv(f,E),m=this.recurrentConv(m,_),g=this.recurrentConv(g,T);const I=this.recurrentActivation.apply(Pl(l,p)),N=this.recurrentActivation.apply(Pl(c,f)),O=Pl(Gl(N,i),Gl(I,this.activation.apply(Pl(u,m)))),D=Gl(this.recurrentActivation.apply(Pl(h,g)),this.activation.apply(O));return[D,D,O]}))}getConfig(){const e=super.getConfig(),{units:t}=e,n=Nx(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=ih(e,t,this.strides,s||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?tw(r,n,this.dataFormat):r}recurrentConv(e,t){return ih(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}Dx.className="ConvLSTM2DCell",Ql(Dx);class Rx extends Ox{constructor(e){const t=new Dx(e);super(Object.assign(Object.assign({},e),{cell:t}))}static fromConfig(e,t){return new e(t)}}Rx.className="ConvLSTM2D",Ql(Rx);class Mx extends Vw{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=Tw(e);if(0nw(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()}}Mx.className="Dropout",Ql(Mx);class Fx extends Mx{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}Fx.className="SpatialDropout1D",Ql(Fx);class Bx extends Vw{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,pb(this.units,"units"),this.activation=LA(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=Sw(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=Sw(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=iv(e.kernelConstraint),this.biasConstraint=iv(e.biasConstraint),this.kernelRegularizer=jA(e.kernelRegularizer),this.biasRegularizer=jA(e.biasRegularizer),this.activityRegularizer=jA(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=Iw(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=Iw(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return To((()=>{this.invokeCallHook(e,t);const n=Tw(e),s=mb(this.activation.getClassName());let r;return null!=s?r=Yb(n,this.kernel.read(),s,this.bias?this.bias.read():null):(r=Yb(n,this.kernel.read()),null!=this.bias&&(r=tw(r,this.bias.read())),null!=this.activation&&(r=this.activation.apply(r))),r}))}getConfig(){const e={units:this.units,activation:BA(this.activation),useBias:this.useBias,kernelInitializer:kw(this.kernelInitializer),biasInitializer:kw(this.biasInitializer),kernelRegularizer:UA(this.kernelRegularizer),biasRegularizer:UA(this.biasRegularizer),activityRegularizer:UA(this.activityRegularizer),kernelConstraint:sv(this.kernelConstraint),biasConstraint:sv(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}Bx.className="Dense",Ql(Bx);class zx extends Vw{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=Iw(e);for(const t of e.slice(1))if(null==t)throw new $y(`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],Bb(e,1)]}call(e,t){return To((()=>{this.invokeCallHook(e,t);let n=Tw(e);if("channelsFirst"===this.dataFormat&&n.rank>1){const e=[0];for(let t=2;t{this.invokeCallHook(e,t);const n=Tw(e);return this.activation.apply(n)}))}getConfig(){const e={activation:BA(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}Lx.className="Activation",Ql(Lx);class Px extends Vw{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 To((()=>{return e=Tw(e),t=e,n=this.n,To((()=>{if(2!==t.shape.length)throw new $y(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return Xb(Ub(t,1),[1,n,1])}));var t,n}))}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}Px.className="RepeatVector",Ql(Px);class Vx extends Vw{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e{this.invokeCallHook(e,t);const n=Tw(e),s=n.shape,r=s.slice(0,1).concat(this.fixUnknownDimension(s.slice(1),this.targetShape));return Fu(n,r)}))}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}Vx.className="Reshape",Ql(Vx);class Wx extends Vw{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=Pb(1,e.dims.length+1);if(!Xt(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 Fw({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=Iw(e)).slice();return this.dims.forEach(((n,s)=>{t[s+1]=e[n]})),t}call(e,t){return af(Tw(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}Wx.className="Permute",Ql(Wx);class Gx extends Vw{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=Tw(e);return du(Md(n,this.maskValue),-1)}call(e,t){return To((()=>{this.invokeCallHook(e,t);const n=Tw(e),s=du(Md(n,this.maskValue),-1,!0);return Gl(n,Bl(s,n.dtype))}))}}Gx.className="Masking",Ql(Gx);class Ux extends Vw{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(tb(e.inputLength))}this.inputDim=e.inputDim,pb(this.inputDim,"inputDim"),this.outputDim=e.outputDim,pb(this.outputDim,"outputDim"),this.embeddingsInitializer=Sw(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=jA(e.embeddingsRegularizer),this.activityRegularizer=jA(e.activityRegularizer),this.embeddingsConstraint=iv(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 To((()=>this.maskZero?(e=Tw(e),Md(e,jl(e))):null))}computeOutputShape(e){if(e=Iw(e),null==this.inputLength)return[...e,this.outputDim];const t=tb(this.inputLength);if(t.length!==e.length-1)throw new $y(`"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=Tw(e);"int32"!==n.dtype&&(n=Gb(n,"int32"));const s=Qb(this.embeddings.read(),Fu(n,[n.size]));return Fu(s,Iw(this.computeOutputShape(n.shape)))}))}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:kw(this.embeddingsInitializer),embeddingsRegularizer:UA(this.embeddingsRegularizer),activityRegularizer:UA(this.activityRegularizer),embeddingsConstraint:sv(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}Ux.className="Embedding",Ql(Ux);class qx extends Vw{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new Ky}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length1)throw new $y(`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===cb(s).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return To((()=>{if(this.reshapeRequired){const t=[],n=e.map((e=>e.rank));if(-1===n.indexOf(null)){const s=Lb(n);for(let n of e){const e=n.rank;for(let t=0;t1){const r=Pb(1,e).concat([0]);t.push(af(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=Fu(af(Fu(s,[-1,t]),[1,0]),n)}else if(r>1){const e=[r-1].concat(Pb(0,r-1));s=af(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 $y("`mask` should be an Array");if(!Array.isArray(e))throw new $y("`inputs` should be an Array");if(t.length!==e.length)throw new $y(`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:qh(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 $y("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return To((()=>$b(e,this.axis)))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new $y("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 $y("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new $y("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new $y(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return To((()=>{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 Ky("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 $y(`Dimension incompatibility: ${t[s[0]]} !== ${n[s[1]]}`)}mergeFunction(e){if(2!==e.length)throw new $y(`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)=>Yx(t,e[n].shape.length))):[Yx(this.axes,n.shape.length),Yx(this.axes,s.shape.length)],this.normalize&&(n=wv(n,t[0]),s=wv(s,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new Ky("batchDot is not implemented for tensors of 4D or higher rank yet");if(jt(e.shape.length>=2,(()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`)),jt(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 Ky("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 i=n;return To((()=>{let n,a;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 Ky("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}}Qx.className="Dot",Ql(Qx);class Jx extends Vw{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 To((()=>{this.invokeCallHook(e,t);const n=Tw(e);return sw((()=>Pl(Zb(n.shape,0,this.stddev),n)),(()=>n),t.training||!1)}))}}Jx.className="GaussianNoise",Ql(Jx);class eC extends Vw{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 To((()=>{this.invokeCallHook(e,t);const n=Tw(e);if(this.rate>0&&this.rate<1){return sw((()=>{const e=Math.sqrt(this.rate/(1-this.rate));return Gl(n,Zb(n.shape,1,e))}),(()=>n),t.training||!1)}return n}))}}eC.className="GaussianDropout",Ql(eC);class tC extends Vw{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||Tw(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 To((()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(e);return sw((()=>{const t=Tw(e),s=-1.7580993408473766;let r=Yh(rp(n),this.rate);r=Gb(r,"float32");const i=((1-this.rate)*(1+this.rate*s**2))**-.5,a=-i*s*this.rate,o=Pl(Gl(t,r),Gl(Pl(r,-1),s));return Pl(Gl(o,i),a)}),(()=>Tw(e)),t.training||!1)}return e}))}}function nC(e,t,n,s,r,i=.001){let a;if(2===e.rank)a=Hu(e,t,n,s,r,i);else if(3===e.rank)a=$u(e,t,n,s,r,i);else{if(4!==e.rank)throw new Ky(`batchNormalization is not implemented for array of rank ${e.rank} yet`);a=Ku(e,t,n,s,r,i)}return a}function sC(e,t,n,s,r=.001){return Xt(s.slice().sort(),Pb(0,e.rank-1))?function(e,t,n,s,r=.001){return To((()=>{const i=Od(e,s),a=i.mean,o=i.variance;return[nC(e,a,o,n,t,r),a,o]}))}(e,t,n,s,r):function(e,t,n,s,r=.001){return To((()=>{const i=Od(e,s),a=i.mean,o=i.variance,l=[];for(const t of Pb(0,e.rank))-1!==s.indexOf(t)?l.push(1):l.push(e.shape[t]);const c=Fu(a,l),u=Fu(o,l),h=null==t?null:Fu(t,l),d=null==n?null:Fu(n,l);return[nC(e,c,u,d,h,r),a,o]}))}(e,t,n,s,r)}tC.className="AlphaDropout",Ql(tC);class rC extends Vw{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=Sw(e.betaInitializer||"zeros"),this.gammaInitializer=Sw(e.gammaInitializer||"ones"),this.movingMeanInitializer=Sw(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=Sw(e.movingVarianceInitializer||"ones"),this.betaConstraint=iv(e.betaConstraint),this.gammaConstraint=iv(e.gammaConstraint),this.betaRegularizer=jA(e.betaRegularizer),this.gammaRegularizer=jA(e.gammaRegularizer)}build(e){e=Iw(e);const t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new $y(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new Fw({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 To((()=>{const n=null!=t.training&&t.training,s=Tw(e),r=s.shape,i=r.length,a=Pb(0,i),o=this.axis>=0?this.axis:this.axis+i;a.splice(o,1);const l=Yy(1,i);l[o]=r[o];const c=a.slice();c.sort();const u=!Xt(c,Pb(0,i).slice(0,i-1));if(!n)return(()=>{if(u){const e=Fu(this.movingMean.read(),l),t=Fu(this.movingVariance.read(),l),n=this.center?Fu(this.beta.read(),l):null,r=this.scale?Fu(this.gamma.read(),l):null;return nC(s,e,t,n,r,this.epsilon)}return nC(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]=sC(s,this.gamma.read(),this.beta.read(),a,this.epsilon),f=(e,t,n)=>{To((()=>{const s=1-n,r=e.read(),i=Gl(rc(r,t),s);e.write(rc(r,i))}))};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:kw(this.betaInitializer),gammaInitializer:kw(this.gammaInitializer),movingMeanInitializer:kw(this.movingMeanInitializer),movingVarianceInitializer:kw(this.movingVarianceInitializer),betaRegularizer:UA(this.betaRegularizer),gammaRegularizer:UA(this.gammaRegularizer),betaConstraint:sv(this.betaConstraint),gammaConstraint:sv(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}rC.className="BatchNormalization",Ql(rC);class iC extends Vw{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=Sw(e.betaInitializer||"zeros"),this.gammaInitializer=Sw(e.gammaInitializer||"ones"),this.betaRegularizer=jA(e.betaRegularizer),this.gammaRegularizer=jA(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=Iw(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!==cb(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=Tw(e),s=n.shape,r=s.length;return To((()=>{let{mean:e,variance:t}=Od(n,this.axis,!0);const i=Yy(1,r);for(const e of this.axis)i[e]=s[e];const a=e=>null!=e&&e.shape.length!==r?Fu(e,i):e;let o=this.scale?a(this.gamma.read()):null,l=this.center?a(this.beta.read()):null;const c=[],u=[];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 To((()=>{return t=Tw(e),n=this.padding,s=this.dataFormat,To((()=>{if(4!==t.rank)throw new $y(`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 $y("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 $y(`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]],Ld(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 oC(e,t,n,s,r,i){return To((()=>{let a;Eb(r),Tb(i),_b(s),null==n&&(n=[1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==i&&(i="max"),e=tx(e,r);const o="same"===s?"same":"valid";return a="max"===i?Ad(e,t,n,o):Bu(e,t,n,o),"channelsFirst"===r&&(a=af(a,[0,3,1,2])),a}))}function lC(e,t,n,s,r,i){return To((()=>{let a;Eb(r),Tb(i),_b(s),null==n&&(n=[1,1,1]),null==s&&(s="valid"),null==r&&(r="channelsLast"),null==i&&(i="max"),e=nx(e,r);const o="same"===s?"same":"valid";return a="max"===i?xd(e,t,n,o):zu(e,t,n,o),"channelsFirst"===r&&(a=af(a,[0,4,1,2,3])),a}))}aC.className="ZeroPadding2D",Ql(aC);class cC extends Vw{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 $y(`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(pb(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 $y(`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}pb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,_b(this.padding),this.inputSpec=[new Fw({ndim:3})]}computeOutputShape(e){const t=JA((e=Iw(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return To((()=>{this.invokeCallHook(e,t),e=Ub(Tw(e),2);const n=this.poolingFunction(Tw(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return Fp(n,[2])}))}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class uC extends cC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),oC(e,t,n,s,r,"max")}}uC.className="MaxPooling1D",Ql(uC);class hC extends cC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),oC(e,t,n,s,r,"avg")}}hC.className="AveragePooling1D",Ql(hC);class dC extends Vw{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 $y(`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];pb(this.poolSize,"poolSize"),pb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Eb(this.dataFormat),_b(this.padding),this.inputSpec=[new Fw({ndim:4})]}computeOutputShape(e){e=Iw(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=JA(t,this.poolSize[0],this.padding,this.strides[0]),n=JA(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 To((()=>(this.invokeCallHook(e,t),this.poolingFunction(Tw(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 pC extends dC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),oC(e,t,n,s,r,"max")}}pC.className="MaxPooling2D",Ql(pC);class fC extends dC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),oC(e,t,n,s,r,"avg")}}fC.className="AveragePooling2D",Ql(fC);class mC extends Vw{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 $y(`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];pb(this.poolSize,"poolSize"),pb(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Eb(this.dataFormat),_b(this.padding),this.inputSpec=[new Fw({ndim:5})]}computeOutputShape(e){e=Iw(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=JA(t,this.poolSize[0],this.padding,this.strides[0]),n=JA(n,this.poolSize[1],this.padding,this.strides[1]),s=JA(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 To((()=>(this.invokeCallHook(e,t),this.poolingFunction(Tw(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 gC extends mC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),lC(e,t,n,s,r,"max")}}gC.className="MaxPooling3D",Ql(gC);class yC extends mC{constructor(e){super(e)}poolingFunction(e,t,n,s,r){return Eb(r),_b(s),lC(e,t,n,s,r,"avg")}}yC.className="AveragePooling3D",Ql(yC);class bC extends Vw{constructor(e){super(e),this.inputSpec=[new Fw({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new Ky}}class wC extends bC{constructor(e){super(e||{})}call(e,t){return To((()=>{const t=Tw(e);return kd(t,1)}))}}wC.className="GlobalAveragePooling1D",Ql(wC);class vC extends bC{constructor(e){super(e||{})}call(e,t){return To((()=>{const t=Tw(e);return zh(t,1)}))}}vC.className="GlobalMaxPooling1D",Ql(vC);class AC extends Vw{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,Eb(this.dataFormat),this.inputSpec=[new Fw({ndim:4})]}computeOutputShape(e){return"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new Ky}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class xC extends AC{call(e,t){return To((()=>{const t=Tw(e);return"channelsLast"===this.dataFormat?kd(t,[1,2]):kd(t,[2,3])}))}}xC.className="GlobalAveragePooling2D",Ql(xC);class CC extends AC{call(e,t){return To((()=>{const t=Tw(e);return"channelsLast"===this.dataFormat?zh(t,[1,2]):zh(t,[2,3])}))}}CC.className="GlobalMaxPooling2D",Ql(CC);class kC extends Vw{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=bv(t.layer,n);delete t.layer;const r={layer:s};return Object.assign(r,t),new e(r)}}class SC extends kC{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=Iw(e)).length<3)throw new $y(`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=Iw(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 To((()=>wx(((e,n)=>[Tw(this.layer.call(e,t)),[]]),e=Tw(e),[],!1,null,null,!1,!0)[1]))}}SC.className="TimeDistributed",Ql(SC);class EC extends kC{constructor(e){super(e);const t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=bv(n),t.goBackwards=!0!==t.goBackwards;const s={};var r;if(s.className=e.layer.getClassName(),s.config=t,this.backwardLayer=bv(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,hb(kb,"BidirectionalMergeMode",r),e.weights)throw new Ky("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()):eb(n)}apply(e,t){let n=null==t?null:t.initialState,s=null==t?null:t.constants;null==t&&(t={});const r=bx(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 i=[],a=[];if(null!=n){const e=n.length;if(e%2>0)throw new $y("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,i.push(...n);const s=n.map((e=>new Fw({shape:e.shape})));this.forwardLayer.stateSpec=s.slice(0,e/2),this.backwardLayer.stateSpec=s.slice(e/2),a.push(...s)}if(null!=s)throw new Ky("Support for constants in Bidirectional layers is not implemented yet.");const o=i[0]instanceof Bw;for(const e of i)if(e instanceof Bw!==o)throw new $y("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(i),s=this.inputSpec.concat(a),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 To((()=>{const n=t.initialState;let s,r,i,a;if(null==n)s=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{const i=n.slice(0,n.length/2),a=n.slice(n.length/2);s=this.forwardLayer.call(e,Object.assign(t,{initialState:i})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:a}))}return this.returnState&&(Array.isArray(s)&&(i=s.slice(1).concat(r.slice(1))),s=s[0],r=r[0]),this.returnSequences&&(r=hp(r,1)),"concat"===this.mergeMode?a=$b([s,r]):"sum"===this.mergeMode?a=Pl(s,r):"ave"===this.mergeMode?a=Gl(.5,Pl(s,r)):"mul"===this.mergeMode?a=Gl(s,r):null==this.mergeMode&&(a=[s,r]),this.returnState?null==this.mergeMode?a.concat(i):[a].concat(i):a}))}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){Ob(this.forwardLayer.name,(()=>{this.forwardLayer.build(e)})),Ob(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=bv(t.layer);if(delete t.layer,null!=t.numConstants)throw new Ky("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const s=t;return s.layer=n,new e(s)}}EC.className="Bidirectional",Ql(EC);class _C extends Vw{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 To((()=>("float32"!==(e=Tw(e)).dtype&&(e=Gb(e,"float32")),Pl(Gl(e,this.scale),this.offset))))}}_C.className="Rescaling",Ql(_C);const{resizeBilinear:TC,cropAndResize:IC}=ym;class NC extends Vw{constructor(e){super(e),this.height=e.height,this.width=e.width}centerCrop(e,t,n,s,r,i,a,o){return To((()=>{let l,c=!1;const u=[t/i,n/a,(s+t)/i,(r+n)/a],h=[];3===e.rank?(c=!0,l=Bp([e])):l=e;for(let e=0;eGb(TC(e,[t,n]),s)))}call(e,t){return To((()=>{const t=Tw(e),n=t.dtype,s=t.shape,r=s[s.length-3],i=s[s.length-2];let a=0;r!==this.height&&(a=Math.floor((r-this.height)/2));let o=0;return i!==this.width&&(o=Math.floor((i-this.width)/2),0===o&&(o=1)),a>=0&&o>=0?this.centerCrop(t,a,o,this.height,this.width,r,i,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=Iw(e)).length-3,n=e.length-2;return e[t]=this.height,e[n]=this.width,e}}NC.className="CenterCrop",Ql(NC);class OC extends Vw{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=Iw(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 To((()=>{let n;if("int32"!==(e=Tw(e)).dtype&&(e=Gb(e,"int32")),void 0!==t.countWeights){if("count"!==this.outputMode)throw new $y(`countWeights is not used when outputMode !== count.\n Received countWeights=${t.countWeights}`);n=Tw(t.countWeights)}const s=zh(e),r=Lh(e),i=Zh(this.numTokens,s).bufferSync().get(0),a=Yh(r,0).bufferSync().get(0);if(!i||!a)throw new $y(`Input values must be between 0 < values <= numTokens with numTokens=${this.numTokens}`);return function(e,t,n,s){let r=Tw(e);if("int32"!==r.dtype&&(r=Gb(r,"int32")),"int"===t)return r;const i=r.shape;if(0===r.rank&&(r=qh(r,-1)),"oneHot"===t&&1!==r.shape[r.shape.length-1]&&(r=qh(r,-1)),r.rank>2)throw new $y(`When outputMode is not int, maximum output rank is 2 Received outputMode ${t} and input shape ${i} which would result in output rank ${r.rank}.`);const a=["multiHot","oneHot"].includes(t);let o;if(o=gh(r,void 0!==s&&"count"===t?s:[],n,a),"tfIdf"!==t)return o;if(s)return Gl(o,s);throw new $y("When outputMode is 'tfIdf', weights must be provided.")}(e,this.outputMode,this.numTokens,n)}))}}OC.className="CategoryEncoding",Ql(OC);const DC=new Set(["bilinear","nearest"]);class RC extends Vw{constructor(e){if(super(e),this.height=e.height,this.width=e.width,e.interpolation){if(!DC.has(e.interpolation))throw new $y(`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=Iw(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 To((()=>{const t=[this.height,this.width];if("bilinear"===this.interpolation)return ym.resizeBilinear(e,t,!this.cropToAspectRatio);if("nearest"===this.interpolation)return ym.resizeNearestNeighbor(e,t,!this.cropToAspectRatio);throw new Error(`Interpolation is ${this.interpolation} but only ${[...DC]} are supported`)}))}}RC.className="Resizing",Ql(RC);class MC{constructor(e){this.seed=e}next(){if(void 0!==this.seed)return this.seed++}}MC.className="RandomSeed";class FC extends Vw{constructor(e){super(e),this.randomGenerator=new MC(e.seed)}getConfig(){const e={seed:this.randomGenerator.seed},t=super.getConfig();return Object.assign(e,t),e}}FC.className="BaseRandomLayer";const BC=new Set(["bilinear","nearest"]);class zC extends FC{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 $y(`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 $y(`factor must have values larger than -1. Got: ${this.factor}`);if(this.widthUpper{const t=Tw(e);this.imgHeight=t.shape[t.shape.length-3];const n=t.shape[t.shape.length-2];this.widthFactor=rp([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 ym.resizeBilinear(e,r);case"nearest":return ym.resizeNearestNeighbor(e,r);default:throw new Error(`Interpolation is ${this.interpolation}\n but only ${[...BC]} are supported`)}}))}}zC.className="RandomWidth",Ql(zC);var LC,PC,VC;En().registerFlag("KEEP_INTERMEDIATE_TENSORS",(()=>!1),(e=>{})),(PC=LC||(LC={}))[PC.DT_INVALID=0]="DT_INVALID",PC[PC.DT_FLOAT=1]="DT_FLOAT",PC[PC.DT_DOUBLE=2]="DT_DOUBLE",PC[PC.DT_INT32=3]="DT_INT32",PC[PC.DT_UINT8=4]="DT_UINT8",PC[PC.DT_INT16=5]="DT_INT16",PC[PC.DT_INT8=6]="DT_INT8",PC[PC.DT_STRING=7]="DT_STRING",PC[PC.DT_COMPLEX64=8]="DT_COMPLEX64",PC[PC.DT_INT64=9]="DT_INT64",PC[PC.DT_BOOL=10]="DT_BOOL",PC[PC.DT_QINT8=11]="DT_QINT8",PC[PC.DT_QUINT8=12]="DT_QUINT8",PC[PC.DT_QINT32=13]="DT_QINT32",PC[PC.DT_BFLOAT16=14]="DT_BFLOAT16",PC[PC.DT_QINT16=15]="DT_QINT16",PC[PC.DT_QUINT16=16]="DT_QUINT16",PC[PC.DT_UINT16=17]="DT_UINT16",PC[PC.DT_COMPLEX128=18]="DT_COMPLEX128",PC[PC.DT_HALF=19]="DT_HALF",PC[PC.DT_RESOURCE=20]="DT_RESOURCE",PC[PC.DT_VARIANT=21]="DT_VARIANT",PC[PC.DT_UINT32=22]="DT_UINT32",PC[PC.DT_UINT64=23]="DT_UINT64",PC[PC.DT_FLOAT_REF=101]="DT_FLOAT_REF",PC[PC.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",PC[PC.DT_INT32_REF=103]="DT_INT32_REF",PC[PC.DT_UINT8_REF=104]="DT_UINT8_REF",PC[PC.DT_INT16_REF=105]="DT_INT16_REF",PC[PC.DT_INT8_REF=106]="DT_INT8_REF",PC[PC.DT_STRING_REF=107]="DT_STRING_REF",PC[PC.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",PC[PC.DT_INT64_REF=109]="DT_INT64_REF",PC[PC.DT_BOOL_REF=110]="DT_BOOL_REF",PC[PC.DT_QINT8_REF=111]="DT_QINT8_REF",PC[PC.DT_QUINT8_REF=112]="DT_QUINT8_REF",PC[PC.DT_QINT32_REF=113]="DT_QINT32_REF",PC[PC.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",PC[PC.DT_QINT16_REF=115]="DT_QINT16_REF",PC[PC.DT_QUINT16_REF=116]="DT_QUINT16_REF",PC[PC.DT_UINT16_REF=117]="DT_UINT16_REF",PC[PC.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",PC[PC.DT_HALF_REF=119]="DT_HALF_REF",PC[PC.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",PC[PC.DT_VARIANT_REF=121]="DT_VARIANT_REF",PC[PC.DT_UINT32_REF=122]="DT_UINT32_REF",PC[PC.DT_UINT64_REF=123]="DT_UINT64_REF",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={}))}(VC||(VC={}));const WC={};function GC(e){return WC[e]}function UC(e,t,n,s,r){const i=t.inputParams[e];if(i&&void 0!==i.inputIndexStart){const e=i.inputIndexStart,a=0===i.inputIndexEnd?void 0:void 0===i.inputIndexEnd?e+1:i.inputIndexEnd,o=e<0?t.inputNames.length+e:e;if("tensor"===i.type)return qC(t.inputNames[o],n,s,r);if("tensors"===i.type){const i=t.inputs.slice(e,a);return t.inputNames.slice(e,a).filter(((e,t)=>{var n;return"NoOp"!==(null===(n=i[t])||void 0===n?void 0:n.op)})).map((e=>qC(e,n,s,r)))}const l=qC(t.inputNames[o],n,s,r),c=l.dataSync();return"number"===i.type?c[0]:mn(l.shape,c)}const a=t.attrParams[e];return a&&a.value}function qC(e,t,n,s){const[r,i]=KC(e,n);if(null!=s){const e=s.getHashTableHandleByName(r);if(null!=e)return e}const a=n.currentContextIds.find((e=>!!t[$C(r,e)]));return void 0!==a?t[$C(r,a)][i]:void 0}function jC(e,t,n){return t[$C(e,n.currentContextId)]}function HC(e,t){const[n,s,r]=KC(e,t);return[$C(n,t&&t.currentContextId),s,r]}function $C(e,t){return t?`${e}-${t}`:e}function KC(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 XC(e,t,n){let s=UC("pad",e,t,n);if("explicit"===s){s=UC("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 ZC(e){return e.kept?e:zl(e)}const YC=[{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}]}],QC=[{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}]}],JC=[{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"}]}],ek=[{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"}]}],tk=[{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"}]}],nk=[{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}]}],sk=[{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"}]}],rk=[{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"}]}],ik=[{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"}]}],ak=[{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"}]}],ok=[{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"}]}],lk=[{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"}]}],ck=[{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"}]}],uk=[{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"}]}],hk=[{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"}]}],dk=[{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"}]}],pk=[{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}]}],fk=[{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"}]}],mk=[{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 gk{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[i,a,o,l,c,u,h,d,p,f,m,g,y,b,w,v,A,x,C].map((e=>e.json)));this.opMappers=e.reduce(((e,t)=>(e[t.tfOpName]=t,e)),{})}transformGraph(e,t={}){const n=e.node,s=[],r=[],i=[],a=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||i.push(e[t.name]),e)),{});let o=[];const l=[];let c={},u={};null!=t&&(c=this.mapSignatureEntries(t.inputs),u=this.mapSignatureEntries(t.outputs));const h=Object.keys(a);h.forEach((e=>{const t=a[e];t.inputNames.forEach(((e,n)=>{const[s,,r]=HC(e),i=a[s];if(null!=i.outputs){const e=i.outputs.indexOf(r);if(-1!==e){const r=`${s}:${e}`;t.inputNames[n]=r}}t.inputs.push(i),i.children.push(t)}))})),0===Object.keys(u).length?h.forEach((e=>{const t=a[e];0===t.children.length&&l.push(t)})):Object.keys(u).forEach((e=>{const[t]=HC(e),n=a[t];null!=n&&(n.signatureKey=u[e],l.push(n))})),Object.keys(c).length>0?Object.keys(c).forEach((e=>{const[t]=HC(e),n=a[t];n&&(n.signatureKey=c[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:a,inputs:o,outputs:l,weights:r,placeholders:s,signature:t,functions:d};return i.length>0&&(p.initNodes=i),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce(((t,n)=>(t[e[n].name]=n,t)),{})}mapNode(e){const t=GC(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=bk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=bk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":r=Tk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Tk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":r=vk(e.attr,n.tfName,n.defaultValue||0),void 0===r&&n.tfDeprecatedName&&(r=vk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":r=_k(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=_k(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":r=wk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=wk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":r=Nk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Nk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":r=Ek(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Ek(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":r=Ik(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Ik(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":r=Ck(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Ck(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":r=kk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=kk(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":r=xk(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=xk(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=[],i=[];e.signature.inputArg.forEach((e=>{const[t]=HC(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:Ak(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,,i]=HC(e),a=s[r];if(null!=a.outputs){const e=a.outputs.indexOf(i);if(-1!==e){const s=`${r}:${e}`;t.inputNames[n]=s}}t.inputs.push(a),a.children.push(t)}))}));const a=e.ret;e.signature.outputArg.forEach((e=>{const[t,n]=HC(a[e.name]),r=s[t];null!=r&&(r.defaultOutput=n,i.push(r))}));const o=this.mapArgsToSignature(e);return{nodes:s,inputs:r,outputs:i,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 yk(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=En().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 bk(e,t,n,s=!1){const r=e[t];return null!=r?yk(r.s,s):n}function wk(e,t,n){const s=e[t];return s?s.b:n}function vk(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 Ak(e){switch("string"==typeof e&&(e=LC[e]),e){case LC.DT_FLOAT:case LC.DT_HALF:return"float32";case LC.DT_INT32:case LC.DT_INT64:case LC.DT_INT8:case LC.DT_UINT8:return"int32";case LC.DT_BOOL:return"bool";case LC.DT_DOUBLE:return"float32";case LC.DT_STRING:return"string";case LC.DT_COMPLEX64:case LC.DT_COMPLEX128:return"complex64";default:return null}}function xk(e,t,n){const s=e[t];return s&&s.func?s.func.name:n}function Ck(e,t,n){const s=e[t];return s&&s.type?Ak(s.type):n}function kk(e,t,n){const s=e[t];return s&&s.list&&s.list.type?s.list.type.map((e=>Ak(e))):n}function Sk(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((e=>"number"==typeof e.size?e.size:parseInt(e.size,10))):[]}function Ek(e,t,n){const s=e[t];return s&&s.shape?Sk(s.shape):n}function _k(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 Tk(e,t,n,s=!1){const r=e[t];return r&&r.list&&r.list.s?r.list.s.map((e=>yk(e,s))):n}function Ik(e,t,n){const s=e[t];return s&&s.list&&s.list.shape?s.list.shape.map((e=>Sk(e))):n}function Nk(e,t,n){const s=e[t];return s&&s.list&&s.list.b?s.list.b:n}class Ok{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 qC(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return qC(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return vk(this.node.rawAttrs,e,t);if(null!=n.s)return bk(this.node.rawAttrs,e,t);if(null!=n.b)return wk(this.node.rawAttrs,e,t);if(null!=n.shape)return Ek(this.node.rawAttrs,e,t);if(null!=n.type)return Ck(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return _k(this.node.rawAttrs,e,t);if(null!=n.list.s)return Tk(this.node.rawAttrs,e,t);if(null!=n.list.shape)return Ik(this.node.rawAttrs,e,t);if(null!=n.list.b)return Nk(this.node.rawAttrs,e,t);if(null!=n.list.type)return kk(this.node.rawAttrs,e,t)}return t}}function Dk(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){jt(e.length===t.length,(()=>n+` Shapes ${e} and ${t} must match`));for(let s=0;sn+` Shapes ${e} and ${t} must match`))}}}function Rk(e){return"number"!=typeof e&&!e.some((e=>e<0))}function Mk(e,t,n){let s=Fk(e,n);const r=!Rk(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=Fk(e.shape,s)})),!Rk(s))throw new Error(`Non-fully-defined elementShape: ${s}`);return s}function Fk(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&&i>=0&&r!==i)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[s]=r>=0?r:i}return n}class Bk{constructor(e,t,n,s,r,i,a){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=s,this.identicalElementShapes=r,this.dynamicSize=i,this.clearAfterRead=a,this.tensors=[],this.closed_=!1,this.idTensor=$l(0),No(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),Dk(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,No(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,Jp(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,i=[];To((()=>{t=Fu(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}`);Dk(t,e.shape,"TensorList shape mismatch: "),No(e)})),this.idTensor=$l(0),this.maxNumElements=s,No(this.idTensor)}copy(){return new zk([...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.`);Dk(e,this.elementShape,"TensorList shape mismatch: ");const s=Mk(this.elementShape,this.tensors,e);return To((()=>{const e=this.tensors.map((e=>Fu(e,s)));return Bp(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=Mk(this.elementShape,this.tensors,e),s=this.tensors.pop();return s.kept=!1,Dk(s.shape,e,"TensorList shape mismatch: "),Fu(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(Dk(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");No(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 zk([],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.`);Dk(this.tensors[e].shape,t,"TensorList shape mismatch: ");const s=Mk(this.elementShape,this.tensors,t);return Fu(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.`);Dk(this.elementShape,t.shape,"TensorList shape mismatch: "),No(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}`);Dk(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const s=Mk(this.elementShape,this.tensors,n);return 0===e.length?Co([],[0].concat(s)):To((()=>{const t=e.map((e=>Fu(this.tensors[e],s)));return Bp(t,0)}))}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);Dk(this.elementShape,t,"TensorList shape mismatch: ");const n=Mk(this.elementShape,this.tensors,t);return 0===this.size()?Co([],[0].concat(n)):To((()=>{const e=this.tensors.map((e=>Fu(e,n)));return Lu(e,0)}))}}const Lk=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const s=UC("thenBranch",e,t,n),r=UC("elseBranch",e,t,n),i=UC("cond",e,t,n),a=UC("args",e,t,n);return(await i.data())[0]?n.functionMap[s].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(a,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const s=UC("body",e,t,n),r=UC("cond",e,t,n),i=UC("args",e,t,n),a=await n.functionMap[r].executeFunctionAsync(i,n.tensorArrayMap,n.tensorListMap),o=i.map((e=>e.id));let l=await a[0].data();a.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||e.dispose()}));let c=i;for(;l[0];){const e=c;c=await n.functionMap[s].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);const t=c.map((e=>e.id));e.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}));const i=await n.functionMap[r].executeFunctionAsync(c,n.tensorArrayMap,n.tensorListMap);l=await i[0].data(),i.forEach((e=>{e.kept||-1!==o.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}))}return c}case"LoopCond":return[ZC(UC("pred",e,t,n))];case"Switch":{const s=UC("pred",e,t,n);let r=UC("data",e,t,n);return r.kept||(r=ZC(r)),(await s.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{const s=e.inputNames.find((e=>void 0!==qC(e,t,n)));if(s){return[ZC(qC(s,t,n))]}return}case"Enter":{const s=UC("frameName",e,t,n),r=UC("tensor",e,t,n);return n.enterFrame(s),[ZC(r)]}case"Exit":{const s=UC("tensor",e,t,n);return n.exitFrame(),[ZC(s)]}case"NextIteration":{const s=UC("tensor",e,t,n);return n.nextIteration(),[ZC(s)]}case"TensorArrayV3":{const s=UC("size",e,t,n),r=UC("dtype",e,t,n),i=UC("elementShape",e,t,n),a=UC("dynamicSize",e,t,n),o=UC("clearAfterRead",e,t,n),l=UC("identicalElementShapes",e,t,n),c=UC("name",e,t,n),u=new Bk(c,r,s,i,l,a,o);return n.addTensorArray(u),[u.idTensor,$l(1)]}case"TensorArrayWriteV3":{const s=UC("tensorArrayId",e,t,n),r=UC("index",e,t,n),i=UC("tensor",e,t,n),a=n.getTensorArray(s.id);return a.write(r,i),[a.idTensor]}case"TensorArrayReadV3":{const s=UC("tensorArrayId",e,t,n),r=UC("index",e,t,n);return[n.getTensorArray(s.id).read(r)]}case"TensorArrayGatherV3":{const s=UC("tensorArrayId",e,t,n),r=UC("indices",e,t,n),i=UC("dtype",e,t,n);return[n.getTensorArray(s.id).gather(r,i)]}case"TensorArrayScatterV3":{const s=UC("tensorArrayId",e,t,n),r=UC("indices",e,t,n),i=UC("tensor",e,t,n),a=n.getTensorArray(s.id);return a.scatter(r,i),[a.idTensor]}case"TensorArrayConcatV3":{const s=UC("tensorArrayId",e,t,n),r=n.getTensorArray(s.id),i=UC("dtype",e,t,n);return[r.concat(i)]}case"TensorArraySplitV3":{const s=UC("tensorArrayId",e,t,n),r=UC("tensor",e,t,n),i=UC("lengths",e,t,n),a=n.getTensorArray(s.id);return a.split(i,r),[a.idTensor]}case"TensorArraySizeV3":{const s=UC("tensorArrayId",e,t,n);return[$l(n.getTensorArray(s.id).size(),"int32")]}case"TensorArrayCloseV3":{const s=UC("tensorArrayId",e,t,n),r=n.getTensorArray(s.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{const s=UC("tensorListId",e,t,n),r=UC("index",e,t,n),i=UC("tensor",e,t,n),a=n.getTensorList(s.id);return a.setItem(r,i),[a.idTensor]}case"TensorListGetItem":{const s=UC("tensorListId",e,t,n),r=UC("index",e,t,n),i=UC("elementShape",e,t,n),a=UC("elementDType",e,t,n);return[n.getTensorList(s.id).getItem(r,i,a)]}case"TensorListScatterV2":case"TensorListScatter":{const s=UC("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 i=new zk([],n,e.dtype,s),a=Jp(e,0);return t.forEach(((e,t)=>{i.setItem(e,a[t])})),i}(UC("tensor",e,t,n),s,UC("elementShape",e,t,n),UC("numElements",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const s=UC("elementShape",e,t,n),r=UC("elementDType",e,t,n);let i;i="TensorListReserve"===e.op?"numElements":"maxNumElements";const a=UC(i,e,t,n),o=function(e,t,n,s){return new zk([],e,t,s)}(s,r,0,"TensorListReserve"===e.op?-1:a);return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{const s=UC("tensorListId",e,t,n),r=UC("indices",e,t,n),i=UC("elementShape",e,t,n),a=UC("elementDType",e,t,n);return[n.getTensorList(s.id).gather(r,a,i)]}case"TensorListStack":{const s=UC("tensorListId",e,t,n),r=UC("elementShape",e,t,n),i=UC("elementDType",e,t,n),a=UC("numElements",e,t,n);return[n.getTensorList(s.id).stack(r,i,a)]}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}`);Dk(e.shape.slice(1),t,"TensorList shape mismatch: ");const r=Jp(e);return new zk(r,t,s)}(UC("tensor",e,t,n),UC("elementShape",e,t,n),UC("elementDType",e,t,n));return n.addTensorList(s),[s.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const s=UC("tensorListId",e,t,n),r=n.getTensorList(s.id),i=UC("dtype",e,t,n),a=UC("elementShape",e,t,n);return[r.concat(i,a)]}case"TensorListPushBack":{const s=UC("tensorListId",e,t,n),r=UC("tensor",e,t,n),i=n.getTensorList(s.id);return i.pushBack(r),[i.idTensor]}case"TensorListPopBack":{const s=UC("tensorListId",e,t,n),r=UC("elementShape",e,t,n),i=UC("elementDType",e,t,n);return[n.getTensorList(s.id).popBack(r,i)]}case"TensorListSplit":{const s=UC("tensor",e,t,n),r=UC("elementShape",e,t,n),i=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 i=Fk(e.shape.slice(1),n),a=0===s?0:e.size/s,o=To((()=>{const n=[];e=Fu(e,[1,s,a]);for(let s=0;se.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return $l(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(),To((()=>{const e=Jp(t),s=n.length,r=e.length;jt(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=k)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[s.add(UC("a",e,t,n),UC("b",e,t,n))];case"AddN":return[s.addN(UC("tensors",e,t,n))];case"FloorMod":case"Mod":return[s.mod(UC("a",e,t,n),UC("b",e,t,n))];case"Mul":return[s.mul(UC("a",e,t,n),UC("b",e,t,n))];case"RealDiv":case"Div":return[s.div(UC("a",e,t,n),UC("b",e,t,n))];case"DivNoNan":return[s.divNoNan(UC("a",e,t,n),UC("b",e,t,n))];case"FloorDiv":return[s.floorDiv(UC("a",e,t,n),UC("b",e,t,n))];case"Sub":return[s.sub(UC("a",e,t,n),UC("b",e,t,n))];case"Minimum":return[s.minimum(UC("a",e,t,n),UC("b",e,t,n))];case"Maximum":return[s.maximum(UC("a",e,t,n),UC("b",e,t,n))];case"Pow":return[s.pow(UC("a",e,t,n),UC("b",e,t,n))];case"SquaredDifference":return[s.squaredDifference(UC("a",e,t,n),UC("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=k)=>{switch(e.op){case"Abs":case"ComplexAbs":return[s.abs(UC("x",e,t,n))];case"Acos":return[s.acos(UC("x",e,t,n))];case"Acosh":return[s.acosh(UC("x",e,t,n))];case"Asin":return[s.asin(UC("x",e,t,n))];case"Asinh":return[s.asinh(UC("x",e,t,n))];case"Atan":return[s.atan(UC("x",e,t,n))];case"Atan2":return[s.atan2(UC("x",e,t,n),UC("y",e,t,n))];case"Atanh":return[s.atanh(UC("x",e,t,n))];case"Ceil":return[s.ceil(UC("x",e,t,n))];case"Complex":return[s.complex(UC("real",e,t,n),UC("imag",e,t,n))];case"Cos":return[s.cos(UC("x",e,t,n))];case"Cosh":return[s.cosh(UC("x",e,t,n))];case"Elu":return[s.elu(UC("x",e,t,n))];case"Erf":return[s.erf(UC("x",e,t,n))];case"Exp":return[s.exp(UC("x",e,t,n))];case"Expm1":return[s.expm1(UC("x",e,t,n))];case"Floor":return[s.floor(UC("x",e,t,n))];case"Log":return[s.log(UC("x",e,t,n))];case"Log1p":return[s.log1p(UC("x",e,t,n))];case"Imag":return[s.imag(UC("x",e,t,n))];case"Neg":return[s.neg(UC("x",e,t,n))];case"Reciprocal":return[s.reciprocal(UC("x",e,t,n))];case"Real":return[s.real(UC("x",e,t,n))];case"Relu":return[s.relu(UC("x",e,t,n))];case"Round":return[s.round(UC("x",e,t,n))];case"Selu":return[s.selu(UC("x",e,t,n))];case"Sigmoid":return[s.sigmoid(UC("x",e,t,n))];case"Sin":return[s.sin(UC("x",e,t,n))];case"Sign":return[s.sign(UC("x",e,t,n))];case"Sinh":return[s.sinh(UC("x",e,t,n))];case"Softplus":return[s.softplus(UC("x",e,t,n))];case"Sqrt":return[s.sqrt(UC("x",e,t,n))];case"Square":return[s.square(UC("x",e,t,n))];case"Tanh":return[s.tanh(UC("x",e,t,n))];case"Tan":return[s.tan(UC("x",e,t,n))];case"ClipByValue":return[s.clipByValue(UC("x",e,t,n),UC("clipValueMin",e,t,n),UC("clipValueMax",e,t,n))];case"Relu6":return[s.relu6(UC("x",e,t,n))];case"Rsqrt":return[s.rsqrt(qC(e.inputNames[0],t,n))];case"LeakyRelu":return[s.leakyRelu(UC("x",e,t,n),UC("alpha",e,t,n))];case"Prelu":return[s.prelu(UC("x",e,t,n),UC("alpha",e,t,n))];case"IsNan":return[s.isNaN(qC(e.inputNames[0],t,n))];case"IsInf":return[s.isInf(qC(e.inputNames[0],t,n))];case"IsFinite":return[s.isFinite(qC(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"control":return Lk(e,t,n);case"convolution":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Conv1D":{const r=UC("stride",e,t,n),i=UC("pad",e,t,n),a=UC("dataFormat",e,t,n).toUpperCase(),o=UC("dilation",e,t,n);return[s.conv1d(UC("x",e,t,n),UC("filter",e,t,n),r,i,a,o)]}case"Conv2D":{const r=UC("strides",e,t,n),i=XC(e,t,n),a=UC("dataFormat",e,t,n).toUpperCase(),o=UC("dilations",e,t,n);return[s.conv2d(UC("x",e,t,n),UC("filter",e,t,n),[r[1],r[2]],i,a,[o[1],o[2]])]}case"_FusedConv2D":{const{stride:r,pad:i,dataFormat:a,dilations:o,biasArg:l,preluArg:c,activationFunc:u,leakyreluAlpha:h}=Pk(e,t,n);return[s.fused.conv2d({x:UC("x",e,t,n),filter:UC("filter",e,t,n),strides:[r[1],r[2]],pad:i,dataFormat:a,dilations:[o[1],o[2]],bias:l,activation:u,preluActivationWeights:c,leakyreluAlpha:h})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:i,dataFormat:a,dilations:o,biasArg:l,preluArg:c,activationFunc:u,leakyreluAlpha:h}=Pk(e,t,n);return[s.fused.depthwiseConv2d({x:UC("x",e,t,n),filter:UC("filter",e,t,n),strides:[r[1],r[2]],pad:i,dataFormat:a,dilations:[o[1],o[2]],bias:l,activation:u,preluActivationWeights:c,leakyreluAlpha:h})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=UC("outputShape",e,t,n),i=UC("strides",e,t,n),a=XC(e,t,n);return[s.conv2dTranspose(UC("x",e,t,n),UC("filter",e,t,n),r,[i[1],i[2]],a)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=UC("strides",e,t,n),i=XC(e,t,n),a=UC("dilations",e,t,n),o=UC("dataFormat",e,t,n).toUpperCase();return[s.depthwiseConv2d(UC("input",e,t,n),UC("filter",e,t,n),[r[1],r[2]],i,o,[a[1],a[2]])]}case"Conv3D":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("dataFormat",e,t,n).toUpperCase(),o=UC("dilations",e,t,n);return[s.conv3d(UC("x",e,t,n),UC("filter",e,t,n),[r[1],r[2],r[3]],i,a,[o[1],o[2],o[3]])]}case"AvgPool":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("kernelSize",e,t,n);return[s.avgPool(UC("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i)]}case"MaxPool":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("kernelSize",e,t,n);return[s.maxPool(UC("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i)]}case"MaxPoolWithArgmax":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("kernelSize",e,t,n),o=UC("includeBatchInIndex",e,t,n),{result:l,indexes:c}=s.maxPoolWithArgmax(UC("x",e,t,n),[a[1],a[2]],[r[1],r[2]],i,o);return[l,c]}case"AvgPool3D":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("kernelSize",e,t,n);return[s.avgPool3d(UC("x",e,t,n),[a[1],a[2],a[3]],[r[1],r[2],r[3]],i)]}case"MaxPool3D":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("kernelSize",e,t,n);return[s.maxPool3d(UC("x",e,t,n),[a[1],a[2],a[3]],[r[1],r[2],r[3]],i)]}case"Dilation2D":{const r=UC("strides",e,t,n),i=UC("pad",e,t,n),a=UC("dilations",e,t,n),o=r[1],l=r[2],c=a[1],u=a[2];return[s.dilation2d(UC("x",e,t,n),UC("filter",e,t,n),[o,l],i,[c,u],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"creation":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Fill":{const r=UC("shape",e,t,n),i=UC("dtype",e,t,n),a=UC("value",e,t,n);return[s.fill(r,a,i)]}case"LinSpace":{const r=UC("start",e,t,n),i=UC("stop",e,t,n),a=UC("num",e,t,n);return[s.linspace(r,i,a)]}case"Multinomial":{const r=UC("logits",e,t,n),i=UC("numSamples",e,t,n),a=UC("seed",e,t,n);return[s.multinomial(r,i,a)]}case"OneHot":{const r=UC("indices",e,t,n),i=UC("depth",e,t,n),a=UC("onValue",e,t,n),o=UC("offValue",e,t,n),l=UC("dtype",e,t,n);return[s.oneHot(r,i,a,o,l)]}case"Ones":return[s.ones(UC("shape",e,t,n),UC("dtype",e,t,n))];case"OnesLike":return[s.onesLike(UC("x",e,t,n))];case"RandomStandardNormal":return[s.randomStandardNormal(UC("shape",e,t,n),UC("dtype",e,t,n),UC("seed",e,t,n))];case"RandomUniform":return[s.randomUniform(UC("shape",e,t,n),UC("minval",e,t,n),UC("maxval",e,t,n),UC("dtype",e,t,n))];case"RandomUniformInt":return[s.randomUniformInt(UC("shape",e,t,n),UC("minval",e,t,n),UC("maxval",e,t,n),UC("seed",e,t,n))];case"Range":{const r=UC("start",e,t,n),i=UC("stop",e,t,n),a=UC("step",e,t,n);return[s.range(r,i,a,UC("dtype",e,t,n))]}case"TruncatedNormal":{const r=UC("shape",e,t,n),i=UC("mean",e,t,n),a=UC("stdDev",e,t,n),o=UC("seed",e,t,n);return[s.truncatedNormal(r,i,a,UC("dtype",e,t,n),o)]}case"Zeros":return[s.zeros(UC("shape",e,t,n),UC("dtype",e,t,n))];case"ZerosLike":return[s.zerosLike(UC("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=k)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l,softNmsSigma:c}=Vk(e,t,n),u=await r.image.nonMaxSuppressionWithScoreAsync(s,i,a,o,l,c);return[u.selectedIndices,u.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=Vk(e,t,n),c=UC("padToMaxOutputSize",e,t,n),u=await r.image.nonMaxSuppressionPaddedAsync(s,i,a,o,l,c);return[u.selectedIndices,u.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:s,scores:i,maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=Vk(e,t,n);return[await r.image.nonMaxSuppressionAsync(s,i,a,o,l)]}case"Where":{const s=r.cast(UC("condition",e,t,n),"bool"),i=[await r.whereAsync(s)];return s.dispose(),i}case"ListDiff":return r.setdiff1dAsync(UC("x",e,t,n),UC("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=k)=>{switch(e.op){case"LowerBound":{const r=UC("sortedSequence",e,t,n),i=UC("values",e,t,n);return[s.lowerBound(r,i)]}case"TopKV2":{const r=UC("x",e,t,n),i=UC("k",e,t,n),a=UC("sorted",e,t,n),o=s.topk(r,i,a);return[o.values,o.indices]}case"UpperBound":{const r=UC("sortedSequence",e,t,n),i=UC("values",e,t,n);return[s.upperBound(r,i)]}case"Unique":{const r=UC("x",e,t,n),i=s.unique(r);return[i.values,i.indices]}case"UniqueV2":{const r=UC("x",e,t,n),i=UC("axis",e,t,n),a=s.unique(r,i);return[a.values,a.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"image":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"ResizeBilinear":{const r=UC("images",e,t,n),i=UC("size",e,t,n),a=UC("alignCorners",e,t,n),o=UC("halfPixelCenters",e,t,n);return[s.image.resizeBilinear(r,[i[0],i[1]],a,o)]}case"ResizeNearestNeighbor":{const r=UC("images",e,t,n),i=UC("size",e,t,n),a=UC("alignCorners",e,t,n),o=UC("halfPixelCenters",e,t,n);return[s.image.resizeNearestNeighbor(r,[i[0],i[1]],a,o)]}case"CropAndResize":{const r=UC("image",e,t,n),i=UC("boxes",e,t,n),a=UC("boxInd",e,t,n),o=UC("cropSize",e,t,n),l=UC("method",e,t,n),c=UC("extrapolationValue",e,t,n);return[s.image.cropAndResize(r,i,a,o,l,c)]}case"ImageProjectiveTransformV3":{const r=UC("images",e,t,n),i=UC("transforms",e,t,n),a=UC("outputShape",e,t,n),o=UC("fillValue",e,t,n),l=UC("interpolation",e,t,n),c=UC("fillMode",e,t,n);return[s.image.transform(r,i,l.toLowerCase(),c.toLowerCase(),o,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"graph":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=UC("default",e,t,n);return[qC(e.name,t,n)||r];case"Placeholder":return[qC(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[ZC(UC("x",e,t,n))];case"IdentityN":return UC("x",e,t,n).map((e=>ZC(e)));case"Shape":return[s.tensor1d(UC("x",e,t,n).shape,"int32")];case"ShapeN":return UC("x",e,t,n).map((e=>s.tensor1d(e.shape)));case"Size":return[s.scalar(UC("x",e,t,n).size,"int32")];case"Rank":return[s.scalar(UC("x",e,t,n).rank,"int32")];case"NoOp":return[s.scalar(1)];case"Print":const i=UC("x",e,t,n),a=UC("data",e,t,n);UC("message",e,t,n),UC("summarize",e,t,n);for(let e=0;e((e,t,n,s=k)=>{switch(e.op){case"Equal":return[s.equal(UC("a",e,t,n),UC("b",e,t,n))];case"NotEqual":return[s.notEqual(UC("a",e,t,n),UC("b",e,t,n))];case"Greater":return[s.greater(UC("a",e,t,n),UC("b",e,t,n))];case"GreaterEqual":return[s.greaterEqual(UC("a",e,t,n),UC("b",e,t,n))];case"Less":return[s.less(UC("a",e,t,n),UC("b",e,t,n))];case"LessEqual":return[s.lessEqual(UC("a",e,t,n),UC("b",e,t,n))];case"LogicalAnd":return[s.logicalAnd(UC("a",e,t,n),UC("b",e,t,n))];case"LogicalNot":return[s.logicalNot(UC("a",e,t,n))];case"LogicalOr":return[s.logicalOr(UC("a",e,t,n),UC("b",e,t,n))];case"Select":case"SelectV2":return[s.where(UC("condition",e,t,n),UC("a",e,t,n),UC("b",e,t,n))];case"BitwiseAnd":return[s.bitwiseAnd(UC("a",e,t,n),UC("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=k)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[s.matMul(UC("a",e,t,n),UC("b",e,t,n),UC("transposeA",e,t,n),UC("transposeB",e,t,n))];case"Einsum":return[s.einsum(UC("equation",e,t,n),...UC("tensors",e,t,n))];case"Transpose":return[s.transpose(UC("x",e,t,n),UC("perm",e,t,n))];case"_FusedMatMul":const[r,i]=UC("fusedOps",e,t,n),a="biasadd"===r,o="prelu"===i,l=UC("numArgs",e,t,n),c=UC("leakyreluAlpha",e,t,n);if(a){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[u,h]=UC("args",e,t,n);return[s.fused.matMul({a:UC("a",e,t,n),b:UC("b",e,t,n),transposeA:UC("transposeA",e,t,n),transposeB:UC("transposeB",e,t,n),bias:u,activation:i,preluActivationWeights:h,leakyreluAlpha:c})];case"MatrixBandPart":return[s.linalg.bandPart(UC("a",e,t,n),UC("numLower",e,t,n),UC("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=k)=>{switch(e.op){case"EuclideanNorm":return[s.euclideanNorm(UC("x",e,t,n),UC("axis",e,t,n),UC("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[s.batchNorm(UC("x",e,t,n),UC("mean",e,t,n),UC("variance",e,t,n),UC("offset",e,t,n),UC("scale",e,t,n),UC("epsilon",e,t,n))];case"LRN":return[s.localResponseNormalization(UC("x",e,t,n),UC("radius",e,t,n),UC("bias",e,t,n),UC("alpha",e,t,n),UC("beta",e,t,n))];case"Softmax":return[s.softmax(UC("x",e,t,n))];case"LogSoftmax":return[s.logSoftmax(UC("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=k)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:r,outputDenseValues:i}=s.raggedGather(UC("paramsNestedSplits",e,t,n),UC("paramsDenseValues",e,t,n),UC("indices",e,t,n),UC("outputRaggedRank",e,t,n));return r.concat(i)}case"RaggedRange":{const{rtNestedSplits:r,rtDenseValues:i}=s.raggedRange(UC("starts",e,t,n),UC("limits",e,t,n),UC("splits",e,t,n));return[r,i]}case"RaggedTensorToTensor":return[s.raggedTensorToTensor(UC("shape",e,t,n),UC("values",e,t,n),UC("defaultValue",e,t,n),UC("rowPartitionTensors",e,t,n),UC("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=k)=>{switch(e.op){case"Max":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.max(UC("x",e,t,n),r,i)]}case"Mean":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.mean(UC("x",e,t,n),r,i)]}case"Min":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.min(UC("x",e,t,n),r,i)]}case"Sum":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.sum(UC("x",e,t,n),r,i)]}case"All":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.all(UC("x",e,t,n),r,i)]}case"Any":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.any(UC("x",e,t,n),r,i)]}case"ArgMax":{const r=UC("axis",e,t,n);return[s.argMax(UC("x",e,t,n),r)]}case"ArgMin":{const r=UC("axis",e,t,n);return[s.argMin(UC("x",e,t,n),r)]}case"Prod":{const r=UC("axis",e,t,n),i=UC("keepDims",e,t,n);return[s.prod(UC("x",e,t,n),r,i)]}case"Cumprod":{const r=UC("axis",e,t,n),i=UC("exclusive",e,t,n),a=UC("reverse",e,t,n);return[s.cumprod(UC("x",e,t,n),r,i,a)]}case"Cumsum":{const r=UC("axis",e,t,n),i=UC("exclusive",e,t,n),a=UC("reverse",e,t,n);return[s.cumsum(UC("x",e,t,n),r,i,a)]}case"Bincount":const r=UC("x",e,t,n),i=UC("weights",e,t,n),a=UC("size",e,t,n);return[s.bincount(r,i,a)];case"DenseBincount":{const r=UC("x",e,t,n),i=UC("weights",e,t,n),a=UC("size",e,t,n),o=UC("binaryOutput",e,t,n);return[s.denseBincount(r,i,a,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"slice_join":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=UC("n",e,t,n),i=UC("axis",e,t,n);let a=UC("tensors",e,t,n);return a=a.slice(0,r),[s.concat(a,i)]}case"Gather":{const r=UC("x",e,t,n),i=UC("indices",e,t,n);return[s.gather(r,s.cast(i,"int32"),0)]}case"GatherV2":{const r=UC("axis",e,t,n),i=UC("batchDims",e,t,n),a=UC("x",e,t,n),o=UC("indices",e,t,n);return[s.gather(a,s.cast(o,"int32"),r,i)]}case"Reverse":{const r=UC("dims",e,t,n),i=[];for(let e=0;e{const r=UC("axis",e,t,n),i=UC("tensors",e,t,n),a=i[0].shape,o=s.squeeze(i[0]).shape,l=i.map((e=>{const t=Xt(e.shape,a);if(!t&&!Xt(s.squeeze(e).shape,o))throw new Error("the input tensors shape does not match");return t?e:s.reshape(e,a)}));return[s.stack(l,r)]}));case"Unpack":{const r=UC("axis",e,t,n),i=UC("tensor",e,t,n);return s.unstack(i,r)}case"Tile":{const r=UC("reps",e,t,n);return[s.tile(UC("x",e,t,n),r)]}case"Split":case"SplitV":{const r=UC("axis",e,t,n),i=UC("numOrSizeSplits",e,t,n),a=UC("x",e,t,n);return s.split(a,i,r)}case"ScatterNd":{const r=UC("indices",e,t,n),i=UC("values",e,t,n),a=UC("shape",e,t,n);return[s.scatterND(r,i,a)]}case"GatherNd":{const r=UC("x",e,t,n),i=UC("indices",e,t,n);return[s.gatherND(r,i)]}case"SparseToDense":{const r=UC("sparseIndices",e,t,n),i=UC("outputShape",e,t,n),a=UC("sparseValues",e,t,n),o=UC("defaultValue",e,t,n);return[s.sparseToDense(r,a,i,a.dtype===o.dtype?o:s.cast(o,a.dtype))]}case"TensorScatterUpdate":{const r=UC("indices",e,t,n),i=UC("values",e,t,n),a=UC("tensor",e,t,n);return[s.tensorScatterUpdate(a,r,i)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"sparse":return r((()=>((e,t,n,s=k)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:i,emptyRowIndicator:a,reverseIndexMap:o}=s.sparse.sparseFillEmptyRows(UC("indices",e,t,n),UC("values",e,t,n),UC("denseShape",e,t,n),UC("defaultValue",e,t,n));return[r,i,a,o]}case"SparseReshape":{const{outputIndices:r,outputShape:i}=s.sparse.sparseReshape(UC("inputIndices",e,t,n),UC("inputShape",e,t,n),UC("newShape",e,t,n));return[r,i]}case"SparseSegmentMean":return[s.sparse.sparseSegmentMean(UC("data",e,t,n),UC("indices",e,t,n),UC("segmentIds",e,t,n))];case"SparseSegmentSum":return[s.sparse.sparseSegmentSum(UC("data",e,t,n),UC("indices",e,t,n),UC("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=k)=>{switch(e.op){case"FFT":return[s.fft(UC("x",e,t,n))];case"IFFT":return[s.ifft(UC("x",e,t,n))];case"RFFT":return[s.rfft(UC("x",e,t,n))];case"IRFFT":return[s.irfft(UC("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=k)=>{switch(e.op){case"StaticRegexReplace":return[s.string.staticRegexReplace(UC("input",e,t,n),UC("pattern",e,t,n),UC("rewrite",e,t,n),UC("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:r,nGramsSplits:i}=s.string.stringNGrams(UC("data",e,t,n),UC("dataSplits",e,t,n),UC("separator",e,t,n),UC("nGramWidths",e,t,n),UC("leftPad",e,t,n),UC("rightPad",e,t,n),UC("padWidth",e,t,n),UC("preserveShortSequences",e,t,n));return[r,i]}case"StringSplit":{const{indices:r,values:i,shape:a}=s.string.stringSplit(UC("input",e,t,n),UC("delimiter",e,t,n),UC("skipEmpty",e,t,n));return[r,i,a]}case"StringToHashBucketFast":return[s.string.stringToHashBucketFast(UC("input",e,t,n),UC("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=k)=>{switch(e.op){case"Cast":return[s.cast(UC("x",e,t,n),UC("dtype",e,t,n))];case"ExpandDims":{const r=UC("axis",e,t,n);return[s.expandDims(UC("x",e,t,n),r)]}case"Squeeze":{const r=UC("axis",e,t,n);return[s.squeeze(UC("x",e,t,n),r)]}case"Reshape":return[s.reshape(UC("x",e,t,n),UC("shape",e,t,n))];case"EnsureShape":return[s.ensureShape(UC("x",e,t,n),UC("shape",e,t,n))];case"MirrorPad":return[s.mirrorPad(UC("x",e,t,n),UC("padding",e,t,n),UC("mode",e,t,n))];case"PadV2":case"Pad":return[s.pad(UC("x",e,t,n),UC("padding",e,t,n),UC("constantValue",e,t,n))];case"SpaceToBatchND":{const r=UC("blockShape",e,t,n),i=UC("paddings",e,t,n);return[s.spaceToBatchND(UC("x",e,t,n),r,i)]}case"BatchToSpaceND":{const r=UC("blockShape",e,t,n),i=UC("crops",e,t,n);return[s.batchToSpaceND(UC("x",e,t,n),r,i)]}case"DepthToSpace":{const r=UC("blockSize",e,t,n),i=UC("dataFormat",e,t,n).toUpperCase();return[s.depthToSpace(UC("x",e,t,n),r,i)]}case"BroadcastTo":return[s.broadcastTo(UC("x",e,t,n),UC("shape",e,t,n))];case"BroadcastArgs":return[s.broadcastArgs(UC("s0",e,t,n),UC("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=UC("keyDType",e,t,n),i=UC("valueDType",e,t,n),a=new Wk(r,i);return s.addHashTable(e.name,a),[a.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const r=UC("tableHandle",e,t,n,s),i=UC("keys",e,t,n),a=UC("values",e,t,n),o=s.getHashTableById(r.id);return[await o.import(i,a)]}case"LookupTableFind":case"LookupTableFindV2":{const r=UC("tableHandle",e,t,n,s),i=UC("keys",e,t,n),a=UC("defaultValue",e,t,n),o=s.getHashTableById(r.id);return[await o.find(i,a)]}case"LookupTableSize":case"LookupTableSizeV2":{const r=UC("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 i=GC(e.op);if(i&&i.customExecutor)return i.customExecutor(new Ok(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(i)?i.then((e=>[].concat(e))):[].concat(i)}class Uk{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 qk(e,t,n,s){const r=new Set,i=[];let a=null,o=null;const l=new Set,c=new Set(Object.keys(e).map((e=>KC(e)[0])));s=s||[];const u=new Set(s.map((e=>KC(e.name)[0]))),h=[...t];for(;h.length>0;){const e=h.pop();(Zk(e)||Yk(e)||Qk(e))&&null==a&&(a=e,o=a.children.map((e=>e.name)).filter((e=>r.has(e)))),r.add(e.name),null==n[e.name]&&(c.has(e.name)||u.has(e.name)||(0!==e.inputs.length?e.inputs.forEach((e=>{l.has(e.name)||(l.add(e.name),h.push(e))})):i.push(e.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:i,dynamicNode:a,syncInputs:o}}function jk(e,t){const{usedNodes:n,inputs:s}=t,r=Object.keys(s).map((e=>KC(e)[0])).map((t=>e.nodes[t])),i=e.initNodes||[],a=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,...i]).filter(a),c=o([...l,...Object.values(e.nodes)]).filter(a),u=new Map(c.map((e=>[e.name,e]))),h={};for(const e of c){h[e.name]=h[e.name]||0;for(const t of e.children)a(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=u.get(e);for(const e of t.children.filter(a))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 i=e.filter((e=>r.has(e.name)));return i}(p.map((e=>u.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),i=new Set(e.map((e=>e.name))),a=e=>i.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(a)){if(!n.has(e.name))throw new Hk(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new Hk(`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 Hk(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new Hk(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(f,l),f}class Hk extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const $k=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),Kk=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),Xk=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function Zk(e){return $k.has(e.op)}function Yk(e){return Kk.has(e.op)}function Qk(e){return Xk.has(e.op)}class Jk{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 Jk(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=qk(e,t,this.weightMap,this._initNodes),{missingInputs:s,dynamicNode:r,syncInputs:i}=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 [${i}]`);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 a=jk(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)=>Zk(e)?n:t)),r=e=>{const n=s[t.get(e.name)];return null==n?-1:n},i=e.map(((e,t)=>e.children.map(r).reduce(((e,t)=>Math.max(e,t)),s[t]))),a=new Map;for(let t=0;tthis.cloneAndKeepTensor(e)))}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[KC(e)[0]])),r=t.map((e=>KC(e)[0])),i=new Set(r);let a=r.map((e=>this.graph.nodes[e]));0===a.length&&(a=this._outputs);const o=this.getCompilationKey(s,a);let l=this.compiledMap.get(o);null==l&&(l=this.compile(e,a),this.compiledMap.set(o,l));try{this.keepIntermediateTensors=En().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const c={},u={};return To((()=>{const n=new Uk(this.weightMap,c,u,this.functionExecutorMap,this.parseNodeNameCache),s=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach((t=>{const[r,i]=KC(t,n),a=[];a[i]=e[t],s[r]=a,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(a))}));const r=this.getFrozenTensorIds(s),{orderedNodes:a,nodeLiveUntilMap:o}=l;for(const e of a){if(s[e.name])continue;const t=Gk(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,i,o.get(e.name))}return null==this.parent&&n.dispose(r),t.map((e=>qC(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,i,a){if(!Zk(t)&&!i.has(e)){for(const s of n[e])null!=s&&(a[s.id]=(a[s.id]||0)+t.children.length);for(const e of t.inputs){if(Zk(e))continue;const t=jC(e.name,n,s);if(null!=t)for(const e of t){if(!e||e.kept||r.has(e.id))continue;const t=a[e.id];1===t?(e.dispose(),delete a[e.id]):null!=t&&a[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,s,r,i){function a(e){return Zk(e)||r.has(e.name)}if(!Zk(e)&&null!=i)for(const e of i){if(a(e))continue;const r=jC(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=En().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1}const i=new Uk(this.weightMap,s,r,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const a=await this.executeWithControlFlow(e,i,t,n),o=t.map((e=>qC(e,a,i))),l=o.map((e=>e.id)),c=Object.keys(e).map((t=>e[t].id)),u=new Set([...l,...c,...this.weightIds]);return Object.values(a).forEach((e=>{e.forEach((e=>{!e||e.isDisposed||u.has(e.id)||e.dispose()}))})),null==this.parent&&i.dispose(u),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),i=r.map((e=>this.graph.nodes[KC(e)[0]])),a=n.map((e=>KC(e)[0])),o=new Set(a);let l=a.map((e=>this.graph.nodes[e]));0===l.length&&(l=this._outputs);const{usedNodes:c,missingInputs:u,dynamicNode:h,syncInputs:d}=qk(e,l,this.weightMap,this._initNodes),p=[...i,...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]=KC(t),r=[];r[s]=e[t],f[n]=r}));const m={},g=this.getFrozenTensorIds(f),y={};for(;p.length>0;){const e=this.processStack(i,p,t,f,y,g,o,m,c);await Promise.all(e)}const b=l.filter((e=>!Zk(e)&&!qC(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: [${u}]. ${e}`)}return f}processStack(e,t,n,s,r,i,a,o,l){const c=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let u="";if("Enter"===e.node.op&&UC("isConstant",e.node,s,n)&&([u]=HC(e.node.name,n)),null==s[e.node.name]){const h=Gk(e.node,s,n,this._resourceManager);u||([u]=HC(e.node.name,n));const d=n.currentContext;xn(h)?c.push(h.then((c=>(s[u]=c,this.keepIntermediateTensors&&(this.clonedTensorsMap[u]=this.cloneTensorList(c)),n.currentContext=d,this.checkTensorForDisposal(u,e.node,s,n,i,a,o),this.processChildNodes(e.node,t,n,s,r,l),c)))):(s[u]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[u]=this.cloneTensorList(h)),this.checkTensorForDisposal(u,e.node,s,n,i,a,o),this.processChildNodes(e.node,t,n,s,r,l))}else this.processChildNodes(e.node,t,n,s,r,l)}return c}processChildNodes(e,t,n,s,r,i){e.children.forEach((e=>{const[a]=HC(e.name,n);!r[a]&&i.has(e.name)&&("Merge"===e.op?e.inputNames.some((e=>!!qC(e,s,n)))&&(r[a]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((e=>!!qC(e,s,n)))&&(r[a]=!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]=KC(t),r=this.graph.nodes[s];if(r.attrParams.shape&&r.attrParams.shape.value){const e=r.attrParams.shape.value;jt(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&&jt(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 i=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[r];null!=i?s[i.name]=e[r]:s[r]=e[r]}return s}checkInputs(e){const t=Object.keys(e).filter((e=>{const[t]=KC(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]=KC(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)}))}}class eS{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 tS="?tfjs-format=file",nS="model.json";class sS{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 eS}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 Vo(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 Jk(gk.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=gk.Instance.transformGraph(e.modelInitializer);this.initializer=new Jk(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 Fa?[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 Fa||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,i,a;const o=null===(a=null===(i=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===i?void 0:i[n])||void 0===a?void 0:a.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&&Io(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function rS(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}${nS}${tS}`}(t));const r=new sS(t,n,s);return await r.load(),r}function iS(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(cS(e)){const r=Array.isArray(e)?[]:{};s.add(e);for(const i in e){const a=iS(e[i],t,n,s);r[i]=a}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 aS(e,t=lS){return oS(e,t)}function oS(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(cS(s)){const r=Array.isArray(s)?[]:{};n.add(s);for(const i in s){const s=oS(e.map((e=>e[i])),t,n);r[i]=s}return n.delete(s),r}throw new Error(`Can't recurse into non-iterable type: ${s}`)}return r.value}function lS(e){return null===e?null:cS(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}function cS(e){let t=!1;if(En().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 Fa)&&!(e instanceof Promise)&&!t)}function uS(e){return iS(e,hS)}function hS(e){return e instanceof Fa?{value:e.clone(),recurse:!1}:cS(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}class dS{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 pS extends dS{constructor(){super(pS.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 xS(this,e,t)}columnMajorBatch(e,t=!0,n=lS){return this.rowMajorBatch(e,t).map((e=>aS(e,n)))}concatenate(e,t){return new IS(new yS([this,e]),t)}take(e){return e<0||null==e?this:new AS(this,e)}skip(e){return e<0||null==e?this:new vS(this,e)}prefetch(e){return new OS(this,e)}shuffle(e,t){return new DS(this,e,t)}serial(){return new wS(this)}}class yS extends gS{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:uS(e),done:!1}}}class bS extends gS{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 wS extends gS{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 vS extends gS{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 xS extends gS{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 CS extends gS{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;Io(e.value)}}}class kS extends gS{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=to(e.value),n=this.transform(e.value),s=to(n);for(const e of t)eo(e,s)||e.dispose();return{value:n,done:!1}}}class SS extends gS{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 ES extends gS{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=to(e.value),n=await this.transform(e.value),s=to(n);for(const e of t)eo(e,s)||e.dispose();return{value:n,done:!1}}}class _S extends gS{constructor(){super(),this.outputQueue=new pS,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 TS extends _S{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=to(e.value),n=this.transform(e.value),s=to(n);this.outputQueue.pushAll(n);for(const e of t)eo(e,s)||e.dispose();return!0}}class IS extends gS{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 NS;!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(NS||(NS={}));class OS extends gS{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new dS(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 DS extends OS{constructor(e,t,n){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=Yd.alea(n||ma().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 RS{constructor(){this.size=null}batch(e,t=!0){const n=this;let s;return jt(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),MS((async()=>(await n.iterator()).columnMajorBatch(e,t,FS)),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,MS((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,MS((async()=>(await t.iterator()).filter((t=>To((()=>e(t)))))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return MS((async()=>(await t.iterator()).map((t=>To((()=>e(t)))))),this.size)}mapAsync(e){const t=this;return MS((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 MS((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,MS((async()=>mS(fS((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=Yd.alea(t||ma().toString());return MS((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,MS((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 MS(e,t=null){return new class extends RS{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function FS(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 Fa||ba(n)){return{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof Fa?Bp(e):Co(e)}(e),recurse:!1}}var n,s;return{value:null,recurse:!0}}RS.MAX_BUFFER_SIZE=1e4;Symbol("out"),Symbol("field"),Symbol("quote"),Symbol("quoteafterquote"),Symbol("quoteinquote");function BS(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&jt("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the CPU backend.`))}))}const zS=nf;class LS extends Pt{nextDataId(){return LS.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new Lt(this,Eo())}write(e,t,n){this.firstUse&&(this.firstUse=!1,En().get("IS_NODE")&&Gi());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&&ln(n[0])){const r=n.map((e=>ga(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=>ya(e)));return Fl(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return Fl(e.shape,e.dtype,t)}makeOutput(e,t,n){return Eo().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=ma();e();return{kernelMs:ma()-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){BS([e],"where");const t=this.readSync(e.dataId);return zS(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}LS.nextDataId=0;function PS(e){return(t,n,s)=>{const r=rn(n,t.length);for(let n=0;n{const{x:a}=s;BS(a,e);const o=i,l=o.data.get(a.dataId).values;let c;if("string"===a.dtype){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");c=Ng(l)}else c=l;const u=n||a.dtype,h=t(c,u,r);return o.makeTensorInfo(a.shape,u,h)}}Oo("cpu",(()=>new LS),1);const GS=VS(Is,(e=>e>=0?e:Math.exp(e)-1)),US={kernelName:Is,backendName:"cpu",kernelFunc:GS};function qS(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 jS={kernelName:Hs,backendName:"cpu",kernelFunc:qS};function HS(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:i}=s;BS([r],"leakyRelu");const a=Kt(r.shape),o=n.data.get(r.dataId).values,l=sn("float32",a);for(let e=0;e{const a=cc(t,n),o=a.length,l=pn(a),c=sn(i,Kt(a)),u=t.length,h=n.length,d=pn(t),p=pn(n),f=oc(t,a),m=oc(n,a);if(f.length+m.length===0)for(let t=0;ti[e]=0));const a=vn(i,u,d),g=n.slice(-h);m.forEach((e=>g[e]=0));const y=vn(g,h,p);c[t]=e(s[a],r[y])}return[c,a]}}const XS=KS(((e,t)=>e<0?t*e:e));function ZS(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t;BS([s,r],"prelu");const i=n.data.get(s.dataId).values,a=n.data.get(r.dataId).values,[o,l]=XS(s.shape,r.shape,i,a,"float32");return n.makeTensorInfo(l,"float32",o)}const YS={kernelName:Rr,backendName:"cpu",kernelFunc:ZS},QS=VS(Wr,(e=>Math.max(0,e))),JS={kernelName:Wr,backendName:"cpu",kernelFunc:QS},eE=VS($r,(e=>Math.min(Math.max(0,e),6))),tE={kernelName:$r,backendName:"cpu",kernelFunc:eE},nE=PS((e=>1/(1+Math.exp(-e)))),sE=VS(ai,(e=>1/(1+Math.exp(-e)))),rE={kernelName:ai,backendName:"cpu",kernelFunc:sE};function iE(e,t,n,s,r){if("linear"===n)return qS({inputs:{x:t},backend:e});if("relu"===n)return QS({inputs:{x:t},backend:e});if("elu"===n)return GS({inputs:{x:t},backend:e});if("relu6"===n)return eE({inputs:{x:t},backend:e});if("prelu"===n)return ZS({inputs:{x:t,alpha:s},backend:e});if("leakyrelu"===n)return HS({inputs:{x:t},backend:e,attrs:{alpha:r}});if("sigmoid"===n)return sE({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function aE(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,i=n.data.get(s.dataId).values,a=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",i),imag:n.makeTensorInfo(r.shape,"float32",a)},o}const oE={kernelName:ss,backendName:"cpu",kernelFunc:aE};function lE(e,t,n="float32"){if("complex64"===n){return aE({inputs:{real:lE(e,t,"float32"),imag:lE(e,t,"float32")},backend:e})}const s=yn(Kt(t),n);return e.makeTensorInfo(t,n,s)}function cE(e){const{inputs:t,backend:n}=e,{input:s}=t,r=n.data.get(s.dataId).complexTensorInfos.real,i=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,i)}const uE={kernelName:Pr,backendName:"cpu",kernelFunc:cE};function hE(e,t,n,s){if("int32"===s){return[t,"int32",Int32Array.from(e)]}if("bool"===s){const s=fa([0],n),[r,i]=KS(((e,t)=>e!==t?1:0))(t,[],e,s,"bool");return[i,"bool",r]}throw new Error(`Error in Cast: failed to cast ${n} to ${s}`)}function dE(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dtype:i}=s;if("complex64"===i){if("complex64"===r.dtype)return qS({inputs:{x:r},backend:n});const e=lE(n,r.shape,r.dtype),t=dE({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),s=aE({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),s}if("complex64"===r.dtype){const e=cE({inputs:{input:r},backend:n}),t=dE({inputs:{x:e},backend:n,attrs:{dtype:i}});return n.disposeIntermediateTensorInfo(e),t}if(!an(r.dtype,i)){const e=qS({inputs:{x:r},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:i}}const a=n.data.get(r.dataId).values,[o,l,c]=hE(a,r.shape,r.dtype,i);return n.makeTensorInfo(o,l,c)}const pE={kernelName:es,backendName:"cpu",kernelFunc:dE};function fE(e,t,n,s){return null==n?({inputs:n,backend:r})=>{const{a:i,b:a}=n,o=r;BS([i,a],e);const l=o.data.get(i.dataId).values,c=o.data.get(a.dataId).values,u="string"===i.dtype?Ng(l):l,h="string"===i.dtype?Ng(c):c,d=s||i.dtype,[p,f]=t(i.shape,a.shape,u,h,d);return o.makeTensorInfo(f,d,p)}:({inputs:e,backend:r})=>{const{a:i,b:a}=e,o=r;if("complex64"===i.dtype||"complex64"===a.dtype){const e=dE({inputs:{x:i},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,c=o.data.get(r.dataId).values,u=dE({inputs:{x:a},backend:o,attrs:{dtype:"complex64"}}),h=o.data.get(u.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(i.shape,a.shape,l,c,f,m),w=o.makeTensorInfo(b,"float32",g),v=o.makeTensorInfo(b,"float32",y),A=aE({inputs:{real:w,imag:v},backend:o});return o.disposeIntermediateTensorInfo(e),o.disposeIntermediateTensorInfo(u),o.disposeIntermediateTensorInfo(w),o.disposeIntermediateTensorInfo(v),A}{const e=o.data.get(i.dataId).values,n=o.data.get(a.dataId).values,r=s||i.dtype,[l,c]=t(i.shape,a.shape,e,n,r);return o.makeTensorInfo(c,r,l)}}}function mE(e){return(t,n,s,r,i,a)=>{const o=cc(t,n),l=Kt(o),c=o.length,u=pn(o),h=sn("float32",l),d=sn("float32",l),p=oc(t,o),f=oc(n,o),m=Zm(s,r),g=Zm(i,a),y=t.length,b=pn(t),w=n.length,v=pn(n);if(p.length+f.length===0)for(let t=0;ts[e]=0));const r=vn(s,y,b),i=n.slice(-w);f.forEach((e=>i[e]=0));const a=vn(i,w,v),o=e(m[2*r],m[2*r+1],g[2*a],g[2*a+1]);h[t]=o.real,d[t]=o.imag}return[h,d,o]}}const gE=KS(((e,t)=>e+t)),yE=mE(((e,t,n,s)=>({real:e+n,imag:t+s}))),bE=fE(Mn,gE,yE),wE={kernelName:Mn,backendName:"cpu",kernelFunc:bE};function vE(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{shape:i}=s,a=Kt(r.shape),o=en(i,a),l=Kt(o);jt(a===l,(()=>`The new shape (${o}) has ${l} elements and the old shape (${r.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`)),n.incRef(r.dataId);const c=n.data.get(r.dataId);if(null!=c.complexTensorInfos){const e=c.complexTensorInfos.real,t=c.complexTensorInfos.imag;e.shape=o,t.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}const AE={kernelName:Gr,backendName:"cpu",kernelFunc:vE};function xE(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i}=t,{transposeA:a,transposeB:o}=s;BS([r,i],"matMul");const l=r.shape.length,c=i.shape.length,u=a?r.shape[l-2]:r.shape[l-1],h=o?i.shape[c-1]:i.shape[c-2],d=a?r.shape[l-1]:r.shape[l-2],p=o?i.shape[c-2]:i.shape[c-1],f=r.shape.slice(0,-2),m=i.shape.slice(0,-2),g=Kt(f),y=Kt(m),b=cc(r.shape.slice(0,-2),i.shape.slice(0,-2)).concat([d,p]);jt(u===h,(()=>`Error in matMul: inner shapes (${u}) and (${h}) of Tensors with shapes ${r.shape} and ${i.shape} and transposeA=${a} and transposeB=${o} must match.`));const w=o?[y,p,h]:[y,h,p],v=vE({inputs:{x:r},backend:n,attrs:{shape:a?[g,u,d]:[g,d,u]}}),A=vE({inputs:{x:i},backend:n,attrs:{shape:w}}),x=a?v.shape[1]:v.shape[2],C=a?v.shape[2]:v.shape[1],k=o?A.shape[1]:A.shape[2],S=Math.max(g,y),E=n.data.get(v.dataId).values,_=n.data.get(A.dataId).values,T=pn(v.shape),I=pn(A.shape),[N,O,D]=a?[T[0],1,T[1]]:[T[0],T[1],1],[R,M,F]=o?[1,I[1],I[0]]:[I[1],1,I[0]],B=C*k,z=Fl([S,C,k],v.dtype),L=z.values,P=n.blockSize;for(let e=0;e{const{x:t}=e.inputs,n=e.backend;BS(t,"abs");let s=new Float32Array(Kt(t.shape));return s=SE(n.data.get(t.dataId).values),n.makeOutput(s,t.shape,t.dtype)}},_E=VS(Dn,(e=>Math.acos(e))),TE={kernelName:Dn,backendName:"cpu",kernelFunc:_E},IE=VS(Rn,(e=>Math.acosh(e))),NE={kernelName:Rn,backendName:"cpu",kernelFunc:IE};const OE={kernelName:Fn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,s=t;BS(t,"addN");const r=s.map((e=>n.data.get(e.dataId).values)),i=Fl(s[0].shape,s[0].dtype),a=i.values;for(let e=0;en&&(n=r,s=e)}d[e]=s}return c.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(u,"int32",d)}};const LE={kernelName:Pn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;BS(r,"argMin");let a=tn(i,r.shape);const o=Mh(a,r.shape.length);let l=r;const c=[];null!=o&&(l=RE({inputs:{x:r},backend:n,attrs:{perm:o}}),c.push(l),a=Bh(a.length,l.shape.length)),a=[a[0]],Rh("argMin",a,l.shape.length);const[u,h]=Oh(l.shape,a),d=yn(Kt(u),"int32"),p=Kt(h),f=n.data.get(l.dataId).values;for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(u,"int32",d)}},PE=VS(Vn,(e=>Math.asin(e))),VE={kernelName:Vn,backendName:"cpu",kernelFunc:PE},WE=VS(Wn,(e=>Math.asinh(e))),GE={kernelName:Wn,backendName:"cpu",kernelFunc:WE},UE=VS(Gn,(e=>Math.atan(e))),qE={kernelName:Gn,backendName:"cpu",kernelFunc:UE},jE=KS(((e,t)=>Math.atan2(e,t))),HE=fE(qn,jE),$E={kernelName:qn,backendName:"cpu",kernelFunc:HE},KE=VS(Un,(e=>Math.atanh(e))),XE={kernelName:Un,backendName:"cpu",kernelFunc:KE};function ZE(e,t,n,s,r,i){const a=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,c=r.dilationWidth,u=r.effectiveFilterHeight,h=r.effectiveFilterWidth,d=r.padInfo.top,p=r.padInfo.left,f="max"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=Fl(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=a:"avg"===i&&(b+=a,v++)}if(isNaN(y))break}g[C+n*w+t]="avg"===i?b/v:y}}}return m}function YE(e,t,n,s,r=!1,i=!1){const a=Fl(s.outShape,"int32"),o=s.strideHeight,l=s.strideWidth,c=s.dilationHeight,u=s.dilationWidth,h=s.effectiveFilterHeight,d=s.effectiveFilterWidth,p=s.padInfo.top,f=s.padInfo.left,m=Fl(t,n,e);for(let e=0;ev&&(v=c,A=r?i?((e*s.inHeight+n)*s.inWidth+o)*s.inChannels+t:(n*s.inWidth+o)*s.inChannels+t:a*d+l)}}a.set(A,e,n,o,t)}}return a}function QE(e,t,n,s,r,i){const a=r.strideDepth,o=r.strideHeight,l=r.strideWidth,c=r.dilationDepth,u=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"===i?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,w=Fl(r.outShape,n),v=w.values,A=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],x=r.outShape[2]*r.outShape[3]*r.outShape[4],C=r.outShape[3]*r.outShape[4],k=r.outShape[4];for(let t=0;tx?x=r:"avg"===i&&(C+=r,S++),isNaN(x))break}if(isNaN(x))break}if(isNaN(x))break}v[g+t]="avg"===i?C/Math.max(S,1):x}}}}return w}const JE={kernelName:jn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;BS(r,"avgPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;jt(Ou(a,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const c=Au(r.shape,i,a,1,o,l);let u;if(1===c.filterWidth&&1===c.filterHeight&&Xt(c.inShape,c.outShape))u=qS({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=pn(r.shape),s=ZE(e,r.shape,r.dtype,t,c,"avg");u=n.makeTensorInfo(c.outShape,r.dtype,s.values)}return u}};const e_={kernelName:$n,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:c}=s;BS(r,"avgPool3d");const u=xu(r.shape,i,a,1,o,l,c),h=QE(n.data.get(r.dataId).values,r.shape,r.dtype,pn(r.shape),u,"avg");return n.makeTensorInfo(h.shape,"float32",h.values)}};const t_={kernelName:Kn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,{filterSize:a,strides:o,pad:l,dimRoundingMode:c}=s;BS([r,i],"avgPool3DGrad");const u=xu(i.shape,a,o,1,l,c),h=u.strideDepth,d=u.strideHeight,p=u.strideWidth,f=u.filterDepth,m=u.filterHeight,g=u.filterWidth,y=u.dilationDepth,b=u.dilationHeight,w=u.dilationWidth,v=u.effectiveFilterDepth,A=u.effectiveFilterHeight,x=u.effectiveFilterWidth,C=v-1-u.padInfo.front,k=x-1-u.padInfo.left,S=A-1-u.padInfo.top,E=Fl(i.shape,"float32"),_=1/(f*m*g),T=n.bufferSync(r);for(let e=0;e=u.outDepth||Math.floor(s)!==s))for(let n=0;n=u.outHeight||Math.floor(r)!==r))for(let n=0;n=u.outWidth||Math.floor(i)!==i)continue;l+=T.get(e,s,r,i,t)}}}E.set(l*_,e,n,s,r,t)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}};const n_={kernelName:Hn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i;BS([r,i],"avgPoolGrad");const{filterSize:o,strides:l,pad:c}=s,u=Au(a.shape,o,l,1,c),h=u.strideHeight,d=u.strideWidth,p=u.filterHeight,f=u.filterWidth,m=u.dilationHeight,g=u.dilationWidth,y=u.effectiveFilterHeight,b=u.effectiveFilterWidth,w=b-1-u.padInfo.left,v=y-1-u.padInfo.top,A=Fl(a.shape,"float32"),x=1/(p*f),C=n.data.get(r.dataId).values,k=Fl(r.shape,"float32",C);for(let e=0;e=u.outHeight||Math.floor(s)!==s))for(let n=0;n=u.outWidth||Math.floor(r)!==r)continue;a+=k.get(e,s,r,t)}}A.set(a*x,e,n,s,t)}return n.makeTensorInfo(A.shape,A.dtype,A.values)}};const s_={kernelName:Ws,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,scale:i,offset:a,mean:o,variance:l}=t;jt(o.shape.length===l.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),jt(null==a||o.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),jt(null==i||o.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks.")),BS([r,o,l,i,a],"batchNorm");let{varianceEpsilon:c}=s;null==c&&(c=.001);const u=n.data.get(r.dataId).values,h=n.data.get(o.dataId).values,d=n.data.get(l.dataId).values,p=i?n.data.get(i.dataId).values:new Float32Array([1]),f=a?n.data.get(a.dataId).values:new Float32Array([0]),m=new Float32Array(u.length),g=f.length,y=p.length,b=d.length,w=h.length;let v=0,A=0,x=0,C=0;for(let e=0;e=g&&(v=0),A>=w&&(A=0),x>=y&&(x=0),C>=b&&(C=0);return n.makeTensorInfo(r.shape,r.dtype,m)}};function r_(e,t,n,s,r){const i=su(s,t,n),a=Kt(n),o=pn(s);if(i){const n=ru(t,o);return"string"===r?e.slice(n,n+a):e.subarray(n,n+a)}const l=Fl(s,r,"string"===r?Ng(e):e),c=Fl(n,r);for(let e=0;ee+t[n]));c.set(l.get(...s),...n)}return"string"===r?Og(c.values):c.values}function i_(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,size:a}=s;BS(r,"slice");const[o,l]=iu(r,i,a);jc(r,o,l);const c=r_(n.data.get(r.dataId).values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,c)}const a_={kernelName:ni,backendName:"cpu",kernelFunc:i_};const o_={kernelName:Zn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,crops:a}=s;BS([r],"batchToSpaceND");const o=i.reduce(((e,t)=>e*t)),l=Bm(r.shape,i,o),c=zm(l.length,i.length),u=Lm(r.shape,i,o),h=Pm(a,i.length),d=Vm(u,a,i.length),p=vE({inputs:{x:r},backend:n,attrs:{shape:l}}),f=RE({inputs:{x:p},backend:n,attrs:{perm:c}}),m=vE({inputs:{x:f},backend:n,attrs:{shape:u}}),g=i_({inputs:{x:m},backend:n,attrs:{begin:h,size:d}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}};function l_(e,t,n,s,r){const i=Kt(s),a=yn(r,n);for(let n=0;n=r||(a[s]+=i>0?t[n]:1)}return a}function c_(e,t,n,s=!1){const r=e.shape[0],i=e.shape[1],a=Fl([r,n],t.dtype);for(let o=0;o=n||(s?a.set(1,o,i):t.size>0?a.set(a.get(o,i)+t.get(o,r),o,i):a.set(a.get(o,i)+1,o,i))}return a}const u_={kernelName:Yn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a}=s,o=l_(n.data.get(r.dataId).values,n.data.get(i.dataId).values,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,o)}},h_=KS(((e,t)=>e&t)),d_=fE(Qn,h_),p_={kernelName:Qn,backendName:"cpu",kernelFunc:d_};const f_={kernelName:Jn,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,i=n.data.get(s.dataId).values,a=n.data.get(r.dataId).values,o=cc(Array.from(i),Array.from(a));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},m_=PS((e=>Math.ceil(e))),g_=WS(ts,m_),y_={kernelName:ts,backendName:"cpu",kernelFunc:g_},b_=VS(ns,((e,t)=>{const n=t;return e>n.clipValueMax?n.clipValueMax:e{const{x:t}=e.inputs,n=e.backend,s=new Float32Array(Kt(t.shape)),r=n.data.get(t.dataId),i=r.complexTensorInfos.real,a=r.complexTensorInfos.imag,o=n.data.get(i.dataId).values,l=n.data.get(a.dataId).values;for(let e=0;e{const n=Kt(e.shape);r.set(e.vals,t),t+=n}))}else{let s=0;e.forEach((e=>{const i="string"===n?Ng(e.vals):e.vals;let a=0;for(let n=0;ne.shape)),i);let a=Em(t.map((e=>e.shape)),i);if(0===Kt(a))return n.makeTensorInfo(a,t[0].dtype,[]);const o=t.filter((e=>Kt(e.shape)>0));if(1===o.length)return qS({inputs:{x:o[0]},backend:n});if("complex64"===o[0].dtype){const e=o.map((e=>cE({inputs:{input:e},backend:n}))),t=o.map((e=>x_({inputs:{input:e},backend:n}))),s=k_({inputs:e,backend:n,attrs:{axis:i}}),r=k_({inputs:t,backend:n,attrs:{axis:i}}),a=aE({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),a}const l=o.map((e=>{const t=Kt(e.shape.slice(i));return vE({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})})),c=l.map((e=>({vals:n.data.get(e.dataId).values,shape:e.shape})));a=Em(l.map((e=>e.shape)),1);const u=1===l[0].shape[0],h=A_(c,a,t[0].dtype,u),d=Em(o.map((e=>e.shape)),i),p=n.makeTensorInfo(d,t[0].dtype,h);return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}const S_={kernelName:is,backendName:"cpu",kernelFunc:k_};function E_(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dataFormat:l,dilations:c,dimRoundingMode:u}=s;BS([r,i],"conv2d");const h=Ru(l),d=Cu(r.shape,i.shape,a,c,o,u,!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 Oa(d.outShape,r.dtype),A=pn(r.shape),x=pn(i.shape),C=A[0],k=w?A[1]:A[2],S=w?A[2]:1,E=w?1:A[1],_=v.strides[0],T=w?v.strides[1]:v.strides[2],I=w?v.strides[2]:1,N=w?1:v.strides[1],O=n.data.get(r.dataId).values,D=n.data.get(i.dataId).values,R=v.values;for(let e=0;e=d.inHeight)continue;const i=e*x[0],a=t+n*k;for(let e=0;e=d.inWidth)continue;const r=a+s*S;let o=i+e*x[1];for(let e=0;e=c.inDepth)continue;const i=e*S[0],a=t+n*k[1];for(let e=0;e=c.inHeight)continue;const r=i+e*S[1],o=a+s*k[2];for(let e=0;e=c.inWidth)continue;const i=r+e*S[2],a=o+t*c.inChannels;let l=i;for(let e=0;eMath.cos(e))),M_={kernelName:ds,backendName:"cpu",kernelFunc:R_},F_=VS(ps,(e=>Math.cosh(e))),B_={kernelName:ps,backendName:"cpu",kernelFunc:F_};const z_={kernelName:gs,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:i,boxInd:a}=t,{cropSize:o,method:l,extrapolationValue:c}=s,[u,h,d,p]=r.shape,f=i.shape[0],[m,g]=o,y=Fl([f,m,g,p],"float32"),b=n.data.get(i.dataId).values,w=n.data.get(a.dataId).values,v=n.data.get(r.dataId).values,A=pn(r.shape),x=pn(y.shape);for(let e=0;e=u)continue;const o=m>1?(r-n)*(h-1)/(m-1):0,f=g>1?(i-s)*(d-1)/(g-1):0;for(let t=0;t1?n*(h-1)+t*o:.5*(n+r)*(h-1);if(u<0||u>h-1)for(let n=0;n1?s*(d-1)+l*f:.5*(s+i)*(d-1);if(u<0||u>d-1){for(let n=0;n1?s*(d-1)+n*f:.5*(s+i)*(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 ${a}`));const o=r.shape[0],l=r.shape[1],c=r.shape[2],u=r.shape[3],h=l*i,d=c*i,p=u/(i*i),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 ${a} and dilations '${d}'`));const p=Cu(r.shape,i.shape,a,d,o,c,!0),{filterHeight:f,filterWidth:m,dilationHeight:g,dilationWidth:y,padInfo:b}=p,w=b.left,v=b.top,A=p.outChannels/p.inChannels,x=new Oa(p.outShape,r.dtype),C=n.data.get(r.dataId).values,k=n.data.get(i.dataId).values,S=x.values;for(let e=0;e=p.inHeight)continue;const i=e*h[0],a=t+n*u[1];for(let e=0;e=p.inWidth)continue;const r=i+e*h[1],o=a+s*p.inChannels;let l=t,c=r;for(let e=0;e{const{x:s,filter:r}=e,{strides:i,pad:a,dilations:o}=n,l=t,c=l.data.get(s.dataId).values,u=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:A,filterHeight:x,filterWidth:C,dilationHeight:k,dilationWidth:S,outShape:E}=vu(s.shape,r.shape,i,a,"NHWC",o),_=Kt(E),T=E.length,I=rn(s.dtype,_);for(let e=0;e=0&&i=0&&pl&&(l=m)}}}I[vn([e,t,i,o],T,pn(E))]=l}}}return{dataId:l.write(fa(I,s.dtype),E,s.dtype),shape:E,dtype:s.dtype}}},K_={kernelName:Ss,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:i}=e,{strides:a,pad:o,dilations:l}=n,c=t,u=mn(s.shape,c.data.get(s.dataId).values),h=mn(r.shape,c.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:A,filterWidth:x,dilationHeight:C,dilationWidth:k,outShape:S}=vu(s.shape,r.shape,a,o,"NHWC",l);jt(i.rank===S.length,(()=>`Error in ${Ss}, dy must have the same rank as output ${S.length}, but got ${i.rank}`));const E=mn(S,c.data.get(i.dataId).values),_=bn(r.shape,r.dtype);for(let e=0;e=0&&s=0&&ca&&(a=r,o=t,l=n)}}}_[o][l][i]+=E[e][t][s][i]}}}return{dataId:c.write(fa(_,s.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},X_={kernelName:ks,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,filter:r,dy:i}=e,{strides:a,pad:o,dilations:l}=n,c=t,u=mn(s.shape,c.data.get(s.dataId).values),h=mn(r.shape,c.data.get(r.dataId).values),{batchSize:d,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:w,strideWidth:v,filterHeight:A,filterWidth:x,dilationHeight:C,dilationWidth:k,outShape:S}=vu(s.shape,r.shape,a,o,"NHWC",l);jt(i.rank===S.length,(()=>`Error in ${ks}, dy must have the same rank as output ${S.length}, but got ${i.rank}`));const E=mn(S,c.data.get(i.dataId).values),_=bn(s.shape,s.dtype);for(let e=0;e=0&&s=0&&ca&&(a=r,o=s,l=c)}}}_[e][o][l][i]+=E[e][t][s][i]}}}return{dataId:c.write(fa(_,s.dtype),s.shape,s.dtype),shape:s.shape,dtype:s.dtype}}};const Z_={kernelName:Es,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r}=t,{canvas:i,options:a}=s,{contextOptions:o,imageOptions:l}=a||{},c=(null==l?void 0:l.alpha)||1,u=(null==o?void 0:o.contextType)||"2d";if("2d"!==u)throw new Error(`Context type ${o.contextType} is not supported by the CPU backend.`);const h=i.getContext(u,(null==o?void 0:o.contextAttributes)||{});if(null==h)throw new Error(`Could not get the context with ${u} 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])}i.width=p,i.height=d;const b=new ImageData(y,p,d);return h.putImageData(b,0,0),r}},Y_=KS(((e,t)=>e*t)),Q_=mE(((e,t,n,s)=>({real:e*n-t*s,imag:e*s+t*n}))),J_=fE(xr,Y_,Q_),eT={kernelName:xr,backendName:"cpu",kernelFunc:J_};function tT(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s;let o;BS(r,"sum"),o="bool"===r.dtype?dE({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):qS({inputs:{x:r},backend:n});const l=o.shape.length,c=tn(i,o.shape),u=Mh(c,l);let h=c,d=o;null!=u&&(d=RE({inputs:{x:o},backend:n,attrs:{perm:u}}),h=Bh(h.length,l)),Rh("sum",h,d.shape.length);const[p,f]=Oh(d.shape,h);let m=lE(n,p,Xa(d.dtype,"int32"));const g=Kt(f),y=n.data.get(m.dataId).values,b=n.data.get(d.dataId).values;for(let e=0;e=0&&(d=tT({inputs:{x:d},backend:n,attrs:{axis:c[e]-(a.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}};const rT={kernelName:Ns,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{dy:s,y:r}=t;BS([s,r],"eluGrad");const i=new Float32Array(Kt(r.shape)),a=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",i)}},iT=KS(((e,t)=>e===t?1:0)),aT=fE(Ds,iT,null,"bool"),oT={kernelName:Ds,backendName:"cpu",kernelFunc:aT},lT=qm,cT=jm,uT=Hm,hT=$m,dT=Km,pT=Xm,fT=VS(Os,(e=>{const t=Math.sign(e),n=Math.abs(e),s=1/(1+lT*n);return t*(1-((((pT*s+dT)*s+hT)*s+uT)*s+cT)*s*Math.exp(-n*n))})),mT={kernelName:Os,backendName:"cpu",kernelFunc:fT},gT=PS((e=>Math.exp(e))),yT=WS(Rs,gT,"float32"),bT={kernelName:Rs,backendName:"cpu",kernelFunc:yT};function wT(e){const{inputs:t,backend:n,attrs:s}=e,{input:r}=t,{dim:i}=s,a=r.shape.length,o=r.shape.slice();let l=i;return i<0&&(jt(-(a+1)<=i,(()=>`Axis must be in the interval [${-(a+1)}, ${a}]`)),l=a+i+1),o.splice(l,0,1),vE({inputs:{x:r},backend:n,attrs:{shape:o}})}const vT={kernelName:Ms,backendName:"cpu",kernelFunc:wT},AT=PS((e=>Math.expm1(e))),xT=WS(Fs,AT),CT={kernelName:Fs,backendName:"cpu",kernelFunc:xT},kT=KS(((e,t)=>e/t)),ST=fE(_s,kT),ET={kernelName:_s,backendName:"cpu",kernelFunc:ST},_T=KS(((e,t)=>e-t)),TT=mE(((e,t,n,s)=>({real:e-n,imag:t-s}))),IT=fE(Si,_T,TT),NT={kernelName:Si,backendName:"cpu",kernelFunc:IT};function OT(e,t,n){const s=e.shape,r=s[0],i=s[1],a=n.data.get(e.dataId),o=a.complexTensorInfos.real,l=a.complexTensorInfos.imag,c=[r,i],u=Kt(c),h=sn("float32",u),d=sn("float32",u);for(let e=0;e{const{image:s}=e,r=n,i=sn(s.dtype,Kt(s.shape)),[a,o,l,c]=s.shape,u=r.data.get(s.dataId).values;for(let e=0;e=0&&aMath.floor(e))),PT=WS(Ps,LT),VT={kernelName:Ps,backendName:"cpu",kernelFunc:PT},WT=KS(((e,t)=>Math.floor(e/t))),GT=fE(Vs,WT,null,"int32"),UT={kernelName:Vs,backendName:"cpu",kernelFunc:GT};const qT={kernelName:Vi,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=E_({inputs:{x:r,filter:i},backend:n,attrs:{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d}});if(a){const e=m;if("NCHW"===u&&1===a.shape.length&&1!==a.shape[0]){const e=vE({inputs:{x:a},backend:n,attrs:{shape:[a.shape[0],1,1]}});m=bE({inputs:{a:m,b:e},backend:n}),n.disposeIntermediateTensorInfo(e)}else m=bE({inputs:{a:m,b:a},backend:n});n.disposeIntermediateTensorInfo(e)}if(p){const e=m;if("NCHW"===u&&"prelu"===p&&1===o.shape.length&&1!==o.shape[0]){const e=vE({inputs:{x:o},backend:n,attrs:{shape:[o.shape[0],1,1]}});m=iE(n,m,p,e,f),n.disposeIntermediateTensorInfo(e)}else m=iE(n,m,p,o,f);n.disposeIntermediateTensorInfo(e)}return m}};const jT={kernelName:Wi,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s;let m=G_({inputs:{x:r,filter:i},backend:n,attrs:{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d}});if(a){const e=m;m=bE({inputs:{a:m,b:a},backend:n}),n.disposeIntermediateTensorInfo(e)}if(p){const e=m;m=iE(n,m,p,o,f),n.disposeIntermediateTensorInfo(e)}return m}};function HT(e,t,n,s,r,i,a,o,l){const c=Fl([s,i],n);for(let n=0;n=l/i)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, ${u-1}]`))}let h=o;null==o&&(h=0);const d=Kt(i.shape),p=Ig(r,i,l,h),f=vE({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),m=vE({inputs:{x:i},backend:n,attrs:{shape:[p.batchSize,d/p.batchSize]}}),g=[p.batchSize,p.outerSize,d/p.batchSize,p.sliceSize],y=n.bufferSync(m),b=KT(n.bufferSync(f),y,g);return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.makeTensorInfo(p.outputShape,b.dtype,b.values)}},ZT=KS(((e,t)=>e>t?1:0)),YT=fE(qs,ZT,null,"bool"),QT={kernelName:qs,backendName:"cpu",kernelFunc:YT},JT=KS(((e,t)=>e>=t?1:0)),eI=fE(js,JT,null,"bool"),tI={kernelName:js,backendName:"cpu",kernelFunc:eI};const nI={kernelName:$s,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t,r=Kt(s.shape),i=s.shape[s.shape.length-1],a=vE({inputs:{x:s},backend:n,attrs:{shape:[r/i,i]}}),o=OT(a,!0,n),l=vE({inputs:{x:o},backend:n,attrs:{shape:s.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(o),l}},sI=VS(Xs,(e=>Number.isFinite(e)?1:0),"bool"),rI={kernelName:Xs,backendName:"cpu",kernelFunc:sI},iI=VS(Zs,(e=>Math.abs(e)===1/0?1:0),"bool"),aI={kernelName:Zs,backendName:"cpu",kernelFunc:iI},oI=VS(Ys,(e=>Number.isNaN(e)?1:0),"bool"),lI={kernelName:Ys,backendName:"cpu",kernelFunc:oI},cI=KS(((e,t)=>ee<=t?1:0)),pI=fE(er,dI,null,"bool"),fI={kernelName:er,backendName:"cpu",kernelFunc:pI};function mI(e,t,n){const s=(t-e)/(n-1),r=yn(n,"float32");r[0]=e;for(let e=1;eMath.log(e))),bI=WS(nr,yI),wI={kernelName:nr,backendName:"cpu",kernelFunc:bI},vI=VS(sr,(e=>Math.log1p(e))),AI={kernelName:sr,backendName:"cpu",kernelFunc:vI},xI=KS(((e,t)=>e&&t)),CI=fE(rr,xI,null,"bool"),kI={kernelName:rr,backendName:"cpu",kernelFunc:CI},SI=VS(ir,(e=>e?0:1),"bool"),EI={kernelName:ir,backendName:"cpu",kernelFunc:SI},_I=KS(((e,t)=>e||t)),TI=fE(ar,_I,null,"bool"),II={kernelName:ar,backendName:"cpu",kernelFunc:TI};const NI={kernelName:or,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:i,bias:a,alpha:o,beta:l}=s;BS(r,"LRN");const c=r.shape[3],u=c-1,h=n.data.get(r.dataId).values,d=Kt(r.shape),p=new Float32Array(d);function f(e){const t=e%c;let n=e-t+Math.max(0,t-i);const s=e-t+Math.min(t+i,u);let r=0;for(;n<=s;n++){const e=h[n];r+=e*e}return r}for(let e=0;ei)&&(i=t)}r[n]=i}return r}function RI(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:i,keepDims:a}=s,o=n;let l=r.shape;const c=l.length,u=tn(i,l);let h=u;const d=Mh(h,c);let p=o.data.get(r.dataId).values;if(null!=d){const e=new Array(c);for(let t=0;tMath.max(e,t))),BI=fE(ur,FI),zI={kernelName:ur,backendName:"cpu",kernelFunc:BI};const LI={kernelName:hr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;BS(r,"maxPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;jt(Ou(a,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const c=Au(r.shape,i,a,1,o,l);let u;if(1===c.filterWidth&&1===c.filterHeight&&Xt(c.inShape,c.outShape))u=qS({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=pn(r.shape),s=ZE(e,r.shape,r.dtype,t,c,"max");u=n.makeTensorInfo(c.outShape,r.dtype,s.values)}return u}};const PI={kernelName:pr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:c}=s;BS(r,"maxPool3d");const u=xu(r.shape,i,a,1,o,l,c),h=QE(n.data.get(r.dataId).values,r.shape,r.dtype,pn(r.shape),u,"max");return n.makeTensorInfo(h.shape,"float32",h.values)}};const VI={kernelName:fr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,{filterSize:a,strides:o,pad:l,dimRoundingMode:c}=s;BS([r,i],"maxPool3DGrad");const u=xu(i.shape,a,o,1,l,c),h=function(e,t){const n=Fl(t.outShape,"int32"),s=t.strideDepth,r=t.strideHeight,i=t.strideWidth,a=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,c=t.effectiveFilterDepth,u=t.effectiveFilterHeight,h=t.effectiveFilterWidth,d=t.padInfo.front,p=t.padInfo.top,f=t.padInfo.left;for(let m=0;m=k&&(k=o,S=n*u*h+r*u+a)}}}n.set(S,m,y,s,r,g)}}}return n}(n.bufferSync(i),u),d=u.strideDepth,p=u.strideHeight,f=u.strideWidth,m=u.dilationDepth,g=u.dilationHeight,y=u.dilationWidth,b=u.effectiveFilterDepth,w=u.effectiveFilterHeight,v=u.effectiveFilterWidth,A=b-1-u.padInfo.front,x=v-1-u.padInfo.left,C=w-1-u.padInfo.top,k=Fl(i.shape,"float32"),S=n.bufferSync(r);for(let e=0;e=u.outDepth||Math.floor(s)!==s))for(let r=0;r=u.outHeight||Math.floor(i)!==i))for(let a=0;a=u.outWidth||Math.floor(c)!==c)continue;const d=b*w*v-1-h.get(e,s,i,c,t)===n*w*v+r*v+a?1:0;if(0===d)continue;l+=S.get(e,s,i,c,t)*d}}}k.set(l,e,n,s,r,t)}return n.makeTensorInfo(k.shape,k.dtype,k.values)}};const WI={kernelName:dr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i,output:a}=t,o=i;BS([i,a],"maxPoolGrad");const{filterSize:l,strides:c,pad:u,dimRoundingMode:h}=s,d=Au(o.shape,l,c,1,u,h),p=n.data.get(o.dataId).values,f=Fl(d.outShape,o.dtype,YE(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,A=v-1-d.padInfo.left,x=w-1-d.padInfo.top,C=Fl(o.shape,"float32"),k=n.data.get(r.dataId).values,S=Fl(r.shape,"float32",k);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;a+=S.get(e,s,o,t)*l}}C.set(a,e,n,s,t)}return n.makeTensorInfo(C.shape,C.dtype,C.values)}};const GI={kernelName:mr,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:i,pad:a,includeBatchInIndex:o}=t,l=n;BS(s,"MaxPoolWithArgmax");const c=l.data.get(s.dataId).values,u=Au(s.shape,r,i,[1,1],a),[h,d]=function(e,t,n,s,r){const i=ZE(e,0,n,pn(t),r,"max"),a=YE(e,t,n,r,!0,s);return[i.values,a.values]}(c,s.shape,s.dtype,o,u),p=l.write(h,u.outShape,s.dtype),f=l.write(d,u.outShape,s.dtype);return[{dataId:p,shape:u.outShape,dtype:s.dtype},{dataId:f,shape:u.outShape,dtype:"int32"}]}};const UI={kernelName:gr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=tn(i,r.shape),l=Kt(Oh(r.shape,o)[1]),c=[],u=n.makeTensorInfo([],"float32",new Float32Array([l]));c.push(u);const h=dE({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});c.push(h);const d=ST({inputs:{a:h,b:u},backend:n});c.push(d);const p=tT({inputs:{x:d},backend:n,attrs:{axis:i,keepDims:a}});return c.forEach((e=>n.disposeIntermediateTensorInfo(e))),p}};const qI={kernelName:yr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s;BS(r,"min");const o=tn(i,r.shape);let l=o;const c=Mh(l,r.shape.length);let u=r;null!=c&&(u=RE({inputs:{x:r},backend:n,attrs:{perm:c}}),l=Bh(l.length,r.shape.length)),Rh("min",l,u.shape.length);const[h,d]=Oh(u.shape,l),p=Kt(d),f=yn(Kt(h),u.dtype),m=n.data.get(u.dataId).values;for(let e=0;eMath.min(e,t))),HI=fE(br,jI),$I={kernelName:br,backendName:"cpu",kernelFunc:HI};const KI={kernelName:wr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:i,mode:a}=s;BS(r,"mirrorPad");const o=i.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=i.map((e=>e[0])),c=i.map(((e,t)=>e[0]+r.shape[t])),u="reflect"===a?0:1,h=n.data.get(r.dataId).values,d=r.shape.length,p=pn(r.shape),f=Kt(o),m=o.length,g=pn(o),y=sn(r.dtype,f);for(let e=0;e=c[e]&&(t[e]=2*(c[e]-1)-t[e]+u);t=t.map(((e,t)=>e-l[t]));const n=vn(t,d,p);y[e]=h[n]}return{dataId:n.write(y,o,r.dtype),shape:o,dtype:r.dtype}}},XI=KS(((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t})),ZI=fE(vr,XI),YI={kernelName:vr,backendName:"cpu",kernelFunc:ZI};function QI(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:i}=s,a=r.shape.length;let o=i;if(-1===o&&(o=a-1),o!==a-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a} and dim was ${o}`);const l=tn([o],r.shape),c=RI({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),u=Dh(c.shape,l),h=vE({inputs:{x:c},backend:n,attrs:{shape:u}}),d=IT({inputs:{a:r,b:h},backend:n}),p=yT({inputs:{x:d},backend:n}),f=tT({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),m=vE({inputs:{x:f},backend:n,attrs:{shape:u}}),g=ST({inputs:{a:p,b:m},backend:n});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}const JI={kernelName:di,backendName:"cpu",kernelFunc:QI};const eN={kernelName:Ar,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:i,seed:a,normalized:o}=s;BS(r,"multinomial");const l=o?r:QI({inputs:{logits:r},backend:n,attrs:{dim:-1}}),c=l.shape[0],u=l.shape[1],h=n.data.get(l.dataId).values,d=[c,i],p=yn(Kt(d),"int32");for(let e=0;ee!==t?1:0)),uN=fE(kr,cN,null,"bool"),hN={kernelName:kr,backendName:"cpu",kernelFunc:uN};const dN={kernelName:Ir,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:i,depth:a,onValue:o,offValue:l}=s;BS(r,"oneHot");const c=Kt(r.shape),u=new Float32Array(c*a);u.fill(l);const h=n.data.get(r.dataId).values;for(let e=0;e=0&&h[e]{Ht(i,e.shape,"All tensors passed to stack must have matching shapes"),jt(a===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=k_({inputs:t.map((e=>{const t=wT({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 yN={kernelName:Nr,backendName:"cpu",kernelFunc:gN};const bN={kernelName:Or,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{paddings:i,constantValue:a}=s;BS(r,"pad");const o=i.map(((e,t)=>e[0]+r.shape[t]+e[1])),l=i.map((e=>e[0])),c=n.data.get(r.dataId).values,u=Kt(r.shape),h=r.shape.length,d=pn(r.shape),p=Kt(o),f=o.length,m=pn(o),g=sn(r.dtype,p);0!==a&&g.fill(a);for(let e=0;ee+l[t])),f,m)]=c[e]}return{dataId:n.write(g,o,r.dtype),shape:o,dtype:r.dtype}}},wN=KS(((e,t)=>Math.pow(e,t))),vN=fE(Dr,wN),AN={kernelName:Dr,backendName:"cpu",kernelFunc:vN};function xN(e,t,n,s){const[r,i]=Oh(e,s),a=Xa(t,"int32"),o=yn(Kt(r),a),l=Kt(i);for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(y,g,f)}};function kN(e,t,n,s){const r=[];let i=0;const a=t.length-1+n.length,o=new Array(a).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[a];for(let e=a;e{if(e<0||e>=n){const r=An(s,t.length,pn(t)).join(",");throw new Error(`indices[${r}] = ${e} is not in [0, ${n})`)}}))}(i,a,t[0][0]-1),0===s.length)throw new Error("params.rank must be nonzero");const l=s[0],{outSplits:c,valueSlices:u,numValues:h}=kN(i,a,e,l),d=function(e){const t=[];for(let n=0;ns[t]=e))}return t}(c),p=EN(n,s,r,u,h);return[d,p[0],p[1]]}const TN={kernelName:Fr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:i,indices:a}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.data.get(e.dataId).values)),c=r.map((e=>e.shape)),u=n.data.get(i.dataId).values,h=n.data.get(a.dataId).values,[d,p,f]=_N(l,c,u,i.shape,i.dtype,h,a.shape),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,i.dtype,p);return m.concat([g])}},IN=2147483647;function NN(e,t,n,s,r,i,a){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(a.length>1)throw new Error("deltas must be a scalar or vector");const o=0===t.length,l=0===r.length,c=0===a.length,u=[];o||u.push(t[0]),l||u.push(r[0]),c||u.push(a[0]);for(let e=1;e0&&rn)u=0;else if(u=Math.ceil(Math.abs((r-n)/a)),u>IN)throw new Error(`Requires ((limit - start) / delta) <= ${IN}`);d[t+1]=d[t]+u}const p=rn(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 i=1;i"Final length of result must be equal to firstDimension.")),r}calculateOutputIndexRowSplit(e,t,n,s){const r=e.length,i=[];for(let a=0;a0&&i.length!==e[r-1])throw new Error("Invalid row split size.");return i}calculateOutputIndexValueRowID(e,t,n,s){const r=e.length,i=[];if(0===r)return[];let a=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];i.push(l);for(let c=1;c=0&&(++a,a=t.length)throw new Error(`Got nextValueRowId=${r} which is not less than ${t.length}`);l=t[r]}i.push(l)}if(i.length!==e.length)throw new Error("Invalid row ids.");return i}calculateOutputIndex(e,t,n,s){const r=this.getRowPartitionTensor(e),i=this.getRowPartitionTypeByDimension(e);switch(i){case DN.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(r,t,n,s);case DN.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: ${DN[i]}`)}}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 DN.FIRST_DIM_SIZE:return e[0];case DN.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case DN.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${DN[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=FN(t,!1),r=rn(this.valuesDType,Kt(s));if(n[0]*t[0]>0){let i=this.calculateFirstParentOutputIndex(e,n[0],t[0]);for(let e=1;e<=this.raggedRank;++e){i=this.calculateOutputIndex(e-1,i,n[e],t[e])}this.setOutput(this.raggedRank,i,r,s)}return[s,r]}setOutput(e,t,n,s){if(0===n.length)return;const r=this.values,i=n;let a=s.slice();a=a.slice(e+1);const o=Kt(a),l=t.length;let c=this.defaultValue;if(c.length!==o&&1!==c.length){const e=this.defaultValueShape;To((()=>{const t=Fu(c,e),n=Qu(t,a);c=n.dataSync()}))}let u=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)i.subarray(d*o,s*o).fill(this.defaultValue[0]),d=s;else for(;s>d;){MN(i.slice(d*o),c,o),++d}s<0?(u=e+1,h=d):(u=e,h=d,d=h+1)}else++d}}}function MN(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 BN(e,t,n,s,r,i,a,o,l,c){return new RN(e,t,n,s,r,i,a,o,l,c).compute()}const zN={kernelName:zr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:i,defaultValue:a,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,c=n.data.get(r.dataId).values,u=n.data.get(i.dataId).values,h=n.data.get(a.dataId).values,d=o.map((e=>n.data.get(e.dataId).values)),p=o.map((e=>e.shape)),[f,m]=BN(c,r.shape,u,i.shape,i.dtype,h,a.shape,d,p,l);return n.makeTensorInfo(f,i.dtype,m)}};function LN(e,t,n,s){if(e===t||e1)return yn(0,s);const r=yn(Math.abs(Math.ceil((t-e)/n)),s);t1/e)),WN={kernelName:Vr,backendName:"cpu",kernelFunc:VN};const GN={kernelName:jr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s;BS(r,"resizeBilinear");const l=pn(r.shape),[c,u]=o,[h,d,p,f]=r.shape,m=n.data.get(r.dataId).values,g=new Float32Array(Kt([h,c,u,f])),y=[i&&c>1?d-1:d,i&&u>1?p-1:p],b=[i&&c>1?c-1:c,i&&u>1?u-1:u];let w=0;const v=y[0]/b[0],A=y[1]/b[1];for(let e=0;e1?c-1:c,a&&p>1?u-1:u],g=[a&&d>1?d-1:d,a&&p>1?p-1:p],y=m[0]/g[0],b=m[1]/g[1],w=n.data.get(i.dataId).values;let v=0;for(let e=0;e1?d-1:d,i&&u>1?p-1:p],b=[i&&c>1?c-1:c,i&&u>1?u-1:u],w=y[0]/b[0],v=y[1]/b[1];let A=0;for(let e=0;e1?u-1:u,a&&f>1?h-1:h],b=[a&&p>1?p-1:p,a&&f>1?f-1:f],w=y[0]/b[0],v=y[1]/b[1],A=1/w,x=1/v,C=2*Math.ceil(A)+2,k=2*Math.ceil(x)+2;for(let e=0;e=p)continue;const d=t+c*l[1],m=c*w;if(e===Math.min(u-1,a?Math.round(m):Math.floor(m)))for(let e=0;e=f)continue;const r=d+t*l[2],i=t*v;s===Math.min(h-1,a?Math.round(i):Math.floor(i))&&(o+=g[r+n])}}m[i+n]=o}}}}return n.makeTensorInfo(r.shape,r.dtype,m)}};const HN={kernelName:Kr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:i}=s;BS(r,"reverse");const a=r.shape.length,o=tn(i,r.shape);if(0===a)return qS({inputs:{x:r},backend:n});const l=new Oa(r.shape,r.dtype),c=n.bufferSync(r);for(let e=0;en[e]=r.shape[e]-1-n[e])),l.set(c.get(...n),...t)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}},$N={kernelName:Li,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:i,center:a}=t,o=n,l=sn(s.dtype,Kt(s.shape)),[c,u,h,d]=s.shape,[p,f]=Fm(a,u,h),m=Math.sin(r),g=Math.cos(r),y=o.data.get(s.dataId).values;for(let e=0;e=0&&v=0&&A{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1})),XN={kernelName:Xr,backendName:"cpu",kernelFunc:KN},ZN=PS((e=>1/Math.sqrt(e))),YN=WS(Zr,ZN),QN={kernelName:Zr,backendName:"cpu",kernelFunc:YN};function JN(e,t,n,s,r,i,a,o,l,c){const u=[s/r,r],h=e.values,d=t.values;if(0===s)return Fl(n,t.dtype);const p=l instanceof Oa?l:Fl(u,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: ${i} does not index into ${n}`);for(let n=0;n1||1===r.shape.length?1:Kt(r.shape.slice(1));for(let e=0;ee>=0?aO*e:iO*(Math.exp(e)-1))),lO={kernelName:ti,backendName:"cpu",kernelFunc:oO},cO=VS(ii,(e=>e<0?-1:e>0?1:0)),uO={kernelName:ii,backendName:"cpu",kernelFunc:cO},hO=VS(si,(e=>Math.sin(e))),dO={kernelName:si,backendName:"cpu",kernelFunc:hO},pO=VS(ri,(e=>Math.sinh(e))),fO={kernelName:ri,backendName:"cpu",kernelFunc:pO},mO=Math.log(1.1920928955078125e-7)+2,gO=VS(oi,(e=>{const t=e>-mO,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 AO(e,t,n,s,r){const i=Kt(s),a=t[0],o=r.length,l=[];let c=1,u=-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=rn(n,a*o);for(let t=0;t0?r[o-1]+1:0;if(u<0)throw new Error("segment ids must be >= 0");const h=t.slice();h[0]=u;const d=rn(n,h.reduce(((e,t)=>e*t),1));if(0===o)return u>0&&d.fill(a),[d,h];if(u<=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>=u)throw new Error(Sg(g,u));g>m&&d.fill(a,m*c,g*c);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=[...u];t[o]=e;const s=i_({inputs:{x:r},backend:n,attrs:{begin:c,size:t}});return c[o]+=e,s}))}},TO=PS((e=>Math.sqrt(e))),IO=VS(li,(e=>Math.sqrt(e))),NO={kernelName:li,backendName:"cpu",kernelFunc:IO},OO={kernelName:wi,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,s=t;BS(n,"square");const r=s.data.get(n.dataId).values,i=new Float32Array(r.length);for(let e=0;e{const n=e-t;return n*n})),RO=fE(bi,DO),MO={kernelName:bi,backendName:"cpu",kernelFunc:RO},FO=PS(((e,t)=>{const{pattern:n,replaceGlobal:s,rewrite:r}=t;return e.replace(new RegExp(n,s?"g":""),r)})),BO=WS(vi,FO),zO={kernelName:vi,backendName:"cpu",kernelFunc:BO},LO=VS(Bi,((e,t)=>{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha})),PO={kernelName:Bi,backendName:"cpu",kernelFunc:LO};function VO(e,t,n,s){const r=Fl(e,t.dtype);for(let e=0;e=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=$c(b,w,v),t=i_({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});A=vE({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{const e=VO(p,n.bufferSync(r),v,b);A=n.makeTensorInfo(f,e.dtype,e.values)}return A}};class GO{constructor(e,t,n,s,r,i){this.separator=ga(e),this.nGramWidths=t,this.leftPad=ga(n),this.rightPad=ga(s),this.padWidth=r,this.preserveShort=i}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,i){for(let a=0;a0?0:a-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+u-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,i=rn("int32",s);if(0===n||0===s){const e=new Array(n);for(let e=0;e<=r;++e)i[e]=0;return[e,i]}i[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),i[e]=i[e-1]+s}const a=new Array(i[r]);for(let n=0;n{const o=t[n+1]-t[n],l=this.getNumNGrams(o,i);this.createNGrams(e,s,a,r,l,i),r+=l})),this.preserveShort&&r===i[n]){const i=t[n+1]-t[n];if(0===i)continue;const o=i+2*this.padWidth,l=1;this.createNGrams(e,s,a,r,l,o)}}return[a,i]}}function UO(e,t,n,s,r,i,a,o){return new GO(n,s,r,i,a,o).compute(e,t)}const qO={kernelName:xi,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:i,leftPad:a,rightPad:o,padWidth:l,preserveShortSequences:c}=s,{data:u,dataSplits:h}=t,d=n.data.get(u.dataId).values,p=n.data.get(h.dataId).values,[f,m]=UO(d,p,r,i,a,o,l,c);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};function jO(e,t,n,s){if(!e.length)return;if(0===t.length){for(let t=0;tMath.tan(e))),YO={kernelName:Ei,backendName:"cpu",kernelFunc:ZO},QO=VS(_i,(e=>Math.tanh(e)));function JO(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 tD(e,t,n=0,s=e.length-1){for(;s>n;){if(s-n>600){const r=s-n+1,i=t-n+1,a=Math.log(r),o=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*o*(r-o)/r)*Math.sign(i-r/2);tD(e,t,Math.max(n,Math.floor(t-i*o/r+l)),Math.min(s,Math.floor(t+(r-i)*o/r+l)))}const r=e[t];let i=n,a=s;for(qt(e,n,t),eD(e[s],r)>0&&qt(e,n,s);i0;)a-=1}0===eD(e[n],r)?qt(e,n,a):(a+=1,qt(e,a,s)),a<=t&&(n=a+1),t<=a&&(s=a-1)}}function nD(e,t,n,s,r){const i=t[t.length-1],[a,o]=[e.length/i,i],l=sn(n,a*s),c=sn("int32",a*s);for(let t=0;ta[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 Gt(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 Gt(0,n,t-1)}(e,t);case"nearest":return function(e,t){return Gt(0,e,t-1)}(e,t);default:return function(e,t){return e}(e)}}function rD(e,t,n,s,r,i,a,o,l,c,u){return 0<=o&&o{for(let n=0;nn.disposeIntermediateTensorInfo(e))),h}},cD=[kE,EE,TE,NE,wE,OE,FE,BE,zE,LE,VE,GE,qE,$E,XE,JE,e_,t_,n_,CE,s_,o_,u_,p_,f_,pE,y_,w_,oE,v_,S_,__,T_,I_,N_,O_,D_,M_,B_,z_,L_,P_,V_,W_,U_,q_,j_,H_,$_,K_,X_,Z_,sT,US,rT,oT,mT,bT,vT,CT,MT,BT,zT,VT,UT,qT,jT,$T,XT,QT,tI,jS,nI,C_,rI,aI,lI,$S,hI,fI,gI,wI,AI,kI,EI,II,NI,OI,MI,zI,LI,PI,VI,WI,GI,UI,qI,$I,KI,YI,eN,eT,nN,rN,aN,lN,hN,dN,mN,yN,bN,AN,YS,CN,TN,ON,zN,PN,uE,ET,WN,JS,tE,AE,GN,UN,qN,jN,HN,$N,XN,QN,eO,sO,rO,lO,rE,uO,dO,fO,a_,JI,yO,bO,vO,xO,kO,SO,EO,_O,NO,OO,MO,zO,PO,WO,qO,$O,XO,NT,nT,YO,{kernelName:_i,backendName:"cpu",kernelFunc:QO},{kernelName:Qr,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{tensor:s,indices:r,updates:i}=t,{sliceRank:a,numUpdates:o,sliceSize:l,strides:c,outputSize:u}=$p(0,r,s.shape),h=n.bufferSync(r),d=n.bufferSync(i),p=n.bufferSync(s),f=JN(h,d,s.shape,u,l,o,a,c,p,!1);return n.makeTensorInfo(s.shape,f.dtype,f.values)}},{kernelName:Ti,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reps:i}=s;BS(r,"tile");const a=JO(n.bufferSync(r),i);return n.makeTensorInfo(a.shape,a.dtype,a.values)}},{kernelName:Ii,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{k:i,sorted:a}=s;BS(r,"topk");const o=n.data.get(r.dataId).values,[l,c]=nD(o,r.shape,r.dtype,i,a);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(c.shape,c.dtype,c.values)]}},{kernelName:Ni,backendName:"cpu",kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,{image:r,transforms:i}=t,{interpolation:a,fillMode:o,fillValue:l,outputShape:c}=n,[u,h,d,p]=r.shape,[f,m]=null!=c?c:[h,d],g=[u,f,m,p],y=pn(r.shape),b=y[0],w=y[1],v=y[2],A=pn(g),x=A[0],C=A[1],k=A[2],S=sn(r.dtype,Kt(g));S.fill(l);const E=s.data.get(r.dataId).values,_=s.data.get(i.dataId).values;for(let e=0;e{t.preventDefault(),delete uD[e]}),!1),En().getBool("SOFTWARE_WEBGL_ENABLED")&&(hD.failIfMajorPerformanceCaveat=!1);if(1===e)return n.getContext("webgl",hD)||n.getContext("experimental-webgl",hD);return n.getContext("webgl2",hD)}(e,t);if(null===n)return null;uD[e]=n}const n=uD[e];return null==n||n.isContextLost()?(delete uD[e],dD(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),uD[e])}var pD,fD,mD,gD,yD,bD;function wD(e,t){return[t,e]}function vD(e){const t=Kt(e);return Yt(Math.ceil(t/4))}function AD(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function xD(e,t){const n=e;let s,r,i,a,o,l,c,u,h,d;return 2===En().getNumber("WEBGL_VERSION")?(s=n.R32F,r=n.R16F,i=n.RGBA16F,a=n.RGBA32F,o=n.RED,c=4,u=1,h=n.HALF_FLOAT,d=n.FLOAT,l=n.RGBA8):(s=e.RGBA,r=e.RGBA,i=e.RGBA,a=n.RGBA,o=e.RGBA,c=4,u=4,h=null!=t?t.HALF_FLOAT_OES:null,d=e.FLOAT,l=e.RGBA),{internalFormatFloat:s,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:i,internalFormatPackedFloat:a,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:c,defaultNumChannels:u,textureTypeHalfFloat:h,textureTypeFloat:d}}function CD(e,t){const n=t();return En().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}(fD=pD||(pD={}))[fD.DENSE=0]="DENSE",fD[fD.SHARED_BATCH=1]="SHARED_BATCH",(gD=mD||(mD={}))[gD.RENDER=0]="RENDER",gD[gD.UPLOAD=1]="UPLOAD",gD[gD.PIXELS=2]="PIXELS",gD[gD.DOWNLOAD=3]="DOWNLOAD",(bD=yD||(yD={}))[bD.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",bD[bD.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",bD[bD.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",bD[bD.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",bD[bD.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16";function kD(e){return!!(En().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||5.96e-8e.getExtension(t)),'Extension "'+t+'" not supported on this browser.')}const ED=/ERROR: [0-9]+:([0-9]+):/g;function _D(e,t){const n=ED.exec(t);if(null==n)return;const s=+n[1],r=e.split("\n"),i=r.length.toString().length+2,a=r.map(((e,t)=>Qt((t+1).toString(),i)+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 ID(e,t,n,s,r,i,a){const o=e.getAttribLocation(t,n);return-1!==o&&(CD(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,s))),CD(e,(()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,i,a))),CD(e,(()=>e.enableVertexAttribArray(o))),!0)}function ND(e,t,n,s){CD(e,(()=>function(e,t,n){FD(e,n),CD(e,(()=>e.activeTexture(e.TEXTURE0+n))),CD(e,(()=>e.bindTexture(e.TEXTURE_2D,t)))}(e,t,s))),CD(e,(()=>e.uniform1i(n,s)))}function OD(e,t,n){CD(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,n))),CD(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)))}function DD(e,t){CD(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,t))),CD(e,(()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0)))}function RD(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 MD(e,t,n){const s=CD(e,(()=>t()));if(null==s)throw new Error(n);return s}function FD(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 BD(e,t=2){return Kt(e.slice(0,e.length-t))}function zD(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 LD(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[BD(e),...zD(e)]),t}function PD(e){return e%2==0}function VD(e,t){if(Xt(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(PD(n)&&PD(s)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&PD(e[0])&&PD(t[0])}let WD,GD;function UD(e,t){return null!=e.getExtension(t)}function qD(e){try{if(null!=dD(e))return!0}catch(e){return!1}return!1}function jD(e){if(0===e)return!1;const t=dD(e);if(1!==e){if(UD(t,"EXT_color_buffer_float"))return HD(t);const e="EXT_color_buffer_half_float";if(UD(t,e)){const n=t.getExtension(e);return function(e,t){const n=xD(e,t),s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s);const r=1,i=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,i,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const a=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,a),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(a),o}(t,n)}return!1}if(!UD(t,"OES_texture_float"))return!1;if(!UD(t,"WEBGL_color_buffer_float"))return!1;return HD(t)}function HD(e){const t=xD(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 $D(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&jt("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the WebGL backend.`))}))}const KD=En();function XD(){let e,t,n,s,r,i,a,o,l,c;return 2===En().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",s="in",r="texture",i="outputColor",a="out vec4 outputColor;",o=En().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="",c="\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",i="gl_FragColor",a="",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 ",c="\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:i,defineOutput:a,defineSpecialNaN:o,defineSpecialInf:l,defineRound:c}}function ZD(e,t,n="index"){const s=pn(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 YD(e,t,n="index"){const s=pn(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 QD(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 JD(e){const t=pn(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`}KD.registerFlag("HAS_WEBGL",(()=>KD.getNumber("WEBGL_VERSION")>0)),KD.registerFlag("WEBGL_VERSION",(()=>qD(2)?2:qD(1)?1:0)),KD.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",(()=>!1)),KD.registerFlag("WEBGL_BUFFER_SUPPORTED",(()=>2===KD.get("WEBGL_VERSION"))),KD.registerFlag("WEBGL_CPU_FORWARD",(()=>!0)),KD.registerFlag("WEBGL_FORCE_F16_TEXTURES",(()=>!1)),KD.registerFlag("WEBGL_PACK",(()=>KD.getBool("HAS_WEBGL"))),KD.registerFlag("WEBGL_PACK_NORMALIZATION",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_CLIP",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_DEPTHWISECONV",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_REDUCE",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_LAZILY_UNPACK",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_CONV_IM2COL",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",(()=>KD.getBool("WEBGL_PACK"))),KD.registerFlag("WEBGL_MAX_TEXTURE_SIZE",(()=>function(e){if(null==WD){const t=dD(e);WD=t.getParameter(t.MAX_TEXTURE_SIZE)}return WD}(KD.getNumber("WEBGL_VERSION")))),KD.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",(()=>function(e){if(null==GD){const t=dD(e);GD=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,GD)}(KD.getNumber("WEBGL_VERSION")))),KD.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",(()=>{const e=KD.getNumber("WEBGL_VERSION");return 0===e?0:function(e){if(0===e)return 0;let t;const n=dD(e);return t=UD(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:UD(n,"EXT_disjoint_timer_query")?1:0,t}(e)})),KD.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",(()=>KD.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!uo())),KD.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",(()=>function(e){if(0===e)return!1;const t=dD(e);if(1===e){if(!UD(t,"OES_texture_float"))return!1}else if(!UD(t,"EXT_color_buffer_float"))return!1;return HD(t)}(KD.getNumber("WEBGL_VERSION")))),KD.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",(()=>!KD.getBool("WEBGL_FORCE_F16_TEXTURES")&&KD.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))),KD.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",(()=>jD(KD.getNumber("WEBGL_VERSION")))),KD.registerFlag("WEBGL_FENCE_API_ENABLED",(()=>{return 2===(e=KD.getNumber("WEBGL_VERSION"))&&null!=dD(e).fenceSync;var e})),KD.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",(()=>KD.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0)),KD.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}.`)})),KD.registerFlag("WEBGL_FLUSH_THRESHOLD",(()=>uo()?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}.`)})),KD.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",(()=>128)),KD.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",(()=>!1)),KD.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",(()=>1e5)),KD.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",(()=>128)),KD.registerFlag("WEBGL_EXP_CONV",(()=>!1)),KD.registerFlag("SOFTWARE_WEBGL_ENABLED",(()=>KD.getBool("IS_TEST"))),KD.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",(()=>1/0)),KD.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",(()=>!1)),KD.registerFlag("WEBGL2_ISNAN_CUSTOM",(()=>!1)),KD.registerFlag("ENGINE_COMPILE_ONLY",(()=>!1));const eR="\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:tR}=r;function nR(e,t,n){const s=[];if(e.forEach((e=>{const t=Kt(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}=pR(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"),i=e.map((e=>function(e,t,n=!1,s){let r="";r+=n?rR(e,s):sR(e,s);const i=e.shapeInfo.logicalShape,a=t.logicalShape;i.length<=a.length&&(r+=n?function(e,t){const n=e.name,s=n.charAt(0).toUpperCase()+n.slice(1),r="get"+s+"AtOutCoords",i=e.shapeInfo.logicalShape.length,a=t.logicalShape.length,o=tR(e.shapeInfo.logicalShape,t.logicalShape),l=dR(a),c=a-i;let u;const h=["x","y","z","w","u","v"];u=0===i?"":a<2&&o.length>=1?"coords = 0;":o.map((e=>`coords.${h[e+c]} = 0;`)).join("\n");let d="";d=a<2&&i>0?"coords":e.shapeInfo.logicalShape.map(((e,t)=>`coords.${h[t+c]}`)).join(", ");let p="return outputValue;";const f=1===Kt(e.shapeInfo.logicalShape),m=Kt(t.logicalShape),g=1===m;if(1!==i||f||g){if(f&&!g)p=1===a?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(o.length){const e=i-2,t=i-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 ${u}\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",i=t.texShape,a=e.shapeInfo.texShape,o=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&o===l&&null==e.shapeInfo.flatOffset&&Xt(a,i))return`\n float ${r}() {\n return sampleTexture(${n}, resultUV);\n }\n `;const c=dR(l),u=tR(e.shapeInfo.logicalShape,t.logicalShape),h=l-o;let d;const p=["x","y","z","w","u","v"];d=0===o?"":l<2&&u.length>=1?"coords = 0;":u.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 ${c} coords = getOutputCoords();\n ${d}\n return get${s}(${f});\n }\n `}(e,t));return r}(e,t,n.packedInputs,n.enableShapeUniforms))).join("\n"),a=t.texShape,o=XD(),l=function(e){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${e.texture2D}(textureSampler, uv).r;\n }\n `}(o);let c,u,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 ${iR}\n ${aR}\n ${oR}\n `;return t}(o);t.isPacked?(c=function(e,t,n){switch(e.length){case 0:return cR();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(Xt(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),i=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 / ${i};\n index -= b * ${i};\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),i=r*Math.ceil(e[e.length-2]/2);let a=i,o="",l="b, r, c";for(let t=2;t1&&!Xt(t,n)&&s.lengthe[t])).join(", ")}function gR(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}})),i=r.map((e=>e.shapeInfo)),a={logicalShape:s.shape,texShape:s.texData.texShape,isUniform:!1,isPacked:s.texData.isPacked,flatOffset:null},o=nR(r,a,t),l=function(e,t){const n=MD(e,(()=>e.createShader(e.FRAGMENT_SHADER)),"Unable to create fragment WebGLShader.");if(CD(e,(()=>e.shaderSource(n,t))),CD(e,(()=>e.compileShader(n))),En().get("ENGINE_COMPILE_ONLY"))return n;if(!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw _D(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}(e.gl,o),c=e.createProgram(l);return En().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:o,webGLProgram:c,inShapeInfos:i,outShapeInfo:a,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(c),Object.assign({program:t,fragmentShader:l,source:o,webGLProgram:c,inShapeInfos:i,outShapeInfo:a},yR(e,t,c)))}function yR(e,t,n){const s=[],r=[];let i,a,o,l=null,c=null;c=e.getUniformLocation(n,"NAN",!1),1===En().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(n,"INFINITY",!1));const u=!1;for(const r of t.variableNames){const i={name:r,uniform:e.getUniformLocation(n,r,u),offset:e.getUniformLocation(n,`offset${r}`,u)};t.enableShapeUniforms&&(i.shape=e.getUniformLocation(n,`${r}Shape`,u),i.texShape=e.getUniformLocation(n,`${r}TexShape`,u)),s.push(i)}if(t.enableShapeUniforms&&(i=e.getUniformLocation(n,"outShape",u),o=e.getUniformLocation(n,"outShapeStrides",u),a=e.getUniformLocation(n,"outTexShape",u)),t.customUniforms)for(const s of t.customUniforms)r.push(e.getUniformLocation(n,s.name,u));return{variablesLocations:s,customUniformLocations:r,infLoc:l,nanLoc:c,outShapeLocation:i,outShapeStridesLocation:o,outTexShapeLocation:a}}function bR(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],i=r.shape;if(!Xt(s,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${s} and ${i} must match`);if(e.isUniform&&r.isUniform)return;const a=e.texShape,o=r.isUniform?null:r.texData.texShape;if(!Xt(a,o))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${a} and ${o} must match`)}))}function wR(e){return En().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}class vR{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=pD.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=XD();this.outputShape=e,this.enableShapeUniforms=wR(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?YD(["r","c","d"],e):ZD(["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 AR{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=pD.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=XD();this.outputShape=e,this.enableShapeUniforms=wR(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?YD(["r","c","d"],e):ZD(["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 xR{constructor(e){this.variableNames=["A"],this.outTexUsage=mD.DOWNLOAD;const t=XD();this.outputShape=e,this.userCode=`\n ${eR}\n\n void main() {\n float x = getAAtOutCoords();\n ${t.output} = encode_float(x);\n }\n `}}class CR{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=mD.DOWNLOAD;const t=XD();this.outputShape=e,this.userCode=`\n ${eR}\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 kR={R:0,G:1,B:2,A:3};class SR{constructor(e,t=!1,n="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const s=XD();this.outputShape=e,this.enableShapeUniforms=wR(this.outputShape.length);let r="result";t&&(r="floor(result * 255. + 0.5)");let i="";for(let e=0;ee.createShader(e.VERTEX_SHADER)),"Unable to create vertex WebGLShader.");if(CD(e,(()=>e.shaderSource(n,t))),CD(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 TR(e){return function(e,t){const n=MD(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return CD(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),CD(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 IR(e){return function(e,t){const n=MD(e,(()=>e.createBuffer()),"Unable to create WebGLBuffer");return CD(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n))),CD(e,(()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW))),n}(e,new Uint16Array([0,1,2,2,1,3]))}function NR(e,t,n,s,r,i){!function(e,t){const n=En().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 a=function(e){return MD(e,(()=>e.createTexture()),"Unable to create WebGLTexture.")}(e),o=e.TEXTURE_2D;return CD(e,(()=>e.bindTexture(o,a))),CD(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE))),CD(e,(()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE))),CD(e,(()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST))),CD(e,(()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST))),1===En().getNumber("WEBGL_VERSION")?CD(e,(()=>e.texImage2D(o,0,s,t,n,0,r,i,null))):CD(e,(()=>e.texStorage2D(o,1,s,t,n))),CD(e,(()=>e.bindTexture(e.TEXTURE_2D,null))),{texture:a,texShape:[n,t]}}function OR(e){return e.internalFormatFloat}function DR(e){return e.internalFormatHalfFloat}function RR(e){return e.downloadTextureFormat}function MR(e){return e.internalFormatPackedFloat}function FR(e){return e.internalFormatPackedHalfFloat}function BR(e,t,n,s,r,i,a,o){const l=e,c=new Float32Array(function(e,t){const[n,s]=AD(e,t);return n*s*4}(i,a));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,c),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),c}class zR{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const t=En().getNumber("WEBGL_VERSION");if(null!=e?(this.gl=e,function(e,t){uD[e]=t}(t,e)):this.gl=dD(t),e=this.gl,2===En().getNumber("WEBGL_VERSION")){const t=e;this.createVertexArray=()=>CD(t,(()=>t.createVertexArray())),this.bindVertexArray=e=>CD(t,(()=>t.bindVertexArray(e))),this.deleteVertexArray=e=>CD(t,(()=>t.deleteVertexArray(e))),this.getVertexArray=()=>CD(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=()=>CD(e,(()=>t.createVertexArrayOES())),this.bindVertexArray=n=>CD(e,(()=>t.bindVertexArrayOES(n))),this.deleteVertexArray=n=>CD(e,(()=>t.deleteVertexArrayOES(n))),this.getVertexArray=()=>CD(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===En().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=SD(this.gl,e),UD(this.gl,t))this.textureHalfFloatExtension=SD(this.gl,t);else if(En().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),UD(this.gl,s))this.colorBufferHalfFloatExtension=SD(this.gl,s);else if(En().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",UD(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!UD(this.gl,s))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(s)}this.vertexBuffer=TR(this.gl),this.indexBuffer=IR(this.gl),this.framebuffer=function(e){return MD(e,(()=>e.createFramebuffer()),"Unable to create WebGLFramebuffer.")}(this.gl),this.textureConfig=xD(this.gl,this.textureHalfFloatExtension)}get debug(){return En().getBool("DEBUG")}dispose(){if(this.disposed)return;this.program,this.outputTexture;const e=this.gl;CD(e,(()=>e.finish())),CD(e,(()=>e.bindFramebuffer(e.FRAMEBUFFER,null))),CD(e,(()=>e.deleteFramebuffer(this.framebuffer))),CD(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,null))),CD(e,(()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null))),CD(e,(()=>e.deleteBuffer(this.indexBuffer))),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=wD(t,n);return NR(e,r,i,OR(s),s.textureFormatFloat,e.FLOAT)}(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=wD(t,n);return NR(e,r,i,DR(s),s.textureFormatFloat,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=wD(t,n);return NR(e,r,i,RR(s),e.RGBA,e.UNSIGNED_BYTE)}(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),function(e,t,n){CD(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),n.data instanceof Uint8Array?2===En().getNumber("WEBGL_VERSION")?CD(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,e.RGBA,e.UNSIGNED_BYTE,n.data))):CD(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data))):2===En().getNumber("WEBGL_VERSION")?CD(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,n))):CD(e,(()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n))),CD(e,(()=>e.bindTexture(e.TEXTURE_2D,null)))}(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,s){this.throwIfDisposed(),function(e,t,n,s,r,i){let a,o,l;CD(e,(()=>e.bindTexture(e.TEXTURE_2D,t))),r instanceof Uint8Array?(a=new Uint8Array(n*s*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(a=new Float32Array(n*s*4),o=e.FLOAT,l=i.internalFormatPackedFloat),a.set(r),2===En().getNumber("WEBGL_VERSION")?CD(e,(()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,s,e.RGBA,o,a))):CD(e,(()=>e.texImage2D(e.TEXTURE_2D,0,l,n,s,0,e.RGBA,o,a))),CD(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,i]=AD(t,n);return NR(e,r,i,FR(s),e.RGBA,s.textureTypeHalfFloat)}(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),function(e,t,n,s){const[r,i]=AD(t,n);return NR(e,r,i,MR(s),e.RGBA,e.FLOAT)}(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(DD(this.gl,this.framebuffer),this.outputTexture=null),CD(this.gl,(()=>this.gl.deleteTexture(e)))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,(()=>function(e,t,n,s){const[r,i]=wD(t,n),a=new Uint8Array(t*n*4);return CD(e,(()=>e.readPixels(0,0,r,i,s.downloadTextureFormat,e.UNSIGNED_BYTE,a))),new Float32Array(a.buffer)}(this.gl,t,n,this.textureConfig)))}downloadPackedMatrixFromBuffer(e,t,n,s,r,i){return BR(this.gl,e,0,0,0,r,i,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();CD(e,(()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r)));const i=16*t*n;return CD(e,(()=>e.bufferData(e.PIXEL_PACK_BUFFER,i,e.STREAM_READ))),CD(e,(()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0))),CD(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(En().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 En().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,En().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 CD(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=_R(t));const n=function(e){return MD(e,(()=>e.createProgram()),"Unable to create WebGLProgram.")}(t);CD(t,(()=>t.attachShader(n,this.vertexShader))),CD(t,(()=>t.attachShader(n,e))),function(e,t){if(CD(e,(()=>e.linkProgram(t))),!En().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&&TD(t,s),s}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const t=this.gl;CD(t,(()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer))),function(e,t,n){CD(e,(()=>e.bindBuffer(e.ARRAY_BUFFER,n))),ID(e,t,"clipSpacePos",n,3,20,0)&&ID(e,t,"uv",n,2,20,12)}(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&(CD(this.gl,(()=>this.gl.deleteProgram(e))),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&TD(this.gl,this.program),CD(this.gl,(()=>this.gl.useProgram(e)))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?function(e,t,n){return MD(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(),CD(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(),ND(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();const[s,r]=AD(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&&TD(this.gl,this.program),RD(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){this.getVertexArray();this.debugValidate()}CD(e,(()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),CD(this.gl,(()=>this.gl.finish()))}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=SD(this.gl,2===En().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===En().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===En().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 Jt((()=>this.disposed||this.isQueryAvailable(e,En().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")))),this.getQueryTime(e,En().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 En().platform&&(n=En().platform.setTimeoutCustom.bind(En().platform)),Jt((()=>(this.pollItems(),0===this.itemsToPoll.length)),(()=>0),null,n)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),OD(this.gl,e,this.framebuffer),this.debug&&RD(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(OD(this.gl,this.outputTexture,this.framebuffer),this.debug&&RD(this.gl)):DD(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;OD(s,e,this.framebuffer),this.debug&&RD(s),this.outputTexture=e,CD(s,(()=>s.viewport(0,0,t,n))),CD(s,(()=>s.scissor(0,0,t,n)))}setOutputMatrixWriteRegionDriver(e,t,n,s){this.throwIfDisposed(),CD(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{mx:LR,XI:PR,Nk:VR,f6:WR,ct:GR,YG:UR,hH:qR,z3:jR,sG:HR,uM:$R,vS:KR,qB:XR,GG:ZR,rq:YR,lg:QR,WR:JR,cu:eM,GE:tM,px:nM,jC:sM,He:rM,hE:iM,BF:aM,Dk:oM,cl:lM,_B:cM,ub:uM,_f:hM,Ku:dM,qy:pM,Zy:fM,bu:mM,zv:gM,dH:yM,HS:bM,yH:wM,l3:vM,z9:AM,x6:xM,_m:CM,eW:kM,GK:SM,SP:EM,yr:_M,dl:TM,Dw:IM,xT:NM,_X:OM,wz:DM}=S;function RM(e,t){return["x","y","z","w","u","v"].slice(0,t).map((t=>`${e}.${t}`))}function MM(e,t){return 1===t?[e]:RM(e,t)}class FM{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=wR(this.outputShape.length),0===this.rank)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{const e=MM("rc",this.rank),t=dR(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 BM{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=wR(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?QD(["r","c","d"],"inputShape"):ZD(["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":JD(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 zM{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=PM(t,n),r=VM(e,s,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);const i=LM(e,s,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=i,this.log();const e=this.freeTextures[r].pop();return this.usedTextures[r].push(e),e}let a;return s===yD.PACKED_2X2_FLOAT32?a=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):s===yD.PACKED_2X2_FLOAT16?a=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):s===yD.UNPACKED_FLOAT32?a=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):s===yD.UNPACKED_FLOAT16?a=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):s===yD.PACKED_4X1_UNSIGNED_BYTE&&(a=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(a),this.numUsedTextures++,this._numBytesAllocated+=i,this.log(),a}releaseTexture(e,t,n,s){if(null==this.freeTextures)return;const r=PM(n,s),i=VM(t,r,s);i in this.freeTextures||(this.freeTextures[i]=[]);const a=LM(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,s),o=En().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==o&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=a):(this.freeTextures[i].push(e),this.numFreeTextures++,this._numBytesFree+=a),this.numUsedTextures--;const l=this.usedTextures[i],c=l&&l.indexOf(e);if(null==c||c<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[c]=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 LM(e,t,n,s,r){const i=function(e,t){switch(e){case yD.PACKED_2X2_FLOAT32:return MR(t);case yD.PACKED_2X2_FLOAT16:return FR(t);case yD.UNPACKED_FLOAT32:return OR(t);case yD.UNPACKED_FLOAT16:return DR(t);case yD.PACKED_4X1_UNSIGNED_BYTE:return RR(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,s);let a;if(r){const[t,n]=AD(e[0],e[1]);a=t*n}else{const[t,n]=wD(e[0],e[1]);a=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,i);return a*o}function PM(e,t){if(e===mD.UPLOAD)return yD.PACKED_2X2_FLOAT32;if(e===mD.RENDER||null==e)return function(e){return En().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?yD.PACKED_2X2_FLOAT32:yD.UNPACKED_FLOAT32:e?yD.PACKED_2X2_FLOAT16:yD.UNPACKED_FLOAT16}(t);if(e===mD.DOWNLOAD||e===mD.PIXELS)return yD.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function VM(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}class WM{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=wR(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 GM="if (isnan(x)) return x;",UM="return x;",qM="return abs(x);";const jM="return (x >= 0.0) ? x : (exp(x) - 1.0);",HM=GM+"\n return (x < 0.0) ? 0.0 : x;\n",$M=GM+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",KM="return x;",XM="return 1.0 / (1.0 + exp(-1.0 * x));",ZM="return x;",YM="\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",QM="\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",JM="\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",eF="return 1.0 / (1.0 + exp(-1.0 * x));";class tF{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=wR(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 nF{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=wR(this.outputShape.length);const t=e.length,n=MM("rc",t),s=dR(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:i,complexTensorInfos:a,isPacked:o}=t;if(null!=r){let t;t=o?new tF(s,KM):new WM(s,KM);const n=this.runWebGLProgram(t,[{dataId:e,shape:s,dtype:i}],i),r=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if(En().getBool("DEBUG")&&!En().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===En().getNumber("WEBGL_VERSION"))throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l,c,u=null;if("complex64"!==i&&En().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);u=this.gpgpu.createBufferFromTexture(t.texture.texture,...vD(s))}if(this.pendingRead.set(e,[]),"complex64"!==i&&await this.gpgpu.createAndWaitForFence(),"complex64"===i){const e=await Promise.all([this.read(a.real.dataId),this.read(a.imag.dataId)]);c=Zm(e[0],e[1])}else if(null==u)c=this.getValuesFromTexture(e);else{const e=Kt(s);c=this.gpgpu.downloadFloat32MatrixFromBuffer(u,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=u){const e=this.gpgpu.gl;CD(e,(()=>e.deleteBuffer(u)))}const h=this.convertAndCacheOnCPU(e,c),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)&&Eo().removeDataId(e,this),this.pendingDeletes--),h}readToGPU(e,t={}){const n=this.texData.get(e),{values:s,shape:r,slice:i,dtype:a,isPacked:o,texture:l}=n;if("complex64"===a)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=i){let n;n=o?new tF(r,KM):new WM(r,KM);const s=this.runWebGLProgram(n,[{dataId:e,shape:r,dtype:a}],a),i=this.readToGPU(s,t);return this.disposeIntermediateTensorInfo(s),i}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 c=this.decode(e,t.customTexShape),u=Eo().makeTensorFromTensorInfo(c),h=this.texData.get(c.dataId);return Object.assign({tensorRef:u},h.texture)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map((e=>ya(e)));return Fl(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return Fl(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=wa(this.activeTimers.map((e=>e.query))).filter((e=>null!=e)),i=wa(this.activeTimers.map((e=>e.name))).filter((e=>null!=e));this.activeTimers=t,s&&(this.programTimersStack=null);const a={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(En().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(r);a.kernelMs=function(e){let t=0;for(let n=0;ne.map(((e,t)=>({name:i[t],ms:e}))).map((e=>`${e.name}: ${e.ms}`)).join(", ")}else a.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,a})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return En().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:ma(),endMs:null}}endTimer(e){return En().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=ma(),e)}async getQueryTime(e){if(En().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:i,slice:a}=this.texData.get(e),o=a&&a.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,i)));const c=this.texData.get(e);c.texture=null,c.texShape=null,c.isPacked=!1,c.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=iF){return En().getBool("WEBGL_CPU_FORWARD")&&e.every((e=>null==this.texData.get(e.dataId).texture&&Kt(e.shape)0&&ln(n[0])){const r=n.map((e=>ga(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 Eo().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,n),this)}unpackTensor(e){const t=new nF(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new FM(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const n=[BD(e.shape),...zD(e.shape)],s={dtype:e.dtype,shape:n,dataId:e.dataId},r=[BD(t),...zD(t)],i=new BM(r,n),a=[n],o=this.runWebGLProgram(i,[s],e.dtype,a,!0);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e,t){const n=this.texData.get(e),{isPacked:s,shape:r,dtype:i}=n;if(null!=t){jt(Kt(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 a=LD(r);let o;o=s?new AR(a):new vR(a);const l=[null!=t?t:vD(a)];return{dtype:i,shape:r,dataId:this.runWebGLProgram(o,[{shape:a,dtype:i,dataId:e}],i,l,!0,t).dataId}}runWebGLProgram(e,t,n,s,r=!1,i){const a=this.makeTensorInfo(e.outputShape,n),o=this.texData.get(a.dataId);if(e.packedOutput&&(o.isPacked=!0),e.outPackingScheme===pD.DENSE){const t=null!=i?i:vD(e.outputShape);o.texShape=t.map((e=>2*e))}if(null!=e.outTexUsage&&(o.usage=e.outTexUsage),0===Kt(a.shape))return o.values=sn(a.dtype,0),a;const l=[],c=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&&Kt(t.shape)<=En().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&&!VD(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(a.dataId);const u={shape:a.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 i=t.texData.texShape,{useSqueezeShape:a,uniformShape:o,keptDims:l}=pR(e.packedInputs,t.shape,i);let c="",u="",h="";if(1===o.length&&e.packedInputs){const e=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)];c=`${e[0]>1}_${e[1]>1}`}else if(2!==o.length||e.packedInputs){if(o.length>2&&!e.packedInputs){const e=pn(o);h=`${e[0]===i[1]}_${e[e.length-1]===i[1]}`}}else u=`${o[0]>1}_${o[1]>1}`;const d=t.shape.length,p=2===o.length&&Xt(t.shape,i),f=1===Kt(t.shape),m=oc(t.shape,n.shape),g=!e.packedInputs&&d===n.shape.length&&Xt(i,n.texData.texShape),y=e.packedInputs||o.length>2?"":`${i[0]>1}_${i[1]>1}`;s+=`${d}_${g}_${a?l:""}_${o.length}_${f}_${m}_${p}_${c}_${u}_${h}_${y}_${r}`}else{const e=t.isUniform?"uniform":t.texData.texShape;s+=`${t.shape}_${e}_${r}`}}));const r=e.userCode;let i=e.constructor.name;return i+="_"+s+"_"+r+`${En().getNumber("WEBGL_VERSION")}`,i}(e,c,u),d=this.getAndSaveBinary(h,(()=>gR(this.gpgpu,e,c,u))),p=null!=this.activeTimers;let f;p&&(f=this.startTimer()),En().get("ENGINE_COMPILE_ONLY")||function(e,t,n,s,r){t.program.enableShapeUniforms||(bR(t.inShapeInfos,n),bR([t.outShapeInfo],[s]));const i=s.texData.texture,a=s.texData.texShape;s.texData.isPacked?e.setOutputPackedMatrixTexture(i.texture,a[0],a[1]):e.setOutputMatrixTexture(i.texture,a[0],a[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),1===En().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=En().getNumber("WEBGL_FLUSH_THRESHOLD");if(m>0){const e=ma();e-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!En().getBool("WEBGL_LAZILY_UNPACK")&&o.isPacked&&!1===r){const e=this.unpackTensor(a);return this.disposeIntermediateTensorInfo(a),e}return a}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(!En().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=To((()=>{if(!En().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=En().getBool("DEBUG");En().set("DEBUG",!1);const t=this.abs($l(1e-8)).dataSync()[0];if(En().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:i,usage:a,isPacked:o}=t;if(null!=i)return;const l=null!=this.activeTimers;let c;l&&(c=ma());let u=t.texShape;if(null==u&&(u=function(e,t=!1){let n=En().getNumber("WEBGL_MAX_TEXTURE_SIZE"),s=En().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");if(s===1/0&&En().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=nn(e);e=t.newShape}let r=Kt(e),i=null;e.length<=1&&r<=n?i=[1,r]:2===e.length&&e[0]<=n&&e[1]<=n?i=e:3===e.length&&e[0]*e[1]<=n&&e[2]<=n?i=[e[0]*e[1],e[2]]:3===e.length&&e[0]<=n&&e[1]*e[2]<=n?i=[e[0],e[1]*e[2]]:4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n?i=[e[0]*e[1]*e[2],e[3]]:4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n&&(i=[e[0],e[1]*e[2]*e[3]]);const a=null!=i&&Math.max(...i)>s&&Math.min(...i)<=(t?2:1)&&Math.min(...i)>0;if(null==i||a)if(t){const t=BD(e);let n=2,s=2;e.length&&([n,s]=zD(e)),r=t*(n/2)*(s/2),i=Yt(r).map((e=>2*e))}else i=Yt(r);return i}(n,o),t.texShape=u),null!=r){const e=LD(n);let i,a=u[1],h=u[0];const d=r instanceof Uint8Array||r instanceof Uint8ClampedArray;!o&&d||([a,h]=AD(u[0],u[1])),i=o?new ER(e,d):new SR(e,d);const p=d?[h,a]:u,f=this.makeTensorInfo(p,s),m=this.texData.get(f.dataId);m.usage=d?mD.PIXELS:mD.UPLOAD,m.texShape=p,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(f.dataId),a,h,r);const g=[[h,a]],y=!0,b=this.runWebGLProgram(i,[f],s,g,y),w=this.texData.get(b.dataId);t.texShape=w.texShape,t.isPacked=w.isPacked,t.usage=w.usage,En().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+=ma()-c)}else{const e=this.acquireTexture(u,a,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]*on(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 km(),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 _D(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:i,outShapeStridesLocation:a,outTexShapeLocation:o}=yR(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=n,e.infLoc=s,e.nanLoc=r,e.outShapeLocation=i,e.outShapeStridesLocation=a,e.outTexShapeLocation=o}}createTensorFromGPUData(e,t,n){e.channels=e.channels||"RGBA";const{texture:s,height:r,width:i,channels:a}=e,o=Eo().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,i,a);return Eo().makeTensorFromDataId(l,t,n,o)}}aF.nextDataId=0;ho()&&Oo("webgl",(()=>new aF),2);const oF="\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";class lF{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=cc(t,n),this.enableShapeUniforms=wR(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 cF="\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 uF{constructor(e,t,n,s=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=cc(t,n);const r=this.outputShape.length;this.enableShapeUniforms=wR(r);let i="";if(s)if(0===r||1===Kt(this.outputShape))i="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{if(i=`\n ${dR(r)} coords = getOutputCoords();\n `,1===r)this.enableShapeUniforms?i+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":i+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{const e=MM("coords",r);this.enableShapeUniforms?i+=`\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 `:i+=`\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 ${i}\n\n setOutput(result);\n }\n `}}function hF(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 dF={kernelName:Hs,backendName:"webgl",kernelFunc:hF};function pF(e){const{inputs:t,backend:n}=e,{real:s,imag:r}=t,i=n.makeTensorInfo(s.shape,"complex64"),a=n.texData.get(i.dataId),o=hF({inputs:{x:s},backend:n}),l=hF({inputs:{x:r},backend:n});return a.complexTensorInfos={real:o,imag:l},i}const fF={kernelName:ss,backendName:"webgl",kernelFunc:pF},mF="return (a < 0.) ? b * a : a;",gF="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const yF={kernelName:Qs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{alpha:i}=s,a=n.makeTensorInfo([],"float32",pa(i,"float32")),o=En().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new uF(gF,r.shape,a.shape):new lF(mF,r.shape,a.shape),l=n.runWebGLProgram(o,[r,a],"float32");return n.disposeIntermediateTensorInfo(a),l}},bF="return (a < 0.) ? b * a : a;",wF="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const vF={kernelName:Rr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s,alpha:r}=t,i=En().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new uF(wF,s.shape,r.shape):new lF(bF,s.shape,r.shape);return n.runWebGLProgram(i,[s,r],"float32")}},AF="if (isnan(x)) return x;";function xF({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:s}){return({inputs:r,backend:i})=>{const{x:a}=r,o=i,l=s||a.dtype;if(o.shouldExecuteOnCPU([a])&&null!=n){const e=o.texData.get(a.dataId),t=n(e.values,l);return o.makeTensorInfo(a.shape,l,t)}let c;return c=En().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new tF(a.shape,t):new WM(a.shape,e),o.runWebGLProgram(c,[a],l)}}function CF({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:s=!1,cpuKernelImpl:r,dtype:i}){return({inputs:a,backend:o})=>{const{a:l,b:c}=a,u=o;if(s&&"complex64"===l.dtype){const t=u.texData.get(l.dataId),n=u.texData.get(c.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},i={dataId:s.dataId,dtype:s.dtype,shape:c.shape},a=new lF(e,l.shape,c.shape);return u.runWebGLProgram(a,[r,i],Xa(n.dtype,s.dtype))})),i=pF({inputs:{real:s,imag:r},backend:u});return u.disposeIntermediateTensorInfo(s),u.disposeIntermediateTensorInfo(r),i}const h=i||Xa(l.dtype,c.dtype);if(("string"===l.dtype||"string"===c.dtype||u.shouldExecuteOnCPU([l,c]))&&null!=r){const e=u.texData.get(l.dataId).values,t=u.texData.get(c.dataId).values,n="string"===l.dtype?Ng(e):e,s="string"===l.dtype?Ng(t):t,[i,a]=r(l.shape,c.shape,n,s,h),o=u.makeTensorInfo(a,h);return u.texData.get(o.dataId).values=i,o}let d;return d=En().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new uF(t,l.shape,c.shape,n):new lF(e,l.shape,c.shape),u.runWebGLProgram(d,[l,c],h)}}function kF(e,t=!1){if("linear"===e)return t?ZM:UM;if("relu"===e)return t?QM:HM;if("elu"===e)return t?YM:jM;if("relu6"===e)return t?JM:$M;if("prelu"===e)return t?wF:bF;if("leakyrelu"===e)return t?gF:mF;if("sigmoid"===e)return t?eF:XM;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}class SF{constructor(e,t,n,s=!1,r=!1,i=!1,a=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.enableShapeUniforms=wR(this.outputShape.length);const c=s?e[1]:e[2],u=Math.ceil(c/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="";a&&(m=o?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${a}\n }`:l?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${a}\n }`:`vec4 activation(vec4 x) {\n ${a}\n }`,g="result = activation(result);");const y=i?"result += getBiasAtOutCoords();":"";i&&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 ${c} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`));const u=a.texData.get(r.dataId);return!u.isPacked||VD(r.shape,l)||null!==u.texture&&VD(u.shape,l)?(a.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype}):function(e,t,n){const s=[BD(e.shape),...zD(e.shape)],r={dtype:e.dtype,shape:s,dataId:e.dataId},i=[BD(t),...zD(t)],a=new BM(i,s),o=[s],l=n.runWebGLProgram(a,[r],e.dtype,o,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(r,l,a)}const DF={kernelName:Gr,backendName:"webgl",kernelFunc:OF};class RF{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:i}=e;this.outputShape=[s,i];const a=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 * ${Zt(e)?e.toPrecision(2):e}, ones);`}let c="";r%n>0&&(c=`\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 ${c}\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 < ${a}; 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 + ${a};\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 MF{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:s,inSize:r,outSize:i}=e;this.outputShape=[s,i];let a="0.0",o="";"prod"===t?a="1.0":"min"===t?(a="1.0 / 1e-20",o="min"):"max"===t&&(a="-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 c=4*Math.floor(n/4),u=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?(a="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&&(a="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 = ${a};\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(${a});\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 < ${c}; 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 + ${c};\n if (${1===u}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${h}\n } else if (${2===u}) {\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===u}) {\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 FF(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 i=e;for(let a=0;a6)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=dR(this.rank),r=RM("rc",this.rank),i=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],A=s?[b,f,d]:[b,d,f],x=OF({inputs:{x:e},backend:r,attrs:{shape:v}}),C=OF({inputs:{x:t},backend:r,attrs:{shape:A}}),k=[x,C],S=Math.max(y,b),E=n?x.shape[1]:x.shape[2],_=null!=i,T=null!=a,I="leakyrelu"===l,N=null!=l?kF(l,!0):null;let O;if((1===p||1===f)&&E>UF&&!1===(_||T||I||null!=N)){let e=x,t=C;n&&(e=WF({inputs:{x},backend:r,attrs:{perm:[0,2,1]}}),k.push(e)),s&&(t=WF({inputs:{x:C},backend:r,attrs:{perm:[0,2,1]}}),k.push(t));const i=1===f;let a=e;1!==f&&(a=OF({inputs:{x:e},backend:r,attrs:{shape:[S,E,1]}}),k.push(a));const o=1===f?2:1;let l=t;i&&(l=OF({inputs:{x:t},backend:r,attrs:{shape:[S,1,E]}}),k.push(l));const c=IF({inputs:{a,b:l},backend:r});O=PF({inputs:{x:c},backend:r,attrs:{axis:o,keepDims:!0}}),k.push(c)}else{const l=Xa(e.dtype,t.dtype),c=new SF(v,A,[S,p,f],n,s,_,N,T,I),u=[x,C];if(null!=i&&u.push(i),T&&u.push(a),I){const e=r.makeTensorInfo([],"float32",pa(o,"float32"));u.push(e),k.push(e)}O=r.runWebGLProgram(c,u,l)}const D=OF({inputs:{x:O},backend:r,attrs:{shape:w}});k.push(O);for(const e of k)r.disposeIntermediateTensorInfo(e);return D}const jF={kernelName:Pi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i,bias:a,preluActivationWeights:o}=t,{transposeA:l,transposeB:c,activation:u,leakyreluAlpha:h}=s;return qF({a:r,b:i,transposeA:l,transposeB:c,backend:n,bias:a,preluActivationWeights:o,leakyreluAlpha:h,activation:u})}},HF="return abs(x);";const $F={kernelName:On,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=yM(e.values);return n.makeTensorInfo(s.shape,s.dtype,t)}let r;return r=En().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new tF(s.shape,HF):new WM(s.shape,HF),n.runWebGLProgram(r,[s],s.dtype)}},KF=xF({opSnippet:GM+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),XF={kernelName:Dn,backendName:"webgl",kernelFunc:KF},ZF=xF({opSnippet:GM+"\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),YF={kernelName:Rn,backendName:"webgl",kernelFunc:ZF},QF="return a + b;",JF=CF({opSnippet:QF,packedOpSnippet:QF,supportsComplex:!0,cpuKernelImpl:LR}),eB={kernelName:Mn,backendName:"webgl",kernelFunc:JF};class tB{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 nB{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 sB={kernelName:Fn,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s}=t,r=n;if(1===r.length)return hF({inputs:{x:r[0]},backend:s});if(r.length>En().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(r.length/2),n=e({inputs:r.slice(0,t),backend:s}),i=e({inputs:r.slice(t),backend:s});return e({inputs:[n,i],backend:s})}const i=r.map((e=>e.dtype)).reduce(((e,t)=>Xa(e,t))),a=r.map((e=>e.shape)),o=En().getBool("WEBGL_PACK")?new nB(r[0].shape,a):new tB(r[0].shape,a);return s.runWebGLProgram(o,r,i)}};const rB={kernelName:Bn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=tn(i,r.shape);let c=l;const u=Mh(c,o);let h=r;null!=u&&(h=WF({inputs:{x:r},backend:n,attrs:{perm:u}}),c=Bh(c.length,o)),Rh("all",c,o);const[d,p]=Oh(h.shape,c),f=OF({inputs:{x:h},backend:n,attrs:{shape:[-1,Kt(p)]}}),m=FF(f,f.dtype,"all",n);let g;if(a){g=OF({inputs:{x:m},backend:n,attrs:{shape:Dh(d,l)}})}else g=OF({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=u&&n.disposeIntermediateTensorInfo(h),g}};const iB={kernelName:zn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=tn(i,r.shape);let c=l;const u=Mh(c,o);let h=r;null!=u&&(h=WF({inputs:{x:r},backend:n,attrs:{perm:u}}),c=Bh(c.length,o)),Rh("any",c,o);const[d,p]=Oh(h.shape,c),f=OF({inputs:{x:h},backend:n,attrs:{shape:[-1,Kt(p)]}}),m=FF(f,f.dtype,"any",n);let g;if(a){g=OF({inputs:{x:m},backend:n,attrs:{shape:Dh(d,l)}})}else g=OF({inputs:{x:m},backend:n,attrs:{shape:d}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=u&&n.disposeIntermediateTensorInfo(h),g}};class aB{constructor(e,t,n){this.variableNames=["A"];const{windowSize:s,batchSize:r,outSize:i}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,i];const a="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 ${a} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}}class oB{constructor(e,t,n,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,jt(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],i=Math.ceil(r/t);this.outputShape=e.slice(0,-1),i>1&&this.outputShape.push(i),s||this.variableNames.push("bestIndicesA");const a=this.outputShape,o=a.length,l=dR(o),c=MM("coords",o);let u,h;if(1===i){h=o+1;const e=dR(h);u=`\n ${e} sourceLocR = ${e}(${c.join()}, 0);\n ++${c[o-1]};\n ${e} sourceLocG = ${e}(${c.join()}, 0);\n ++${c[o-2]};\n ${e} sourceLocA = ${e}(${c.join()}, 0);\n --${c[o-1]};\n ${e} sourceLocB = ${e}(${c.join()}, 0);\n --${c[o-2]};`}else h=o,u=`\n ${l} sourceLocR = coords;\n ++${c[o-1]};\n ${l} sourceLocG = coords;\n ++${c[o-2]};\n ${l} sourceLocA = coords;\n --${c[o-1]};\n ${l} sourceLocB = coords;\n --${c[o-2]};`;const d=["x","y","z","w","u","v"].slice(0,h),p="."+d[h-1],f=d.map((e=>"int "+e)),m=MM("sourceLocR",h-1).concat("inIdx.r"),g=MM("sourceLocG",h-1).concat("inIdx.g"),y=MM("sourceLocB",h-1).concat("inIdx.b"),b=MM("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()})));`,A=`vec4(\n getAChannel(${m.join()}),\n hasNextCol ? getAChannel(${g.join()}) : 0.,\n hasNextRow ? getAChannel(${y.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${b.join()}) : 0.)`,x=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 ${x}\n void main() {\n ${l} coords = getOutputCoords();\n bool hasNextCol = ${c[o-1]} < ${a[o-1]-1};\n bool hasNextRow = ${c[o-2]} < ${a[o-2]-1};\n ${u}\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 = ${A};\n\n for (int i = 0; i < ${t}; i++) {\n inIdx = srcIdx;\n ${v}\n vec4 candidate = ${A};\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 lB(e,t,n,s=null){let r=t.shape[0],i=t.shape[1];null!=s&&(r=s.shape[0],i=s.shape[1]);const a=Mm(i),o={windowSize:a,inSize:i,batchSize:r,outSize:Math.ceil(i/a)},l=new aB(o,n,null==s),c=[t];null!=s&&c.push(s);const u=e.runWebGLProgram(l,c,"int32");if(1===u.shape[1])return u;const h=lB(e,t,n,u);return e.disposeIntermediateTensorInfo(u),h}function cB(e,t,n,s=null){const r=null!=s?s.shape:t.shape,i=Mm(r[r.length-1]),a=new oB(r,i,n,null==s),o=null==s?[t]:[t,s],l=e.runWebGLProgram(a,o,"int32");if(l.shape.length===t.shape.length){const s=cB(e,t,n,l);return e.disposeIntermediateTensorInfo(l),s}return l}function uB(e,t,n,s){const r=[n];if(Rh("arg"+s.charAt(0).toUpperCase()+s.slice(1),r,t.shape.length),!En().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const n=[],i=e.texData.get(t.dataId);let a=t;null!==i&&i.isPacked&&(a=e.unpackTensor(t),n.push(a));const[o,l]=Oh(a.shape,r),c=Kt(l),u=OF({inputs:{x:a},backend:e,attrs:{shape:[-1,c]}});n.push(u);const h=lB(e,u,s);n.push(h);const d=OF({inputs:{x:h},backend:e,attrs:{shape:o}});return n.forEach((t=>e.disposeIntermediateTensorInfo(t))),d}return cB(e,t,s)}const hB={kernelName:Ln,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;let a=tn(i,r.shape);const o=Mh(a,r.shape.length);let l=r;const c=[];null!=o&&(l=WF({inputs:{x:r},backend:n,attrs:{perm:o}}),c.push(l),a=Bh(a.length,l.shape.length)),Rh("argMax",[a[0]],l.shape.length);const u=uB(n,l,a[0],"max");return c.forEach((e=>n.disposeIntermediateTensorInfo(e))),u}};const dB={kernelName:Pn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i}=s;let a=tn(i,r.shape);const o=Mh(a,r.shape.length);let l=r;const c=[];null!=o&&(l=WF({inputs:{x:r},backend:n,attrs:{perm:o}}),c.push(l),a=Bh(a.length,l.shape.length)),Rh("argMin",[a[0]],l.shape.length);const u=uB(n,l,a[0],"min");return c.forEach((e=>n.disposeIntermediateTensorInfo(e))),u}},pB=xF({opSnippet:GM+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),fB={kernelName:Vn,backendName:"webgl",kernelFunc:pB},mB=xF({opSnippet:GM+"return log(x + sqrt(x * x + 1.0));"}),gB={kernelName:Wn,backendName:"webgl",kernelFunc:mB},yB=xF({opSnippet:GM+"\n return atan(x);\n"}),bB={kernelName:Gn,backendName:"webgl",kernelFunc:yB},wB=CF({opSnippet:oF+"\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 "+cF+"\n return result;\n"}),vB={kernelName:qn,backendName:"webgl",kernelFunc:wB},AB=xF({opSnippet:GM+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),xB={kernelName:Un,backendName:"webgl",kernelFunc:AB};class CB{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 i=e.filterWidth,a=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,u=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(${a}, ${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 < ${u};\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 += ${c}) {\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(i/4),v=i%4,A=`\n if (${f}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${a}, ${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 < ${u};\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 * ${c};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${c}, d),\n getValue(batch, xR, xC + 2 * ${c}, d),\n getValue(batch, xR, xC + 3 * ${c}, d)\n );\n\n ${A}\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 ${A}\n } else if (${2===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${c}, d),\n initializationValue,\n initializationValue\n );\n\n ${A}\n } else if (${3===v}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${c}, d),\n getValue(batch, xR, xC + 2 * ${c}, d),\n initializationValue\n );\n\n ${A}\n }\n }\n setOutput(${b});\n }\n `}}class kB{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 i=e.filterWidth,a=e.strideDepth,o=e.strideHeight,l=e.strideWidth,c=e.dilationDepth,u=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(${a}, ${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 += ${c}) {\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 += ${u}) {\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 A=4*Math.floor(i/4),x=i%4,C=`\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(${a}, ${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 += ${c}) {\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 += ${u}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${A}; 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 ${C}\n }\n\n int xC = xCCorner + ${A};\n if (${1===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${C}\n } else if (${2===x}) {\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 ${C}\n } else if (${3===x}) {\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 ${C}\n }\n }\n }\n setOutput(${v});\n }\n `}}const SB={kernelName:jn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t;$D(r,"avgPool");const{filterSize:i,strides:a,pad:o,dimRoundingMode:l}=s;jt(Ou(a,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '1'`));const c=Au(r.shape,i,a,1,o,l);if(1===c.filterWidth&&1===c.filterHeight&&Xt(c.inShape,c.outShape))return hF({inputs:{x:r},backend:n});const u=new CB(c,"avg",!1);return n.runWebGLProgram(u,[r],"float32")}};const EB={kernelName:$n,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dimRoundingMode:l,dataFormat:c}=s,u=xu(r.shape,i,a,[1,1,1],o,l,c),h=new kB(u,"avg",!1);return n.runWebGLProgram(h,[r],"float32")}};class _B{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i=e.dilationHeight,a=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,c=o-1-e.padInfo.top,u=l-1-e.padInfo.left,h=1/(t*n);this.userCode=`\n const ivec2 pads = ivec2(${c}, ${u});\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 += ${i}) {\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+= ${a}) {\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 TB{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,i=e.strideHeight,a=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=e.effectiveFilterDepth,h=e.effectiveFilterHeight,d=e.effectiveFilterWidth,p=u-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 < ${u};\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) / ${i}.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 += ${c}) {\n float dyC = float(dyCCorner + wC) / ${a}.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 IB={kernelName:Kn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i,{filterSize:o,strides:l,pad:c,dimRoundingMode:u}=s,h=xu(a.shape,o,l,[1,1,1],c,u),d=new TB(h);return n.runWebGLProgram(d,[r],a.dtype)}};const NB={kernelName:Hn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i;$D([r,i],"avgPoolGrad");const{filterSize:o,strides:l,pad:c}=s,u=Au(a.shape,o,l,1,c),h=new _B(u);return n.runWebGLProgram(h,[r],a.dtype)}};const OB={kernelName:Xn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{a:r,b:i}=t,{transposeA:a,transposeB:o}=s;return qF({a:r,b:i,transposeA:a,transposeB:o,backend:n})}};class DB{constructor(e,t,n,s,r,i){this.outputShape=[],this.variableNames=["x","mean","variance"],cc(e,t),cc(e,n);let a="0.0";null!=s&&(cc(e,s),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let o="1.0";null!=r&&(cc(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 = ${a};\n float scale = ${o};\n float inv = scale * inversesqrt(variance + float(${i}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}}class RB{constructor(e,t,n,s,r,i){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],cc(e,t),cc(e,n);let a="vec4(0.0)";null!=s&&(cc(e,s),this.variableNames.push("offset"),a="getOffsetAtOutCoords()");let o="vec4(1.0)";null!=r&&(cc(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n vec4 offset = ${a};\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(${i}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}}const MB={kernelName:Ws,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s,mean:r,variance:i,offset:a,scale:o}=e;jt(r.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),jt(null==a||r.shape.length===a.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),jt(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 c=[s,r,i];let u=null;null!=a&&(u=a.shape,c.push(a));let h=null;null!=o&&(h=o.shape,c.push(o));const d=En().getBool("WEBGL_PACK_NORMALIZATION")?new RB(s.shape,r.shape,i.shape,u,h,l):new DB(s.shape,r.shape,i.shape,u,h,l);return t.runWebGLProgram(d,c,c[0].dtype)}};class FB{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=dR(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(e){if(1===e)return"sourceLoc";if(e<=6)return BB.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.${BB[t]} = start[${t}] + coords.${BB[t]};`)).join("\n")}\n `,this.userCode=`\n void main() {\n ${s}\n setOutput(getSource(${n}));\n }\n `}}const BB=["x","y","z","w","u","v"];class zB{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=dR(this.rank),n=MM("coords",this.rank),s=MM("sourceLoc",this.rank),r=1===this.rank?"sourceLoc":`vec2(${s.slice(-2).join()})`,i=`getChannel(getSource(${s.join()}), ${r})`,a=`\n result.x = ${i};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.y = ${i};\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 = ${i};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${s[this.rank-1]};\n result.w = ${i};\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 ${a}\n ${o}\n setOutput(result);\n }\n `}}function LB(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,size:a}=s,[o,l]=iu(r,i,a);if(jc(r,o,l),0===Kt(l))return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||"string"===r.dtype){const e=n.texData.get(r.dataId),t=bM(e.values,o,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,t)}const{isPacked:c}=n.texData.get(r.dataId),u=su(r.shape,o,l);if(c||!u){const e=En().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new zB(l):new FB(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),i=s.makeTensorInfo(n,e.dtype),a=s.texData.get(i.dataId);Object.assign(a,r),a.refCount=1,a.shape=n,a.dtype=e.dtype;let o=ru(t,pn(e.shape));r.slice&&(o+=r.slice.flatOffset),a.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};const l=s.dataRefCount.get(a.slice.origDataId)||1;return s.dataRefCount.set(a.slice.origDataId,l+1),i}(r,o,l,n)}const PB={kernelName:ni,backendName:"webgl",kernelFunc:LB},VB={kernelName:Zn,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,crops:a}=s;jt(r.shape.length<=4,(()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"));const o=i.reduce(((e,t)=>e*t)),l=Bm(r.shape,i,o),c=zm(l.length,i.length),u=Lm(r.shape,i,o),h=Pm(a,i.length),d=Vm(u,a,i.length),p=[],f=OF({inputs:{x:r},backend:n,attrs:{shape:l}}),m=WF({inputs:{x:f},backend:n,attrs:{perm:c}}),g=OF({inputs:{x:m},backend:n,attrs:{shape:u}}),y=LB({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 WB={kernelName:Yn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a}=s,o=n.readSync(r.dataId),l=n.readSync(i.dataId),c=PR(o,l,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,c)}};const GB={kernelName:Qn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{a:s,b:r}=t,i=En().getBool("WEBGL_PACK_BINARY_OPERATIONS"),a=En().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([s,r])||1===a){const e=n.texData.get(s.dataId).values,t=n.texData.get(r.dataId).values,[i,a]=WR(s.shape,r.shape,e,t,s.dtype),o=n.makeTensorInfo(a,s.dtype);return n.texData.get(o.dataId).values=i,o}let o;return o=i?new uF("\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 lF("\n return float(int(a.r) & int(b.r));\n",s.shape,r.shape),n.runWebGLProgram(o,[s,r],s.dtype)}};const UB={kernelName:Jn,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:s,s1:r}=t,i=n.readSync(s.dataId),a=n.readSync(r.dataId),o=cc(Array.from(i),Array.from(a));return n.makeTensorInfo([o.length],"int32",Int32Array.from(o))}},qB=CF({opSnippet:"return float(a != b);",cpuKernelImpl:lM,dtype:"bool"}),jB={kernelName:kr,backendName:"webgl",kernelFunc:qB};function HB(e){const{inputs:t,backend:n}=e,{input:s}=t;return hF({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.real},backend:n})}const $B={kernelName:Pr,backendName:"webgl",kernelFunc:HB},KB="return float(int(x));";const XB={kernelName:es,backendName:"webgl",kernelFunc:function e(t){const{inputs:n,backend:s,attrs:r}=t,{x:i}=n,{dtype:a}=r;if("complex64"===a){if("complex64"===i.dtype)return hF({inputs:{x:i},backend:s});const t=Sd(i.shape),n=e({inputs:{x:i},backend:s,attrs:{dtype:"float32"}}),r=pF({inputs:{real:n,imag:t},backend:s});return t.dispose(),s.disposeIntermediateTensorInfo(n),r}if("complex64"===i.dtype){const t=HB({inputs:{input:i},backend:s}),n=e({inputs:{x:t},backend:s,attrs:{dtype:a}});return s.disposeIntermediateTensorInfo(t),n}if(!an(i.dtype,a)){const e=hF({inputs:{x:i},backend:s});return{dataId:e.dataId,shape:e.shape,dtype:a}}if(s.shouldExecuteOnCPU([i])){const e=s.texData.get(i.dataId).values,[t,n,r]=GR(e,i.shape,i.dtype,a);return s.makeTensorInfo(t,n,r)}if("int32"===a)return function(e,t){const n=new WM(e.shape,KB),s=t.runWebGLProgram(n,[e],"int32");return{dataId:s.dataId,shape:s.shape,dtype:s.dtype}}(i,s);if("bool"===a){const e=s.makeTensorInfo([],"bool",sn("bool",1)),t=qB({inputs:{a:i,b:e},backend:s});return s.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${i.dtype} to ${a}`)}},ZB="return ceil(x);",YB=xF({opSnippet:ZB,packedOpSnippet:ZB,cpuKernelImpl:UR}),QB={kernelName:ts,backendName:"webgl",kernelFunc:YB};class JB{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 ez{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 tz={kernelName:ns,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{clipValueMin:i,clipValueMax:a}=s;let o;o=En().getBool("WEBGL_PACK_CLIP")?new ez(r.shape):new JB(r.shape);const l=[[i],[a]];return n.runWebGLProgram(o,[r],r.dtype,l)}};class nz{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 sz(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const rz={kernelName:rs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=n.texData.get(s.dataId),i=new nz(s.shape),a=[sz(s,r.complexTensorInfos.real),sz(s,r.complexTensorInfos.imag)];return n.runWebGLProgram(i,a,a[0].dtype)}};class iz{constructor(e){this.outputShape=[],this.outputShape=Em(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}(${oz(a,l,t)}),\n vec2(${oz(c,l,t)}));\n }`}const d=o.length,p=o[o.length-1];h+=`\n return getChannel(\n getT${d}(${oz(a,l,p)}),\n vec2(${oz(c,l,p)}));`,this.userCode=`\n float getValue(${a.map((e=>"int "+e))}) {\n ${h}\n }\n\n void main() {\n ${r} coords = getOutputCoords();\n vec4 result = vec4(getValue(${i}), 0., 0., 0.);\n\n ${i[s-1]} = ${i[s-1]} + 1;\n if (${i[s-1]} < ${n[s-1]}) {\n result.g = getValue(${i});\n }\n\n ${i[s-2]} = ${i[s-2]} + 1;\n if (${i[s-2]} < ${n[s-2]}) {\n result.a = getValue(${i});\n }\n\n ${i[s-1]} = ${i[s-1]} - 1;\n if (${i[s-2]} < ${n[s-2]} &&\n ${i[s-1]} < ${n[s-1]}) {\n result.b = getValue(${i});\n }\n setOutput(result);\n }\n `}}function oz(e,t,n){const s=e.indexOf(t);return e.map(((e,t)=>t===s?`${e} - ${n}`:e)).join()}function lz(e){const{inputs:t,backend:n}=e,{input:s}=t;return hF({inputs:{x:n.texData.get(s.dataId).complexTensorInfos.imag},backend:n})}const cz={kernelName:Ks,backendName:"webgl",kernelFunc:lz};function uz(e,t,n){const s=e[0].dtype;if("complex64"===s){const s=e.map((e=>HB({inputs:{input:e},backend:n}))),r=e.map((e=>lz({inputs:{input:e},backend:n}))),i=uz(s,t,n),a=uz(r,t,n),o=pF({inputs:{real:i,imag:a},backend:n});return s.forEach((e=>n.disposeIntermediateTensorInfo(e))),r.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(a),o}let r=n.shouldExecuteOnCPU(e);if("string"===s&&(r=!0),r){const r=e.map((e=>{const s=Kt(e.shape.slice(t));return OF({inputs:{x:e},backend:n,attrs:{shape:[-1,s]}})})),i=r.map((e=>({vals:n.readSync(e.dataId),shape:e.shape}))),a=Em(r.map((e=>e.shape)),1),o=1===r[0].shape[0],l=qR(i,a,s,o),c=Em(e.map((e=>e.shape)),t),u=n.makeTensorInfo(c,s,l);return r.forEach((e=>n.disposeIntermediateTensorInfo(e))),u}const i=e.filter((e=>Kt(e.shape)>0)),a=En().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&i[0].shape.length>1;if(1===i.length){const t=a?new WM(e[0].shape,KM):new tF(e[0].shape,KM);return n.runWebGLProgram(t,e,s)}const o=En().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(i.length>o){const e=[];for(let s=0;se.shape)),t);return n.runWebGLProgram(e,i,s)}const{tensors2D:l,outShape:c}=function(e,t,n){const s=Em(e.map((e=>e.shape)),t),r=e.map((e=>OF({inputs:{x:e},attrs:{shape:[-1,Kt(e.shape.slice(t))]},backend:n})));return{tensors2D:r,outShape:s}}(i,t,n),u=new iz(l.map((e=>e.shape))),h=n.runWebGLProgram(u,l,s);l.forEach((e=>n.disposeIntermediateTensorInfo(e)));const d=OF({inputs:{x:h},attrs:{shape:c},backend:n});return n.disposeIntermediateTensorInfo(h),d}function hz(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s,i=tn(r,t[0].shape)[0];Sm(t.map((e=>e.shape)),i);const a=Em(t.map((e=>e.shape)),i);if(0===Kt(a))return n.makeTensorInfo(a,t[0].dtype,[]);const o=t.filter((e=>Kt(e.shape)>0));return 1===o.length?hF({inputs:{x:o[0]},backend:n}):uz(o,i,n)}const dz={kernelName:is,backendName:"webgl",kernelFunc:hz};class pz{constructor(e,t=!1,n=null,s=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const i=e.padInfo.top,a=e.padInfo.left,o=e.strideHeight,l=e.strideWidth,c=e.dilationHeight,u=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 A=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(${i}, ${a});\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 * ${c};\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 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 ${A}\n ${v}\n setOutput(result);\n }\n `}}class fz{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,i=e.strideHeight,a=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,c=e.dilationWidth,u=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}, ${i}, ${a});\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 < ${u}; 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 * ${c};\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 mz{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=wR(this.outputShape.length);const i=e.padInfo.left,a=e.strideWidth,o=e.dilationWidth,l=e.filterHeight,c=e.filterWidth,u=c;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<(u+1)/2;t++){const n=2*t;if(h+=`\n xC = xCCorner + ${n*o};\n `,1===a){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[${a}] && 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 yz(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 bz({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:i=null,leakyreluAlpha:a=0,activation:o=null}){const l=e.shape,c=s.texData.get(e.dataId),u=n.inChannels,h=l[0]*l[1]*l[2],d=n.outChannels,p="channelsLast"===n.dataFormat,f=!1;let m;const g=[];if(null!=i){const e=yz(i.shape,p);null!=e&&(i=OF({inputs:{x:i},backend:s,attrs:{shape:e}}),g.push(i))}if(null!=r){const e=yz(r.shape,p);null!=e&&(r=OF({inputs:{x:r},backend:s,attrs:{shape:e}}),g.push(r))}if(!((1===h||1===d)&&u>UF)&&c.isPacked&&p&&null!=c.texture&&l[2]%2!=0&&Xt(c.shape.slice(-3),l.slice(-3))){const u=l[0]*l[1]*(l[2]+1),h={dataId:e.dataId,shape:[1,u,n.inChannels],dtype:e.dtype},d=c.shape;c.shape=c.shape.slice(),c.shape[c.shape.length-2]++,jt(VD(c.shape,h.shape),(()=>`packed reshape ${c.shape} to ${h.shape} isn't free`));const p=OF({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}});g.push(p);const y=qF({a:h,b:p,backend:s,transposeA:false,transposeB:f,bias:r,activation:o,preluActivationWeights:i,leakyreluAlpha:a}),b=s.texData.get(y.dataId);jt(b.isPacked,(()=>"batchMatMul result is expected to be packed")),c.shape=d,b.shape=n.outShape,m=hF({inputs:{x:y},backend:s}),m.shape=n.outShape,g.push(y)}else{const l=n.outHeight*n.outWidth,c=OF({inputs:{x:e},backend:s,attrs:{shape:p?[n.batchSize,l,n.inChannels]:[n.batchSize,n.inChannels,l]}}),u=OF({inputs:{x:t},backend:s,attrs:{shape:[1,n.inChannels,n.outChannels]}}),h=qF({a:p?c:u,b:p?u:c,transposeA:!p,transposeB:f,backend:s,bias:r,activation:o,preluActivationWeights:i,leakyreluAlpha:a});m=OF({inputs:{x:h},backend:s,attrs:{shape:n.outShape}}),g.push(c),g.push(u),g.push(h)}for(const e of g)s.disposeIntermediateTensorInfo(e);return m}function wz({x:e,filter:t,convInfo:n,backend:s,bias:r=null,preluActivationWeights:i=null,leakyreluAlpha:a=0,activation:o=null}){const{filterWidth:l,filterHeight:c,inChannels:u,outWidth:h,outHeight:d,dataFormat:p}=n,f="channelsLast"===p,m=l*c*u,g=d*h,y=[n.batchSize,m,g],b=[];if(null!=i){const e=yz(i.shape,f);null!=e&&(i=OF({inputs:{x:i},backend:s,attrs:{shape:e}}),b.push(i))}if(null!=r){const e=yz(r.shape,f);null!=e&&(r=OF({inputs:{x:r},backend:s,attrs:{shape:e}}),b.push(r))}const w=OF({inputs:{x:t},backend:s,attrs:{shape:[1,m,Kt(t.shape)/m]}});b.push(w);const v=new gz(y,n),A=[e.shape,[n.padInfo.top,n.padInfo.left],[n.strideHeight,n.strideWidth],[n.dilationHeight,n.dilationWidth],[n.inChannels],[n.filterWidth*n.inChannels],[n.outWidth]],x=s.runWebGLProgram(v,[e],"float32",A),C=OF({inputs:{x},backend:s,attrs:{shape:y}});b.push(x),b.push(C);const k=null!=r,S=null!=i,E="leakyrelu"===o,_=o?kF(o,!0):null,T=new SF(f?C.shape:w.shape,f?w.shape:C.shape,f?[n.batchSize,g,n.outChannels]:[n.batchSize,n.outChannels,g],!0,!1,k,_,S,E),I=f?[C,w]:[w,C];if(r&&I.push(r),S&&I.push(i),E){const e=s.makeTensorInfo([],"float32",pa(a,"float32"));I.push(e),b.push(e)}const N=s.runWebGLProgram(T,I,"float32"),O=OF({inputs:{x:N},backend:s,attrs:{shape:n.outShape}});b.push(N);for(const e of b)s.disposeIntermediateTensorInfo(e);return O}const vz={kernelName:as,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dataFormat:l,dilations:c,dimRoundingMode:u}=s,h=Ru(l),d=Cu(r.shape,i.shape,a,c,o,u,!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&&En().getBool("WEBGL_EXP_CONV")){const e=new mz(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,i],"float32",t)}else if(En().getBool("WEBGL_CONV_IM2COL"))p=wz({x:r,filter:i,convInfo:d,backend:n});else{const e=new pz(d);p=n.runWebGLProgram(e,[r,i],"float32")}else p=bz({x:r,filter:i,convInfo:d,backend:n});const f=OF({inputs:{x:p},backend:n,attrs:{shape:d.outShape}});return n.disposeIntermediateTensorInfo(p),f}};class Az{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,i="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 ${i?"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 xz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i="channelsLast"===e.dataFormat,a=t-1-e.padInfo.top,o=n-1-e.padInfo.left,l=i?1:2,c=i?2:3,u=i?3:1;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${u}];\n\n ivec2 dyCorner = ivec2(coords[${l}], coords[${c}]) - 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 (${i}) {\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 Cz{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.padInfo.front,i=e.padInfo.top,a=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} - ${i};\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} - ${a};\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 kz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,s=e.filterWidth,r=e.strideDepth,i=e.strideHeight,a=e.strideWidth,o=t-1-e.padInfo.front,l=n-1-e.padInfo.top,c=s-1-e.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${o}, ${l}, ${c});\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) / ${i}.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) / ${a}.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 Sz={kernelName:os,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,pad:o,dataFormat:l,dimRoundingMode:c,filterShape:u}=s,h=Ru(l),d=Cu(r.shape,u,a,1,o,c,!1,h),p=new Az(d);return n.runWebGLProgram(p,[r,i],"float32")}};class Ez{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=wR(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 _z={kernelName:ls,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{inputShape:a,strides:o,pad:l,dataFormat:c,dimRoundingMode:u}=s,h=Ru(c),d=Cu(a,i.shape,o,1,l,u,!1,h);if(En().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&"channelsLast"===h){const e=[[d.strideHeight,d.strideWidth]],t=new Ez(d);return n.runWebGLProgram(t,[r,i],"float32",e)}{const e=new xz(d);return n.runWebGLProgram(e,[r,i],"float32")}}};const Tz={kernelName:cs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dilations:l}=s,c=ku(r.shape,i.shape,a,l,o),u=new fz(c);return n.runWebGLProgram(u,[r,i],"float32")}};const Iz={kernelName:us,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,pad:o,filterShape:l}=s,c=ku(r.shape,l,a,1,o),u=new Cz(c);return n.runWebGLProgram(u,[r,i],"float32")}};const Nz={kernelName:hs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{pad:a,strides:o,inputShape:l}=s,c=ku(l,i.shape,o,1,a),u=new kz(c);return n.runWebGLProgram(u,[r,i],"float32")}},Oz=xF({opSnippet:AF+"\n return cos(x);\n",packedOpSnippet:`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${cF}\n return result;\n`}),Dz={kernelName:ds,backendName:"webgl",kernelFunc:Oz},Rz=xF({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),Mz={kernelName:ps,backendName:"webgl",kernelFunc:Rz};class Fz{constructor(e,t,n,s,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[i,a,o,l]=e,[c]=t,[u,h]=n;this.outputShape=[c,u,h,l];const d="bilinear"===s?1:0,[p,f]=[a-1+".0",o-1+".0"],[m,g,y]=u>1?[""+(a-1)/(u-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 >= ${i}) {\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 Bz={kernelName:gs,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{image:r,boxes:i,boxInd:a}=t,{cropSize:o,method:l,extrapolationValue:c}=s,u=new Fz(r.shape,i.shape,o,l,c);return n.runWebGLProgram(u,[r,i,a],"float32")}};var zz,Lz;(Lz=zz||(zz={})).Prod="*",Lz.Sum="+";class Pz{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,i=this.op===zz.Prod?"1.0":"0.0",a=n?i:`getX(${Vz(r,"coords",this.op)})`,o=this.outputShape[this.outputShape.length-1];let l="",c="";n?(l=s?"end != "+(o-1):"end != 0",c=s?"end + 1":"end - 1"):(l=s?`end + pow2 < ${o}`:"end >= pow2",c=s?"end + pow2":"end - pow2"),this.userCode=`\n void main() {\n ${dR(r)} coords = getOutputCoords();\n int end = ${Wz(r,"coords",this.op)};\n float val = ${a};\n int pow2 = int(pow(2.0, index));\n if (${l}) {\n int idx = ${c};\n ${Wz(r,"coords",this.op)} = idx;\n val ${this.op}= getX(${Vz(r,"coords",this.op)});\n }\n setOutput(val);\n }\n `}}function Vz(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 Wz(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 Gz(e,t,n,s,r,i){const a=t.shape.length,o=Mh([s],a);let l=t;null!=o&&(l=WF({inputs:{x:t},backend:n,attrs:{perm:o}}));const c=Bh(1,a)[0];if(c!==a-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${s}`);const u=l.shape[c];let h=hF({inputs:{x:l},backend:n});for(let t=0;t<=Math.ceil(Math.log2(u))-1;t++){const s=new Pz(e,l.shape,!1,i),r=[[t]],a=h;h=n.runWebGLProgram(s,[h],h.dtype,r),n.disposeIntermediateTensorInfo(a)}if(r){const t=new Pz(e,l.shape,r,i),s=h;h=n.runWebGLProgram(t,[h],h.dtype),n.disposeIntermediateTensorInfo(s)}if(null!=o){const e=WF({inputs:{x:h},backend:n,attrs:{perm:Fh(o)}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(l),e}return h}const Uz={kernelName:fs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,exclusive:a,reverse:o}=s;return Gz(zz.Prod,r,n,i,a,o)}};const qz={kernelName:ms,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,exclusive:a,reverse:o}=s;return Gz(zz.Sum,r,n,i,a,o)}};const jz={kernelName:ys,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,weights:i}=t,{size:a,binaryOutput:o}=s;if(1===r.shape.length){const e=n.readSync(r.dataId),t=n.readSync(i.dataId),s=PR(e,t,i.dtype,i.shape,a);return n.makeTensorInfo([a],i.dtype,s)}if(2===r.shape.length){const e=n.bufferSync(r),t=n.bufferSync(i),s=VR(e,t,a,o);return n.makeTensorInfo(s.shape,i.dtype,s.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}};class Hz{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 $z={kernelName:bs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockSize:i,dataFormat:a}=s,o=r.shape[0],l=("NHWC"===a?r.shape[1]:r.shape[2])*i,c=("NHWC"===a?r.shape[2]:r.shape[3])*i,u=("NHWC"===a?r.shape[3]:r.shape[1])/(i*i),h=new Hz("NHWC"===a?[o,l,c,u]:[o,u,l,c],i,a);return n.runWebGLProgram(h,[r],r.dtype)}};class Kz{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=wR(this.outputShape.length);const i=e.filterHeight,a=e.filterWidth,o=e.outChannels/e.inChannels;let l="",c="";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 `,c="result = activation(result);");const u=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 < ${i}; 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 < ${a}; 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 ${u}\n ${c}\n setOutput(result);\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=wR(this.outputShape.length);const i=e.outChannels/e.inChannels,a=e.padInfo.left,o=e.strideWidth,l=e.dilationWidth,c=e.filterHeight,u=e.filterWidth,h=u;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 ${a} and dilations '${u}'`));const h=Cu(r.shape,i.shape,a,u,o,c,!0);let d;d=En().getBool("WEBGL_PACK_DEPTHWISECONV")&&h.strideWidth<=2&&h.outChannels/h.inChannels==1?new Xz(h):new Kz(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,i],"float32",p)}};class Yz{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,i=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 * ${i} + 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 Qz{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,s=e.strideHeight,r=e.strideWidth,i=t-1-e.padInfo.top,a=n-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${a});\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 Jz={kernelName:vs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,dy:i}=t,{strides:a,dilations:o,pad:l,dimRoundingMode:c,filterShape:u}=s,h=Cu(r.shape,u,a,o,l,c,!0),d=new Yz(h);return n.runWebGLProgram(d,[r,i],"float32")}};const eL={kernelName:As,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,filter:i}=t,{strides:a,dilations:o,pad:l,dimRoundingMode:c,inputShape:u}=s,h=Cu(u,i.shape,a,o,l,c,!0),d=new Qz(h);return n.runWebGLProgram(d,[r,i],"float32")}};class tL{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 nL={kernelName:xs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:s}=t,r=[...s.shape,...s.shape],i=Kt(s.shape),a=OF({inputs:{x:s},backend:n,attrs:{shape:[i]}}),o=new tL(i),l=n.runWebGLProgram(o,[a],a.dtype),c=OF({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(l),c}};class sL{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:n,padInfo:s,strideHeight:r,strideWidth:i,filterHeight:a,filterWidth:o,dilationHeight:l,dilationWidth:c}=e,{top:u,left:h}=s;this.userCode=`\n const ivec2 strides = ivec2(${r}, ${i});\n const ivec2 pads = ivec2(${u}, ${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 < ${a}; 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 * ${c};\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 rL={kernelName:Cs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i}=t,{strides:a,pad:o,dilations:l}=s,c=vu(r.shape,i.shape,a,o,"NHWC",l);let u;const h=new sL(c);u=n.runWebGLProgram(h,[r,i],"float32");const d=OF({inputs:{x:u},backend:n,attrs:{shape:c.outShape}});return n.disposeIntermediateTensorInfo(u),d}};const iL={kernelName:Ts,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{equation:r}=s,i=t,{allDims:a,summedDims:o,idDims:l}=lg(r,i.length);ug(a.length,l,i);const{path:c,steps:u}=hg(o,l),h=u.length;let d=null,p=a.length;const f=[];for(let e=0;e=0&&(d=PF({inputs:{x:d},backend:n,attrs:{axis:c[e]-(a.length-p),keepDims:!1}}),f.push(d)),p--)}for(const e of f)e!==d&&n.disposeIntermediateTensorInfo(e);return d}},aL=xF({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"}),oL={kernelName:Is,backendName:"webgl",kernelFunc:aL},lL={kernelName:Ns,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n}=e,{dy:s,y:r}=t,i=En().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new uF("\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 lF("return (b >= 0.0) ? a : a * (b + 1.0);",s.shape,r.shape);return n.runWebGLProgram(i,[s,r],s.dtype)}},cL=CF({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:jR}),uL={kernelName:Ds,backendName:"webgl",kernelFunc:cL},hL=xF({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`}),dL={kernelName:Os,backendName:"webgl",kernelFunc:hL},pL=xF({opSnippet:AF+"\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:HR,dtype:"float32"}),fL={kernelName:Rs,backendName:"webgl",kernelFunc:pL};function mL(e){const{inputs:t,attrs:n,backend:s}=e,{dim:r}=n,{input:i}=t,a=i.shape.length,o=i.shape.slice();let l=r;return r<0&&(jt(-(a+1)<=r,(()=>`Axis must be in the interval [${-(a+1)}, ${a}]`)),l=a+r+1),o.splice(l,0,1),OF({inputs:{x:i},backend:s,attrs:{shape:o}})}const gL={kernelName:Ms,backendName:"webgl",kernelFunc:mL},yL="return exp(x) - 1.0;",bL=xF({opSnippet:yL,packedOpSnippet:yL,cpuKernelImpl:$R}),wL={kernelName:Fs,backendName:"webgl",kernelFunc:bL};class vL{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}`,i=n?`${s}.0`:"1.0";let a;if("real"===e)a="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);a="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 ${a}\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) / ${i};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}}function AL(e,t,n){const s=n.texData.get(e.dataId),r=Kt(e.shape),i=e.shape[e.shape.length-1],a=OF({inputs:{x:e},backend:n,attrs:{shape:[r/i,i]}}),o=a.shape,l=new vL("real",o,t),c=new vL("imag",o,t),u=[{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,u,"float32"),d=n.runWebGLProgram(c,u,"float32"),p=pF({inputs:{real:h,imag:d},backend:n});n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d);const f=OF({inputs:{x:p},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(p),f}const xL={kernelName:Bs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return AL(s,!1,n)}};class CL{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 kL(e){const{backend:t,attrs:n}=e,{shape:s,value:r}=n;let{dtype:i}=n;if(i=i||un(r),"string"===i){const e=rn(i,Kt(s));return e.fill(r),t.makeTensorInfo(s,i,e)}{const e=new CL(s,r),n=[[r]];return t.runWebGLProgram(e,[],i,n)}}const SL={kernelName:zs,backendName:"webgl",kernelFunc:kL};class EL{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 _L={kernelName:Ls,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:n}=e,s=t,r=new EL(n.shape);return s.runWebGLProgram(r,[n],n.dtype)}},TL="return floor(x);",IL=xF({opSnippet:TL,packedOpSnippet:TL,cpuKernelImpl:KR}),NL={kernelName:Ps,backendName:"webgl",kernelFunc:IL},OL=CF({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"}),DL={kernelName:Vs,backendName:"webgl",kernelFunc:OL};class RL{constructor(e){this.variableNames=["A"];const t=XD(),[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 ML{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=XD(),[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 FL={kernelName:zi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e;let{pixels:r}=t;const{numChannels:i}=s,a="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement,o="undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement,[l,c]=a?[r.videoWidth,r.videoHeight]:[r.width,r.height],u=[c,l],h=[c,l,i];if(o||a){const e=En().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");null!=BL&&e===zL||(zL=e,BL=document.createElement("canvas").getContext("2d",{willReadFrequently:zL})),BL.canvas.width=l,BL.canvas.height=c,BL.drawImage(r,0,0,l,c),r=BL.canvas}const d=n.makeTensorInfo(u,"int32");n.texData.get(d.dataId).usage=mD.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(d.dataId),r);const p=En().getBool("WEBGL_PACK")?new ML(h):new RL(h),f=n.runWebGLProgram(p,[d],"int32");return n.disposeData(d.dataId),f}};let BL,zL=En().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");const LL={kernelName:Vi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:c,dataFormat:u,dilations:h,dimRoundingMode:d,activation:p,leakyreluAlpha:f}=s,m=Ru(u),g=Cu(r.shape,i.shape,l,h,c,d,!1,m);let y;const b=[],w=null!=a,v=null!=o,A="leakyrelu"===p,x=()=>{const e=[r,i],t=(e,t)=>{if("NCHW"===t&&1===e.shape.length&&1!==e.shape[0]){const t=OF({inputs:{x:e},backend:n,attrs:{shape:[e.shape[0],1,1]}});return b.push(t),t}return e};if(w&&e.push(t(a,u)),v&&e.push(t(o,u)),A){const t=n.makeTensorInfo([],"float32",pa(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&&En().getBool("WEBGL_EXP_CONV")){const e=p?kF(p,!0):null,t=new mz(g,w,e,v,A),s=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],r=x();y=n.runWebGLProgram(t,r,"float32",s)}else if(En().getBool("WEBGL_CONV_IM2COL"))y=wz({x:r,filter:i,convInfo:g,backend:n,bias:a,activation:p,preluActivationWeights:o,leakyreluAlpha:f});else{const e=p?kF(p,!1):null,t=new pz(g,w,e,v,A),s=x();y=n.runWebGLProgram(t,s,"float32")}else y=bz({x:r,filter:i,convInfo:g,backend:n,bias:a,activation:p,preluActivationWeights:o,leakyreluAlpha:f});const C=OF({inputs:{x:y},backend:n,attrs:{shape:g.outShape}});return b.push(y),b.forEach((e=>n.disposeIntermediateTensorInfo(e))),C}};const PL={kernelName:Wi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,filter:i,bias:a,preluActivationWeights:o}=t,{strides:l,pad:c,dilations:u,dimRoundingMode:h,activation:d,leakyreluAlpha:p}=s,f=[];let m=u;null==m&&(m=[1,1]),jt(Ou(l,m),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`));const g=Cu(r.shape,i.shape,l,m,c,h,!0),y=En().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels==1,b=d?kF(d,y):null,w=[r,i],v=null!=a,A=null!=o,x="leakyrelu"===d;if(v&&w.push(a),A&&w.push(o),x){const e=n.makeTensorInfo([],"float32",pa(p,"float32"));w.push(e),f.push(e)}let C;C=y?new Xz(g,v,b,A,x):new Kz(g,v,b,A,x);const k=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],S=n.runWebGLProgram(C,w,"float32",k);return f.forEach((e=>n.disposeIntermediateTensorInfo(e))),S}};class VL{constructor(e,t,n,s){this.sliceDim=e,this.strides=t,this.paramsShape=s,this.variableNames=["x","indices"],this.outputShape=n;const r=dR(n.length);let i="\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 ${i}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}}const WL={kernelName:Us,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{params:s,indices:r}=t,i=r.shape,a=i[i.length-1],o=Kt(s.shape),[l,c,u,h]=Wm(s,r),d=OF({inputs:{x:r},backend:n,attrs:{shape:[c,a]}}),p=OF({inputs:{x:s},backend:n,attrs:{shape:[Kt(s.shape)/u,u]}});if(n.shouldExecuteOnCPU([s,r])||"string"===s.dtype){const e=n.readSync(r.dataId),t=n.bufferSync(s),i=XR(e,t,s.dtype,c,a,u,h,s.shape,o);return n.makeTensorInfo(l,s.dtype,i.values)}const f=new VL(a,h,[c,u],s.shape),m=n.runWebGLProgram(f,[p,d],p.dtype),g=OF({inputs:{x:m},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),g}};class GL{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const n=dR(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 UL(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,indices:i}=t,{axis:a,batchDims:o}=s,l=tn(a,r.shape)[0];if(En().get("DEBUG")){const e=n.readSync(i.dataId),t=r.shape[l];for(let n=0;n=0,(()=>`GatherV2: the index value ${s} is not in [0, ${t-1}]`))}}const c=Ig(r,i,l,o),u=Kt(i.shape),h=[],d=OF({inputs:{x:r},backend:n,attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]}}),p=OF({inputs:{x:i},backend:n,attrs:{shape:[c.batchSize,u/c.batchSize]}});h.push(d),h.push(p);const f=[c.batchSize,c.outerSize,u/c.batchSize,c.sliceSize];if(n.shouldExecuteOnCPU([r,i])||"string"===r.dtype){const e=n.bufferSync(p),t=n.bufferSync(d),s=ZR(t,e,f);return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(c.outputShape,s.dtype,s.values)}const m=new GL(d.shape,f),g=n.runWebGLProgram(m,[d,p],d.dtype);h.push(g);const y=OF({inputs:{x:g},backend:n,attrs:{shape:c.outputShape}});return h.forEach((e=>n.disposeIntermediateTensorInfo(e))),y}const qL={kernelName:Gs,backendName:"webgl",kernelFunc:UL},jL=CF({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:YR,dtype:"bool"}),HL={kernelName:qs,backendName:"webgl",kernelFunc:jL},$L=CF({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:QR}),KL={kernelName:js,backendName:"webgl",kernelFunc:$L};const XL={kernelName:$s,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:s}=t;return AL(s,!0,n)}},ZL=xF({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),YL={kernelName:Xs,backendName:"webgl",kernelFunc:ZL},QL=xF({opSnippet:"return float(isinf(x));",dtype:"bool"}),JL={kernelName:Zs,backendName:"webgl",kernelFunc:QL},eP=xF({opSnippet:"return float(isnan(x));",dtype:"bool"}),tP={kernelName:Ys,backendName:"webgl",kernelFunc:eP},nP=CF({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:JR,dtype:"bool"}),sP={kernelName:Js,backendName:"webgl",kernelFunc:nP},rP=CF({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:eM,dtype:"bool"}),iP={kernelName:er,backendName:"webgl",kernelFunc:rP};const aP={kernelName:tr,backendName:"webgl",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:s,stop:r,num:i}=n,a=tM(s,r,i);return t.makeTensorInfo([a.length],"float32",a)}},oP=xF({opSnippet:AF+"\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:nM}),lP={kernelName:nr,backendName:"webgl",kernelFunc:oP},cP=xF({opSnippet:AF+"\n return log(1.0 + x);\n"}),uP={kernelName:sr,backendName:"webgl",kernelFunc:cP},hP=CF({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"}),dP={kernelName:rr,backendName:"webgl",kernelFunc:hP},pP=xF({opSnippet:"return float(!(x >= 1.0));"}),fP={kernelName:ir,backendName:"webgl",kernelFunc:pP},mP=CF({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"}),gP={kernelName:ar,backendName:"webgl",kernelFunc:mP};class yP{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[];const i=t,a=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 = -${i}; j <= ${i}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${a}) {\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 bP{constructor(e,t,n,s,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const i=t,a=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 - ${i};\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 = - ${i}; j <= ${i}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${a}));\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 wP={kernelName:or,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{depthRadius:i,bias:a,alpha:o,beta:l}=s,c=En().getBool("WEBGL_PACK_NORMALIZATION")?new bP(r.shape,i,a,o,l):new yP(r.shape,i,a,o,l);return n.runWebGLProgram(c,[r],r.dtype)}};class vP{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 AP={kernelName:lr,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r,y:i,dy:a}=t,{depthRadius:o,bias:l,alpha:c,beta:u}=s,h=new vP(r.shape,o,l,c,u);return n.runWebGLProgram(h,[r,i,a],r.dtype)}};function xP(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{reductionIndices:i,keepDims:a}=s,o=r.shape.length,l=tn(i,r.shape);let c=l;const u=Mh(c,o),h=null!=u,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 ${a} and dilations '1'`));const c=Au(r.shape,i,a,1,o,l);if(1===c.filterWidth&&1===c.filterHeight&&Xt(c.inShape,c.outShape))return hF({inputs:{x:r},backend:n});const u=new CB(c,"max",!1);return n.runWebGLProgram(u,[r],r.dtype)}};const _P={kernelName:pr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{filterSize:i,strides:a,pad:o,dataFormat:l,dimRoundingMode:c}=s,u=xu(r.shape,i,a,[1,1,1],o,c,l),h=new kB(u,"max",!1);return n.runWebGLProgram(h,[r],r.dtype)}};class TP{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,n=e.strideWidth,s=e.dilationHeight,r=e.effectiveFilterHeight,i=e.effectiveFilterWidth,a=r-1-e.padInfo.top,o=i-1-e.padInfo.left,l=r*i-1;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${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 < ${i}; 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 * ${i} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}}class IP{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,n=e.strideHeight,s=e.strideWidth,r=e.dilationDepth,i=e.dilationHeight,a=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,c=e.effectiveFilterWidth,u=o-1-e.padInfo.front,h=l-1-e.padInfo.top,d=c-1-e.padInfo.left,p=o*l*c-1;this.userCode=`\n const ivec3 pads = ivec3(${u}, ${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 += ${i}) {\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 < ${c};\n wC += ${a}) {\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} * ${c} +\n wR * ${c} + 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 NP={kernelName:fr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i}=t,a=i,{filterSize:o,strides:l,pad:c,dimRoundingMode:u}=s,h=xu(a.shape,o,l,[1,1,1],c,u),d=new kB(h,"max",!0),p=n.runWebGLProgram(d,[a],a.dtype),f=new IP(h),m=n.runWebGLProgram(f,[r,p],a.dtype);return n.disposeIntermediateTensorInfo(p),m}};const OP={kernelName:dr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{dy:r,input:i,output:a}=t,o=i;$D([i,a],"maxPoolGrad");const{filterSize:l,strides:c,pad:u,dimRoundingMode:h}=s,d=Au(o.shape,l,c,1,u,h),p=new CB(d,"max",!0),f=n.runWebGLProgram(p,[o],o.dtype),m=new TP(d),g=n.runWebGLProgram(m,[r,f],o.dtype);return n.disposeIntermediateTensorInfo(f),g}};const DP={kernelName:mr,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{filterSize:r,strides:i,pad:a,includeBatchInIndex:o}=t,l=n;jt(4===s.shape.length,(()=>`Error in maxPool: input must be rank 4 but got rank ${s.shape.length}.`));const c=[1,1];jt(Ou(i,c),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${c}'`));const u=Au(s.shape,r,i,c,a),[h,d]=function(e,t,n,s){let r=new CB(n,"max",!1);const i=s.runWebGLProgram(r,[e],"float32");return r=new CB(n,"max",!0,!0,t),[i,s.runWebGLProgram(r,[e],"float32")]}(s,o,u,l);return[h,d]}};const RP={kernelName:gr,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:s}=e,{keepDims:r,axis:i}=t,a=n,o=s.shape.length,l=tn(i,s.shape);let c=l;const u=Mh(c,o),h=null!=u,d=a.shouldExecuteOnCPU([s]),p=[];let f=s;if(h){if(d){const e=a.texData.get(f.dataId).values,t=new Array(o);for(let e=0;et[0]+e[n]+t[1]));const s=e.length,r=dR(s),i=t.map((e=>e[0])).join(","),a=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}(${i});\n ${r} end = ${r}(${a});\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 = ${i};\n int end = ${a};\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 LP{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=dR(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=MM("rc",s),l=MM("source",s),c=`${o[s-1]} < ${this.outputShape[s-1]}`,u=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()}), ${u});\n ${o[s-1]} += 1;\n if(${c}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${u});\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()}), ${u});\n ${o[s-1]} += 1;\n if(${c}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${u});\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()}), ${u});\n ${o[s-1]} += 1;\n if(${c}) {\n ${e}\n result[3] = getChannel(getX(${l.join()}), ${u});\n }\n }\n `}this.userCode=`\n const ${r} start = ${r}(${i});\n const ${r} end = ${r}(${a});\n\n void main() {\n ${r} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${d}\n setOutput(result);\n }\n `}}const PP={kernelName:wr,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:s}=e,{paddings:r,mode:i}=n,a=En().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new LP(s.shape,r,i):new zP(s.shape,r,i);return t.runWebGLProgram(a,[s],s.dtype)}},VP=CF({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 "+cF+"\n return result;\n"}),WP={kernelName:vr,backendName:"webgl",kernelFunc:VP};class GP{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 UP=CF({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}),qP={kernelName:_s,backendName:"webgl",kernelFunc:UP},jP="return a - b;",HP=CF({opSnippet:jP,packedOpSnippet:jP,supportsComplex:!0,cpuKernelImpl:TM}),$P={kernelName:Si,backendName:"webgl",kernelFunc:HP};function KP(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{dim:i}=s,a=tn([i],r.shape),o=xP({inputs:{x:r},backend:n,attrs:{reductionIndices:a,keepDims:!1}}),l=Dh(o.shape,a),c=OF({inputs:{x:o},backend:n,attrs:{shape:l}}),u=HP({inputs:{a:r,b:c},backend:n}),h=pL({inputs:{x:u},backend:n}),d=PF({inputs:{x:h},backend:n,attrs:{axis:a,keepDims:!1}}),p=OF({inputs:{x:d},backend:n,attrs:{shape:l}}),f=UP({inputs:{a:h,b:p},backend:n});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(p),f}const XP={kernelName:di,backendName:"webgl",kernelFunc:KP};const ZP={kernelName:Ar,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{logits:r}=t,{numSamples:i,seed:a,normalized:o}=s,l=o?r:KP({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),c=l.shape[0],u=l.shape[1],h=new GP(c,u,i),d=[[a]],p=n.runWebGLProgram(h,[l],"int32",d);return o||n.disposeIntermediateTensorInfo(l),p}},YP=GM+"\n return -x;\n";const QP={kernelName:Cr,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]=oM(e.values,s.shape,s.dtype);return n.makeTensorInfo(r,s.dtype,t)}let r;return r=En().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new tF(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 WM(s.shape,YP),n.runWebGLProgram(r,[s],s.dtype)}},JP=Lf;const eV={kernelName:Sr,backendName:"webgl",kernelFunc:function(e){Gi();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l}=s,c=n.readSync(r.dataId),u=n.readSync(i.dataId),{selectedIndices:h}=JP(c,u,a,o,l);return n.makeTensorInfo([h.length],"int32",new Int32Array(h))}},tV=Pf;const nV={kernelName:Er,backendName:"webgl",kernelFunc:function(e){Gi();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:c}=s,u=n.readSync(r.dataId),h=n.readSync(i.dataId),{selectedIndices:d,validOutputs:p}=tV(u,h,a,o,l,c);return[n.makeTensorInfo([d.length],"int32",new Int32Array(d)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}},sV=Vf;const rV={kernelName:_r,backendName:"webgl",kernelFunc:function(e){Gi();const{inputs:t,backend:n,attrs:s}=e,{boxes:r,scores:i}=t,{maxOutputSize:a,iouThreshold:o,scoreThreshold:l,softNmsSigma:c}=s,u=n.readSync(r.dataId),h=n.readSync(i.dataId),d=a,p=o,f=l,m=c,{selectedIndices:g,selectedScores:y}=sV(u,h,d,p,f,m);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([y.length],"float32",new Float32Array(y))]}};class iV{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 aV={kernelName:Ir,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{indices:r}=t,{dtype:i,depth:a,onValue:o,offValue:l}=s,c=Kt(r.shape),u=new iV(c,a,o,l),h=OF({inputs:{x:r},backend:n,attrs:{shape:[c]}}),d=n.runWebGLProgram(u,[h],i);n.disposeIntermediateTensorInfo(h);const p=OF({inputs:{x:d},backend:n,attrs:{shape:[...r.shape,a]}});return n.disposeIntermediateTensorInfo(d),p}};function oV(e){const{inputs:t,backend:n}=e,{x:s}=t;if("complex64"===s.dtype){const e=HB({inputs:{input:s},backend:n}),t=oV({inputs:{x:e},backend:n}),r=lz({inputs:{input:s},backend:n}),i=oV({inputs:{x:r},backend:n}),a=pF({inputs:{real:t,imag:i},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(i),a}return kL({attrs:{shape:s.shape,dtype:s.dtype,value:"string"===s.dtype?"":0},backend:n})}const lV={kernelName:Fi,backendName:"webgl",kernelFunc:oV};const cV={kernelName:Tr,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=HB({inputs:{input:r},backend:s}),n=e({inputs:{x:t},backend:s}),i=lz({inputs:{input:r},backend:s}),a=oV({inputs:{x:i},backend:s}),o=pF({inputs:{real:n,imag:a},backend:s});return s.disposeIntermediateTensorInfo(t),s.disposeIntermediateTensorInfo(n),s.disposeIntermediateTensorInfo(i),s.disposeIntermediateTensorInfo(a),o}return kL({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:s})}};const uV={kernelName:Nr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{axis:r}=s;if(1===t.length)return mL({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const i=t[0].shape,a=t[0].dtype;t.forEach((e=>{Ht(i,e.shape,"All tensors passed to stack must have matching shapes"),jt(a===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const o=[],l=hz({inputs:t.map((e=>{const t=mL({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 hV{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=dR(s),i=t.map((e=>e[0])).join(","),a=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}(${i});\n ${r} end = ${r}(${a});\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 = ${i};\n int end = ${a};\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 dV{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=dR(s),i=t.map((e=>e[0])).join(","),a=t.map(((t,n)=>t[0]+e[n])).join(","),o=MM("rc",s),l=MM("source",s),c=`${o[s-1]} < ${this.outputShape[s-1]}`,u=1===s?"source":`vec2(${l.slice(-2).join()})`,h=[`${r} rc = outputLoc;`,`${o[s-1]} += 1;\n if(${c}) {\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(${c}) {`],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:i,constantValue:a}=s;if(0===Kt(r.shape)){return kL({backend:n,attrs:{shape:i.map(((e,t)=>e[0]+r.shape[t]+e[1])),value:a,dtype:r.dtype}})}const o=En().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new dV(r.shape,i,a):new hV(r.shape,i,a),l=[[a]];return n.runWebGLProgram(o,[r],r.dtype,l)},fV={kernelName:Or,backendName:"webgl",kernelFunc:pV},mV=CF({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 "+cF+"\n return result;\n"}),gV={kernelName:Dr,backendName:"webgl",kernelFunc:mV};const yV={kernelName:Mr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{axis:i,keepDims:a}=s,o=r.shape.length,l=[],c=tn(i,r.shape);let u=c;const h=Mh(u,o);let d,p=r;if(null!=h&&(p=WF({inputs:{x:r},backend:n,attrs:{perm:h}}),u=Bh(u.length,o),l.push(p)),Rh("prod",u,o),n.shouldExecuteOnCPU([p])){const e=n.texData.get(p.dataId).values,{outVals:t,outShape:s,outDtype:r}=cM(p.shape,p.dtype,e,u);d=n.makeTensorInfo(s,r,t)}else{const[e,t]=Oh(p.shape,u),s=Kt(t),i=OF({inputs:{x:p},backend:n,attrs:{shape:[-1,s]}}),a=FF(i,Za(r.dtype),"prod",n);d=OF({inputs:{x:a},backend:n,attrs:{shape:e}}),l.push(i),l.push(a)}if(a){l.push(d);const e=Dh(d.shape,c);d=OF({inputs:{x:d},backend:n,attrs:{shape:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),d}};const bV={kernelName:Fr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{paramsNestedSplits:r,paramsDenseValues:i,indices:a}=t,{outputRaggedRank:o}=s,l=r.map((e=>n.readSync(e.dataId))),c=r.map((e=>e.shape)),u=n.readSync(i.dataId),h=n.readSync(a.dataId),[d,p,f]=uM(l,c,u,i.shape,i.dtype,h,a.shape,o),m=d.map((e=>n.makeTensorInfo([e.length],"int32",e))),g=n.makeTensorInfo(f,i.dtype,p);return m.concat([g])}};const wV={kernelName:Br,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{starts:s,limits:r,deltas:i}=t,a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[c,u]=hM(a,s.shape,s.dtype,o,r.shape,l,i.shape);return[n.makeTensorInfo([c.length],"int32",c),n.makeTensorInfo([u.length],s.dtype,u)]}};const vV={kernelName:zr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{shape:r,values:i,defaultValue:a,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=s,c=n.readSync(r.dataId),u=n.readSync(i.dataId),h=n.readSync(a.dataId),d=o.map((e=>n.readSync(e.dataId))),p=o.map((e=>e.shape)),[f,m]=dM(c,r.shape,u,i.shape,i.dtype,h,a.shape,d,p,l);return n.makeTensorInfo(f,i.dtype,m)}},AV=e=>{const{backend:t,attrs:n}=e,{start:s,stop:r,step:i,dtype:a}=n,o=pM(s,r,i,a);return t.makeTensorInfo([o.length],a,o)},xV={kernelName:Lr,backendName:"webgl",kernelFunc:AV},CV=xF({opSnippet:"return 1.0 / x;"}),kV={kernelName:Vr,backendName:"webgl",kernelFunc:CV},SV=xF({opSnippet:GM+"\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"}),EV={kernelName:Wr,backendName:"webgl",kernelFunc:SV},_V=xF({opSnippet:GM+"\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"}),TV={kernelName:$r,backendName:"webgl",kernelFunc:_V};class IV{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const c=[s&&t>1?a-1:a,s&&n>1?o-1:o],u=[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 ${c[0]/u[0]},\n ${c[1]/u[1]});\n const vec2 inputShapeRC = vec2(${a}.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 NV{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const c=[s&&t>1?a-1:a,s&&n>1?o-1:o],u=[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 ${c[0]/u[0]},\n ${c[1]/u[1]},\n ${c[1]/u[1]});\n const vec3 inputShapeRC = vec3(${a}.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 OV={kernelName:jr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s,[l,c]=o,u=En().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new NV(r.shape,l,c,i,a):new IV(r.shape,l,c,i,a);return n.runWebGLProgram(u,[r],"float32")}};class DV{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,i,a]=e,o=[n&&i>1?s-1:s,n&&a>1?r-1:r],l=[n&&i>1?i-1:i,n&&a>1?a-1:a],c=o[0]/l[0],u=o[1]/l[1],h=1/c,d=1/u,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(${c});\n const float widthScale = float(${u});\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 >= ${i}) {\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 >= ${a}) {\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 RV={kernelName:Hr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:i}=t,{alignCorners:a}=s,o=new DV(i.shape,r.shape,a);return n.runWebGLProgram(o,[i],i.dtype)}};class MV{constructor(e,t,n,s,r){this.variableNames=["A"],this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const c=[s&&t>1?a-1:a,s&&n>1?o-1:o],u=[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 ${c[0]/u[0]},\n ${c[1]/u[1]});\n const vec2 inputShapeRC = vec2(${a}.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 FV{constructor(e,t,n,s,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[i,a,o,l]=e;this.outputShape=[i,t,n,l];const c=[s&&t>1?a-1:a,s&&n>1?o-1:o],u=[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 ${c[0]/u[0]},\n ${c[1]/u[1]},\n ${c[1]/u[1]});\n const vec3 inputShapeRC = vec3(${a}.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 BV={kernelName:Ur,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r}=t,{alignCorners:i,halfPixelCenters:a,size:o}=s,[l,c]=o,u=En().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new FV(r.shape,l,c,i,a):new MV(r.shape,l,c,i,a);return n.runWebGLProgram(u,[r],r.dtype)}};class zV{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,s,r]=t,[,i,a]=e,o=[n&&i>1?s-1:s,n&&a>1?r-1:r],l=[n&&i>1?i-1:i,n&&a>1?a-1:a],c=o[0]/l[0],u=o[1]/l[1],h=1/c,d=1/u,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(${c});\n const float widthScale = float(${u});\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 >= ${i}) {\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 >= ${a}) {\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 LV={kernelName:qr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{images:r,dy:i}=t,{alignCorners:a}=s,o=new zV(i.shape,r.shape,a);return n.runWebGLProgram(o,[i],i.dtype)}};class PV{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=dR(n);this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n setOutput(getX(${s}));\n }\n `}}class VV{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=MM("rc",n),r=`${s[n-1]} + 1 < ${this.outputShape[n-1]}`,i=`${s[n-2]} + 1 < ${this.outputShape[n-2]}`,a=dR(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 ${a} 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(${i}) {\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 WV={kernelName:Kr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{dims:i}=s,a=r.shape.length,o=tn(i,r.shape);if(0===a)return hF({inputs:{x:r},backend:n});const l=En().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new VV(r.shape,o):new PV(r.shape,o);return n.runWebGLProgram(l,[r],r.dtype)}};class GV{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 UV={kernelName:Li,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:s}=e,{radians:r,fillValue:i,center:a}=t,o=n,l=new GV(s.shape,i),[c,u]=Fm(a,s.shape[1],s.shape[2]),h=[[c,u,Math.sin(r),Math.cos(r)]];return o.runWebGLProgram(l,[s],s.dtype,h)}},qV=xF({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"}),jV={kernelName:Xr,backendName:"webgl",kernelFunc:qV},HV=xF({opSnippet:"return inversesqrt(x);",cpuKernelImpl:fM}),$V={kernelName:Zr,backendName:"webgl",kernelFunc:HV};class KV{constructor(e,t,n,s,r,i,a=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=i;const l=dR(r.length),c=dR(i.length);let u="";1===n?u="i":2===n&&(u="i, j");const h=`getIndices(${u})`;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 ${c} 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 XV{constructor(e,t,n,s,r,i,a=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=i;const l=dR(r.length),c=dR(i.length);let u="";1===n?u="i":2===n&&(u="i, j");const h=`getIndices(${u})`;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 ${c} 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 ZV={kernelName:Yr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{indices:r,updates:i}=t,{shape:a}=s,{sliceRank:o,numUpdates:l,sliceSize:c,strides:u,outputSize:h}=$p(0,r,a),d=[h/c,c];if(0===h)return n.makeTensorInfo(a,r.dtype);const p=OF({inputs:{x:r},backend:n,attrs:{shape:[l,o]}}),f=OF({inputs:{x:i},backend:n,attrs:{shape:[l,c]}}),m=n.makeTensorInfo([],"float32",new Float32Array([0]));let g;g=En().getBool("WEBGL_PACK")?new XV(l,o,p.shape.length,f.shape.length,u,d):new KV(l,o,p.shape.length,f.shape.length,u,d);const y=n.runWebGLProgram(g,[f,p,m],f.dtype),b=OF({inputs:{x:y},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(m),b}};class YV{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;`,i=2===En().getNumber("WEBGL_VERSION")?"while (left < right) {":r,a="left"===s?"<":"<=";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${i}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${a} 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 QV={kernelName:Jr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sortedSequence:r,values:i}=t,{side:a}=s,o=new YV(r.shape[0],r.shape[1],i.shape[1],a),l=[[r.shape[1]]];return n.runWebGLProgram(o,[r,i],"int32",l)}};class JV{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"],i=[],a=[];for(let s=0;s= 1.0) {\n setOutput(getA(${r}));\n } else {\n setOutput(getB(${r}));\n }\n }\n `}}const eW={kernelName:ei,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{condition:s,t:r,e:i}=t,a=new JV(s.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(a,[s,r,i],Xa(r.dtype,i.dtype))}},tW=xF({opSnippet:`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${Gm};\n float scale = ${Um};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),nW={kernelName:ti,backendName:"webgl",kernelFunc:tW},sW=xF({opSnippet:AF+"\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:gM}),rW={kernelName:ai,backendName:"webgl",kernelFunc:sW},iW=xF({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),aW={kernelName:ii,backendName:"webgl",kernelFunc:iW},oW=xF({opSnippet:AF+"\n return sin(x);\n",packedOpSnippet:`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${cF}\n return result;\n`}),lW={kernelName:si,backendName:"webgl",kernelFunc:oW},cW=xF({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),uW={kernelName:ri,backendName:"webgl",kernelFunc:cW},hW=xF({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"}),dW={kernelName:oi,backendName:"webgl",kernelFunc:hW},pW={kernelName:ui,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{blockShape:i,paddings:a}=s;jt(r.shape.length<=4,(()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"));const o=i.reduce(((e,t)=>e*t)),l=[[0,0]];l.push(...a);for(let e=1+i.length;en.disposeIntermediateTensorInfo(e))),g}};const fW={kernelName:pi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{indices:s,values:r,denseShape:i,defaultValue:a}=t;if(1!==i.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${i.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!==a.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${a.shape}`);const o=n.readSync(s.dataId),l=n.readSync(r.dataId),c=n.readSync(i.dataId),u=n.readSync(a.dataId)[0],[h,d,p,f,m]=wM(o,s.shape,s.dtype,l,r.dtype,c,u);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 mW={kernelName:fi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{inputIndices:s,inputShape:r,newShape:i}=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!==i.shape.length)throw new Error(`Target shape should be a vector but received shape ${i.shape}`);const a=Array.from(n.readSync(r.dataId)),o=n.readSync(s.dataId),l=Array.from(n.readSync(i.dataId)),[c,u,h]=vM(o,s.shape,s.dtype,a,l);return[n.makeTensorInfo(u,s.dtype,c),n.makeTensorInfo([h.length],i.dtype,new Int32Array(h))]}};const gW={kernelName:mi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:i}=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!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${i.shape}`);const a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[c,u]=AM(a,s.shape,s.dtype,o,l,!0);return n.makeTensorInfo(u,s.dtype,c)}};const yW={kernelName:gi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:s,indices:r,segmentIds:i}=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!==i.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${i.shape}`);const a=n.readSync(s.dataId),o=n.readSync(r.dataId),l=n.readSync(i.dataId),[c,u]=AM(a,s.shape,s.dtype,o,l);return n.makeTensorInfo(u,s.dtype,c)}};const bW={kernelName:yi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{sparseIndices:r,sparseValues:i,defaultValue:a}=t,{outputShape:o}=s,{sliceRank:l,numUpdates:c,sliceSize:u,strides:h,outputSize:d}=$p(0,r,o),p=!1;if("string"===i.dtype){const e=n.bufferSync(r),t=n.bufferSync(i),s=ya(n.readSync(a.dataId)[0]),f=mM(e,t,o,d,u,c,l,h,s,p);return n.makeTensorInfo(o,f.dtype,f.values)}const f=new KV(c,l,r.shape.length,i.shape.length,h,[d,1],p),m=n.runWebGLProgram(f,[i,r,a],i.dtype),g=OF({inputs:{x:m},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(m),g}};const wW={kernelName:hi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{numOrSizeSplits:i,axis:a}=s,o=tn(a,r.shape)[0],l=fg(r,i,o),c=r.shape.length,u=new Array(c).fill(0),h=r.shape.slice();return l.map((e=>{const t=[...h];t[o]=e;const s=LB({inputs:{x:r},backend:n,attrs:{begin:u,size:t}});return u[o]+=e,s}))}},vW="return sqrt(x);",AW=xF({opSnippet:vW,packedOpSnippet:vW,cpuKernelImpl:xM}),xW={kernelName:li,backendName:"webgl",kernelFunc:AW},CW={kernelName:wi,backendName:"webgl",kernelFunc:xF({opSnippet:"return x * x;"})},kW="return (a - b) * (a - b);",SW=CF({opSnippet:kW,packedOpSnippet:kW}),EW={kernelName:bi,backendName:"webgl",kernelFunc:SW};const _W={kernelName:vi,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 i=Ng(n.readSync(r.dataId)),a=CM(i,"string",s);return n.makeTensorInfo(r.shape,"string",a)}};const TW={kernelName:Bi,backendName:"webgl",kernelFunc:function({inputs:e,attrs:t,backend:n}){const{x:s}=e,r=GM+`\n return x > 0.0 ? 1.0 : float(${t.alpha});\n `,i=new WM(s.shape,r);return n.runWebGLProgram(i,[s],s.dtype)}};class IW{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const s=n.length,r=dR(n.length),i=dR(n.length);let a="";if(1===s)a="coords * strides + begin";else{let e=0;a=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 ${i} coords = getOutputCoords();\n setOutput(getX(${a}));\n }\n `}}const NW={kernelName:Ai,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r}=t,{begin:i,end:a,strides:o,beginMask:l,endMask:c,ellipsisMask:u,newAxisMask:h,shrinkAxisMask:d}=s,{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:y,begin:b,end:w,strides:v}=au(r.shape,i,a,o,l,c,u,h,d);let A;if(m)A=OF({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||y){jt(r.shape.length>=1,(()=>`Input must have rank at least 1, got: ${r.shape.length}`));const e=$c(b,w,v),t=LB({inputs:{x:r},backend:n,attrs:{begin:b,size:e}});A=OF({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{if(n.shouldExecuteOnCPU([r])){const e=n.readSync(r.dataId),t=Fl(r.shape,r.dtype,e),s=kM(p,t,v,b);A=n.makeTensorInfo(f,r.dtype,s.values)}else{const e=new IW(b,v,p);A=n.runWebGLProgram(e,[r],r.dtype)}}const x=OF({inputs:{x:A},backend:n,attrs:{shape:f}});return n.disposeIntermediateTensorInfo(A),x}};const OW={kernelName:xi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{separator:r,nGramWidths:i,leftPad:a,rightPad:o,padWidth:l,preserveShortSequences:c}=s,{data:u,dataSplits:h}=t,d=n.readSync(u.dataId),p=n.readSync(h.dataId),[f,m]=SM(d,p,r,i,a,o,l,c);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(h.shape,"int32",m)]}};const DW={kernelName:Ci,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{skipEmpty:r}=s,{input:i,delimiter:a}=t;if("string"!==i.dtype)throw new Error("Input must be of datatype string");if(1!==i.shape.length)throw new Error(`Input must be a vector, got shape: ${i.shape}`);if(0!==a.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);const o=n.readSync(i.dataId),l=n.readSync(a.dataId)[0],[c,u,h]=EM(o,l,r),d=u.length;return[n.makeTensorInfo([d,2],"int32",c),n.makeTensorInfo([d],"string",u),n.makeTensorInfo([2],"int32",new Int32Array(h))]}};const RW={kernelName:ki,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{numBuckets:r}=s,{input:i}=t;if("string"!==i.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 a=n.readSync(i.dataId),o=_M(a,r);return n.makeTensorInfo(i.shape,"int32",o)}},MW=xF({opSnippet:"return tan(x);"}),FW={kernelName:Ei,backendName:"webgl",kernelFunc:MW},BW=xF({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),zW={kernelName:_i,backendName:"webgl",kernelFunc:BW};const LW={kernelName:Qr,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{tensor:r,indices:i,updates:a}=t,{}=s,{sliceRank:o,numUpdates:l,sliceSize:c,strides:u,outputSize:h}=$p(0,i,r.shape),d=[h/c,c];if(0===h)return n.makeTensorInfo(r.shape,i.dtype);const p=OF({inputs:{x:i},backend:n,attrs:{shape:[l,o]}}),f=OF({inputs:{x:a},backend:n,attrs:{shape:[l,c]}}),m=OF({inputs:{x:r},backend:n,attrs:{shape:d}}),g=new KV(l,o,p.shape.length,f.shape.length,u,d,!1,!0),y=n.runWebGLProgram(g,[f,p,m],m.dtype),b=OF({inputs:{x:y},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(y),b}};class PW{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=>ya(e))):e,s=Fl(r.shape,r.dtype,t),a=IM(s,i);return n.makeTensorInfo(a.shape,a.dtype,a.values)}const a=new PW(r.shape,i);return n.runWebGLProgram(a,[r],r.dtype)}const WW={kernelName:Ti,backendName:"webgl",kernelFunc:VW};class GW{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 UW{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 qW(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function jW(e){let t=1;for(;tl){const e=n.readSync(r.dataId),[t,s]=NM(e,c,r.dtype,i,a);return[n.makeTensorInfo(t.shape,t.dtype,t.values),n.makeTensorInfo(s.shape,s.dtype,s.values)]}if(0===i)return c[c.length-1]=0,[n.makeTensorInfo(c,r.dtype,[]),n.makeTensorInfo(c,"int32",[])];if(1===u)return[r,kL({attrs:{shape:c,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=Kt(c)/u,m=OF({inputs:{x:p},attrs:{shape:[f,u]},backend:n});d&&qW(n,p);const g=jW(i),y=jW(u);let b=null;const w=()=>null===b?[m,m]:[m,b],v=(e,t,s)=>{const r=w(),i=new GW(s),a=[[u],[null===b?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],o=b;b=n.runWebGLProgram(i,r,"int32",a),qW(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 UW([f,e/2]),r=[[u],[null===b?1:0],[g]],i=b;b=n.runWebGLProgram(s,t,"int32",r),qW(n,i);const a=g/2,o=2*a;for(let e=a;e>=1;e/=2)v(o,e,b.shape)}let A=b;b=LB({inputs:{x:b},backend:n,attrs:{begin:0,size:[f,i]}}),qW(n,A);let x=UL({inputs:{x:m,indices:b},backend:n,attrs:{axis:1,batchDims:1}});qW(n,m);const C=c.slice(0,-1);C.push(i),A=b,b=OF({inputs:{x:b},attrs:{shape:C},backend:n}),qW(n,A);const k=x;return x=OF({inputs:{x},attrs:{shape:C},backend:n}),qW(n,k),[x,b]}};class $W{constructor(e,t,n,s,r,i){this.variableNames=["Image","Transforms"],this.outputShape=i;const a="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 (${a} == 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 KW={kernelName:Ni,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{image:r,transforms:i}=t,{interpolation:a,fillMode:o,fillValue:l,outputShape:c}=s,[u,h,d,p]=r.shape,[f,m]=null!=c?c:[h,d],g=new $W(h,d,a,o,l,[u,f,m,p]);return n.runWebGLProgram(g,[r,i],"float32")}};const XW={kernelName:Di,backendName:"webgl",kernelFunc:function(e){const{inputs:t,attrs:n,backend:s}=e,{axis:r}=n,{x:i}=t;$D(i,"unique");const a=s.readSync(i.dataId),{outputValues:o,outputShape:l,indices:c}=DM(a,r,i.shape,i.dtype);return[s.makeTensorInfo(l,i.dtype,o),s.makeTensorInfo([c.length],"int32",c)]}};const ZW={kernelName:Ri,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{value:r}=t;let{axis:i}=s;i<0&&(i+=r.shape.length);const a=r,o=a.shape.length,l=r.shape[i],c=new Array(o-1);let u=0;for(let e=0;en.disposeIntermediateTensorInfo(e))),f}};class YW{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windowSize,s=e.batchSize,r=e.inSize,i=e.numSegments,a=i*Math.ceil(r/n);this.outputShape=[s,a];const o=4*Math.floor(n/4),l=n%4,c="\n sumValue += dot(values, segFilter);\n ";let u="";r%n>0&&(u=`\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 ${u}\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 ${i})) * float(${n}));\n int currentSeg = int(mod(float(outIdx), float(${i})));\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 ${c}\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 ${c}\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 ${c}\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 ${c}\n }\n setOutput(sumValue);\n }\n `}}const QW={kernelName:Mi,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:s}=e,{x:r,segmentIds:i}=t,{numSegments:a}=s,o=r.shape.length,l=[];let c=0;const u=Mh([c],o);let h=r;null!=u&&(h=WF({inputs:{x:r},backend:n,attrs:{perm:u}}),l.push(h),c=Bh(1,o)[0]);const d=Tg(h.shape,c,a),p=Kt([h.shape[c]]),f=OF({inputs:{x:h},backend:n,attrs:{shape:[-1,p]}});l.push(f);const m=Za(r.dtype),g=(e,t,s,r,i)=>{const a=e.shape[0],o=e.shape[1],c=_g(o,i),u=new YW({windowSize:c,inSize:o,batchSize:a,numSegments:i},t),h=n.compileAndRun(u,[e,s],r);if(l.push(h),h.shape[1]===i)return h;const d=AV({backend:n,attrs:{start:0,stop:i,step:1,dtype:"float32"}}),p=VW({inputs:{x:d},backend:n,attrs:{reps:[o/c]}});l.push(d),l.push(p);return g(h,t,p,r,i)},y=OF({inputs:{x:g(f,"unsortedSegmentSum",i,m,a)},backend:n,attrs:{shape:d}});let b=y;if(null!=u){l.push(y);const e=Fh(u);b=WF({inputs:{x:b},backend:n,attrs:{perm:e}})}return l.forEach((e=>n.disposeIntermediateTensorInfo(e))),b}},JW=[jF,$F,XF,YF,eB,sB,rB,iB,hB,dB,fB,gB,bB,vB,xB,SB,EB,IB,NB,OB,MB,VB,WB,GB,UB,XB,QB,tz,fF,rz,dz,vz,Sz,_z,Tz,Iz,Nz,Dz,Mz,Bz,Uz,qz,jz,$z,Zz,Jz,eL,nL,rL,iL,oL,lL,uL,dL,fL,gL,wL,xL,SL,_L,NL,DL,FL,LL,PL,WL,qL,HL,KL,dF,XL,cz,YL,JL,tP,yF,sP,iP,aP,lP,uP,dP,fP,gP,wP,AP,CP,SP,EP,_P,NP,OP,DP,RP,MP,BP,PP,WP,ZP,NF,QP,eV,nV,rV,jB,aV,cV,uV,fV,gV,vF,yV,bV,wV,vV,xV,$B,qP,kV,EV,TV,DF,OV,RV,BV,LV,WV,UV,jV,$V,ZV,QV,eW,nW,rW,aW,lW,uW,PB,XP,dW,pW,fW,mW,gW,yW,bW,wW,xW,CW,EW,_W,TW,NW,OW,DW,RW,$P,VF,FW,zW,LW,WW,HW,KW,GF,XW,ZW,QW,lV];for(const e of JW)Xi(e);__webpack_require__(9464);const eG={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:7680},height:{min:240,ideal:4320},facingMode:"user"}},dataTimestep:50,showVideoPreview:!0,applyKalmanFilter:!0,saveDataAcrossSessions:!0,storingPoints:!1,videoIsOn:!1,trackEye:"both"};__webpack_require__(6003);var tG=__webpack_require__(7350),nG=__webpack_require__.n(tG),sG=__webpack_require__(8990),rG=function(){return rG=Object.assign||function(e){for(var t,n=1,s=arguments.length;n0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[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(" "),a=0;a(t=t||0)&&(t=Math.max(t+s,0));t>2];a=t[(3&a)<<4|o>>4],o=t[(15&o)<<2|l>>6],l=t[63&l],n[i++]=c+a+o+l}switch(c=0,l=s,e.length-r){case 2:l=t[(15&(c=e[r+1]))<<2]||s;case 1:e=e[r],n[i]=t[e>>2]+t[(3&e)<<4|c>>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!=a&&(t(i<<4&240|a>>2),64!=o&&t(a<<6&192|o))}}(e,(function(e){s[r++]=e})),r!==n?s.subarray(0,r):s}function B(){if(!R){R={};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;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 U(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 U(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 ie(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 ae(e){var t;return null==(t=re?e[re]:e.N)?0:t}function oe(e){return ie(e,1),e}function le(e){return!!Array.isArray(e)&&!!(2&ae(e))}function ce(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ie(e,2)}function ue(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,i=r?1:0;i>>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)?G=0<1/s?0:2147483648:isNaN(s)?G=2147483647:34028234663852886e22>>0:11754943508222875e-54>s?(s=Math.round(s/Math.pow(2,-149)),G=(n<<31|s)>>>0):(t=Math.floor(Math.log(s)/Math.LN2),s*=Math.pow(2,-t),16777216<=(s=Math.round(8388608*s))&&++t,G=(n<<31|t+127<<23|8388607&s)>>>0),n=G,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),it=st((function(e,t,n){if(0!==e.h)return!1;for(var s=e.g,r=128,i=0,a=e=0;4>a&&128<=r;a++)r=s.h[s.g++],$(s),i|=(127&r)<<7*a;if(128<=r&&(r=s.h[s.g++],$(s),i|=(127&r)<<28,e|=(127&r)>>4),128<=r)for(a=0;5>a&&128<=r;a++)r=s.h[s.g++],$(s),e|=(127&r)<<7*a+3;if(!(128>r))throw q();return s=i>>>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=G=t,t=s;0>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),at=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,i=(e=e.g).g;if(e.g+=r,$(e),e=e.h,N)(s=T)||(s=T=new TextDecoder("utf-8",{fatal:!0})),s=s.decode(e.subarray(i,i+r));else{r=i+r;for(var a,o,l,c=[],u=null;i(a=e[i++])?c.push(a):224>a?i>=r?E():(o=e[i++],194>a||128!=(192&o)?(i--,E()):c.push((31&a)<<6|63&o)):240>a?i>=r-1?E():128!=(192&(o=e[i++]))||224===a&&160>o||237===a&&160<=o||128!=(192&(s=e[i++]))?(i--,E()):c.push((15&a)<<12|(63&o)<<6|63&s):244>=a?i>=r-2?E():128!=(192&(o=e[i++]))||o-144+(a<<28)>>30||128!=(192&(s=e[i++]))||128!=(192&(l=e[i++]))?(i--,E()):(a=(7&a)<<18|(63&o)<<12|(63&s)<<6|63&l,a-=65536,c.push(55296+(a>>10&1023),56320+(1023&a))):E(),8192<=c.length&&(u=_(u,c),c.length=0);s=_(u,c)}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=(I||(I=new TextEncoder)).encode(t)}else{for(var r=0,i=new Uint8Array(3*t.length),a=0;ao)i[r++]=o;else{if(2048>o)i[r++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&a=l){o=1024*(o-55296)+l-56320+65536,i[r++]=o>>18|240,i[r++]=o>>12&63|128,i[r++]=o>>6&63|128,i[r++]=63&o|128;continue}a--}if(s)throw Error("Found an unpaired surrogate");o=65533}i[r++]=o>>12|224,i[r++]=o>>6&63|128}i[r++]=63&o|128}}t=i.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=Ae(t,n,s),n=e.g.i,s=K(e.g)>>>0;var i=e.g.g+s,a=i-n;if(0>=a&&(e.g.i=i,r(t,e),a=i-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+s+" bytes, instead read "+(s-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=i,e.g.i=n,!0}),(function(e,t,n,s,r){if(null!=(t=ve(t,s,n)))for(s=0;s>>=7,a.h++;i.push(o),a.h++}}));function ct(){Ne.apply(this,arguments)}if(p(ct,Ne),fe){var ut={};Object.defineProperties(ct,(ut[Symbol.hasInstance]=me(Object[Symbol.hasInstance]),ut))}function ht(e){ct.call(this,e)}function dt(){return[1,at,2,rt,3,ot,4,ot]}function pt(e){ct.call(this,e,-1,mt)}function ft(){return[1,lt,ht,dt]}p(ht,ct),p(pt,ct),pt.prototype.addClassification=function(e,t){return Ae(this,1,ht,e,t),this};var mt=[1];function gt(e){ct.call(this,e)}function yt(){return[1,rt,2,rt,3,rt,4,rt,5,rt]}function bt(e){ct.call(this,e,-1,vt)}function wt(){return[1,lt,gt,yt]}p(gt,ct),p(bt,ct);var vt=[1];function At(e){ct.call(this,e)}function xt(){return[1,rt,2,rt,3,rt,4,rt,5,rt,6,it]}p(At,ct);var Ct=[[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]],kt=[[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]],Tt=[[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]],It=[].concat(o(Ct),o(kt),o(St),o(Et),o(_t),o(Tt));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:xe(e,1),ga:we(e,2),label:null!=ge(e,3)?Ce(e,3):void 0,displayName:null!=ge(e,4)?Ce(e,4):void 0}}))}function Dt(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 Rt(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),i=n.createProgram();if(n.attachShader(i,s),n.attachShader(i,r),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(i));s=e.o=i,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=a(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 x((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,i,o,l,c,u,h,d,p,f,m,g,b;return x((function(w){switch(w.g){case 1:if(!n)return w.return(t);for(s={},r=0,i=a(Object.keys(n)),o=i.next();!o.done;o=i.next())l=o.value,"string"!=typeof(c=n[l])&&"texture"===c.type&&void 0!==t[c.stream]&&++r;10&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]0){var u=o===e.strides.length-1?1:IG(e.minScale,e.maxScale,o+1,e.strides.length);a.push(Math.sqrt(l*u)),i.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})),Io([s,r,i]),[2,o]}}))}))}function DG(e,t,n){return wG(this,void 0,void 0,(function(){var s,r,i,a,o;return vG(this,(function(l){switch(l.label){case 0:return s=e[0],r=e[1],i=function(e,t,n){return To((function(){var s,r,i,a;n.reverseOutputOrder?(r=Fp(Wu(e,[0,n.boxCoordOffset+0],[-1,1])),s=Fp(Wu(e,[0,n.boxCoordOffset+1],[-1,1])),a=Fp(Wu(e,[0,n.boxCoordOffset+2],[-1,1])),i=Fp(Wu(e,[0,n.boxCoordOffset+3],[-1,1]))):(s=Fp(Wu(e,[0,n.boxCoordOffset+0],[-1,1])),r=Fp(Wu(e,[0,n.boxCoordOffset+1],[-1,1])),i=Fp(Wu(e,[0,n.boxCoordOffset+2],[-1,1])),a=Fp(Wu(e,[0,n.boxCoordOffset+3],[-1,1]))),r=Pl(Gl(Wl(r,n.xScale),t.w),t.x),s=Pl(Gl(Wl(s,n.yScale),t.h),t.y),n.applyExponentialOnBoxSize?(i=Gl(Uh(Wl(i,n.hScale)),t.h),a=Gl(Uh(Wl(a,n.wScale)),t.w)):(i=Gl(Wl(i,n.hScale),t.h),a=Gl(Wl(a,n.wScale),t.h));var o=rc(s,Wl(i,2)),l=rc(r,Wl(a,2)),c=Pl(s,Wl(i,2)),u=Pl(r,Wl(a,2)),h=Lu([Fu(o,[n.numBoxes,1]),Fu(l,[n.numBoxes,1]),Fu(c,[n.numBoxes,1]),Fu(u,[n.numBoxes,1])],1);if(n.numKeypoints)for(var d=0;d0)for((u=l.locationData).relativeKeypoints=[],h=n.numKeypoints*n.numValuesPerKeypoint,d=0;dl?(i=e.width,a=e.width*o,u=(1-l/o)/2):(i=e.height/o,a=e.height,c=(1-o/l)/2),e.width=i,e.height=a,{top:u,left:c,right:c,bottom:u}}(l,s,r),u=function(e,t,n,s){var r=e.width,i=e.height,a=Math.cos(e.rotation),o=Math.sin(e.rotation),l=e.xCenter,c=e.yCenter,u=1/t,h=1/n,d=new Array(16);return d[0]=r*a*1*u,d[1]=-i*o*u,d[2]=0,d[3]=(-.5*r*a*1+.5*i*o+l)*u,d[4]=r*o*1*h,d[5]=i*a*h,d[6]=0,d[7]=(-.5*i*a-.5*r*o*1+c)*h,d[8]=0,d[9]=0,d[10]=r*u,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=To((function(){var t=EG(e),n=Wp(function(e,t,n){return _G(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]}(u,o,s),[1,8]),r="zero"===i?"constant":"nearest",l=ym.transform(qh(Bl(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=a?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 To((function(){return Pl(Gl(e,n.scale),n.offset)}))}(l,a):l}));return{imageTensor:h,padding:c,transformationMatrix:u}}(n,this.imageToTensorConfig),r=s.imageTensor,i=s.transformationMatrix,a=this.detectorModel.execute(r,"Identity:0"),o=function(e){return To((function(){var t=function(e){return To((function(){return[Wu(e,[0,0,0],[1,-1,1]),Wu(e,[0,0,1],[1,-1,-1])]}))}(e),n=t[0],s=t[1];return{boxes:Fp(s),logits:Fp(n)}}))}(a),l=o.boxes,[4,DG([c=o.logits,l],this.anchorTensor,this.tensorsToDetectionConfig)]);case 1:return 0===(u=p.sent()).length?(Io([n,r,a,c,l]),[2,u]):[4,OG(u,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=NG(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,i=Number.MAX_VALUE,a=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=NG(s,e),n=t[0],l=t[1];r=Math.min(r,n),a=Math.max(a,n),i=Math.min(i,l),o=Math.max(o,l)})),t.relativeBoundingBox={xMin:r,xMax:a,yMin:i,yMax:o,width:a-r,height:o-i}})),e}(h,i),Io([n,r,a,c,l]),[2,d]}}))}))},e.prototype.estimateFaces=function(e,t){return wG(this,void 0,void 0,(function(){var n,s;return vG(this,(function(r){return n=SG(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 bG(bG({},e),{x:e.x*n.width,y:e.y*n.height,name:AG[t]})})),s=e.locationData.relativeBoundingBox,r=0,i=["width","xMax","xMin"];r-1,[4,rS(t.detectorModelUrl,{fromTFHub:n})];case 1:return s=r.sent(),[2,new UG(t.modelType,s,t.maxFaces)]}}))}))}function jG(e,t){return wG(this,void 0,void 0,(function(){var n,s;return vG(this,(function(r){if(e===FG.MediaPipeFaceDetector){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,qG(n)];if("mediapipe"===n.runtime)return[2,kG(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 HG(e){return e.width*e.height}function $G(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 KG(e){return e instanceof Fa?{height:e.shape[0],width:e.shape[1]}:{height:e.height,width:e.width}}function XG(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function ZG(e){return e instanceof Fa?e:Gc(e)}function YG(e,t){jt(0!==e.width,(function(){return t+" width cannot be 0."})),jt(0!==e.height,(function(){return t+" height cannot be 0."}))}function QG(e,t,n){var s=t.outputTensorSize,r=t.keepAspectRatio,i=t.borderMode,a=t.outputTensorFloatRange,o=KG(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),c=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;YG(t,"targetSize"),YG(e,"roi");var i,a,o=s/r,l=e.height/e.width,c=0,u=0;return o>l?(i=e.width,a=e.width*o,u=(1-l/o)/2):(i=e.height/o,a=e.height,c=(1-o/l)/2),e.width=i,e.height=a,{top:u,left:c,right:c,bottom:u}}(l,s,r),u=function(e,t,n,s){var r=e.width,i=e.height,a=s?-1:1,o=Math.cos(e.rotation),l=Math.sin(e.rotation),c=e.xCenter,u=e.yCenter,h=1/t,d=1/n,p=new Array(16);return p[0]=r*o*a*h,p[1]=-i*l*h,p[2]=0,p[3]=(-.5*r*o*a+.5*i*l+c)*h,p[4]=r*l*a*d,p[5]=i*o*d,p[6]=0,p[7]=(-.5*i*o-.5*r*l*a+u)*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=To((function(){var t=ZG(e),n=Wp(function(e,t,n){return YG(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]}(u,o,s),[1,8]),r="zero"===i?"constant":"nearest",l=ym.transform(qh(Bl(t,"float32")),n,"bilinear",r,0,[s.height,s.width]);return null!=a?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 To((function(){return Pl(Gl(e,n.scale),n.offset)}))}(l,a):l}));return{imageTensor:h,padding:c,transformationMatrix:u}}function JG(e){return{xCenter:e.xMin+e.width/2,yCenter:e.yMin+e.height/2,width:e.width,height:e.height}}function eU(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,i=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),i=Math.max(i,e.y)})),{xCenter:(n+r)/2,yCenter:(s+i)/2,width:r-n,height:i-s}}function tU(e,t,n,s,r){var i="rect"===n?function(e,t,n){var s,r=e.locationData;if("boundingbox"===t)s=JG(r.boundingBox);else{s=eU(r);var i=n.width,a=n.height;s.xCenter=Math.round(s.xCenter*i),s.yCenter=Math.round(s.yCenter*a),s.width=Math.round(s.width*i),s.height=Math.round(s.height*a)}return s}(e,t,s):function(e,t){var n=e.locationData;return"boundingbox"===t?JG(n.relativeBoundingBox):eU(n)}(e,t);return r&&(i.rotation=function(e,t,n){var s,r=e.locationData,i=n.rotationVectorStartKeypointIndex,a=n.rotationVectorEndKeypointIndex;s=n.rotationVectorTargetAngle?n.rotationVectorTargetAngle:Math.PI*n.rotationVectorTargetAngleDegree/180;var o=r.relativeKeypoints[i].x*t.width,l=r.relativeKeypoints[i].y*t.height,c=r.relativeKeypoints[a].x*t.width,u=r.relativeKeypoints[a].y*t.height;return XG(s-Math.atan2(-(u-l),c-o))}(e,s,r)),i}function nU(e,t,n){for(var s=0;s1&&(h.y=s?t.inputImageHeight-a[c+1]:a[c+1]),i>2&&(h.z=a[c+2]),i>3&&(h.score=aU(t.visibilityActivation,a[c+3])),o.push(h);for(u=0;u0?r/i:0}(e,t)<=.5}))).push(e)}))})),l=y,[4,Promise.all(l.map((function(e){return m.faceLandmark(e,r)})))];case 4:for(c=g.sent(),u=[],this.prevFaceRectsFromLandmarks=[],h=0;h-1,[4,rS(t.landmarkModelUrl,{fromTFHub:n})];case 1:return s=i.sent(),[4,jG(FG.MediaPipeFaceDetector,{modelType:"short",maxFaces:t.maxFaces,detectorModelUrl:t.detectorModelUrl,runtime:t.runtime})];case 2:return r=i.sent(),[2,new kU(r,s,t.maxFaces,t.refineLandmarks)]}}))}))}(cU||(cU={})).MediaPipeFaceMesh="MediaPipeFaceMesh";Object.freeze({__proto__:null,getKeypointIndexByContour:function(e){if(e===cU.MediaPipeFaceMesh)return lG;throw new Error("Model "+e+" is not supported.")},getAdjacentPairs:function(e){if(e===cU.MediaPipeFaceMesh)return cG;throw new Error("Model "+e+" is not supported.")}});const EU=(e,t,n,s)=>1===s?.5*(e+t):e+(t-e)*n/(s-1),_U={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},TU={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},IU={outputTensorSize:{width:192,height:192},keepAspectRatio:!0,outputTensorFloatRange:[-1,1],borderMode:"zero"},NU=e=>{e.detector.imageToTensorConfig=IU,e.detector.tensorsToDetectionConfig=_U,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:EU(e.minScale,e.maxScale,o+1,e.strides.length);a.push(Math.sqrt(t*n)),i.push(e.interpolatedScaleAspectRatio)}}o++}for(let e=0;e0)l=e.featureMapHeight[n],c=e.featureMapWidth[n];else{const t=e.strides[n];l=Math.ceil(e.inputSizeHeight/t),c=Math.ceil(e.inputSizeWidth/t)}for(let n=0;ne.width))),n=Vp(e.detector.anchors.map((e=>e.height))),s=Vp(e.detector.anchors.map((e=>e.xCenter))),r=Vp(e.detector.anchors.map((e=>e.yCenter)));e.detector.anchorTensor={x:s,y:r,w:t,h:n}},OU=()=>navigator.onLine,DU=function(){this.model=function(e,t){return iG(this,void 0,void 0,(function(){var n,s;return aG(this,(function(r){if(e===cU.MediaPipeFaceMesh){if(s=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,SU(n)];if("mediapipe"===n.runtime)return[2,mG(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.")}))}))}(cU.MediaPipeFaceMesh,{runtime:"tfjs",detectorModelUrl:OU()?"https://tfhub.dev/mediapipe/tfjs-model/face_detection/full/1":"./models/detector/model.json",landmarkModelUrl:OU()?void 0:"./models/landmark/model.json"}),this.predictionReady=!1,this.modelLoaded=!1},RU={current:!1,resolves:[]};DU.prototype.loadModel=async function(){if(!this.modelLoaded){if(RU.current){const e=new Promise((e=>{RU.resolves.push(e)}));return await e}RU.current=!0;try{this.model=await this.model,NU(this.model),this.modelLoaded=!0,RU.resolves.forEach((e=>e()))}finally{RU.current=!1,RU.resolves=[]}}},DU.prototype.positionsArray=null,DU.prototype.getEyePatches=async function(e,t,n,s){if(0===t.width)return null;const r=this.model,i=await r.estimateFaces(t,{flipHorizontal:!1});if(0===i.length)return!1;this.positionsArray=i[0].keypoints;const a=i[0],[o,l]=[{eyeTopArc:[466,388,387,386,385,384,398].map((e=>a.keypoints[e])),eyeBottomArc:[263,249,390,373,374,380,381,382,362].map((e=>a.keypoints[e]))},{eyeTopArc:[246,161,160,159,158,157,173].map((e=>a.keypoints[e])),eyeBottomArc:[33,7,163,144,145,153,154,155,133].map((e=>a.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 c=o.origin.x,u=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(c,u,h,d);y.left={patch:b,imagex:c,imagey:u,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},DU.prototype.getPositions=function(){return this.positionsArray},DU.prototype.reset=function(){},DU.prototype.drawFaceOverlay=function(e,t){if(t){e.fillStyle="#32EEDB",e.strokeStyle="#32EEDB",e.lineWidth=.5;for(let n=0;nn?n:e}FU.Eye=function(e,t,n,s,r){this.patch=e,this.imagex=t,this.imagey=n,this.width=s,this.height=r},FU.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),i=[];this.equalizeHistogram(s,5,i);var a=[];return this.equalizeHistogram(r,5,a),i.concat(a)},FU.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)},FU.DataWindow.prototype.push=function(e){return this.data.length>2),r=0,i=0,a=0;at?255:0;return e},FU.correlation=function(e,t){const n=Math.min(e.length,t.length);let s=0;for(let r=0;rLU(e,t,((e,t)=>e+t)),sub:(e,t)=>LU(e,t,((e,t)=>e-t)),inv:e=>PU.solve(e,PU.identity(e.length,e[0].length)),identity(e,t=e){const n=new Array(e);for(let s=0;se.length===e[0].length?PU.LUDecomposition(e,t):PU.QRDecomposition(e,t),LUDecomposition(e,t){for(var n=new Array(e.length),s=0;sMath.abs(u[f])&&(f=s);if(f!=r){for(p=0;p=0;p--){for(r=0;r=0;c--){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},WU.addData=function(e,t,n){e&&("click"===n?(this.screenXClicksArray.push([t[0]]),this.screenYClicksArray.push([t[1]]),this.eyeFeaturesClicks.push(zU.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(zU.getEyeFeats(e)),this.trailTimes.push(performance.now()),this.dataTrail.push({eyes:e,screenPos:t,type:n})))};const GU=WU,UU={RidgeReg:function(){this.init()}};UU.RidgeReg.prototype.init=GU.InitRegression,UU.RidgeReg.prototype.addData=GU.addData,UU.RidgeReg.prototype.predict=function(e){if(!e||0===this.eyeFeaturesClicks.length)return null;for(var t=performance.now()-this.trailTime,n=[],s=[],r=[],i=0;it&&(n.push(this.screenXTrailArray.get(i)),s.push(this.screenYTrailArray.get(i)),r.push(this.eyeFeaturesTrail.get(i)));var a=this.screenXClicksArray.data.concat(n),o=this.screenYClicksArray.data.concat(s),l=this.eyeFeaturesClicks.data.concat(r),c=GU.ridge(a,l,this.ridgeParameter),u=GU.ridge(o,l,this.ridgeParameter),h=zU.getEyeFeats(e),d=0;for(i=0;it&&(n.push(this.screenXTrailArray.get(i)),s.push(this.screenYTrailArray.get(i)),r.push(this.eyeFeaturesTrail.get(i)));var a=this.eyeFeaturesClicks.data.length,o=Array(a),l=Array(a),c=Array(a);for(i=0;isetTimeout(t,e)))}function QU(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}const JU={tracker:{}};JU.tracker.TFFaceMesh=MU,JU.reg=qU,JU.reg.RidgeWeightedReg=HU.RidgeWeightedReg,JU.reg.RidgeRegThreaded=ZU.RidgeRegThreaded,JU.util=zU,JU.params=eG,JU.videoParamsToReport={height:0,width:0};var eq=null,tq=null,nq=null,sq=null,rq=null,iq=null,aq=null,oq=!1,lq=new Array(50),cq=new Array(50),uq=(performance.now(),null),hq=null;JU.params.paused=!1,JU.params.greedyLearner=!1,JU.params.framerate=60,JU.params.showGazeDot=!1,JU.params.getLatestVideoFrameTimestamp=()=>{},JU.params.activeCamera={label:"",id:""};let dq=[];var pq=function(e){},fq=pq,mq=["click","move"],gq=performance.now(),yq=new JU.tracker.TFFaceMesh,bq=[new JU.reg.RidgeReg],wq={TFFacemesh:function(){return new JU.tracker.TFFaceMesh}},vq={ridge:function(){return new JU.reg.RidgeReg},weightedRidge:function(){return new JU.reg.RidgeWeightedReg},threadedRidge:function(){return new JU.reg.RidgeRegThreaded}},Aq="webgazerGlobalData",xq="webgazerGlobalSettings",Cq={},kq=[];let Sq,Eq,_q,Tq,Iq,Nq,Oq,Dq,Rq,Mq,Fq,Bq;JU.computeValidationBoxSize=function(){var e=nq.videoWidth,t=nq.videoHeight,n=parseInt(nq.style.width),s=parseInt(nq.style.height),r=Math.min(e,t),i=e==Math.max(e,t)?n/e:s/t,a=r*JU.params.faceFeedbackBoxRatio*i;return[(s-a)/2,(n-a)/2,a,a]};let zq=!1,Lq=!1;function Pq(){null!==iq&&uq?(zq||Lq||(Lq=!0,setTimeout((()=>{Sq=nq.videoWidth,Eq=nq.videoHeight,_q=Math.min(Sq,Eq),Tq=_q*JU.params.faceFeedbackBoxRatio,Iq=(Eq-Tq)/2,Nq=(Sq-Tq)/2,Oq=Nq+Tq,Dq=Iq+Tq,zq=!0,Lq=!1}),500)),Rq=Sq-uq.left.imagex,Fq=Sq-uq.right.imagex,Mq=uq.left.imagey,Bq=uq.right.imagey,iq.style.border=zq&&Rq>Nq&&RqNq&&FqIq&&MqIq&&Bq=1e3/JU.params.framerate&&(Hq=jq,hq=Gq(),hq=await hq,fq(hq),$q=!0,hq)){Uq.push(hq);var e=0,t=0,n=Uq.length;for(var s in Uq.data)e+=Uq.get(s).x,t+=Uq.get(s).y;var r=zU.bound({x:e/n,y:t/n});JU.params.storingPoints&&(JU.storePoints(r.x,r.y,qq),50==++qq&&(qq=0)),aq.style.opacity="",aq.style.left=`${r.x}px`,aq.style.top=`${r.y}px`}requestAnimationFrame(Xq)}var Zq=function(e,t,n){if(!JU.params.paused){if(0===bq.length)return null;for(var s in bq)uq&&bq[s].addData(uq,[e,t],n)}},Yq=async function(e){Zq(e.clientX,e.clientY,mq[0]),JU.params.saveDataAcrossSessions&&await async function(){var e=bq[0].getData()||kq;nG().setItem(xq,Cq),nG().setItem(Aq,e)}()},Qq=function(e){if(!JU.params.paused){var t=performance.now();tJU.params.activeCamera.id?{video:{...e.video,deviceId:JU.params.activeCamera.id}}:e;function sj(e){navigator.vendor&&navigator.vendor.indexOf("Apple")>-1?(e.style.opacity=JU.params.showVideo?"1":"0",e.style.display="block"):e.style.display=JU.params.showVideo?"block":"none"}JU._begin=function(e,t){if(!JU.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;dq=[],e.forEach((e=>{"videoinput"===e.kind&&dq.push(e),e.label.includes("FaceTime")&&(t=e.label,n=e.deviceId)})),dq.length&&(JU.params.activeCamera.label=t||dq[0].label,JU.params.activeCamera.id=n||dq[0].deviceId)})(s),0===dq.length)throw t(dq),JSON.stringify({message:"We can't find any video input devices.",devices:s});try{r=await navigator.mediaDevices.getUserMedia(nj(JU.params.camConstraints));const e=r.getVideoTracks()[0],{height:t,width:n}=e.getSettings();JU.videoParamsToReport={height:t,width:n}}catch(e){throw t(dq),e}tj(e?"video":"all",r).then((()=>{dq.length>1&&(e=>{const t=tq,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("%");JU.params.activeCamera.label=s,JU.params.activeCamera.id=t,JU.setCameraConstraints(nj(JU.params.camConstraints))},t.appendChild(n)})(dq)})),JU.params.videoIsOn=!0,e||n(JU)}else t([])}catch(e){throw nq=null,r=null,t([]),s(e),JSON.stringify({error:e,devices:await navigator.mediaDevices.enumerateDevices()})}}));tj("gaze")},JU.isReady=function(){return null!==sq&&sq.width>0},JU.pause=function(){return JU.params.paused=!0,JU},JU.stopLearning=function(e){return ej(e),JU},JU.startLearning=function(e){return Jq(e),JU},JU.resume=async function(){return JU.params.paused?(JU.params.paused=!1,$q=!0,rj.current&&(clearInterval(rj.current),rj.current=void 0,oq=!1,aq.style.backgroundColor="",aq.style.opacity=""),await Xq(),JU):JU},JU.end=function(e=!1){return e&&(Uq=new zU.DataWindow(4),qq=0,jq=null,Hq=-1,zq=!1,JU.params.videoIsOn=!1,setTimeout((()=>{JU.stopVideo(),tq.remove()}),500)),JU},JU.stopVideo=function(){return eq.getTracks()[0].stop(),JU},JU.detectCompatibility=function(){return void 0!==(navigator.mediaDevices.getUserMedia||navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia)},JU.showVideoPreview=function(e){return JU.params.showVideoPreview=e,JU.showVideo(e&&JU.params.showVideo),JU.showFaceOverlay(e&&JU.params.showFaceOverlay),JU.showFaceFeedbackBox(e&&JU.params.showFaceFeedbackBox),JU},JU.showVideo=function(e,t=.8){return JU.params.showVideo=e,nq&&sj(nq),tq&&sj(tq),JU},JU.showFaceOverlay=function(e){return JU.params.showFaceOverlay=e,rq&&(rq.style.display=e?"block":"none"),JU},JU.showFaceFeedbackBox=function(e){return JU.params.showFaceFeedbackBox=e,iq&&(iq.style.display=e?"block":"none"),JU},JU.showPredictionPoints=function(e){return JU.params.showGazeDot=e,aq&&(aq.style.display=e?"block":"none"),JU};const rj={current:void 0};function ij(e,t){sq&&(sq.width=e,sq.height=t),rq&&(rq.width=e,rq.height=t)}JU.popPredictionPoints=function(){return rj.current&&(clearInterval(rj.current),rj.current=void 0,oq=!1),aq&&JU.params.showGazeDot&&(oq=!0,aq.style.backgroundColor="red",aq.style.opacity=1,rj.current=setInterval((()=>{aq.style.opacity-=.02,aq.style.opacity<=.02&&(clearInterval(rj.current),rj.current=void 0,oq=!1,aq.style.backgroundColor="",aq.style.opacity="")}),50)),JU},JU.saveDataAcrossSessions=function(e){return JU.params.saveDataAcrossSessions=e,JU},JU.applyKalmanFilter=function(e){return JU.params.applyKalmanFilter=e,JU},JU.setCameraConstraints=async function(e){if(JU.params.camConstraints=e,eq){JU.pause();try{eq.getVideoTracks().forEach((e=>{e.stop()}));const e=await navigator.mediaDevices.getUserMedia(JU.params.camConstraints);setTimeout((()=>{const t=e.getVideoTracks()[0].getSettings();eq=e,nq.srcObject=e,ij(t.width,t.height),JU.videoParamsToReport={height:t.height,width:t.width}}),1500)}catch(e){return}await JU.resume()}},JU.setStaticVideo=function(e){return e,JU},JU.setVideoViewerSize=function(e,t){JU.params.videoViewerWidth=e,JU.params.videoViewerHeight=t,nq.style.width=e+"px",nq.style.height=t+"px",tq.style.width=e+"px",tq.style.height=t+"px",rq.style.width=e+"px",rq.style.height=t+"px";var n=JU.computeValidationBoxSize();iq.style.top=n[0]+"px",iq.style.left=n[1]+"px",iq.style.width=n[2]+"px",iq.style.height=n[3]+"px"},JU.addMouseEventListeners=function(){return Jq(),JU},JU.removeMouseEventListeners=function(){return ej(),JU},JU.recordScreenPosition=function(e,t,n){return Zq(e,t,n||mq[0]),JU},JU.storePoints=function(e,t,n){lq[n]=e,cq[n]=t},JU.setTracker=function(e){if(void 0===wq[e]){for(var t in wq);return JU}return yq=wq[e](),JU},JU.setRegression=function(e){if(void 0===vq[e]){for(var t in vq);return JU}return kq=bq[0].getData(),(bq=[vq[e]()])[0].setData(kq),JU},JU.addTrackerModule=function(e,t){wq[e]=function(){return new t}},JU.addRegressionModule=function(e,t){vq[e]=function(){return new t}},JU.addRegression=function(e){var t=vq[e]();return kq=bq[0].getData(),t.setData(kq),bq.push(t),JU},JU.setGazeListener=function(e){return fq=e,JU},JU.clearGazeListener=function(){return fq=pq,JU},JU.setVideoElementCanvas=function(e){return sq=e},JU.clearData=async function(){!function(){for(var e in nG().clear(),bq)bq[e].init()}()},JU.getTracker=function(){return yq},JU.getRegression=function(){return bq},JU.getCurrentPrediction=async function(e=0,t=150,n=5){let s=0;const r=[],i=[];for(let e=0;et.x>=0&&t.x<=window.innerWidth?e+t.x:e),0)/i.length),l=Math.round(i.reduce(((e,t)=>t.y>=0&&t.y<=window.innerHeight?e+t.y:e),0)/i.length);return aq&&(aq.style.left=`${o}px`,aq.style.top=`${l}px`),{x:o,y:l,raw:i.map((e=>({x:QU(e.x,0),y:QU(e.y,0)})))}},JU.params.getEventTypes=function(){return mq.slice()},JU.getVideoElementCanvas=function(){return sq},JU.getVideoPreviewToCameraResolutionRatio=function(){return[JU.params.videoViewerWidth/nq.videoWidth,JU.params.videoViewerHeight/nq.videoHeight]},JU.getStoredPoints=function(){return[lq,cq]};const aj=JU;class oj{constructor(e){this.calibrator=e,this.webgazer=aj,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=ie(this.calibrator,{showIcon:!0});Q.A.fire({...t,icon:"error",iconColor:this.calibrator._CONST.COLOR.DARK_RED,showConfirmButton:!1,html:e.length?G.H.RC_errorCameraUseDenied[this.calibrator.L]:G.H.RC_errorNoCamera[this.calibrator.L]})}attachNewCallback(e){this.checkInitialized("gaze",!0)&&this.webgazer.setGazeListener((t=>{if(t){const n=this.getData(t);this.calibrator.newGazePositionData=n,(0,_.nB)(e,n)}}))}async getGazeNow(e={},t=void 0){const n=Object.assign({wait:0,frames:5},e),s=this.getData(await this.webgazer.getCurrentPrediction(0,n.wait,n.frames));return this.calibrator.newGazePositionData=s,this.webgazer.popPredictionPoints(),(0,_.nB)(t,s),s}end(){this.webgazer.end()}}oj.prototype._init=function({greedyLearner:e,framerate:t,toFixedN:n,showVideo:s,showFaceOverlay:r,showGazer:i},a){this.checkInitialized(a)||("gaze"===a&&(this.webgazer.params.greedyLearner=e,this.webgazer.params.framerate=t,this.webgazer.params.getLatestVideoFrameTimestamp=this._getLatestVideoTimestamp.bind(this),this.showGazer(i)),this._toFixedN=n,this.showVideo(s),this.showFaceOverlay(r),this._initialized[a]=!0)},oj.prototype.checkInitialized=function(e,t=!1){return!!(""===e?this._initialized.gaze||this._initialized.distance:this._initialized[e])},oj.prototype.getData=function(e){const 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}},oj.prototype.pause=function(){this.webgazer.pause()},oj.prototype.resume=function(){this.webgazer.resume()},oj.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)},oj.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=()=>{}},oj.prototype._getLatestVideoTimestamp=function(e){this.calibrator._trackingVideoFrameTimestamps.gaze=e},oj.prototype.startStoringPoints=function(){this.webgazer.params.storingPoints=!0},oj.prototype.stopStoringPoints=function(){this.webgazer.params.storingPoints=!1},oj.prototype.startLearning=function(e){this._learning||(this.webgazer.startLearning(e),this._learning=!0)},oj.prototype.stopLearning=function(e){this._learning&&(this.webgazer.stopLearning(e),this._learning=!1)},oj.prototype.showGazer=function(e){this.webgazer.showPredictionPoints(e)},oj.prototype.showVideo=function(e){this.webgazer.showVideo(e,this.calibrator._params.videoOpacity)},oj.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(),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 i={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=i),(0,_.nB)(e,i),i},E.A.prototype.performance=async function(e={},t=void 0){if(!this.checkInitialized())return;const n=Object.assign({testComputation:!0,testFrameCount:180,testObjectCount:1e4,headline:`🚀 ${G.H.RC_performanceTitle[this.L]}`,description:G.H.RC_performanceIntro[this.L]},e);this._addBackground(),this._addBackgroundText(n.headline,n.description),await(0,_.yy)(200);const s=n.testComputation?await this.performanceCompute(null,!0):{value:{computeArrayFillMHz:void 0,computeRandomMHz:void 0}},r=document.createElement("canvas"),i=r.getContext("2d");r.width=window.innerWidth,r.height=window.innerHeight,this.background.appendChild(r);const a=await lj(i),o=await cj(i,n.testFrameCount,n.testObjectCount),l={value:{computeArrayFillMHz:s.value.computeArrayFillMHz,computeRandomMHz:s.value.computeRandomMHz,idealFps:Math.round(6e4/(a.end-a.start)),stressFps:Math.round(1e3*n.testFrameCount/(o.end-o.start))},timestamp:performance.now()};return this.newPerformanceData=l,this._removeBackground(),(0,_.nB)(t,l),l};const lj=()=>{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)}))},cj=async(e,t,n)=>{let s=t;const r=[],i=["#000000","#333333","#999999"];for(let e=0;e{const n=()=>{e.clearRect(0,0,window.innerWidth,window.innerHeight),e.beginPath();for(const t of r)t.move(),t.draw(e);s--,s>0?requestAnimationFrame(n):t({start:a,end:performance.now()})};requestAnimationFrame(n)}))};class uj{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,n="original"){if(this.equipment&&!t)return(0,_.nB)(e);let s,r;this._replaceBackground(),"original"===n?(s="Do you have a ruler or tape measure?",r='\n

          \n Ideally, it should be long enough to measure your viewing distance, but even a 6 inch (15 cm) ruler can be useful. \n Please select the units you\'ll use, or indicate that no ruler or tape measure is available.\n

          \n
          \n \n \n \n
          \n '):(s=`

          ${G.H.RC_TestDistances[this.language.value].replace(/(?:\r\n|\r|\n)/g,"
          ")}

          `,r=`\n

          ${G.H.RC_rulerUnit[this.language.value].replace(/(?:\r\n|\r|\n)/g,"
          ")}

          \n
          \n \n \n \n
          \n `);const{value:i}=await Q.A.fire({...ie(this,{showIcon:!1}),title:s,html:r,preConfirm:()=>{const e=document.querySelector('input[name="equipment"]:checked');return e?e.value:(Q.A.showValidationMessage("Please select an option."),null)},didOpen:()=>{const e=document.querySelectorAll(".custom-input-class"),t=e=>{"Enter"===e.key&&Q.A.clickConfirm()};if(e.forEach((e=>{e.addEventListener("keyup",t)})),this.keypadHandler){const e=U(null,this.keypadHandler,(()=>{e(),Q.A.clickConfirm()}),!1,["return"],this)}this.customKeydownListener=t,this.customInputs=e},willClose:()=>{this.customInputs&&this.customInputs.forEach((e=>{e.removeEventListener("keyup",this.customKeydownListener)}))}});if(!i)return;const a="none"!==i,o={value:{has:a,unit:a?i:null,equipment:a?"":null,length:a?"":null},timestamp:performance.now()};return"original"!==n&&a?await hj(this,o):this.newEquipmentData=o,(0,_.nB)(e)};const hj=async(e,t)=>{const{value:n}=await Q.A.fire({...ie(e,{showIcon:!1}),title:"

          "+G.H.RC_howLong[e.language.value].replace("AAA",t.value.unit)+"

          ",input:"number",inputAttributes:{min:0,step:1},inputPlaceholder:"",inputValidator:n=>new Promise((s=>{(!n?.length||isNaN(n)||parseInt(n)<=0)&&s("Please provide a number for the length of your ruler or tape measure."),e.rulerLength=n,t.value.length=n,e.newEquipmentData=t,s()})),didOpen:()=>{const t=Q.A.getInput(),n=e=>{"Enter"===e.key&&Q.A.clickConfirm()};if(t&&t.addEventListener("keyup",n),e.keypadHandler){const t=U(null,e.keypadHandler,(()=>{t(),Q.A.clickConfirm()}),!1,["return"],void 0)}e.swalKeydownListener=n},willClose:()=>{const t=Q.A.getInput();t&&e.swalKeydownListener&&t.removeEventListener("keydown",e.swalKeydownListener)}});return n};var dj=__webpack_require__(2016),pj=__webpack_require__(980),fj=__webpack_require__.n(pj),mj=__webpack_require__(3890),gj=__webpack_require__.n(mj);E.A.prototype._checkScreenSize=async function(e,t,n){await this.getEquipment((()=>{yj(this,e,t,n)}))};const yj=async(e,t,n,s)=>{if(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(const t of e.background.getElementsByClassName("arrow-two-sided-svg"))t.remove()},{callback:()=>{},content:"Ruler is too short"}],n=await(0,dj.K)(e,...t(fj())),r=await(0,dj.K)(e,...t(gj())),i={};if(n){const t=n.value,s=e.windowWidthPx.value,r=(0,_.Nh)(2.54*s/e.screenPpi.value,1);i.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);i.vertical={...t,calibratorArrowHeightCm:s,arrowHeightPx:n}}if(i.vertical||i.horizontal){const t={value:i,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,r=[],i=(()=>{})){await this.getEquipment((()=>{}),!1,"new"),await bj(this,e,t,n,s,r,i)};const bj=async(e,t,n,s,r,i,a)=>{const o="trackDistance"===s,l=()=>{e._removeBackground(),o||(0,_.nB)(t,n,!1),a()};if(o&&(0,_.nB)(t,n,!1),e.equipment?.value?.has){if("inches"===e.equipment?.value?.unit&&(i=i.map((e=>Math.round(e/2.54)))),0===(i=i.filter((t=>t>0&&t<=e.equipment?.value?.length))).length)return void l();e._removeBackground(),e.pauseNudger(),xj(),wj(),e.calibrateTrackDistanceRequestedCm=i.map((t=>"inches"===e.equipment?.value?.unit?Math.round(2.54*t):t)),e.calibrateTrackDistanceMeasuredCm=[];for(let t=0;t
          "),!1,"","left",G.H.RC_produceDistanceTitle2[e.language.value].replace("222",s).replace("333",i.length));e._replaceBackground(r),await new Promise((t=>{document.addEventListener("keydown",(function n(s){if("Enter"===s.key){const s=e.viewingDistanceAllowedPreciseBool?e.viewingDistanceCm.value.toFixed(1):Math.round(e.viewingDistanceCm.value);e.calibrateTrackDistanceMeasuredCm.push(s),document.removeEventListener("keydown",n),t()}}));const n=U(null,e.keypadHandler,(()=>{const s=e.viewingDistanceAllowedPreciseBool?e.viewingDistanceCm.value.toFixed(1):Math.round(e.viewingDistanceCm.value);e.calibrateTrackDistanceMeasuredCm.push(s),n(),t()}),!1,["return"],e)}))}e.resumeNudger(),kj(),vj()}l()},wj=()=>{if(document.getElementById("viewing-distance-div"))return;const e=document.createElement("viewing-distance-div");e.id="calibration-trackDistance-check-viewingDistance-container",e.className="calibration-trackDistance-check-viewingDistance-container";const t=document.createElement("p");t.id="viewing-distance-p",t.className="calibration-trackDistance-check-viewingDistance";const n=document.createElement("p");n.id="calibration-trackDistance-check-viewingDistance-units",n.className="calibration-trackDistance-check-viewingDistance-units",e.appendChild(t),e.appendChild(n),document.body.appendChild(e)},vj=()=>{const e=document.getElementById("viewing-distance-p"),t=document.getElementById("calibration-trackDistance-check-viewingDistance-units"),n=document.getElementById("calibration-trackDistance-check-viewingDistance-container");e&&e.remove(),t&&t.remove(),n&&n.remove()},Aj=(e,t)=>{const n=document.getElementById("viewing-distance-p");if(!n)return;n.innerText=e;const s=document.getElementById("calibration-trackDistance-check-viewingDistance-units");s&&(s.innerText=t,((e,t)=>{const n=e.parentElement,s=n.offsetWidth,r=n.offsetHeight;let i=s;for(e.style.fontSize=`${i}px`,t.style.fontSize=.5*i+"px";(e.scrollWidth>s||t.scrollWidth>s||e.offsetHeight+t.offsetHeight>r)&&i>10;)i-=1,e.style.fontSize=`${i}px`,t.style.fontSize=.5*i+"px"})(n,s))},xj=()=>{if(document.getElementById("custom-progress-bar"))return;const e=document.createElement("div");e.id="custom-progress-bar",e.className="calibration-trackDistance-check-progessBar-container";const t=document.createElement("div");t.id="calibration-trackDistance-check-progessBar",t.className="calibration-trackDistance-check-progessBar";const n=document.createElement("p");n.id="calibration-trackDistance-check-progessBar-text",n.className="calibration-trackDistance-check-progessBar-text",e.appendChild(t),e.appendChild(n),document.body.appendChild(e)},Cj=(e,t,n)=>{const s=document.getElementById("calibration-trackDistance-check-progessBar"),r=document.getElementById("calibration-trackDistance-check-progessBar-text");if(!s||!r)return;const i=Math.min(100,Math.max(0,e));s.style.width=`${i}%`,r.innerText=`${t}/${n}`},kj=()=>{const e=document.getElementById("custom-progress-bar");e&&document.body.removeChild(e)};var Sj=__webpack_require__(7790),Ej=__webpack_require__(627),_j=__webpack_require__.n(Ej),Tj=__webpack_require__(8110),Ij=__webpack_require__.n(Tj),Nj=__webpack_require__(5072),Oj=__webpack_require__.n(Nj),Dj=__webpack_require__(7825),Rj=__webpack_require__.n(Dj),Mj=__webpack_require__(7659),Fj=__webpack_require__.n(Mj),Bj=__webpack_require__(5056),zj=__webpack_require__.n(Bj),Lj=__webpack_require__(540),Pj=__webpack_require__.n(Lj),Vj=__webpack_require__(1113),Wj=__webpack_require__.n(Vj),Gj=__webpack_require__(4636),Uj={};Uj.styleTagTransform=Wj(),Uj.setAttributes=zj(),Uj.insert=Fj().bind(null,"head"),Uj.domAPI=Rj(),Uj.insertStyleElement=Pj();Oj()(Gj.A,Uj);Gj.A&&Gj.A.locals&&Gj.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,eH(this),!0)},E.A.prototype.resetPanel=function(e=null,t=null,n=null,s=null,r=null){if(!this._panelStatus.hasPanel)return!1;const i=e||[...this._panel.panelTasks],a=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(i,t,a,o,l)):(eH(this),this.panel(i,this._panel.panelParent,a,o,l,!0))},E.A.prototype.panel=async function(e,t,n={},s=null,r=null,i=!1){if(this._panelStatus.hasPanel^i)return!1;if(!Hj(e))return!1;const a=document.querySelector(t);if(!a)return!1;const o=Object.assign({headline:G.H.RC_panelTitle[this.L],description:G.H.RC_panelIntro[this.L],showNextButton:!1,nextHeadline:G.H.RC_panelTitleNext[this.L],nextDescription:G.H.RC_panelIntroNext[this.L],nextButton:G.H.RC_panelButton[this.L],color:"#3490de",debug:!1,i18n:!0,_demoActivateAll:!1},n),l=qe(o.color).darken(20).toString();document.documentElement.style.setProperty("--rc-panel-theme-color",o.color),document.documentElement.style.setProperty("--rc-panel-darken-color",l),document.documentElement.style.setProperty("--rc-panel-theme-color-semi",`${o.color}66`),document.documentElement.style.setProperty("--rc-panel-darken-color-semi",`${l}88`);const c=document.createElement("div");c.className=c.id="rc-panel",this.LD===this._CONST.RTL?c.className+=" rc-lang-rtl":c.className+=" rc-lang-ltr",o.i18n&&(c.innerHTML+='
          '),c.innerHTML+=`

          ${o.headline}

          `,c.innerHTML+=`

          ${o.description}

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

          ${r}

          `:""}

          ${Number(t)+1}  ${G.H[qj[Qj(n)].phraseHandle][e.L]}

          ${r.length?`

          ${r} ${i}

          `:""}`,a},Kj=(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},Xj=(e,t,n)=>{if(t<640){e.classList.add("rc-panel-steps-s"),e.classList.remove("rc-panel-steps-l");for(const t of e.childNodes)t.classList.add(`rc-lang-${n.toLowerCase()}`)}else{e.classList.add("rc-panel-steps-l"),e.classList.remove("rc-panel-steps-s");for(const t of e.childNodes)t.classList.remove("rc-lang-ltr"),t.classList.remove("rc-lang-rtl")}},Zj=(e,t,n,s,r)=>{document.querySelectorAll(".rc-panel-step").forEach(((i,a)=>{const o=Number(i.dataset.index);if(s._demoActivateAll)i.onclick=()=>{e[Qj(n[a])](...Jj(n[a])),Yj(a),t.finished.push(Qj(n[a]));for(const e of n)if(!t.finished.includes(Qj(e)))return;const 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()})}},U(i,e.keypadHandler,null,!0,["return"],e);else if(o===t.index)if(i.classList.replace("rc-panel-step-inactive","rc-panel-step-active"),i.focus(),o!==n.length)o!==n.length-1||s.showNextButton?i.onclick=()=>{e[Qj(n[t.index])](...Jj(n[t.index],(()=>{Yj(t.index),t.index++,Zj(e,t,n,s,r)})))}:i.onclick=()=>{e[Qj(n[t.index])](...Jj(n[t.index],(()=>{Yj(t.index)}),r,(()=>{e._panelStatus.panelFinished=!0})))},U(i,e.keypadHandler,null,!0,["return"],e);else if(o===n.length&&s.showNextButton){const{headline:t,nextHeadline:n,description:a,nextDescription:o}=s;t!==n&&(document.querySelector("#rc-panel-title").innerHTML=n),a!==o&&(document.querySelector("#rc-panel-description").innerHTML=o),i.onclick=()=>{e._panelStatus.panelFinished=!0,(0,_.nB)(r,{timestamp:performance.now()})},U(i,e.keypadHandler,null,!0,["return"],e)}}))},Yj=e=>{const t=document.querySelectorAll(".rc-panel-step");for(const n of t)Number(n.dataset.index)===e&&(n.classList.replace("rc-panel-step-todo","rc-panel-step-finished"),n.classList.replace("rc-panel-step-active","rc-panel-step-inactive"))},Qj=e=>"string"==typeof e?e:e.name,Jj=(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},eH=e=>{e._panelStatus.panelResolveIntervals.map((e=>clearInterval(e))),e._panelStatus.panelResolveIntervals=[]},tH=(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";const 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;const 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 nH=__webpack_require__(9725),sH={};sH.styleTagTransform=Wj(),sH.setAttributes=zj(),sH.insert=Fj().bind(null,"head"),sH.domAPI=Rj(),sH.insertStyleElement=Pj();Oj()(nH.A,sH);nH.A&&nH.A.locals&&nH.A.locals;var rH=__webpack_require__(5151),iH={};iH.styleTagTransform=Wj(),iH.setAttributes=zj(),iH.insert=Fj().bind(null,"head"),iH.domAPI=Rj(),iH.insertStyleElement=Pj();Oj()(rH.A,iH);rH.A&&rH.A.locals&&rH.A.locals;var aH=__webpack_require__(2945),oH={};oH.styleTagTransform=Wj(),oH.setAttributes=zj(),oH.insert=Fj().bind(null,"head"),oH.domAPI=Rj(),oH.insertStyleElement=Pj();Oj()(aH.A,oH);aH.A&&aH.A.locals&&aH.A.locals;var lH=__webpack_require__(9057),cH={};cH.styleTagTransform=Wj(),cH.setAttributes=zj(),cH.insert=Fj().bind(null,"head"),cH.domAPI=Rj(),cH.insertStyleElement=Pj();Oj()(lH.A,cH);lH.A&&lH.A.locals&&lH.A.locals;var uH=__webpack_require__(4889),hH={};hH.styleTagTransform=Wj(),hH.setAttributes=zj(),hH.insert=Fj().bind(null,"head"),hH.domAPI=Rj(),hH.insertStyleElement=Pj();Oj()(uH.A,hH);uH.A&&uH.A.locals&&uH.A.locals;var dH=__webpack_require__(2636),pH={};pH.styleTagTransform=Wj(),pH.setAttributes=zj(),pH.insert=Fj().bind(null,"head"),pH.domAPI=Rj(),pH.insertStyleElement=Pj();Oj()(dH.A,pH);dH.A&&dH.A.locals&&dH.A.locals;var fH=__webpack_require__(2921),mH={};mH.styleTagTransform=Wj(),mH.setAttributes=zj(),mH.insert=Fj().bind(null,"head"),mH.domAPI=Rj(),mH.insertStyleElement=Pj();Oj()(fH.A,mH);fH.A&&fH.A.locals&&fH.A.locals;var gH=__webpack_require__(7271),yH={};yH.styleTagTransform=Wj(),yH.setAttributes=zj(),yH.insert=Fj().bind(null,"head"),yH.domAPI=Rj(),yH.insertStyleElement=Pj();Oj()(gH.A,yH);gH.A&&gH.A.locals&&gH.A.locals;var bH=__webpack_require__(2551),wH={};wH.styleTagTransform=Wj(),wH.setAttributes=zj(),wH.insert=Fj().bind(null,"head"),wH.domAPI=Rj(),wH.insertStyleElement=Pj();Oj()(bH.A,wH);bH.A&&bH.A.locals&&bH.A.locals;var vH=__webpack_require__(8470),AH={};AH.styleTagTransform=Wj(),AH.setAttributes=zj(),AH.insert=Fj().bind(null,"head"),AH.domAPI=Rj(),AH.insertStyleElement=Pj();Oj()(vH.A,AH);vH.A&&vH.A.locals&&vH.A.locals;var xH=__webpack_require__(2535),CH={};CH.styleTagTransform=Wj(),CH.setAttributes=zj(),CH.insert=Fj().bind(null,"head"),CH.domAPI=Rj(),CH.insertStyleElement=Pj();Oj()(xH.A,CH);xH.A&&xH.A.locals&&xH.A.locals;var kH=__webpack_require__(663),SH={};SH.styleTagTransform=Wj(),SH.setAttributes=zj(),SH.insert=Fj().bind(null,"head"),SH.domAPI=Rj(),SH.insertStyleElement=Pj();Oj()(kH.A,SH);kH.A&&kH.A.locals&&kH.A.locals;var EH=__webpack_require__(5319),_H={};_H.styleTagTransform=Wj(),_H.setAttributes=zj(),_H.insert=Fj().bind(null,"head"),_H.domAPI=Rj(),_H.insertStyleElement=Pj();Oj()(EH.A,_H);EH.A&&EH.A.locals&&EH.A.locals;var TH=__webpack_require__(290),IH={};IH.styleTagTransform=Wj(),IH.setAttributes=zj(),IH.insert=Fj().bind(null,"head"),IH.domAPI=Rj(),IH.insertStyleElement=Pj();Oj()(TH.A,IH);TH.A&&TH.A.locals&&TH.A.locals;const NH=new E.A;NH.gazeTracker=new oj(NH);const OH=NH})(),__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 603dad9..70909a2 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.31 + * EasyEyes Remote Calibrator (remote-calibrator) Version 0.7.32 * https://github.com/EasyEyes/remote-calibrator * * Copyright 2024 New York University. All Rights Reserved diff --git a/package.json b/package.json index 6b7f4bb..9fcab8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remote-calibrator", - "version": "0.7.31", + "version": "0.7.32", "description": "Useful calibration tools for remote psychophysics experiments", "main": "lib/RemoteCalibrator.min.js", "directories": {