From 5b3a258c3c39daae6cfd652612f5a69fb1ce9ee5 Mon Sep 17 00:00:00 2001 From: bherr2 Date: Wed, 9 Feb 2022 18:03:23 +0000 Subject: [PATCH] Production deploy -- 92ec1ecc94df3ba3b9bf3ef6396e05cb5ab7ce7c --- rui/main.js | 2 +- rui/wc.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rui/main.js b/rui/main.js index a07e6a51a..dca32b127 100644 --- a/rui/main.js +++ b/rui/main.js @@ -1 +1 @@ -var ZRe=Object.defineProperty,QRe=Object.defineProperties,JRe=Object.getOwnPropertyDescriptors,l9=Object.getOwnPropertySymbols,eke=Object.prototype.hasOwnProperty,tke=Object.prototype.propertyIsEnumerable,zi=Math.pow,c9=(pt,We,Ve)=>We in pt?ZRe(pt,We,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):pt[We]=Ve,J=(pt,We)=>{for(var Ve in We||(We={}))eke.call(We,Ve)&&c9(pt,Ve,We[Ve]);if(l9)for(var Ve of l9(We))tke.call(We,Ve)&&c9(pt,Ve,We[Ve]);return pt},an=(pt,We)=>QRe(pt,JRe(We));(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{517:(pt,We)=>{"use strict";var _t=(()=>{return(It=_t||(_t={})).typeOfFunction="function",It.boolTrue=!0,_t;var It})();function k(It,Pt,ft){if(!ft||typeof ft.value!==_t.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+Pt+"> is not a method!");return{configurable:_t.boolTrue,get:function(){var qt=ft.value.bind(this);return Object.defineProperty(this,Pt,{value:qt,configurable:_t.boolTrue,writable:_t.boolTrue}),qt}}}We.ak=k,We.ZP=k},266:(pt,We,Ve)=>{pt.exports={ResizeSensor:Ve(835),ElementQueries:Ve(845)}},845:function(pt,We,Ve){"use strict";var _t,k,It;"undefined"!=typeof window&&window,k=[Ve(835)],void 0!==(It="function"==typeof(_t=function(Pt){var ft=function(){var yt,dn={},En=[];function Fe(Ae){Ae||(Ae=document.documentElement);var oe=window.getComputedStyle(Ae,null).fontSize;return parseFloat(oe)||16}function $t(Ae,oe){var kt=oe.split(/\d/),Bt=kt[kt.length-1];switch(oe=parseFloat(oe),Bt){case"px":return oe;case"em":return oe*Fe(Ae);case"rem":return oe*Fe();case"vw":return oe*document.documentElement.clientWidth/100;case"vh":return oe*document.documentElement.clientHeight/100;case"vmin":case"vmax":var Gt=document.documentElement.clientWidth/100,oi=document.documentElement.clientHeight/100;return oe*(0,Math["vmin"===Bt?"min":"max"])(Gt,oi);default:return oe}}function Ne(Ae,oe){this.element=Ae;var kt,Bt,Gt,oi,Oi,we,rn,Ln,be=["min-width","min-height","max-width","max-height"];this.call=function(){for(kt in Gt=function(Ae){if(!Ae.getBoundingClientRect)return{width:Ae.offsetWidth,height:Ae.offsetHeight};var oe=Ae.getBoundingClientRect();return{width:Math.round(oe.width),height:Math.round(oe.height)}}(this.element),we={},dn[oe])!dn[oe].hasOwnProperty(kt)||(oi=$t(this.element,(Bt=dn[oe][kt]).value),Oi="width"===Bt.property?Gt.width:Gt.height,rn="","min"===Bt.mode&&Oi>=oi&&(rn+=Bt.value),"max"===Bt.mode&&Oi<=oi&&(rn+=Bt.value),we[Ln=Bt.mode+"-"+Bt.property]||(we[Ln]=""),rn&&-1===(" "+we[Ln]+" ").indexOf(" "+rn+" ")&&(we[Ln]+=" "+rn));for(var Ii in be)!be.hasOwnProperty(Ii)||(we[be[Ii]]?this.element.setAttribute(be[Ii],we[be[Ii]].substr(1)):this.element.removeAttribute(be[Ii]))}}function Ie(Ae,oe){Ae.elementQueriesSetupInformation||(Ae.elementQueriesSetupInformation=new Ne(Ae,oe)),Ae.elementQueriesSensor||(Ae.elementQueriesSensor=new Pt(Ae,function(){Ae.elementQueriesSetupInformation.call()}))}function pi(Ae,oe,kt,Bt){if(void 0===dn[Ae]){dn[Ae]=[];var Gt=En.length;yt.innerHTML+="\n"+Ae+" {animation: 0.1s element-queries;}",yt.innerHTML+="\n"+Ae+" > .resize-sensor {min-width: "+Gt+"px;}",En.push(Ae)}dn[Ae].push({mode:oe,property:kt,value:Bt})}function qe(Ae){var oe;if(document.querySelectorAll&&(oe=Ae?Ae.querySelectorAll.bind(Ae):document.querySelectorAll.bind(document)),!oe&&"undefined"!=typeof $$&&(oe=$$),!oe&&"undefined"!=typeof jQuery&&(oe=jQuery),!oe)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return oe}function Rt(Ae){var oe=[],kt=[],Bt=[],Gt=0,oi=-1,Oi=[];for(var we in Ae.children)if(Ae.children.hasOwnProperty(we)&&Ae.children[we].tagName&&"img"===Ae.children[we].tagName.toLowerCase()){oe.push(Ae.children[we]);var rn=Ae.children[we].getAttribute("min-width")||Ae.children[we].getAttribute("data-min-width"),Ln=Ae.children[we].getAttribute("data-src")||Ae.children[we].getAttribute("url");Bt.push(Ln),kt.push({minWidth:rn}),rn?Ae.children[we].style.display="none":(Gt=oe.length-1,Ae.children[we].style.display="block")}function Ii(){var Sr,Ft=!1;for(Sr in oe)!oe.hasOwnProperty(Sr)||kt[Sr].minWidth&&Ae.offsetWidth>kt[Sr].minWidth&&(Ft=Sr);if(Ft||(Ft=Gt),oi!==Ft)if(Oi[Ft])oe[oi].style.display="none",oe[Ft].style.display="block",oi=Ft;else{var os=new Image;os.onload=function(){oe[Ft].src=Bt[Ft],oe[oi].style.display="none",oe[Ft].style.display="block",Oi[Ft]=!0,oi=Ft},os.src=Bt[Ft]}else oe[Ft].src=Bt[Ft]}oi=Gt,Ae.resizeSensorInstance=new Pt(Ae,Ii),Ii()}var $n=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,Ci=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function yi(Ae){var oe,kt,Bt,Gt;for(Ae=Ae.replace(/'/g,'"');null!==(oe=$n.exec(Ae));)for(kt=oe[1]+oe[3],Bt=oe[2];null!==(Gt=Ci.exec(Bt));)pi(kt,Gt[1],Gt[2],Gt[3])}function vi(Ae){var oe="";if(Ae)if("string"==typeof Ae)(-1!==(Ae=Ae.toLowerCase()).indexOf("min-width")||-1!==Ae.indexOf("max-width"))&&yi(Ae);else for(var kt=0,Bt=Ae.length;kt img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",yt.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(yt),Er=!0);for(var oe=0,kt=document.styleSheets.length;oe=je.status}function qt(Fe){try{Fe.dispatchEvent(new MouseEvent("click"))}catch($t){var je=document.createEvent("MouseEvents");je.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),Fe.dispatchEvent(je)}}var yt="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,dn=yt.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),En=yt.saveAs||("object"!=typeof window||window!==yt?function(){}:"download"in HTMLAnchorElement.prototype&&!dn?function(Fe,je,$t){var Ne=yt.URL||yt.webkitURL,Ie=document.createElement("a");Ie.download=je=je||Fe.name||"download",Ie.rel="noopener","string"==typeof Fe?(Ie.href=Fe,Ie.origin===location.origin?qt(Ie):ft(Ie.href)?Pt(Fe,je,$t):qt(Ie,Ie.target="_blank")):(Ie.href=Ne.createObjectURL(Fe),setTimeout(function(){Ne.revokeObjectURL(Ie.href)},4e4),setTimeout(function(){qt(Ie)},0))}:"msSaveOrOpenBlob"in navigator?function(Fe,je,$t){if(je=je||Fe.name||"download","string"!=typeof Fe)navigator.msSaveOrOpenBlob(function(Fe,je){return void 0===je?je={autoBom:!1}:"object"!=typeof je&&(console.warn("Deprecated: Expected third argument to be a object"),je={autoBom:!je}),je.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(Fe.type)?new Blob(["\ufeff",Fe],{type:Fe.type}):Fe}(Fe,$t),je);else if(ft(Fe))Pt(Fe,je,$t);else{var Ne=document.createElement("a");Ne.href=Fe,Ne.target="_blank",setTimeout(function(){qt(Ne)})}}:function(Fe,je,$t,Ne){if((Ne=Ne||open("","_blank"))&&(Ne.document.title=Ne.document.body.innerText="downloading..."),"string"==typeof Fe)return Pt(Fe,je,$t);var Ie="application/octet-stream"===Fe.type,pi=/constructor/i.test(yt.HTMLElement)||yt.safari,qe=/CriOS\/[\d]+/.test(navigator.userAgent);if((qe||Ie&&pi||dn)&&"undefined"!=typeof FileReader){var Jn=new FileReader;Jn.onloadend=function(){var $n=Jn.result;$n=qe?$n:$n.replace(/^data:[^;]*;/,"data:attachment/file;"),Ne?Ne.location.href=$n:location=$n,Ne=null},Jn.readAsDataURL(Fe)}else{var Rt=yt.URL||yt.webkitURL,nn=Rt.createObjectURL(Fe);Ne?Ne.location=nn:location.href=nn,Ne=null,setTimeout(function(){Rt.revokeObjectURL(nn)},4e4)}});yt.saveAs=En.saveAs=En,pt.exports=En})?Ve.apply(We,[]):Ve)&&(pt.exports=k)},524:(pt,We,Ve)=>{var _t;!function(k,It,Pt,ft){"use strict";var qe,qt=["","webkit","Moz","MS","ms","o"],yt=It.createElement("div"),En=Math.round,Fe=Math.abs,je=Date.now;function $t(A,R,j){return setTimeout($n(A,j),R)}function Ne(A,R,j){return!!Array.isArray(A)&&(Ie(A,j[R],j),!0)}function Ie(A,R,j){var te;if(A)if(A.forEach)A.forEach(R,j);else if(A.length!==ft)for(te=0;te\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",hn=k.console&&(k.console.warn||k.console.log);return hn&&hn.call(k.console,te,Re),A.apply(this,arguments)}}qe="function"!=typeof Object.assign?function(R){if(R===ft||null===R)throw new TypeError("Cannot convert undefined or null to object");for(var j=Object(R),te=1;te-1}function kt(A){return A.trim().split(/\s+/g)}function Bt(A,R,j){if(A.indexOf&&!j)return A.indexOf(R);for(var te=0;teGr[R]}):te.sort()),te}function Oi(A,R){for(var j,te,Me=R[0].toUpperCase()+R.slice(1),Re=0;Re1&&!j.firstMultiple?j.firstMultiple=La(R):1===Me&&(j.firstMultiple=!1);var Re=j.firstInput,hn=j.firstMultiple,cr=hn?hn.center:Re.center,mr=R.center=ao(te);R.timeStamp=je(),R.deltaTime=R.timeStamp-Re.timeStamp,R.angle=lo(cr,mr),R.distance=ls(cr,mr),function(A,R){var j=R.center,te=A.offsetDelta||{},Me=A.prevDelta||{},Re=A.prevInput||{};(1===R.eventType||4===Re.eventType)&&(Me=A.prevDelta={x:Re.deltaX||0,y:Re.deltaY||0},te=A.offsetDelta={x:j.x,y:j.y}),R.deltaX=Me.x+(j.x-te.x),R.deltaY=Me.y+(j.y-te.y)}(j,R),R.offsetDirection=ki(R.deltaX,R.deltaY);var Gr=Ba(R.deltaTime,R.deltaX,R.deltaY);R.overallVelocityX=Gr.x,R.overallVelocityY=Gr.y,R.overallVelocity=Fe(Gr.x)>Fe(Gr.y)?Gr.x:Gr.y,R.scale=hn?function(A,R){return ls(R[0],R[1],Fr)/ls(A[0],A[1],Fr)}(hn.pointers,te):1,R.rotation=hn?function(A,R){return lo(R[1],R[0],Fr)+lo(A[1],A[0],Fr)}(hn.pointers,te):0,R.maxPointers=j.prevInput?R.pointers.length>j.prevInput.maxPointers?R.pointers.length:j.prevInput.maxPointers:R.pointers.length,function(A,R){var Me,Re,hn,cr,j=A.lastInterval||R,te=R.timeStamp-j.timeStamp;if(8!=R.eventType&&(te>25||j.velocity===ft)){var mr=R.deltaX-j.deltaX,Gr=R.deltaY-j.deltaY,cn=Ba(te,mr,Gr);Re=cn.x,hn=cn.y,Me=Fe(cn.x)>Fe(cn.y)?cn.x:cn.y,cr=ki(mr,Gr),A.lastInterval=R}else Me=j.velocity,Re=j.velocityX,hn=j.velocityY,cr=j.direction;R.velocity=Me,R.velocityX=Re,R.velocityY=hn,R.direction=cr}(j,R);var cn=A.element;Ae(R.srcEvent.target,cn)&&(cn=R.srcEvent.target),R.target=cn}(A,j),A.emit("hammer.input",j),A.recognize(j),A.session.prevInput=j}function La(A){for(var R=[],j=0;j=Fe(R)?A<0?2:4:R<0?8:16}function ls(A,R,j){j||(j=$r);var te=R[j[0]]-A[j[0]],Me=R[j[1]]-A[j[1]];return Math.sqrt(te*te+Me*Me)}function lo(A,R,j){return j||(j=$r),180*Math.atan2(R[j[1]]-A[j[1]],R[j[0]]-A[j[0]])/Math.PI}ei.prototype={handler:function(){},init:function(){this.evEl&&vi(this.element,this.evEl,this.domHandler),this.evTarget&&vi(this.target,this.evTarget,this.domHandler),this.evWin&&vi(Ln(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Er(this.element,this.evEl,this.domHandler),this.evTarget&&Er(this.target,this.evTarget,this.domHandler),this.evWin&&Er(Ln(this.element),this.evWin,this.domHandler)}};var lu={mousedown:1,mousemove:2,mouseup:4},cu="mousedown",uu="mousemove mouseup";function wl(){this.evEl=cu,this.evWin=uu,this.pressed=!1,ei.apply(this,arguments)}nn(wl,ei,{handler:function(R){var j=lu[R.type];1&j&&0===R.button&&(this.pressed=!0),2&j&&1!==R.which&&(j=4),this.pressed&&(4&j&&(this.pressed=!1),this.callback(this.manager,j,{pointers:[R],changedPointers:[R],pointerType:as,srcEvent:R}))}});var pc={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ud={2:os,3:"pen",4:as,5:"kinect"},du="pointerdown",Vs="pointermove pointerup pointercancel";function Ye(){this.evEl=du,this.evWin=Vs,ei.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}k.MSPointerEvent&&!k.PointerEvent&&(du="MSPointerDown",Vs="MSPointerMove MSPointerUp MSPointerCancel"),nn(Ye,ei,{handler:function(R){var j=this.store,te=!1,Me=R.type.toLowerCase().replace("ms",""),Re=pc[Me],hn=ud[R.pointerType]||R.pointerType,cr=hn==os,mr=Bt(j,R.pointerId,"pointerId");1&Re&&(0===R.button||cr)?mr<0&&(j.push(R),mr=j.length-1):12&Re&&(te=!0),!(mr<0)&&(j[mr]=R,this.callback(this.manager,Re,{pointers:j,changedPointers:[R],pointerType:hn,srcEvent:R}),te&&j.splice(mr,1))}});var hu={touchstart:1,touchmove:2,touchend:4,touchcancel:8},G="touchstart",q="touchstart touchmove touchend touchcancel";function Z(){this.evTarget=G,this.evWin=q,this.started=!1,ei.apply(this,arguments)}function T(A,R){var j=Gt(A.touches),te=Gt(A.changedTouches);return 12&R&&(j=oi(j.concat(te),"identifier",!0)),[j,te]}nn(Z,ei,{handler:function(R){var j=hu[R.type];if(1===j&&(this.started=!0),this.started){var te=T.call(this,R,j);12&j&&te[0].length-te[1].length==0&&(this.started=!1),this.callback(this.manager,j,{pointers:te[0],changedPointers:te[1],pointerType:os,srcEvent:R})}}});var D={touchstart:1,touchmove:2,touchend:4,touchcancel:8},B="touchstart touchmove touchend touchcancel";function K(){this.evTarget=B,this.targetIds={},ei.apply(this,arguments)}function H(A,R){var j=Gt(A.touches),te=this.targetIds;if(3&R&&1===j.length)return te[j[0].identifier]=!0,[j,j];var Me,Re,hn=Gt(A.changedTouches),cr=[],mr=this.target;if(Re=j.filter(function(Gr){return Ae(Gr.target,mr)}),1===R)for(Me=0;Me-1&&te.splice(Re,1)},2500)}}function Cn(A){for(var R=A.srcEvent.clientX,j=A.srcEvent.clientY,te=0;te-1&&this.requireFail.splice(R,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(A){return!!this.simultaneous[A.id]},emit:function(A){var R=this,j=this.state;function te(Me){R.manager.emit(Me,A)}j<8&&te(R.options.event+ae(j)),te(R.options.event),A.additionalEvent&&te(A.additionalEvent),j>=8&&te(R.options.event+ae(j))},tryEmit:function(A){if(this.canEmit())return this.emit(A);this.state=32},canEmit:function(){for(var A=0;AR.threshold&&Me&R.direction},attrTest:function(A){return ir.prototype.attrTest.call(this,A)&&(2&this.state||!(2&this.state)&&this.directionTest(A))},emit:function(A){this.pX=A.deltaX,this.pY=A.deltaY;var R=r_(A.direction);R&&(A.additionalEvent=this.options.event+R),this._super.emit.call(this,A)}}),nn(gu,ir,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||2&this.state)},emit:function(A){1!==A.scale&&(A.additionalEvent=this.options.event+(A.scale<1?"in":"out")),this._super.emit.call(this,A)}}),nn(Th,Va,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(A){var R=this.options,j=A.pointers.length===R.pointers,te=A.distanceR.time;if(this._input=A,!te||!j||12&A.eventType&&!Me)this.reset();else if(1&A.eventType)this.reset(),this._timer=$t(function(){this.state=8,this.tryEmit()},R.time,this);else if(4&A.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(A){8===this.state&&(A&&4&A.eventType?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=je(),this.manager.emit(this.options.event,this._input)))}}),nn(mu,ir,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||2&this.state)}}),nn(la,ir,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _c.prototype.getTouchAction.call(this)},attrTest:function(A){var j,R=this.options.direction;return 30&R?j=A.overallVelocity:6&R?j=A.overallVelocityX:24&R&&(j=A.overallVelocityY),this._super.attrTest.call(this,A)&&R&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers==this.options.pointers&&Fe(j)>this.options.velocity&&4&A.eventType},emit:function(A){var R=r_(A.offsetDirection);R&&this.manager.emit(this.options.event+R,A),this.manager.emit(this.options.event,A)}}),nn(Sl,Va,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Hi]},process:function(A){var R=this.options,j=A.pointers.length===R.pointers,te=A.distance"']/g,Vs=RegExp(ud.source),Ye=RegExp(du.source),hu=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,D=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,K=RegExp(B.source),H=/^\s+/,se=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,de=/\{\n\/\* \[wrapped with (.+)\] \*/,Be=/,? & /,Kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cn=/[()=,{}\[\]\/\s]/,jt=/\\(\\)?/g,gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zt=/\w*$/,ti=/^[-+]0x[0-9a-f]+$/i,Hi=/^0b[01]+$/i,$i=/^\[object .+?Constructor\]$/,ln=/^0o[0-7]+$/i,bi=/^(?:0|[1-9]\d*)$/,gc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,co=/($^)/,dd=/['\n\r\u2028\u2029\\]/g,El="\\ud800-\\udfff",Gi="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xn="\\u2700-\\u27bf",pu="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",ir="\\ufe0e\\ufe0f",_c="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Th="["+El+"]",mu="["+_c+"]",la="["+Gi+"]",Sl="\\d+",ja="["+xn+"]",mp="["+pu+"]",vt="[^"+El+_c+Sl+xn+pu+Ee+"]",Ml="\\ud83c[\\udffb-\\udfff]",ca="[^"+El+"]",hd="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",R="["+Ee+"]",j="\\u200d",te="(?:"+mp+"|"+vt+")",Me="(?:"+R+"|"+vt+")",Re="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",hn="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",cr="(?:"+la+"|"+Ml+")?",mr="["+ir+"]?",f1=mr+cr+"(?:"+j+"(?:"+[ca,hd,A].join("|")+")"+mr+cr+")*",fd="(?:"+[ja,hd,A].join("|")+")"+f1,gi="(?:"+[ca+la+"?",la,hd,A,Th].join("|")+")",yp=RegExp("['\u2019]","g"),s_=RegExp(la,"g"),Ah=RegExp(Ml+"(?="+Ml+")|"+gi+f1,"g"),h0=RegExp([R+"?"+mp+"+"+Re+"(?="+[mu,R,"$"].join("|")+")",Me+"+"+hn+"(?="+[mu,R+te,"$"].join("|")+")",R+"?"+te+"+"+Re,R+"+"+hn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sl,fd].join("|"),"g"),p1=RegExp("["+j+El+Gi+ir+"]"),xl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Dh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],g1=-1,Le={};Le[ao]=Le[Ba]=Le[ki]=Le[ls]=Le[lo]=Le[fc]=Le[Cl]=Le[lu]=Le[cu]=!0,Le[as]=Le[sa]=Le[bl]=Le[ai]=Le[La]=Le[ot]=Le[Pi]=Le[oa]=Le[Ri]=Le[Hr]=Le[nr]=Le[$r]=Le[Fr]=Le[ei]=Le[ci]=!1;var wi={};wi[as]=wi[sa]=wi[bl]=wi[La]=wi[ai]=wi[ot]=wi[ao]=wi[Ba]=wi[ki]=wi[ls]=wi[lo]=wi[Ri]=wi[Hr]=wi[nr]=wi[$r]=wi[Fr]=wi[ei]=wi[hc]=wi[fc]=wi[Cl]=wi[lu]=wi[cu]=!0,wi[Pi]=wi[oa]=wi[ci]=!1;var xe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},m1=parseFloat,m0=parseInt,he="object"==typeof global&&global&&global.Object===Object&&global,cs="object"==typeof self&&self&&self.Object===Object&&self,Wn=he||cs||Function("return this")(),Tl=We&&!We.nodeType&&We,ua=Tl&&pt&&!pt.nodeType&&pt,uo=ua&&ua.exports===Tl,o_=uo&&he.process,Wi=function(){try{return ua&&ua.require&&ua.require("util").types||o_&&o_.binding&&o_.binding("util")}catch(ue){}}(),Ze=Wi&&Wi.isArrayBuffer,fn=Wi&&Wi.isDate,xi=Wi&&Wi.isMap,Us=Wi&&Wi.isRegExp,yc=Wi&&Wi.isSet,Mr=Wi&&Wi.isTypedArray;function xr(W,ue,ne){switch(ne.length){case 0:return W.call(ue);case 1:return W.call(ue,ne[0]);case 2:return W.call(ue,ne[0],ne[1]);case 3:return W.call(ue,ne[0],ne[1],ne[2])}return W.apply(ue,ne)}function ur(W,ue,ne,it){for(var Et=-1,Bn=null==W?0:W.length;++Et-1}function Oh(W,ue,ne){for(var it=-1,Et=null==W?0:W.length;++it-1;);return ne}function b1(W,ue){for(var ne=W.length;ne--&&Ua(ue,W[ne],0)>-1;);return ne}function AF(W,ue){for(var ne=W.length,it=0;ne--;)W[ne]===ue&&++it;return it}var DF=Po({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),OF=Po({"&":"&","<":"<",">":">",'"':""","'":"'"});function IF(W){return"\\"+xe[W]}function Rh(W){return p1.test(W)}function y0(W){var ue=-1,ne=Array(W.size);return W.forEach(function(it,Et){ne[++ue]=[Et,it]}),ne}function C1(W,ue){return function(ne){return W(ue(ne))}}function yu(W,ue){for(var ne=-1,it=W.length,Et=0,Bn=[];++ne",""":'"',"'":"'"}),Fh=function W(ue){var u,ne=(ue=null==ue?Wn:Fh.defaults(Wn.Object(),ue,Fh.pick(Wn,Dh))).Array,it=ue.Date,Et=ue.Error,Bn=ue.Function,_r=ue.Math,di=ue.Object,f_=ue.RegExp,p_=ue.String,fa=ue.TypeError,Ti=ne.prototype,vu=di.prototype,bp=ue["__core-js_shared__"],qi=Bn.prototype.toString,hi=vu.hasOwnProperty,LF=0,Nh=(u=/[^.]+$/.exec(bp&&bp.keys&&bp.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ss=vu.toString,S1=qi.call(di),g_=Wn._,vd=f_("^"+qi.call(hi).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ds=uo?ue.Buffer:k,Dl=ue.Symbol,bd=ue.Uint8Array,C0=ds?ds.allocUnsafe:k,pa=C1(di.getPrototypeOf,di),m_=di.create,Cp=vu.propertyIsEnumerable,Ut=Ti.splice,M1=Dl?Dl.isConcatSpreadable:k,Lh=Dl?Dl.iterator:k,bu=Dl?Dl.toStringTag:k,wp=function(){try{var u=Oc(di,"defineProperty");return u({},"",{}),u}catch(h){}}(),w0=ue.clearTimeout!==Wn.clearTimeout&&ue.clearTimeout,x1=it&&it.now!==Wn.Date.now&&it.now,T1=ue.setTimeout!==Wn.setTimeout&&ue.setTimeout,Ce=_r.ceil,Sn=_r.floor,Vn=di.getOwnPropertySymbols,Tr=ds?ds.isBuffer:k,__=ue.isFinite,Bh=Ti.join,Ha=C1(di.keys,di),hr=_r.max,Nr=_r.min,BF=it.now,A1=ue.parseInt,Vh=_r.random,Ep=Ti.reverse,qr=Oc(ue,"DataView"),zs=Oc(ue,"Map"),Sp=Oc(ue,"Promise"),ga=Oc(ue,"Set"),fo=Oc(ue,"WeakMap"),jh=Oc(di,"create"),Uh=fo&&new fo,Cd={},D1=Pu(qr),y_=Pu(zs),v_=Pu(Sp),E0=Pu(ga),b_=Pu(fo),Mp=Dl?Dl.prototype:k,wd=Mp?Mp.valueOf:k,zh=Mp?Mp.toString:k;function O(u){if(Ki(u)&&!Ot(u)&&!(u instanceof pn)){if(u instanceof po)return u;if(hi.call(u,"__wrapped__"))return Xp(u)}return new po(u)}var Cu=function(){function u(){}return function(h){if(!Xi(h))return{};if(m_)return m_(h);u.prototype=h;var m=new u;return u.prototype=k,m}}();function Hh(){}function po(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=k}function pn(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ft,this.__views__=[]}function Hs(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function hs(u,h,m,b,M,P){var V,z=1&h,X=2&h,ge=4&h;if(m&&(V=M?m(u,b,M,P):m(u)),V!==k)return V;if(!Xi(u))return u;var me=Ot(u);if(me){if(V=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&hi.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!z)return xs(u,V)}else{var Se=gs(u),Ke=Se==oa||Se==Fa;if(el(u))return Bp(u,z);if(Se==nr||Se==as||Ke&&!M){if(V=X||Ke?{}:K0(u),!z)return X?function(u,h){return va(u,q0(u),h)}(u,function(u,h){return u&&va(h,As(h),u)}(V,u)):function(u,h){return va(u,z_(u),h)}(u,V1(V,u))}else{if(!wi[Se])return M?u:{};V=function(u,h,m){var b=u.constructor;switch(h){case bl:return Au(u);case ai:case ot:return new b(+u);case La:return function(u,h){var m=h?Au(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case ao:case Ba:case ki:case ls:case lo:case fc:case Cl:case lu:case cu:return L_(u,m);case Ri:return new b;case Hr:case ei:return new b(u);case $r:return function(u){var h=new u.constructor(u.source,Zt.exec(u));return h.lastIndex=u.lastIndex,h}(u);case Fr:return new b;case hc:return function(u){return wd?di(wd.call(u)):{}}(u)}}(u,Se,z)}}P||(P=new _a);var mt=P.get(u);if(mt)return mt;P.set(u,V),iT(u)?u.forEach(function(zt){V.add(hs(zt,h,m,zt,u,P))}):Jx(u)&&u.forEach(function(zt,_n){V.set(_n,hs(zt,h,m,_n,u,P))});var mn=me?k:(ge?X?j_:Fl:X?As:Qr)(u);return us(mn||u,function(zt,_n){mn&&(zt=u[_n=zt]),Ga(V,_n,hs(zt,h,m,_n,u,P))}),V}function Ip(u,h,m){var b=m.length;if(null==u)return!b;for(u=di(u);b--;){var M=m[b],V=u[M];if(V===k&&!(M in u)||!(0,h[M])(V))return!1}return!0}function Wh(u,h,m){if("function"!=typeof u)throw new fa(qt);return Jh(function(){u.apply(k,m)},h)}function wc(u,h,m,b){var M=-1,P=Al,V=!0,z=u.length,X=[],ge=h.length;if(!z)return X;m&&(h=ui(h,ko(m))),b?(P=Oh,V=!1):h.length>=200&&(P=Ph,V=!1,h=new ma(h));e:for(;++M-1},Ol.prototype.set=function(u,h){var m=this.__data__,b=Sd(m,u);return b<0?(++this.size,m.push([u,h])):m[b][1]=h,this},$a.prototype.clear=function(){this.size=0,this.__data__={hash:new Hs,map:new(zs||Ol),string:new Hs}},$a.prototype.delete=function(u){var h=ps(this,u).delete(u);return this.size-=h?1:0,h},$a.prototype.get=function(u){return ps(this,u).get(u)},$a.prototype.has=function(u){return ps(this,u).has(u)},$a.prototype.set=function(u,h){var m=ps(this,u),b=m.size;return m.set(u,h),this.size+=m.size==b?0:1,this},ma.prototype.add=ma.prototype.push=function(u){return this.__data__.set(u,dn),this},ma.prototype.has=function(u){return this.__data__.has(u)},_a.prototype.clear=function(){this.__data__=new Ol,this.size=0},_a.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},_a.prototype.get=function(u){return this.__data__.get(u)},_a.prototype.has=function(u){return this.__data__.has(u)},_a.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Ol){var b=m.__data__;if(!zs||b.length<199)return b.push([u,h]),this.size=++m.size,this;m=this.__data__=new $a(b)}return m.set(u,h),this.size=m.size,this};var Ec=Xa(qa),A_=Xa(Pp,!0);function D0(u,h){var m=!0;return Ec(u,function(b,M,P){return m=!!h(b,M,P)}),m}function qh(u,h,m){for(var b=-1,M=u.length;++b0&&m(z)?h>1?Yr(z,h-1,m,b,M):dr(M,z):b||(M[M.length]=z)}return M}var Md=B0(),xd=B0(!0);function qa(u,h){return u&&Md(u,h,Qr)}function Pp(u,h){return u&&xd(u,h,Qr)}function Yh(u,h){return da(h,function(m){return Ho(u[m])})}function Fo(u,h){for(var m=0,b=(h=Tc(h,u)).length;null!=u&&mh}function Td(u,h){return null!=u&&hi.call(u,h)}function Ad(u,h){return null!=u&&h in di(u)}function Eu(u,h,m){for(var b=m?Oh:Al,M=u[0].length,P=u.length,V=P,z=ne(P),X=1/0,ge=[];V--;){var me=u[V];V&&h&&(me=ui(me,ko(h))),X=Nr(me.length,X),z[V]=!m&&(h||M>=120&&me.length>=120)?new ma(V&&me):k}me=u[0];var Se=-1,Ke=z[0];e:for(;++Se=z?X:X*("desc"==m[b]?-1:1)}return u.index-h.index}(P,V,m)});ne--;)W[ne]=W[ne].value;return W}($1(u,function(P,V,z){return{criteria:ui(h,function(ge){return ge(P)}),index:++b,value:P}}))}function k0(u,h,m){for(var b=-1,M=h.length,P={};++b-1;)z!==u&&Ut.call(z,X,1),Ut.call(u,X,1);return u}function Kh(u,h){for(var m=u?h.length:0,b=m-1;m--;){var M=h[m];if(m==b||M!==P){var P=M;_o(M)?Ut.call(u,M,1):Mu(u,M)}}return u}function Il(u,h){return u+Sn(Vh()*(h-u+1))}function kp(u,h){var m="";if(!u||h<1||h>Ln)return m;do{h%2&&(m+=u),(h=Sn(h/2))&&(u+=u)}while(h);return m}function gn(u,h){return Yp(ox(u,h,Ds),u+"")}function W1(u){return S_(Wd(u))}function qF(u,h){var m=Wd(u);return Ld(m,wu(h,0,m.length))}function Fp(u,h,m,b){if(!Xi(u))return u;for(var M=-1,P=(h=Tc(h,u)).length,V=P-1,z=u;null!=z&&++MM?0:M+h),(m=m>M?M:m)<0&&(m+=M),M=h>m?0:m-h>>>0,h>>>=0;for(var P=ne(M);++b>>1,V=u[P];null!==V&&!$o(V)&&(m?V<=h:V=200){var ge=h?null:V_(u);if(ge)return u_(ge);V=!1,M=Ph,X=new ma}else X=h?[]:z;e:for(;++b=b?u:Kr(u,h,m)}var X1=w0||function(u){return Wn.clearTimeout(u)};function Bp(u,h){if(h)return u.slice();var m=u.length,b=C0?C0(m):new u.constructor(m);return u.copy(b),b}function Au(u){var h=new u.constructor(u.byteLength);return new bd(h).set(new bd(u)),h}function L_(u,h){var m=h?Au(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function Ac(u,h){if(u!==h){var m=u!==k,b=null===u,M=u==u,P=$o(u),V=h!==k,z=null===h,X=h==h,ge=$o(h);if(!z&&!ge&&!P&&u>h||P&&V&&X&&!z&&!ge||b&&V&&X||!m&&X||!M)return 1;if(!b&&!P&&!ge&&u1?m[M-1]:k,V=M>2?m[2]:k;for(P=u.length>3&&"function"==typeof P?(M--,P):k,V&&ms(m[0],m[1],V)&&(P=M<3?k:P,M=1),h=di(h);++b-1?M[P?h[V]:V]:k}}function Ou(u){return Ka(function(h){var m=h.length,b=m,M=po.prototype.thru;for(u&&h.reverse();b--;){var P=h[b];if("function"!=typeof P)throw new fa(qt);if(M&&!V&&"wrapper"==Gp(P))var V=new po([],!0)}for(b=V?b:m;++b1&&On.reverse(),me&&X<_n&&(On.length=X),this&&this!==Wn&&this instanceof zt&&(kc=mn||kd(kc)),kc.apply(il,On)}}function U0(u,h){return function(m,b){return function(u,h,m,b){return qa(u,function(M,P,V){h(b,m(M),P,V)}),b}(m,u,h(b),{})}}function B_(u,h){return function(m,b){var M;if(m===k&&b===k)return h;if(m!==k&&(M=m),b!==k){if(M===k)return b;"string"==typeof m||"string"==typeof b?(m=mo(m),b=mo(b)):(m=N0(m),b=N0(b)),M=u(m,b)}return M}}function jp(u){return Ka(function(h){return h=ui(h,ko(Nt())),gn(function(m){var b=this;return u(h,function(M){return xr(M,b,m)})})})}function Up(u,h){var m=(h=h===k?" ":mo(h)).length;if(m<2)return m?kp(h,u):h;var b=kp(h,Ce(u/kh(h)));return Rh(h)?Ya(za(b),0,u).join(""):b.slice(0,u)}function z0(u){return function(h,m,b){return b&&"number"!=typeof b&&ms(h,m,b)&&(m=b=k),h=tl(h),m===k?(m=h,h=0):m=tl(m),function(u,h,m,b){for(var M=-1,P=hr(Ce((h-u)/(m||1)),0),V=ne(P);P--;)V[b?P:++M]=u,u+=m;return V}(h,m,b=b===k?hz))return!1;var ge=P.get(u),me=P.get(h);if(ge&&me)return ge==h&&me==u;var Se=-1,Ke=!0,mt=2&m?new ma:k;for(P.set(u,h),P.set(h,u);++Se-1&&u%1==0&&u1?"& ":"")+h[b],h=h.join(m>2?", ":" "),u.replace(ce,"{\n/* [wrapped with "+h+"] */\n")}(b,function(u,h){return us(Mh,function(m){var b="_."+m[0];h&m[1]&&!Al(u,b)&&u.push(b)}),u.sort()}(function(u){var h=u.match(de);return h?h[1].split(Be):[]}(b),m)))}function Y_(u){var h=0,m=0;return function(){var b=BF(),M=16-(b-m);if(m=b,M>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(k,arguments)}}function Ld(u,h){var m=-1,b=u.length,M=b-1;for(h=h===k?b:h;++m1?u[h-1]:k;return m="function"==typeof m?(u.pop(),m):k,Dx(u,m)});function sy(u){var h=O(u);return h.__chain__=!0,h}function Vd(u,h){return h(u)}var oy=Ka(function(u){var h=u.length,m=h?u[0]:0,b=this.__wrapped__,M=function(P){return x_(P,u)};return!(h>1||this.__actions__.length)&&b instanceof pn&&_o(m)?((b=b.slice(m,+m+(h?1:0))).__actions__.push({func:Vd,args:[M],thisArg:k}),new po(b,this.__chain__).thru(function(P){return h&&!P.length&&P.push(k),P})):this.thru(M)}),Px=yr(function(u,h,m){hi.call(u,m)?++u[m]:Wa(u,m,1)}),Fx=j0(K_),Nx=j0(Z_);function uy(u,h){return(Ot(u)?us:Ec)(u,Nt(h,3))}function Jp(u,h){return(Ot(u)?pd:A_)(u,Nt(h,3))}var Bx=yr(function(u,h,m){hi.call(u,m)?u[m].push(h):Wa(u,m,[h])}),yC=gn(function(u,h,m){var b=-1,M="function"==typeof h,P=$s(u)?ne(u.length):[];return Ec(u,function(V){P[++b]=M?xr(h,V,m):ya(V,h,m)}),P}),vC=yr(function(u,h,m){Wa(u,m,h)});function Qa(u,h){return(Ot(u)?ui:$1)(u,Nt(h,3))}var CC=yr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),tg=gn(function(u,h){if(null==u)return[];var m=h.length;return m>1&&ms(u,h[0],h[1])?h=[]:m>2&&ms(h[0],h[1],h[2])&&(h=[h[0]]),Xh(u,Yr(h,1),[])}),Ru=x1||function(){return Wn.Date.now()};function ng(u,h,m){return h=m?k:h,kl(u,128,k,k,k,k,h=u&&null==h?u.length:h)}function hy(u,h){var m;if("function"!=typeof h)throw new fa(qt);return u=Jt(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=k),m}}var sf=gn(function(u,h,m){var b=1;if(m.length){var M=yu(m,Nd(sf));b|=32}return kl(u,b,h,m,M)}),Ud=gn(function(u,h,m){var b=3;if(m.length){var M=yu(m,Nd(Ud));b|=32}return kl(h,b,u,m,M)});function AC(u,h,m){var b,M,P,V,z,X,ge=0,me=!1,Se=!1,Ke=!0;if("function"!=typeof u)throw new fa(qt);function mt(Xn){var il=b,kc=M;return b=M=k,ge=Xn,V=u.apply(kc,il)}function Vt(Xn){return ge=Xn,z=Jh(_n,h),me?mt(Xn):V}function zt(Xn){var il=Xn-X;return X===k||il>=h||il<0||Se&&Xn-ge>=P}function _n(){var Xn=Ru();if(zt(Xn))return On(Xn);z=Jh(_n,function(Xn){var WT=h-(Xn-X);return Se?Nr(WT,P-(Xn-ge)):WT}(Xn))}function On(Xn){return z=k,Ke&&b?mt(Xn):(b=M=k,V)}function Go(){var Xn=Ru(),il=zt(Xn);if(b=arguments,M=this,X=Xn,il){if(z===k)return Vt(X);if(Se)return X1(z),z=Jh(_n,h),mt(X)}return z===k&&(z=Jh(_n,h)),V}return h=Gs(h)||0,Xi(m)&&(me=!!m.leading,P=(Se="maxWait"in m)?hr(Gs(m.maxWait)||0,h):P,Ke="trailing"in m?!!m.trailing:Ke),Go.cancel=function(){z!==k&&X1(z),ge=0,b=X=M=z=k},Go.flush=function(){return z===k?V:On(Ru())},Go}var zx=gn(function(u,h){return Wh(u,1,h)}),DC=gn(function(u,h,m){return Wh(u,Gs(h)||0,m)});function of(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new fa(qt);var m=function(){var b=arguments,M=h?h.apply(this,b):b[0],P=m.cache;if(P.has(M))return P.get(M);var V=u.apply(this,b);return m.cache=P.set(M,V)||P,V};return m.cache=new(of.Cache||$a),m}function gy(u){if("function"!=typeof u)throw new fa(qt);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}of.Cache=$a;var Hx=Y1(function(u,h){var m=(h=1==h.length&&Ot(h[0])?ui(h[0],ko(Nt())):ui(Yr(h,1),ko(Nt()))).length;return gn(function(b){for(var M=-1,P=Nr(b.length,m);++M=h}),Ja=j1(function(){return arguments}())?j1:function(u){return Ki(u)&&hi.call(u,"callee")&&!Cp.call(u,"callee")},Ot=ne.isArray,FC=Ze?ko(Ze):function(u){return Ki(u)&&Xr(u)==bl};function $s(u){return null!=u&&_y(u.length)&&!Ho(u)}function Yi(u){return Ki(u)&&$s(u)}var el=Tr||jy,NC=fn?ko(fn):function(u){return Ki(u)&&Xr(u)==ot};function Ca(u){if(!Ki(u))return!1;var h=Xr(u);return h==Pi||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!og(u)}function Ho(u){if(!Xi(u))return!1;var h=Xr(u);return h==oa||h==Fa||"[object AsyncFunction]"==h||"[object Proxy]"==h}function sg(u){return"number"==typeof u&&u==Jt(u)}function _y(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Ln}function Xi(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Ki(u){return null!=u&&"object"==typeof u}var Jx=xi?ko(xi):function(u){return Ki(u)&&gs(u)==Ri};function nT(u){return"number"==typeof u||Ki(u)&&Xr(u)==Hr}function og(u){if(!Ki(u)||Xr(u)!=nr)return!1;var h=pa(u);if(null===h)return!0;var m=hi.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&qi.call(m)==S1}var jC=Us?ko(Us):function(u){return Ki(u)&&Xr(u)==$r},iT=yc?ko(yc):function(u){return Ki(u)&&gs(u)==Fr};function vy(u){return"string"==typeof u||!Ot(u)&&Ki(u)&&Xr(u)==ei}function $o(u){return"symbol"==typeof u||Ki(u)&&Xr(u)==hc}var af=Mr?ko(Mr):function(u){return Ki(u)&&_y(u.length)&&!!Le[Xr(u)]},Ic=zp(R0),by=zp(function(u,h){return u<=h});function UC(u){if(!u)return[];if($s(u))return vy(u)?za(u):xs(u);if(Lh&&u[Lh])return function(W){for(var ue,ne=[];!(ue=W.next()).done;)ne.push(ue.value);return ne}(u[Lh]());var h=gs(u);return(h==Ri?y0:h==Fr?u_:Wd)(u)}function tl(u){return u?(u=Gs(u))===rn||u===-rn?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Jt(u){var h=tl(u),m=h%1;return h==h?m?h-m:h:0}function Cy(u){return u?wu(Jt(u),0,Ft):0}function Gs(u){if("number"==typeof u)return u;if($o(u))return NaN;if(Xi(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=Xi(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=_0(u);var m=Hi.test(u);return m||ln.test(u)?m0(u.slice(2),m?2:8):ti.test(u)?NaN:+u}function zC(u){return va(u,As(u))}function Yn(u){return null==u?"":mo(u)}var rT=Pl(function(u,h){if(qp(h)||$s(h))va(h,Qr(h),u);else for(var m in h)hi.call(h,m)&&Ga(u,m,h[m])}),sT=Pl(function(u,h){va(h,As(h),u)}),zd=Pl(function(u,h,m,b){va(h,As(h),u,b)}),oT=Pl(function(u,h,m,b){va(h,Qr(h),u,b)}),HC=Ka(x_),lT=gn(function(u,h){u=di(u);var m=-1,b=h.length,M=b>2?h[2]:k;for(M&&ms(h[0],h[1],M)&&(b=1);++m1),P}),va(u,j_(u),m),b&&(m=hs(m,7,Hp));for(var M=h.length;M--;)Mu(m,h[M]);return m}),fT=Ka(function(u,h){return null==u?{}:function(u,h){return k0(u,h,function(m,b){return ag(u,b)})}(u,h)});function KC(u,h){if(null==u)return{};var m=ui(j_(u),function(b){return[b]});return h=Nt(h),k0(u,m,function(b,M){return h(b,M[0])})}var pT=Iu(Qr),QC=Iu(As);function Wd(u){return null==u?[]:c_(u,Qr(u))}var vT=Rl(function(u,h,m){return h=h.toLowerCase(),u+(m?My(h):h)});function My(u){return ug(Yn(u).toLowerCase())}function xy(u){return(u=Yn(u))&&u.replace(gc,DF).replace(s_,"")}var CT=Rl(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),wT=Rl(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),pN=Vp("toLowerCase"),TT=Rl(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),Dy=Rl(function(u,h,m){return u+(m?" ":"")+ug(h)}),rw=Rl(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),ug=Vp("toUpperCase");function Ry(u,h,m){return u=Yn(u),(h=m?k:h)===k?function(W){return xl.test(W)}(u)?function(W){return W.match(h0)||[]}(u):function(W){return W.match(Kt)||[]}(u):u.match(h)||[]}var ky=gn(function(u,h){try{return xr(u,k,h)}catch(m){return Ca(m)?m:new Et(m)}}),sw=Ka(function(u,h){return us(h,function(m){m=on(m),Wa(u,m,sf(u[m],u))}),u});function Fy(u){return function(){return u}}var mN=Ou(),ku=Ou(!0);function Ds(u){return u}function Fu(u){return H1("function"==typeof u?u:hs(u,1))}var Ny=gn(function(u,h){return function(m){return ya(m,u,h)}}),ow=gn(function(u,h){return function(m){return ya(u,m,h)}});function Ly(u,h,m){var b=Qr(h),M=Yh(h,b);null==m&&(!Xi(h)||!M.length&&b.length)&&(m=h,h=u,u=this,M=Yh(h,Qr(h)));var P=!(Xi(m)&&"chain"in m&&!m.chain),V=Ho(u);return us(M,function(z){var X=h[z];u[z]=X,V&&(u.prototype[z]=function(){var ge=this.__chain__;if(P||ge){var me=u(this.__wrapped__),Se=me.__actions__=xs(this.__actions__);return Se.push({func:X,args:arguments,thisArg:u}),me.__chain__=ge,me}return X.apply(u,dr([this.value()],arguments))})}),u}function By(){}var kT=jp(ui),FT=jp(sn),lw=jp(ho);function Nu(u){return Vo(u)?a_(on(u)):function(u){return function(h){return Fo(h,u)}}(u)}var NT=z0(),LT=z0(!0);function Rc(){return[]}function jy(){return!1}var Tt=B_(function(u,h){return u+h},0),Uy=Fd("ceil"),yN=B_(function(u,h){return u/h},1),Bl=Fd("floor"),hw=B_(function(u,h){return u*h},1),fw=Fd("round"),pw=B_(function(u,h){return u-h},0);return O.after=function(u,h){if("function"!=typeof h)throw new fa(qt);return u=Jt(u),function(){if(--u<1)return h.apply(this,arguments)}},O.ary=ng,O.assign=rT,O.assignIn=sT,O.assignInWith=zd,O.assignWith=oT,O.at=HC,O.before=hy,O.bind=sf,O.bindAll=sw,O.bindKey=Ud,O.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Ot(u)?u:[u]},O.chain=sy,O.chunk=function(u,h,m){h=(m?ms(u,h,m):h===k)?1:hr(Jt(h),0);var b=null==u?0:u.length;if(!b||h<1)return[];for(var M=0,P=0,V=ne(Ce(b/h));MM?0:M+m),(b=b===k||b>M?M:Jt(b))<0&&(b+=M),b=m>b?0:Cy(b);m>>0)?(u=Yn(u))&&("string"==typeof h||null!=h&&!jC(h))&&!(h=mo(h))&&Rh(u)?Ya(za(u),0,m):u.split(h,m):[]},O.spread=function(u,h){if("function"!=typeof u)throw new fa(qt);return h=null==h?0:hr(Jt(h),0),gn(function(m){var b=m[h],M=Ya(m,0,h);return b&&dr(M,b),xr(u,this,M)})},O.tail=function(u){var h=null==u?0:u.length;return h?Kr(u,1,h):[]},O.take=function(u,h,m){return u&&u.length?Kr(u,0,(h=m||h===k?1:Jt(h))<0?0:h):[]},O.takeRight=function(u,h,m){var b=null==u?0:u.length;return b?Kr(u,(h=b-(h=m||h===k?1:Jt(h)))<0?0:h,b):[]},O.takeRightWhile=function(u,h){return u&&u.length?xu(u,Nt(h,3),!1,!0):[]},O.takeWhile=function(u,h){return u&&u.length?xu(u,Nt(h,3)):[]},O.tap=function(u,h){return h(u),u},O.throttle=function(u,h,m){var b=!0,M=!0;if("function"!=typeof u)throw new fa(qt);return Xi(m)&&(b="leading"in m?!!m.leading:b,M="trailing"in m?!!m.trailing:M),AC(u,h,{leading:b,maxWait:h,trailing:M})},O.thru=Vd,O.toArray=UC,O.toPairs=pT,O.toPairsIn=QC,O.toPath=function(u){return Ot(u)?ui(u,on):$o(u)?[u]:xs(eC(Yn(u)))},O.toPlainObject=zC,O.transform=function(u,h,m){var b=Ot(u),M=b||el(u)||af(u);if(h=Nt(h,4),null==m){var P=u&&u.constructor;m=M?b?new P:[]:Xi(u)&&Ho(P)?Cu(pa(u)):{}}return(M?us:qa)(u,function(V,z,X){return h(m,V,z,X)}),m},O.unary=function(u){return ng(u,1)},O.union=uC,O.unionBy=ny,O.unionWith=Qp,O.uniq=function(u){return u&&u.length?Mc(u):[]},O.uniqBy=function(u,h){return u&&u.length?Mc(u,Nt(h,2)):[]},O.uniqWith=function(u,h){return h="function"==typeof h?h:k,u&&u.length?Mc(u,k,h):[]},O.unset=function(u,h){return null==u||Mu(u,h)},O.unzip=dC,O.unzipWith=Dx,O.update=function(u,h,m){return null==u?u:Np(u,h,N_(m))},O.updateWith=function(u,h,m,b){return b="function"==typeof b?b:k,null==u?u:Np(u,h,N_(m),b)},O.values=Wd,O.valuesIn=function(u){return null==u?[]:c_(u,As(u))},O.without=hC,O.words=Ry,O.wrap=function(u,h){return ig(N_(h),u)},O.xor=iN,O.xorBy=yo,O.xorWith=iy,O.zip=ry,O.zipObject=function(u,h){return Lp(u||[],h||[],Ga)},O.zipObjectDeep=function(u,h){return Lp(u||[],h||[],Fp)},O.zipWith=rf,O.entries=pT,O.entriesIn=QC,O.extend=sT,O.extendWith=zd,Ly(O,O),O.add=Tt,O.attempt=ky,O.camelCase=vT,O.capitalize=My,O.ceil=Uy,O.clamp=function(u,h,m){return m===k&&(m=h,h=k),m!==k&&(m=(m=Gs(m))==m?m:0),h!==k&&(h=(h=Gs(h))==h?h:0),wu(Gs(u),h,m)},O.clone=function(u){return hs(u,4)},O.cloneDeep=function(u){return hs(u,5)},O.cloneDeepWith=function(u,h){return hs(u,5,h="function"==typeof h?h:k)},O.cloneWith=function(u,h){return hs(u,4,h="function"==typeof h?h:k)},O.conformsTo=function(u,h){return null==h||Ip(u,h,Qr(h))},O.deburr=xy,O.defaultTo=function(u,h){return null==u||u!=u?h:u},O.divide=yN,O.endsWith=function(u,h,m){u=Yn(u),h=mo(h);var b=u.length,M=m=m===k?b:wu(Jt(m),0,b);return(m-=h.length)>=0&&u.slice(m,M)==h},O.eq=St,O.escape=function(u){return(u=Yn(u))&&Ye.test(u)?u.replace(du,OF):u},O.escapeRegExp=function(u){return(u=Yn(u))&&K.test(u)?u.replace(B,"\\$&"):u},O.every=function(u,h,m){var b=Ot(u)?sn:D0;return m&&ms(u,h,m)&&(h=k),b(u,Nt(h,3))},O.find=Fx,O.findIndex=K_,O.findKey=function(u,h){return Ih(u,Nt(h,3),qa)},O.findLast=Nx,O.findLastIndex=Z_,O.findLastKey=function(u,h){return Ih(u,Nt(h,3),Pp)},O.floor=Bl,O.forEach=uy,O.forEachRight=Jp,O.forIn=function(u,h){return null==u?u:Md(u,Nt(h,3),As)},O.forInRight=function(u,h){return null==u?u:xd(u,Nt(h,3),As)},O.forOwn=function(u,h){return u&&qa(u,Nt(h,3))},O.forOwnRight=function(u,h){return u&&Pp(u,Nt(h,3))},O.get=uf,O.gt=Y,O.gte=kC,O.has=function(u,h){return null!=u&&X0(u,h,Td)},O.hasIn=ag,O.head=nC,O.identity=Ds,O.includes=function(u,h,m,b){u=$s(u)?u:Wd(u),m=m&&!b?Jt(m):0;var M=u.length;return m<0&&(m=hr(M+m,0)),vy(u)?m<=M&&u.indexOf(h,m)>-1:!!M&&Ua(u,h,m)>-1},O.indexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=null==m?0:Jt(m);return M<0&&(M=hr(b+M,0)),Ua(u,h,M)},O.inRange=function(u,h,m){return h=tl(h),m===k?(m=h,h=0):m=tl(m),function(u,h,m){return u>=Nr(h,m)&&u=-Ln&&u<=Ln},O.isSet=iT,O.isString=vy,O.isSymbol=$o,O.isTypedArray=af,O.isUndefined=function(u){return u===k},O.isWeakMap=function(u){return Ki(u)&&gs(u)==ci},O.isWeakSet=function(u){return Ki(u)&&"[object WeakSet]"==Xr(u)},O.join=function(u,h){return null==u?"":Bh.call(u,h)},O.kebabCase=CT,O.last=jo,O.lastIndexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=b;return m!==k&&(M=(M=Jt(m))<0?hr(b+M,0):Nr(M,b-1)),h==h?function(W,ue,ne){for(var it=ne+1;it--;)if(W[it]===ue)return it;return it}(u,h,M):md(u,vc,M,!0)},O.lowerCase=wT,O.lowerFirst=pN,O.lt=Ic,O.lte=by,O.max=function(u){return u&&u.length?qh(u,Ds,fs):k},O.maxBy=function(u,h){return u&&u.length?qh(u,Nt(h,2),fs):k},O.mean=function(u){return Wr(u,Ds)},O.meanBy=function(u,h){return Wr(u,Nt(h,2))},O.min=function(u){return u&&u.length?qh(u,Ds,R0):k},O.minBy=function(u,h){return u&&u.length?qh(u,Nt(h,2),R0):k},O.stubArray=Rc,O.stubFalse=jy,O.stubObject=function(){return{}},O.stubString=function(){return""},O.stubTrue=function(){return!0},O.multiply=hw,O.nth=function(u,h){return u&&u.length?Su(u,Jt(h)):k},O.noConflict=function(){return Wn._===this&&(Wn._=g_),this},O.noop=By,O.now=Ru,O.pad=function(u,h,m){u=Yn(u);var b=(h=Jt(h))?kh(u):0;if(!h||b>=h)return u;var M=(h-b)/2;return Up(Sn(M),m)+u+Up(Ce(M),m)},O.padEnd=function(u,h,m){u=Yn(u);var b=(h=Jt(h))?kh(u):0;return h&&bh){var b=u;u=h,h=b}if(m||u%1||h%1){var M=Vh();return Nr(u+M*(h-u+m1("1e-"+((M+"").length-1))),h)}return Il(u,h)},O.reduce=function(u,h,m){var b=Ot(u)?_u:Ro,M=arguments.length<3;return b(u,Nt(h,4),m,M,Ec)},O.reduceRight=function(u,h,m){var b=Ot(u)?gd:Ro,M=arguments.length<3;return b(u,Nt(h,4),m,M,A_)},O.repeat=function(u,h,m){return h=(m?ms(u,h,m):h===k)?1:Jt(h),kp(Yn(u),h)},O.replace=function(){var u=arguments,h=Yn(u[0]);return u.length<3?h:h.replace(u[1],u[2])},O.result=function(u,h,m){var b=-1,M=(h=Tc(h,u)).length;for(M||(M=1,u=k);++bLn)return[];var m=Ft,b=Nr(u,Ft);h=Nt(h),u-=Ft;for(var M=yd(b,h);++m=P)return u;var z=m-kh(b);if(z<1)return b;var X=V?Ya(V,0,z).join(""):u.slice(0,z);if(M===k)return X+b;if(V&&(z+=X.length-z),jC(M)){if(u.slice(z).search(M)){var ge,me=X;for(M.global||(M=f_(M.source,Yn(Zt.exec(M))+"g")),M.lastIndex=0;ge=M.exec(me);)var Se=ge.index;X=X.slice(0,Se===k?z:Se)}}else if(u.indexOf(mo(M),z)!=z){var Ke=X.lastIndexOf(M);Ke>-1&&(X=X.slice(0,Ke))}return X+b},O.unescape=function(u){return(u=Yn(u))&&Vs.test(u)?u.replace(ud,h_):u},O.uniqueId=function(u){var h=++LF;return Yn(u)+h},O.upperCase=rw,O.upperFirst=ug,O.each=uy,O.eachRight=Jp,O.first=nC,Ly(O,function(){var u={};return qa(O,function(h,m){hi.call(O.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),O.VERSION="4.17.21",us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){O[u].placeholder=O}),us(["drop","take"],function(u,h){pn.prototype[u]=function(m){m=m===k?1:hr(Jt(m),0);var b=this.__filtered__&&!h?new pn(this):this.clone();return b.__filtered__?b.__takeCount__=Nr(m,b.__takeCount__):b.__views__.push({size:Nr(m,Ft),type:u+(b.__dir__<0?"Right":"")}),b},pn.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),us(["filter","map","takeWhile"],function(u,h){var m=h+1,b=1==m||3==m;pn.prototype[u]=function(M){var P=this.clone();return P.__iteratees__.push({iteratee:Nt(M,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),us(["head","last"],function(u,h){var m="take"+(h?"Right":"");pn.prototype[u]=function(){return this[m](1).value()[0]}}),us(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");pn.prototype[u]=function(){return this.__filtered__?new pn(this):this[m](1)}}),pn.prototype.compact=function(){return this.filter(Ds)},pn.prototype.find=function(u){return this.filter(u).head()},pn.prototype.findLast=function(u){return this.reverse().find(u)},pn.prototype.invokeMap=gn(function(u,h){return"function"==typeof u?new pn(this):this.map(function(m){return ya(m,u,h)})}),pn.prototype.reject=function(u){return this.filter(gy(Nt(u)))},pn.prototype.slice=function(u,h){u=Jt(u);var m=this;return m.__filtered__&&(u>0||h<0)?new pn(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==k&&(m=(h=Jt(h))<0?m.dropRight(-h):m.take(h-u)),m)},pn.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},pn.prototype.toArray=function(){return this.take(Ft)},qa(pn.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),b=/^(?:head|last)$/.test(h),M=O[b?"take"+("last"==h?"Right":""):h],P=b||/^find/.test(h);!M||(O.prototype[h]=function(){var V=this.__wrapped__,z=b?[1]:arguments,X=V instanceof pn,ge=z[0],me=X||Ot(V),Se=function(_n){var On=M.apply(O,dr([_n],z));return b&&Ke?On[0]:On};me&&m&&"function"==typeof ge&&1!=ge.length&&(X=me=!1);var Ke=this.__chain__,mt=!!this.__actions__.length,Vt=P&&!Ke,mn=X&&!mt;if(!P&&me){V=mn?V:new pn(this);var zt=u.apply(V,z);return zt.__actions__.push({func:Vd,args:[Se],thisArg:k}),new po(zt,Ke)}return Vt&&mn?u.apply(this,z):(zt=this.thru(Se),Vt?b?zt.value()[0]:zt.value():zt)})}),us(["pop","push","shift","sort","splice","unshift"],function(u){var h=Ti[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",b=/^(?:pop|shift)$/.test(u);O.prototype[u]=function(){var M=arguments;if(b&&!this.__chain__){var P=this.value();return h.apply(Ot(P)?P:[],M)}return this[m](function(V){return h.apply(Ot(V)?V:[],M)})}}),qa(pn.prototype,function(u,h){var m=O[h];if(m){var b=m.name+"";hi.call(Cd,b)||(Cd[b]=[]),Cd[b].push({name:h,func:m})}}),Cd[Dc(k,2).name]=[{name:"wrapper",func:k}],pn.prototype.clone=function(){var u=new pn(this.__wrapped__);return u.__actions__=xs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=xs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=xs(this.__views__),u},pn.prototype.reverse=function(){if(this.__filtered__){var u=new pn(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},pn.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Ot(u),b=h<0,M=m?u.length:0,P=function(u,h,m){for(var b=-1,M=m.length;++b=this.__values__.length;return{done:u,value:u?k:this.__values__[this.__index__++]}},O.prototype.plant=function(u){for(var h,m=this;m instanceof Hh;){var b=Xp(m);b.__index__=0,b.__values__=k,h?M.__wrapped__=b:h=b;var M=b;m=m.__wrapped__}return M.__wrapped__=u,h},O.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof pn){var h=u;return this.__actions__.length&&(h=new pn(this)),(h=h.reverse()).__actions__.push({func:Vd,args:[ty],thisArg:k}),new po(h,this.__chain__)}return this.thru(ty)},O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=function(){return q1(this.__wrapped__,this.__actions__)},O.prototype.first=O.prototype.head,Lh&&(O.prototype[Lh]=function(){return this}),O}();Wn._=Fh,(_t=function(){return Fh}.call(We,Ve,We,pt))!==k&&(pt.exports=_t)}.call(this)},478:function(pt){pt.exports=function(){"use strict";function We(G,q){for(var Z=0;ZG.length)&&(q=G.length);for(var Z=0,T=new Array(q);Z=G.length?{done:!0}:{done:!1,value:G[T++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Pt={exports:{}};function ft(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Pt.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:ft,changeDefaults:function(G){Pt.exports.defaults=G}};var yt=/[&<>"']/,dn=/[&<>"']/g,En=/[<>"']|&(?!#?\w+;)/,Fe=/[<>"']|&(?!#?\w+;)/g,je={"&":"&","<":"<",">":">",'"':""","'":"'"},$t=function(q){return je[q]};var Ie=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function pi(G){return G.replace(Ie,function(q,Z){return"colon"===(Z=Z.toLowerCase())?":":"#"===Z.charAt(0)?"x"===Z.charAt(1)?String.fromCharCode(parseInt(Z.substring(2),16)):String.fromCharCode(+Z.substring(1)):""})}var qe=/(^|[^\[])\^/g;var Rt=/[^\w:]/g,nn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var Ci={},yi=/^[^:]+:\/*[^/]*$/,vi=/^([^:]+:)[\s\S]*$/,Er=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ae(G,q){Ci[" "+G]||(Ci[" "+G]=yi.test(G)?G+"/":Gt(G,"/",!0));var Z=-1===(G=Ci[" "+G]).indexOf(":");return"//"===q.substring(0,2)?Z?q:G.replace(vi,"$1")+q:"/"===q.charAt(0)?Z?q:G.replace(Er,"$1")+q:G+q}function Gt(G,q,Z){var T=G.length;if(0===T)return"";for(var D=0;D1;)1&q&&(Z+=G),q>>=1,G+=G;return Z+G},Ln=Pt.exports.defaults,be=Gt,Ii=function(G,q){var T=G.replace(/\|/g,function(B,K,H){for(var se=!1,ce=K;--ce>=0&&"\\"===H[ce];)se=!se;return se?"|":" |"}).split(/ \|/),D=0;if(T.length>q)T.splice(q);else for(;T.length1?{type:"space",raw:D[0]}:{raw:"\n"}},q.code=function(T){var D=this.rules.block.code.exec(T);if(D){var B=D[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:D[0],codeBlockStyle:"indented",text:this.options.pedantic?B:be(B,"\n")}}},q.fences=function(T){var D=this.rules.block.fences.exec(T);if(D){var B=D[0],K=function(G,q){var Z=G.match(/^(\s+)(?:```)/);if(null===Z)return q;var T=Z[1];return q.split("\n").map(function(D){var B=D.match(/^\s+/);return null===B?D:B[0].length>=T.length?D.slice(T.length):D}).join("\n")}(B,D[3]||"");return{type:"code",raw:B,lang:D[2]?D[2].trim():D[2],text:K}}},q.heading=function(T){var D=this.rules.block.heading.exec(T);if(D){var B=D[2].trim();if(/#$/.test(B)){var K=be(B,"#");(this.options.pedantic||!K||/ $/.test(K))&&(B=K.trim())}return{type:"heading",raw:D[0],depth:D[1].length,text:B}}},q.nptable=function(T){var D=this.rules.block.nptable.exec(T);if(D){var B={type:"table",header:Ii(D[1].replace(/^ *| *\| *$/g,"")),align:D[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:D[3]?D[3].replace(/\n$/,"").split("\n"):[],raw:D[0]};if(B.header.length===B.align.length){var H,K=B.align.length;for(H=0;H ?/gm,"");return{type:"blockquote",raw:D[0],text:B}}},q.list=function(T){var D=this.rules.block.list.exec(T);if(D){var Be,Kt,Cn,jt,gt,Zt,ti,Hi,$i,B=D[0],K=D[2],H=K.length>1,se={type:"list",raw:B,ordered:H,start:H?+K.slice(0,-1):"",loose:!1,items:[]},ce=D[0].match(this.rules.block.item),de=!1,ln=ce.length;Cn=this.rules.block.listItemStart.exec(ce[0]);for(var bi=0;biCn[1].length:jt[1].length>=Cn[0].length||jt[1].length>3){ce.splice(bi,2,ce[bi]+(!this.options.pedantic&&jt[1].length/i.test(K[0])&&(D=!1),!B&&/^<(pre|code|kbd|script)(\s|>)/i.test(K[0])?B=!0:B&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(K[0])&&(B=!1),{type:this.options.sanitize?"text":"html",raw:K[0],inLink:D,inRawBlock:B,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):Ft(K[0]):K[0]}},q.link=function(T){var D=this.rules.inline.link.exec(T);if(D){var B=D[2].trim();if(!this.options.pedantic&&/^$/.test(B))return;var K=be(B.slice(0,-1),"\\");if((B.length-K.length)%2==0)return}else{var H=Sr(D[2],"()");if(H>-1){var ce=(0===D[0].indexOf("!")?5:4)+D[1].length+H;D[2]=D[2].substring(0,H),D[0]=D[0].substring(0,ce).trim(),D[3]=""}}var de=D[2],Be="";if(this.options.pedantic){var Kt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(de);Kt&&(de=Kt[1],Be=Kt[3])}else Be=D[3]?D[3].slice(1,-1):"";return de=de.trim(),/^$/.test(B)?de.slice(1):de.slice(1,-1)),os(D,{href:de&&de.replace(this.rules.inline._escapes,"$1"),title:Be&&Be.replace(this.rules.inline._escapes,"$1")},D[0])}},q.reflink=function(T,D){var B;if((B=this.rules.inline.reflink.exec(T))||(B=this.rules.inline.nolink.exec(T))){var K=(B[2]||B[1]).replace(/\s+/g," ");if(!(K=D[K.toLowerCase()])||!K.href){var H=B[0].charAt(0);return{type:"text",raw:H,text:H}}return os(B,K,B[0])}},q.emStrong=function(T,D,B){void 0===B&&(B="");var K=this.rules.inline.emStrong.lDelim.exec(T);if(K&&(!K[3]||!B.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var H=K[1]||K[2]||"";if(!H||H&&(""===B||this.rules.inline.punctuation.exec(B))){var ce,de,se=K[0].length-1,Be=se,Kt=0,Cn="*"===K[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Cn.lastIndex=0,D=D.slice(-1*T.length+se);null!=(K=Cn.exec(D));)if(ce=K[1]||K[2]||K[3]||K[4]||K[5]||K[6]){if(de=ce.length,K[3]||K[4]){Be+=de;continue}if((K[5]||K[6])&&se%3&&!((se+de)%3)){Kt+=de;continue}if(!((Be-=de)>0))return de=Math.min(de,de+Be+Kt),Math.min(se,de)%2?{type:"em",raw:T.slice(0,se+K.index+de+1),text:T.slice(1,se+K.index+de)}:{type:"strong",raw:T.slice(0,se+K.index+de+1),text:T.slice(2,se+K.index+de-1)}}}}},q.codespan=function(T){var D=this.rules.inline.code.exec(T);if(D){var B=D[2].replace(/\n/g," "),K=/[^ ]/.test(B),H=/^ /.test(B)&&/ $/.test(B);return K&&H&&(B=B.substring(1,B.length-1)),B=Ft(B,!0),{type:"codespan",raw:D[0],text:B}}},q.br=function(T){var D=this.rules.inline.br.exec(T);if(D)return{type:"br",raw:D[0]}},q.del=function(T){var D=this.rules.inline.del.exec(T);if(D)return{type:"del",raw:D[0],text:D[2]}},q.autolink=function(T,D){var K,H,B=this.rules.inline.autolink.exec(T);if(B)return H="@"===B[2]?"mailto:"+(K=Ft(this.options.mangle?D(B[1]):B[1])):K=Ft(B[1]),{type:"link",raw:B[0],text:K,href:H,tokens:[{type:"text",raw:K,text:K}]}},q.url=function(T,D){var B;if(B=this.rules.inline.url.exec(T)){var K,H;if("@"===B[2])H="mailto:"+(K=Ft(this.options.mangle?D(B[0]):B[0]));else{var se;do{se=B[0],B[0]=this.rules.inline._backpedal.exec(B[0])[0]}while(se!==B[0]);K=Ft(B[0]),H="www."===B[1]?"http://"+K:K}return{type:"link",raw:B[0],text:K,href:H,tokens:[{type:"text",raw:K,text:K}]}}},q.inlineText=function(T,D,B){var H,K=this.rules.inline.text.exec(T);if(K)return H=D?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):Ft(K[0]):K[0]:Ft(this.options.smartypants?B(K[0]):K[0]),{type:"text",raw:K[0],text:H}},G}(),sa=rn_noopTest,Gn=rn_edit,ai=rn_merge,ot={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:sa,table:sa,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};ot.def=Gn(ot.def).replace("label",ot._label).replace("title",ot._title).getRegex(),ot.bullet=/(?:[*+-]|\d{1,9}[.)])/,ot.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ot.item=Gn(ot.item,"gm").replace(/bull/g,ot.bullet).getRegex(),ot.listItemStart=Gn(/^( *)(bull) */).replace("bull",ot.bullet).getRegex(),ot.list=Gn(ot.list).replace(/bull/g,ot.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ot.def.source+")").getRegex(),ot._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ot._comment=/|$)/,ot.html=Gn(ot.html,"i").replace("comment",ot._comment).replace("tag",ot._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ot.paragraph=Gn(ot._paragraph).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.blockquote=Gn(ot.blockquote).replace("paragraph",ot.paragraph).getRegex(),ot.normal=ai({},ot),ot.gfm=ai({},ot.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ot.gfm.nptable=Gn(ot.gfm.nptable).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.gfm.table=Gn(ot.gfm.table).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.pedantic=ai({},ot.normal,{html:Gn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ot._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:sa,paragraph:Gn(ot.normal._paragraph).replace("hr",ot.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ot.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var He={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:sa,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:sa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};He.punctuation=Gn(He.punctuation).replace(/punctuation/g,He._punctuation).getRegex(),He.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,He.escapedEmSt=/\\\*|\\_/g,He._comment=Gn(ot._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),He.emStrong.lDelim=Gn(He.emStrong.lDelim).replace(/punct/g,He._punctuation).getRegex(),He.emStrong.rDelimAst=Gn(He.emStrong.rDelimAst,"g").replace(/punct/g,He._punctuation).getRegex(),He.emStrong.rDelimUnd=Gn(He.emStrong.rDelimUnd,"g").replace(/punct/g,He._punctuation).getRegex(),He._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,He._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,He._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,He.autolink=Gn(He.autolink).replace("scheme",He._scheme).replace("email",He._email).getRegex(),He._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,He.tag=Gn(He.tag).replace("comment",He._comment).replace("attribute",He._attribute).getRegex(),He._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,He._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,He._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,He.link=Gn(He.link).replace("label",He._label).replace("href",He._href).replace("title",He._title).getRegex(),He.reflink=Gn(He.reflink).replace("label",He._label).getRegex(),He.reflinkSearch=Gn(He.reflinkSearch,"g").replace("reflink",He.reflink).replace("nolink",He.nolink).getRegex(),He.normal=ai({},He),He.pedantic=ai({},He.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Gn(/^!?\[(label)\]\((.*?)\)/).replace("label",He._label).getRegex(),reflink:Gn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",He._label).getRegex()}),He.gfm=ai({},He.normal,{escape:Gn(He.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(T="x"+T.toString(16)),q+="&#"+T+";";return q}var li=function(){function G(Z){this.tokens=[],this.tokens.links=Object.create(null),this.options=Z||Fa,this.options.tokenizer=this.options.tokenizer||new oa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var T={block:Ri.normal,inline:Hr.normal};this.options.pedantic?(T.block=Ri.pedantic,T.inline=Hr.pedantic):this.options.gfm&&(T.block=Ri.gfm,T.inline=this.options.breaks?Hr.breaks:Hr.gfm),this.tokenizer.rules=T}G.lex=function(T,D){return new G(D).lex(T)},G.lexInline=function(T,D){return new G(D).inlineTokens(T)};var q=G.prototype;return q.lex=function(T){return T=T.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(T,this.tokens,!0),this.inline(this.tokens),this.tokens},q.blockTokens=function(T,D,B){var H,se,ce,de,Be,Kt,K=this;for(void 0===D&&(D=[]),void 0===B&&(B=!0),this.options.pedantic&&(T=T.replace(/^ +$/gm,""));T;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(jt){return!!(H=jt.call(K,T,D))&&(T=T.substring(H.raw.length),D.push(H),!0)}))){if(H=this.tokenizer.space(T)){T=T.substring(H.raw.length),H.type&&D.push(H);continue}if(H=this.tokenizer.code(T)){T=T.substring(H.raw.length),(de=D[D.length-1])&&"paragraph"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H);continue}if(H=this.tokenizer.fences(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.heading(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.nptable(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.hr(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.blockquote(T)){T=T.substring(H.raw.length),H.tokens=this.blockTokens(H.text,[],B),D.push(H);continue}if(H=this.tokenizer.list(T)){for(T=T.substring(H.raw.length),ce=H.items.length,se=0;se=0&&(jt=Math.min(jt,Zt))}),jt<1/0&&jt>=0&&(Be=T.substring(0,jt+1))}(),B&&(H=this.tokenizer.paragraph(Be))){de=D[D.length-1],Kt&&"paragraph"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H),Kt=Be.length!==T.length,T=T.substring(H.raw.length);continue}if(H=this.tokenizer.text(T)){T=T.substring(H.raw.length),(de=D[D.length-1])&&"text"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H);continue}if(T){var Cn="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(Cn);break}throw new Error(Cn)}}return D},q.inline=function(T){var D,B,K,H,se,ce,de=T.length;for(D=0;D0)for(;null!=(Kt=this.tokenizer.rules.inline.reflinkSearch.exec(Be));)gt.includes(Kt[0].slice(Kt[0].lastIndexOf("[")+1,-1))&&(Be=Be.slice(0,Kt.index)+"["+Na("a",Kt[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(Kt=this.tokenizer.rules.inline.blockSkip.exec(Be));)Be=Be.slice(0,Kt.index)+"["+Na("a",Kt[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(Kt=this.tokenizer.rules.inline.escapedEmSt.exec(Be));)Be=Be.slice(0,Kt.index)+"++"+Be.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;T;)if(Cn||(jt=""),Cn=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ti){return!!(se=ti.call(H,T,D))&&(T=T.substring(se.raw.length),D.push(se),!0)}))){if(se=this.tokenizer.escape(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.tag(T,B,K)){T=T.substring(se.raw.length),B=se.inLink,K=se.inRawBlock,(ce=D[D.length-1])&&"text"===se.type&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(se=this.tokenizer.link(T)){T=T.substring(se.raw.length),"link"===se.type&&(se.tokens=this.inlineTokens(se.text,[],!0,K)),D.push(se);continue}if(se=this.tokenizer.reflink(T,this.tokens.links)){T=T.substring(se.raw.length),ce=D[D.length-1],"link"===se.type?(se.tokens=this.inlineTokens(se.text,[],!0,K),D.push(se)):ce&&"text"===se.type&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(se=this.tokenizer.emStrong(T,Be,jt)){T=T.substring(se.raw.length),se.tokens=this.inlineTokens(se.text,[],B,K),D.push(se);continue}if(se=this.tokenizer.codespan(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.br(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.del(T)){T=T.substring(se.raw.length),se.tokens=this.inlineTokens(se.text,[],B,K),D.push(se);continue}if(se=this.tokenizer.autolink(T,so)){T=T.substring(se.raw.length),D.push(se);continue}if(!B&&(se=this.tokenizer.url(T,so))){T=T.substring(se.raw.length),D.push(se);continue}if(de=T,this.options.extensions&&this.options.extensions.startInline&&function(){var ti=1/0,Hi=T.slice(1),$i=void 0;H.options.extensions.startInline.forEach(function(ln){"number"==typeof($i=ln.call(this,Hi))&&$i>=0&&(ti=Math.min(ti,$i))}),ti<1/0&&ti>=0&&(de=T.substring(0,ti+1))}(),se=this.tokenizer.inlineText(de,K,nr)){T=T.substring(se.raw.length),"_"!==se.raw.slice(-1)&&(jt=se.raw.slice(-1)),Cn=!0,(ce=D[D.length-1])&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(T){var Zt="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(Zt);break}throw new Error(Zt)}}return D},function(G,q,Z){q&&We(G.prototype,q),Z&&We(G,Z)}(G,null,[{key:"rules",get:function(){return{block:Ri,inline:Hr}}}]),G}(),$r=Pt.exports.defaults,Fr=rn_cleanUrl,ei=rn_escape,hc=function(){function G(Z){this.options=Z||$r}var q=G.prototype;return q.code=function(T,D,B){var K=(D||"").match(/\S*/)[0];if(this.options.highlight){var H=this.options.highlight(T,K);null!=H&&H!==T&&(B=!0,T=H)}return T=T.replace(/\n$/,"")+"\n",K?'
'+(B?T:ei(T,!0))+"
\n":"
"+(B?T:ei(T,!0))+"
\n"},q.blockquote=function(T){return"
\n"+T+"
\n"},q.html=function(T){return T},q.heading=function(T,D,B,K){return this.options.headerIds?"'+T+"\n":""+T+"\n"},q.hr=function(){return this.options.xhtml?"
\n":"
\n"},q.list=function(T,D,B){var K=D?"ol":"ul";return"<"+K+(D&&1!==B?' start="'+B+'"':"")+">\n"+T+"\n"},q.listitem=function(T){return"
  • "+T+"
  • \n"},q.checkbox=function(T){return" "},q.paragraph=function(T){return"

    "+T+"

    \n"},q.table=function(T,D){return D&&(D=""+D+""),"\n\n"+T+"\n"+D+"
    \n"},q.tablerow=function(T){return"\n"+T+"\n"},q.tablecell=function(T,D){var B=D.header?"th":"td";return(D.align?"<"+B+' align="'+D.align+'">':"<"+B+">")+T+"\n"},q.strong=function(T){return""+T+""},q.em=function(T){return""+T+""},q.codespan=function(T){return""+T+""},q.br=function(){return this.options.xhtml?"
    ":"
    "},q.del=function(T){return""+T+""},q.link=function(T,D,B){if(null===(T=Fr(this.options.sanitize,this.options.baseUrl,T)))return B;var K='"+B+""},q.image=function(T,D,B){if(null===(T=Fr(this.options.sanitize,this.options.baseUrl,T)))return B;var K=''+B+'":">")},q.text=function(T){return T},G}(),oo=function(){function G(){}var q=G.prototype;return q.strong=function(T){return T},q.em=function(T){return T},q.codespan=function(T){return T},q.del=function(T){return T},q.html=function(T){return T},q.text=function(T){return T},q.link=function(T,D,B){return""+B},q.image=function(T,D,B){return""+B},q.br=function(){return""},G}(),ci=function(){function G(){this.seen={}}var q=G.prototype;return q.serialize=function(T){return T.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},q.getNextSafeSlug=function(T,D){var B=T,K=0;if(this.seen.hasOwnProperty(B)){K=this.seen[T];do{B=T+"-"+ ++K}while(this.seen.hasOwnProperty(B))}return D||(this.seen[T]=K,this.seen[B]=0),B},q.slug=function(T,D){void 0===D&&(D={});var B=this.serialize(T);return this.getNextSafeSlug(B,D.dryrun)},G}(),xh=hc,bl=oo,La=ci,ao=Pt.exports.defaults,Ba=rn_unescape,ls=li,lo=function(){function G(Z){this.options=Z||ao,this.options.renderer=this.options.renderer||new xh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new bl,this.slugger=new La}G.parse=function(T,D){return new G(D).parse(T)},G.parseInline=function(T,D){return new G(D).parseInline(T)};var q=G.prototype;return q.parse=function(T,D){void 0===D&&(D=!0);var K,H,se,ce,de,Be,Kt,Cn,jt,gt,Zt,ti,Hi,$i,ln,bi,gc,co,dd,B="",El=T.length;for(K=0;K0&&"text"===ln.tokens[0].type?(ln.tokens[0].text=co+" "+ln.tokens[0].text,ln.tokens[0].tokens&&ln.tokens[0].tokens.length>0&&"text"===ln.tokens[0].tokens[0].type&&(ln.tokens[0].tokens[0].text=co+" "+ln.tokens[0].tokens[0].text)):ln.tokens.unshift({type:"text",text:co}):$i+=co),$i+=this.parse(ln.tokens,Hi),jt+=this.renderer.listitem($i,gc,bi);B+=this.renderer.list(jt,Zt,ti);continue;case"html":B+=this.renderer.html(gt.text);continue;case"paragraph":B+=this.renderer.paragraph(this.parseInline(gt.tokens));continue;case"text":for(jt=gt.tokens?this.parseInline(gt.tokens):gt.text;K+1An error occurred:

    "+pc(se.message+"",!0)+"
    ";throw se}}return Ye.options=Ye.setOptions=function(G){return uu(Ye.defaults,G),du(Ye.defaults),Ye},Ye.getDefaults=ud,Ye.defaults=Vs,Ye.use=function(){for(var G=this,q=arguments.length,Z=new Array(q),T=0;TAn error occurred:

    "+pc(T.message+"",!0)+"
    ";throw T}},Ye.Parser=lo,Ye.parser=lo.parse,Ye.Renderer=Cl,Ye.TextRenderer=lu,Ye.Lexer=ls,Ye.lexer=ls.lex,Ye.Tokenizer=fc,Ye.Slugger=cu,Ye.parse=Ye,Ye}()},310:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.isMobile=function(){return void 0!==k.window.orientation},We.default=function(yt){if(!yt&&!(0,It.default)())return"Node";if((0,Pt.default)(yt))return"Electron";var dn="undefined"!=typeof navigator?navigator:{},En=yt||dn.userAgent||"";if(En.indexOf("Edge")>-1)return"Edge";var Fe=-1!==En.indexOf("MSIE "),je=-1!==En.indexOf("Trident/");return Fe||je?"IE":k.window.chrome?"Chrome":k.window.safari?"Safari":k.window.mozInnerScreenX?"Firefox":"Unknown"};var k=Ve(151),It=_t(Ve(602)),Pt=_t(Ve(344))},151:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.console=We.process=We.document=We.global=We.window=We.self=void 0;var k=_t(Ve(321)),It={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,k.default)(process))&&process};We.self=It.self||It.window||It.global,We.window=It.window||It.self||It.global,We.global=It.global||It.self||It.window,We.document=It.document||{},We.process=It.process||{};var En=console;We.console=En},761:(pt,We,Ve)=>{"use strict";var k=Ve(948),It=Ve(321);Object.defineProperty(We,"CO",{enumerable:!0,get:function(){return Pt.global}}),Object.defineProperty(We,"jU",{enumerable:!0,get:function(){return ft.default}}),Object.defineProperty(We,"qs",{enumerable:!0,get:function(){return qt.default}});var Pt=Ve(151),ft=En(Ve(602)),qt=En(Ve(310));k(Ve(344));function dn(Fe){if("function"!=typeof WeakMap)return null;var je=new WeakMap,$t=new WeakMap;return(dn=function(Ie){return Ie?$t:je})(Fe)}function En(Fe,je){if(!je&&Fe&&Fe.__esModule)return Fe;if(null===Fe||"object"!==It(Fe)&&"function"!=typeof Fe)return{default:Fe};var $t=dn(je);if($t&&$t.has(Fe))return $t.get(Fe);var Ne={},Ie=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var pi in Fe)if("default"!==pi&&Object.prototype.hasOwnProperty.call(Fe,pi)){var qe=Ie?Object.getOwnPropertyDescriptor(Fe,pi):null;qe&&(qe.get||qe.set)?Object.defineProperty(Ne,pi,qe):Ne[pi]=Fe[pi]}return Ne.default=Fe,$t&&$t.set(Fe,Ne),Ne}},602:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=Pt,We.isBrowserMainThread=function(){return Pt()&&"undefined"!=typeof document};var k=_t(Ve(321)),It=_t(Ve(344));function Pt(){return!("object"===("undefined"==typeof process?"undefined":(0,k.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,It.default)()}},344:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=function(Pt){if("undefined"!=typeof window&&"object"===(0,k.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,k.default)(process.versions)&&Boolean(process.versions.electron))return!0;var ft="object"===("undefined"==typeof navigator?"undefined":(0,k.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,qt=Pt||ft;return!!(qt&&qt.indexOf("Electron")>=0)};var k=_t(Ve(321))},473:(pt,We,Ve)=>{"use strict";var _t={};Ve.r(_t),Ve.d(_t,{decode:()=>$ve,encode:()=>Gve});var k={};Ve.r(k),Ve.d(k,{decode:()=>Kve,encode:()=>Zve});var It={};Ve.r(It),Ve.d(It,{decode:()=>Qve,encode:()=>Jve});var Pt={};function ft(n){return"function"==typeof n}Ve.r(Pt),Ve.d(Pt,{decode:()=>ebe,encode:()=>tbe});let qt=!1;const yt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else qt&&console.log("RxJS: Back to a better error behavior. Thank you. <3");qt=n},get useDeprecatedSynchronousErrorHandling(){return qt}};function dn(n){setTimeout(()=>{throw n},0)}const En={closed:!0,next(n){},error(n){if(yt.useDeprecatedSynchronousErrorHandling)throw n;dn(n)},complete(){}},Fe=Array.isArray||(n=>n&&"number"==typeof n.length);function je(n){return null!==n&&"object"==typeof n}const Ne=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class Ie{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof Ie)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof Ne?t.errors:t),[])}Ie.EMPTY=((n=new Ie).closed=!0,n);const qe="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class Rt extends Ie{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=En;break;case 1:if(!e){this.destination=En;break}if("object"==typeof e){e instanceof Rt?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new nn(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new nn(this,e,t,i)}}[qe](){return this}static create(e,t,i){const r=new Rt(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class nn extends Rt{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;ft(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==En&&(o=Object.create(t),ft(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;yt.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=yt;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):dn(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;dn(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);yt.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),yt.useDeprecatedSynchronousErrorHandling)throw i;dn(i)}}__tryOrSetError(e,t,i){if(!yt.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return yt.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(dn(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const yi="function"==typeof Symbol&&Symbol.observable||"@@observable";function vi(n){return n}function Er(...n){return Ae(n)}function Ae(n){return 0===n.length?vi:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let oe=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof Rt)return n;if(n[qe])return n[qe]()}return n||e||t?new Rt(n,e,t):new Rt(En)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||yt.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),yt.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){yt.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof Rt?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=kt(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[yi](){return this}pipe(...t){return 0===t.length?this:Ae(t)(this)}toPromise(t){return new(t=kt(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function kt(n){if(n||(n=yt.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const Gt=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class oi extends Ie{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class Oi extends Rt{constructor(e){super(e),this.destination=e}}let we=(()=>{class n extends oe{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[qe](){return new Oi(this)}lift(t){const i=new rn(this,this);return i.operator=t,i}next(t){if(this.closed)throw new Gt;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew rn(e,t),n})();class rn extends we{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):Ie.EMPTY}}function Ln(n){return n&&"function"==typeof n.schedule}function be(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new Ii(n,e))}}class Ii{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new Ft(e,this.project,this.thisArg))}}class Ft extends Rt{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const Sr=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function He(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Pi=n=>{if(n&&"function"==typeof n[yi])return(n=>e=>{const t=n[yi]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(ot(n))return Sr(n);if(He(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,dn),e))(n);if(n&&"function"==typeof n[as])return(n=>e=>{const t=n[as]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${je(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Ri(n,e){return new oe(t=>{const i=new Ie;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function li(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[yi]}(n))return function(n,e){return new oe(t=>{const i=new Ie;return i.add(e.schedule(()=>{const r=n[yi]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(He(n))return function(n,e){return new oe(t=>{const i=new Ie;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(ot(n))return Ri(n,e);if(function(n){return n&&"function"==typeof n[as]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new oe(t=>{const i=new Ie;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[as](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof oe?n:new oe(Pi(n))}class $r extends Rt{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class ei extends Rt{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function oo(n,e){if(e.closed)return;if(n instanceof oe)return n.subscribe(e);let t;try{t=Pi(n)(e)}catch(i){e.error(i)}return t}function ci(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(ci((r,s)=>li(n(r,s)).pipe(be((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new xh(n,t)))}class xh{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new bl(e,this.project,this.concurrent))}}class bl extends ei{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function ao(n=Number.POSITIVE_INFINITY){return ci(vi,n)}function Ba(n,e){return e?Ri(n,e):new oe(Sr(n))}function ki(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Ln(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof oe?n[0]:ao(e)(Ba(n,t))}function ls(){return function(e){return e.lift(new lo(e))}}class lo{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new fc(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class fc extends Rt{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Cl extends oe{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new Ie,e.add(this.source.subscribe(new cu(this.getSubject(),this))),e.closed&&(this._connection=null,e=Ie.EMPTY)),e}refCount(){return ls()(this)}}const lu=(()=>{const n=Cl.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class cu extends Oi{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}function pc(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new ud(r,e));const s=Object.create(i,lu);return s.source=i,s.subjectFactory=r,s}}class ud{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function du(){return new we}function Vs(){return n=>ls()(pc(du)(n))}function Ye(n){for(let e in n)if(n[e]===Ye)return e;throw Error("Could not find renamed property on target object.")}function hu(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function G(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(G).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function q(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const Z=Ye({__forward_ref__:Ye});function T(n){return n.__forward_ref__=T,n.toString=function(){return G(this())},n}function D(n){return B(n)?n():n}function B(n){return"function"==typeof n&&n.hasOwnProperty(Z)&&n.__forward_ref__===T}class H extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function de(n){return"string"==typeof n?n:null==n?"":String(n)}function Be(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():de(n)}function gt(n,e){const t=e?` in ${e}`:"";throw new H("201",`No provider for ${Be(n)} found${t}`)}function Gi(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function ae(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Ee(n){return{providers:n.providers||[],imports:n.imports||[]}}function ir(n){return _c(n,la)||_c(n,ja)}function _c(n,e){return n.hasOwnProperty(e)?n[e]:null}function mu(n){return n&&(n.hasOwnProperty(Sl)||n.hasOwnProperty(mp))?n[Sl]:null}const la=Ye({\u0275prov:Ye}),Sl=Ye({\u0275inj:Ye}),ja=Ye({ngInjectableDef:Ye}),mp=Ye({ngInjectorDef:Ye});var vt=(()=>((vt=vt||{})[vt.Default=0]="Default",vt[vt.Host=1]="Host",vt[vt.Self=2]="Self",vt[vt.SkipSelf=4]="SkipSelf",vt[vt.Optional=8]="Optional",vt))();let Ml;function ca(n){const e=Ml;return Ml=n,e}function hd(n,e,t){const i=ir(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&vt.Optional?null:void 0!==e?e:void gt(G(n),"Injector")}function R(n){return{toString:n}.toString()}var j=(()=>((j=j||{})[j.OnPush=0]="OnPush",j[j.Default=1]="Default",j))(),Re=(()=>((Re=Re||{})[Re.Emulated=0]="Emulated",Re[Re.None=2]="None",Re[Re.ShadowDom=3]="ShadowDom",Re))();const hn="undefined"!=typeof globalThis&&globalThis,cr="undefined"!=typeof window&&window,mr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Gr="undefined"!=typeof global&&global,cn=hn||Gr||cr||mr,fd={},gi=[],yp=Ye({\u0275cmp:Ye}),s_=Ye({\u0275dir:Ye}),Ah=Ye({\u0275pipe:Ye}),h0=Ye({\u0275mod:Ye}),p1=Ye({\u0275loc:Ye}),xl=Ye({\u0275fac:Ye}),Dh=Ye({__NG_ELEMENT_ID__:Ye});let g1=0;function Le(n){return R(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===j.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||gi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Re.Emulated,id:"c",styles:n.styles||gi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=g1++,i.inputs=m0(n.inputs,t),i.outputs=m0(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(f0):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(p0):null,i})}function f0(n){return Wn(n)||function(n){return n[s_]||null}(n)}function p0(n){return function(n){return n[Ah]||null}(n)}const g0={};function xe(n){return R(()=>{const e={type:n.type,bootstrap:n.bootstrap||gi,declarations:n.declarations||gi,imports:n.imports||gi,exports:n.exports||gi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(g0[n.id]=n.type),e})}function m0(n,e){if(null==n)return fd;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const he=Le;function cs(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Wn(n){return n[yp]||null}function uo(n,e){const t=n[h0]||null;if(!t&&!0===e)throw new Error(`Type ${G(n)} does not have '\u0275mod' property.`);return t}function Po(n){return Array.isArray(n)&&"object"==typeof n[1]}function Ro(n){return Array.isArray(n)&&!0===n[1]}function l_(n){return 0!=(8&n.flags)}function _d(n){return 2==(2&n.flags)}function yd(n){return 1==(1&n.flags)}function ha(n){return null!==n.template}function _0(n){return 0!=(512&n[2])}function bc(n,e){return n.hasOwnProperty(xl)?n[xl]:null}class h_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function qn(){return b0}function b0(n){return n.type.prototype.ngOnChanges&&(n.setInput=E1),w1}function w1(){const n=W(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===fd)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function E1(n,e,t,i){const r=W(n)||function(n,e){return n[Fh]=e}(n,{previous:fd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new h_(l&&l.currentValue,e,o===fd),n[i]=e}qn.ngInherit=!0;const Fh="__ngSimpleChanges__";function W(n){return n[Fh]||null}const Bn="http://www.w3.org/2000/svg";let di;function Ti(n){return!!n.listen}const vu={createRenderer:(n,e)=>void 0!==di?di:"undefined"!=typeof document?document:void 0};function qi(n){for(;Array.isArray(n);)n=n[0];return n}function Nh(n,e){return qi(e[n])}function Ss(n,e){return qi(e[n.index])}function g_(n,e){return n.data[e]}function vd(n,e){return n[e]}function ds(n,e){const t=e[n];return Po(t)?t:t[0]}function Dl(n){return 4==(4&n[2])}function bd(n){return 128==(128&n[2])}function pa(n,e){return null==e?null:n[e]}function m_(n){n[18]=0}function Cp(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Ut={lFrame:Cu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function w0(){return Ut.bindingsEnabled}function Ce(){return Ut.lFrame.lView}function Sn(){return Ut.lFrame.tView}function Vn(n){return Ut.lFrame.contextLView=n,n[8]}function Tr(){let n=__();for(;null!==n&&64===n.type;)n=n.parent;return n}function __(){return Ut.lFrame.currentTNode}function Ha(n,e){const t=Ut.lFrame;t.currentTNode=n,t.isParent=e}function hr(){return Ut.lFrame.isParent}function Nr(){Ut.lFrame.isParent=!1}function Vh(){return Ut.isInCheckNoChangesMode}function Ep(n){Ut.isInCheckNoChangesMode=n}function qr(){const n=Ut.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function zs(){return Ut.lFrame.bindingIndex}function ga(){return Ut.lFrame.bindingIndex++}function fo(n){const e=Ut.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Cd(n,e){const t=Ut.lFrame;t.bindingIndex=t.bindingRootIndex=n,y_(e)}function y_(n){Ut.lFrame.currentDirectiveIndex=n}function v_(n){const e=Ut.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function E0(){return Ut.lFrame.currentQueryIndex}function b_(n){Ut.lFrame.currentQueryIndex=n}function Mp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function wd(n,e,t){if(t&vt.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&vt.Host||(r=Mp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ut.lFrame=O();return i.currentTNode=e,i.lView=n,!0}function zh(n){const e=O(),t=n[1];Ut.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function O(){const n=Ut.lFrame,e=null===n?null:n.child;return null===e?Cu(n):e}function Cu(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Hh(){const n=Ut.lFrame;return Ut.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const po=Hh;function pn(){const n=Hh();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Ms(){return Ut.lFrame.selectedIndex}function Hs(n){Ut.lFrame.selectedIndex=n}function rr(){const n=Ut.lFrame;return g_(n.tView,n.selectedIndex)}function xp(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class $h{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Dp(n,e,t){const i=Ti(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let Sd=!0;function Op(n){const e=Sd;return Sd=n,e}let x_=0;function hs(n,e){const t=Ip(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,T_(i.data,n),T_(e,null),T_(i.blueprint,null));const r=Wh(n,e),s=n.injectorIndex;if(T0(r)){const o=Ed(r),a=Ga(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function T_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Ip(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Wh(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function wc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Dh)&&(i=t[Dh]),null==i&&(i=t[Dh]=x_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:I0:e}(t);if("function"==typeof s){if(!wd(e,n,i))return i&vt.Host?A_(r,t,i):D0(e,t,i,r);try{const o=s(i);if(null!=o||i&vt.Optional)return o;gt(t)}finally{po()}}else if("number"==typeof s){let o=null,a=Ip(n,e),l=-1,c=i&vt.Host?e[16][6]:null;for((-1===a||i&vt.SkipSelf)&&(l=-1===a?Wh(n,e):e[a+8],-1!==l&&Yh(i,!1)?(o=e[1],a=Ed(l),e=Ga(l,e)):a=-1);-1!==a;){const d=e[1];if(Pp(s,a,d.data)){const f=Yr(a,e,t,o,i,c);if(f!==O0)return f}l=e[a+8],-1!==l&&Yh(i,e[1].data[a+8]===c)&&Pp(s,a,e)?(o=d,a=Ed(l),e=Ga(l,e)):a=-1}}}return D0(e,t,i,r)}const O0={};function I0(){return new Fo(Tr(),Ce())}function Yr(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=Md(a,o,t,null==i?_d(a)&&Sd:i!=o&&0!=(3&a.type),r&vt.Host&&s===a);return null!==d?xd(e,o,d,a):O0}function Md(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&ha(g)&&g.type===t)return l}return null}function xd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof $h}(r)){const o=r;o.resolving&&function(n,e){throw new H("200",`Circular dependency in DI detected for ${n}`)}(Be(s[t]));const a=Op(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ca(o.injectImpl):null;wd(n,i,vt.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=b0(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ca(l),Op(a),o.resolving=!1,po()}}return r}function Pp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[xl]||Xr(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[xl]||Xr(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Xr(n){return B(n)?()=>{const e=Xr(D(n));return e&&e()}:bc(n)}function fs(n){return function(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const i=t.length;let r=0;for(;r{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(Ad)?l[Ad]:Object.defineProperty(l,Ad,{value:[]})[Ad];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class _e{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=ae({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const Su=Function;function No(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Lo(t,e):e(t))}function Kh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Il(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Sc(n,e){const t=[];for(let i=0;i=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function k_(n,e){const t=Kr(n,e);if(t>=0)return n[1|t]}function Kr(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):G(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Tc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[xc]=null,n}const Rd=Pd(ya("Inject",n=>({token:n})),-1),yr=Pd(ya("Optional"),8),Xa=Pd(ya("SkipSelf"),4);let Fd;function Iu(n){var e;return(null===(e=function(){if(void 0===Fd&&(Fd=null,cn.trustedTypes))try{Fd=cn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Fd}())||void 0===e?void 0:e.createHTML(n))||n}class Fl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class j_ extends Fl{getTypeName(){return"HTML"}}class U_ extends Fl{getTypeName(){return"Style"}}class Gp extends Fl{getTypeName(){return"Script"}}class Nd extends Fl{getTypeName(){return"URL"}}class Nt extends Fl{getTypeName(){return"ResourceURL"}}function ps(n){return n instanceof Fl?n.changingThisBreaksApplicationSecurity:n}function Bo(n,e){const t=Oc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Oc(n){return n instanceof Fl&&n.getTypeName()||null}class X0{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Iu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class tx{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Iu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Iu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0_o(e.trim())).join(", ")}function Vo(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Qh(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Wp=Vo("area,br,col,hr,img,wbr"),Z0=Vo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Q0=Vo("rp,rt"),H_=Qh(Wp,Qh(Z0,Vo("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Qh(Q0,Vo("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Qh(Q0,Z0)),$_=Vo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),G_=Vo("srcset"),W_=Qh($_,G_,Vo("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Vo("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),ax=Vo("script,style,template");class q_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!H_.hasOwnProperty(t))return this.sanitizedSomething=!0,!ax.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();H_.hasOwnProperty(t)&&!Wp.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Yp(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return t}}const J0=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Jh=/([^\#-~ |!])/g;function Yp(n){return n.replace(/&/g,"&").replace(J0,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Jh,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let ef;function Y_(n,e){let t=null;try{ef=ef||function(n){const e=new tx(n);return function(){try{return!!(new window.DOMParser).parseFromString(Iu(""),"text/html")}catch(n){return!1}}()?new X0(e):e}(n);let i=e?String(e):"";t=ef.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=t.innerHTML,t=ef.getInertBodyElement(i)}while(i!==s);return Iu((new q_).sanitizeChildren(Ld(t)||t))}finally{if(t){const i=Ld(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Ld(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var on=(()=>((on=on||{})[on.NONE=0]="NONE",on[on.HTML=1]="HTML",on[on.STYLE=2]="STYLE",on[on.SCRIPT=3]="SCRIPT",on[on.URL=4]="URL",on[on.RESOURCE_URL=5]="RESOURCE_URL",on))();const Z_="__ngContext__";function Zr(n,e){n[Z_]=e}function Q_(n){const e=function(n){return n[Z_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Kp(n){return n.ngOriginalError}function bx(n,...e){n.error(...e)}class Uo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||bx}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(Kp(e)):null}_findOriginalError(e){let t=e&&Kp(e);for(;t&&Kp(t);)t=Kp(t);return t||null}}const uC=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(cn))();function ny(n){return n.ownerDocument.defaultView}function Qp(n){return n.ownerDocument}function Za(n){return n instanceof Function?n():n}var yo=(()=>((yo=yo||{})[yo.Important=1]="Important",yo[yo.DashCase=2]="DashCase",yo))();function ry(n,e){return undefined(n,e)}function rf(n){const e=n[3];return Ro(e)?e[3]:e}function Vd(n){return gC(n[13])}function oy(n){return gC(n[4])}function gC(n){for(;null!==n&&!Ro(n);)n=n[4];return n}function jd(n,e,t,i,r){if(null!=i){let s,o=!1;Ro(i)?s=i:Po(i)&&(o=!0,i=i[0]);const a=qi(i);0===n&&null!==t?null==r?bC(e,t,a):Qa(e,t,a,r||null,!0):1===n&&null!==t?Qa(e,t,a,r||null,!0):2===n?function(n,e,t){const i=eg(n,e);i&&function(n,e,t,i){Ti(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==qi(t)&&jd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Il(n,10+e);!function(n,e){Ud(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function uy(n,e){if(!(256&e[2])){const t=e[11];Ti(t)&&t.destroyNode&&Ud(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Jp(n[1],n);for(;e;){let t=null;if(Po(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Po(e)&&Jp(e[1],e),e=e[3];null===e&&(e=n),Po(e)&&Jp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Jp(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==of(g,c,0)||2&i&&c!==p){if(ba(i))return!1;o=!0}}}}else{if(!o&&!ba(i)&&!ba(l))return!1;if(o&&ba(l))continue;o=!1,i=l|1&i}}return ba(i)||o}function ba(n){return 0==(1&n)}function Gx(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!ba(o)&&(e+=RC(s,r),r=""),i=o,s=s||!ba(i);t++}return""!==r&&(e+=RC(s,r)),e}const St={};function Y(n){kC(Sn(),Ce(),Ms()+n,Vh())}function kC(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Tp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Ap(e,s,0,t)}Hs(t)}function Ja(n,e){return n<<17|e<<2}function Ot(n){return n>>17&32767}function Yi(n){return 2|n}function Nl(n){return(131068&n)>>2}function el(n,e){return-131069&n|e<<2}function my(n){return 1|n}function HC(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&kC(n,e,20,Vh()),t(i,r)}finally{Hs(s)}}function GC(n,e,t){if(l_(e)){const r=e.directiveEnd;for(let s=e.directiveStart;s0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function ew(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function tw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function vT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&Ay(t)}}function Ay(n){for(let i=Vd(n);null!==i;i=oy(i))for(let r=10;r0&&Ay(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&Ay(r)}}function xT(n,e){const t=ds(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function rw(n){return n[7]||(n[7]=[])}function ug(n){return n.cleanup||(n.cleanup=[])}function Ry(n,e,t){return(null===n||ha(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function ky(n,e){const t=n[9],i=t?t.get(Uo,null):null;i&&i.handleError(e)}function sw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Lo([e],a=>this.processInjectorType(a,[],s)),this.records.set(ku,Nu(void 0,this));const o=this.records.get(Fu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:G(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=Tu,i=vt.Default){this.assertNotDestroyed();const r=Id(this),s=ca(void 0);try{if(!(i&vt.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof _e}(e)&&ir(e);a=l&&this.injectableDefInScope(l)?Nu(Vy(e),df):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&vt.Self?ow():this.parent).get(e,t=i&vt.Optional&&t===Tu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[xc]=o[xc]||[]).unshift(G(e)),r)throw o;return xs(o,e,"R3InjectorError",this.source)}throw o}finally{ca(s),Id(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(G(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=D(e)))return!1;let r=mu(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=mu(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Lo(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||gi))}}this.injectorDefTypes.add(o);const l=bc(o)||(()=>new o);this.records.set(o,Nu(l,df));const c=r.providers;if(null!=c&&!a){const d=e;Lo(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Rc(e=D(e))?e:D(e&&e.provide);const s=function(n,e,t){return cw(n)?Nu(void 0,n.useValue):Nu(lw(n),df)}(e);if(Rc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Nu(void 0,df,!0),o.factory=()=>Du(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===df&&(t.value=RT,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=D(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Vy(n){const e=ir(n),t=null!==e?e.factory:bc(n);if(null!==t)return t;if(n instanceof _e)throw new Error(`Token ${G(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=Sc(e,"?");throw new Error(`Can't resolve all parameters for ${G(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[la]||n[ja]);if(e){const t=function(n){if(n.hasOwnProperty("name"))return n.name;const e=(""+n).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${t}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${t}" class.`),e}return null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new Error("unreachable")}function lw(n,e,t){let i;if(Rc(n)){const r=D(n);return bc(r)||Vy(r)}if(cw(n))i=()=>D(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Du(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>I(D(n.useExisting));else{const r=D(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return bc(r)||Vy(r);i=()=>new r(...Du(n.deps))}return i}function Nu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function cw(n){return null!==n&&"object"==typeof n&&Bp in n}function Rc(n){return"function"==typeof n}const uw=function(n,e,t){return function(n,e=null,t=null,i){const r=aw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Tt{static create(e,t){return Array.isArray(e)?uw(e,t,""):uw(e.providers,e.parent,e.name||"")}}function u9(n,e){xp(Q_(n)[1],Tr())}function ht(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(ha(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=qT(n.inputs),o.declaredInputs=qT(n.declaredInputs),o.outputs=qT(n.outputs);const a=r.hostBindings;a&&p9(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&h9(n,l),c&&f9(n,c),hu(n.inputs,r.inputs),hu(n.declaredInputs,r.declaredInputs),hu(n.outputs,r.outputs),ha(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Gh(r.hostAttrs,t=Gh(t,r.hostAttrs))}}(i)}function qT(n){return n===fd?{}:n===gi?[]:n}function h9(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function f9(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function p9(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Tt.THROW_IF_NOT_FOUND=Tu,Tt.NULL=new Ds,Tt.\u0275prov=ae({token:Tt,providedIn:"any",factory:()=>I(ku)}),Tt.__NG_ELEMENT_ID__=-1;let gw=null;function hg(){if(!gw){const n=cn.Symbol;if(n&&n.iterator)gw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(qi(L[i.index])):i.index;if(Ti(t)){let L=null;if(!a&&l&&(L=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==L)(L.__ngLastListenerFn__||L).__ngNextListenerFn__=s,L.__ngLastListenerFn__=s,g=!1;else{s=tA(i,e,f,s,!1);const U=t.listen(w,r,s);p.push(s,U),d&&d.push(r,x,C,C+1)}}else s=tA(i,e,f,s,!0),w.addEventListener(r,s,o),p.push(s),d&&d.push(r,x,C,o)}else s=tA(i,e,f,s,!1);const _=i.outputs;let y;if(g&&null!==_&&(y=_[r])){const v=y.length;if(v)for(let w=0;w0;)e=e[15],n--;return e}(n,Ut.lFrame.contextLView))[8]}(n)}function q9(n,e){let t=null;const i=function(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(n);for(let r=0;r=0}const Jr={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function o2(n){return n.substring(Jr.key,Jr.keyEnd)}function a2(n,e){const t=Jr.textEnd;return t===e?-1:(e=Jr.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Jr.key=e,t),Eg(n,e,t))}function Eg(n,e,t){for(;e=0;t=a2(e,t))go(n,o2(e),!0)}function Ul(n,e,t,i){const r=Ce(),s=Sn(),o=fo(2);s.firstUpdatePass&&f2(s,n,o,i),e!==St&&qs(r,o,e)&&g2(s,s.data[Ms()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=G(ps(n)))),n}(e,t),i,o)}function zl(n,e,t,i){const r=Sn(),s=fo(2);r.firstUpdatePass&&f2(r,null,s,i);const o=Ce();if(t!==St&&qs(o,s,t)){const a=r.data[Ms()];if(_2(a,i)&&!h2(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=q(l,t||"")),eA(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===St&&(r=gi);let l=0,c=0,d=0=n.expandoStartIndex}function f2(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Ms()],o=h2(n,t);_2(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=v_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Xy(t=iA(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=iA(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Nl(i))return n[Ot(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=iA(null,n,e,l[1],i),l=Xy(l,e.attrs,i),function(n,e,t,i){n[Ot(t?e.classBindings:e.styleBindings)]=i}(n,e,i,l))}else s=function(n,e,t){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Ot(n[a+1]);n[i+1]=Ja(p,a),0!==p&&(n[p+1]=el(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=Ja(a,0),0!==a&&(n[a+1]=el(n[a+1],i)),a=i;else n[i+1]=Ja(l,0),0===a?a=i:n[l+1]=el(n[l+1],i),l=i;c&&(n[i+1]=Yi(n[i+1])),s2(n,d,i,!0),s2(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Kr(s,e)>=0&&(t[i+1]=my(t[i+1]))}(e,d,n,i,s),o=Ja(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function iA(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===St&&(p=f?gi:void 0);let g=f?k_(p,i):d===i?p:void 0;if(c&&!vw(g)&&(g=k_(l,i)),vw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Ot(_):Nl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=k_(l,i))}return a}function vw(n){return void 0!==n}function _2(n,e){return 0!=(n.flags&(e?16:32))}function Te(n,e=""){const t=Ce(),i=Sn(),r=n+20,s=i.firstCreatePass?Hd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return Ti(n)?n.createText(e):n.createTextNode(e)}(t[11],e);tg(i,t,o,s),Ha(s,!1)}function Ai(n){return Os("",n,""),Ai}function Os(n,e,t){const i=Ce(),r=pg(i,n,e,t);return r!==St&&Ll(i,Ms(),r),Os}function bw(n,e,t,i,r){const s=Ce(),o=function(n,e,t,i,r,s){const a=hf(n,zs(),t,r);return fo(2),a?e+de(t)+i+de(r)+s:St}(s,n,e,t,i,r);return o!==St&&Ll(s,Ms(),o),bw}function sl(n,e,t){const i=Ce();return qs(i,ga(),e)&&vo(Sn(),rr(),i,n,e,i[11],t,!0),sl}function Sg(n,e,t){const i=Ce();if(qs(i,ga(),e)){const s=Sn(),o=rr();vo(s,o,i,n,e,Ry(v_(s.data),o,i),t,!0)}return Sg}const mf=void 0;var D7=["en",[["a","p"],["AM","PM"],mf],[["AM","PM"],mf,mf],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],mf,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],mf,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",mf,"{1} 'at' {0}",mf],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Mg={};function N2(n){return n in Mg||(Mg[n]=cn.ng&&cn.ng.common&&cn.ng.common.locales&&cn.ng.common.locales[n]),Mg[n]}var tt=(()=>((tt=tt||{})[tt.LocaleId=0]="LocaleId",tt[tt.DayPeriodsFormat=1]="DayPeriodsFormat",tt[tt.DayPeriodsStandalone=2]="DayPeriodsStandalone",tt[tt.DaysFormat=3]="DaysFormat",tt[tt.DaysStandalone=4]="DaysStandalone",tt[tt.MonthsFormat=5]="MonthsFormat",tt[tt.MonthsStandalone=6]="MonthsStandalone",tt[tt.Eras=7]="Eras",tt[tt.FirstDayOfWeek=8]="FirstDayOfWeek",tt[tt.WeekendRange=9]="WeekendRange",tt[tt.DateFormat=10]="DateFormat",tt[tt.TimeFormat=11]="TimeFormat",tt[tt.DateTimeFormat=12]="DateTimeFormat",tt[tt.NumberSymbols=13]="NumberSymbols",tt[tt.NumberFormats=14]="NumberFormats",tt[tt.CurrencyCode=15]="CurrencyCode",tt[tt.CurrencySymbol=16]="CurrencySymbol",tt[tt.CurrencyName=17]="CurrencyName",tt[tt.Currencies=18]="Currencies",tt[tt.Directionality=19]="Directionality",tt[tt.PluralCase=20]="PluralCase",tt[tt.ExtraData=21]="ExtraData",tt))();const Cw="en-US";let L2=Cw;function rA(n){Gi(n,"Expected localeId to be defined"),"string"==typeof n&&(L2=n.toLowerCase().replace(/_/g,"-"))}function aA(n,e,t,i,r){if(n=D(n),Array.isArray(n))for(let s=0;s>20;if(Rc(n)||!n.multi){const g=new $h(l,r,E),_=cA(a,e,r?d:d+p,f);-1===_?(wc(hs(c,o),s,a),lA(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[_]=g,o[_]=g)}else{const g=cA(a,e,d+p,f),_=cA(a,e,d,d+p),y=g>=0&&t[g],v=_>=0&&t[_];if(r&&!v||!r&&!y){wc(hs(c,o),s,a);const w=function(n,e,t,i,r){const s=new $h(n,t,E);return s.multi=[],s.index=e,s.componentProviders=0,aL(s,r,i&&!t),s}(r?xY:MY,t.length,r,i,l);!r&&v&&(t[_].providerFactory=w),lA(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(w),o.push(w)}else lA(s,n,g>-1?g:_,aL(t[r?_:g],l,!r&&i));!r&&i&&v&&t[_].componentProviders++}}}function lA(n,e,t,i){const r=Rc(e);if(r||function(n){return!!n.useClass}(e)){const o=(e.useClass||e).prototype.ngOnDestroy;if(o){const a=n.destroyHooks||(n.destroyHooks=[]);if(!r&&e.multi){const l=a.indexOf(t);-1===l?a.push(t,[i,o]):a[l+1].push(i,o)}else a.push(t,o)}}}function aL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function cA(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Sn();if(i.firstCreatePass){const r=ha(n);aA(t,i.data,i.blueprint,r,!0),aA(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class lL{}const uL="ngComponent";class DY{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${G(n)}. Did you add it to @NgModule.entryComponents?`);return e[uL]=n,e}(e)}}class ol{}function xw(...n){}function Tg(n,e){return new nt(Ss(n,e))}ol.NULL=new DY;const PY=function(){return Tg(Tr(),Ce())};let nt=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=PY,n})();function dL(n){return n instanceof nt?n.nativeElement:n}class _f{}let Lc=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>kY(),n})();const kY=function(){const n=Ce(),t=ds(Tr().index,n);return function(n){return n[11]}(Po(t)?t:n)};let hA=(()=>{class n{}return n.\u0275prov=ae({token:n,providedIn:"root",factory:()=>null}),n})();class Lu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const hL=new Lu("12.2.5");class fL{constructor(){}supports(e){return $y(e)}create(e){return new BY(e)}}const LY=(n,e)=>e;class BY{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||LY}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new VY(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new pL),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new pL),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class VY{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class jY{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class pL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new jY,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function gL(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new zY(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class zY{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function _L(){return new Ag([new fL])}let Ag=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||_L()),deps:[[n,new Xa,new yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=ae({token:n,providedIn:"root",factory:_L}),n})();function yL(){return new Dg([new mL])}let Dg=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||yL()),deps:[[n,new Xa,new yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=ae({token:n,providedIn:"root",factory:yL}),n})();function Tw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(qi(s)),Ro(s))for(let a=10;a-1&&(cy(e,i),Il(t,i))}this._attachedToViewContainer=!1}uy(this._lView[1],this._lView)}onDestroy(e){qC(this._lView[1],this._lView,null,e)}markForCheck(){Dy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Iy(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Ep(!0);try{Iy(n,e,t)}finally{Ep(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Ud(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class $Y extends ev{constructor(e){super(e),this._view=e}detectChanges(){iw(this._view)}checkNoChanges(){!function(n){Ep(!0);try{iw(n)}finally{Ep(!1)}}(this._view)}get context(){return null}}const WY=function(n){return function(n,e,t){if(_d(n)&&!t){const i=ds(n.index,e);return new ev(i,i)}return 47&n.type?new ev(e[16],e):null}(Tr(),Ce(),16==(16&n))};let Un=(()=>{class n{}return n.__NG_ELEMENT_ID__=WY,n})();const XY=[new mL],ZY=new Ag([new fL]),QY=new Dg(XY),eX=function(){return Aw(Tr(),Ce())};let Xs=(()=>{class n{}return n.__NG_ELEMENT_ID__=eX,n})();const tX=Xs,nX=class extends tX{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=lf(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),cf(t,i,e),new ev(i)}};function Aw(n,e){return 4&n.type?new nX(e,n,Tg(n,e)):null}class Bc{}const sX=function(){return wL(Tr(),Ce())};let es=(()=>{class n{}return n.__NG_ELEMENT_ID__=sX,n})();const aX=es,bL=class extends aX{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return Tg(this._hostTNode,this._hostLView)}get injector(){return new Fo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Wh(this._hostTNode,this._hostLView);if(T0(e)){const t=Ga(e,this._hostLView),i=Ed(e);return new Fo(t[1].data[i+8],t)}return new Fo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=CL(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Bc,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Ro(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new bL(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),iuC});class $L extends lL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(Kx).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return HL(this.componentDef.inputs)}get outputs(){return HL(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,Rg,r);return s!==Rg||i===Rg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(_f,vu),a=s.get(hA,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(Ti(n))return n.selectRootElement(e,t===Re.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ly(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?Bn:"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||uC,clean:IT,playerHandler:e||null,flags:0}}(),g=lg(0,null,null,1,0,null,null,null,null,null),_=lf(null,g,p,f,null,null,o,l,a,s);let y,v;zh(_);try{const w=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Hd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(dg(l,c,!0),null!==n&&(Dp(r,n,c),null!==l.classes&&py(r,n,l.classes),null!==l.styles&&DC(r,n,l.styles)));const d=i.createRenderer(n,e),f=lf(t,ag(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(wc(hs(l,t),o,e.type),tw(o,l),My(l,t.length,1)),cg(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)Dp(l,d,["ng-version",hL.full]);else{const{attrs:C,classes:x}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&py(l,d,x.join(" "))}if(v=g_(g,20),void 0!==t){const C=v.projection=[];for(let x=0;xl(o,e)),e.contentQueries){const l=Tr();e.contentQueries(1,o,l.directiveStart)}const a=Tr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(Hs(a.index),JC(t[1],a,0,a.directiveStart,a.directiveEnd,e),ew(e,o)),o}(w,this.componentDef,_,p,[u9]),cf(g,_,null)}finally{pn()}return new oK(this.componentType,y,Tg(v,_),_,v)}}class oK extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new $Y(r),this.componentType=e}get injector(){return new Fo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const kg=new Map;class cK extends Bc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new zL(this);const i=uo(e),r=function(n){return n[p1]||null}(e);r&&rA(r),this._bootstrapComponents=Za(i.bootstrap),this._r3Injector=aw(e,t,[{provide:Bc,useValue:this},{provide:ol,useValue:this.componentFactoryResolver}],G(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Tt.THROW_IF_NOT_FOUND,i=vt.Default){return e===Tt||e===Bc||e===ku?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class xA extends class{}{constructor(e){super(),this.moduleType=e,null!==uo(e)&&function(n){const e=new Set;!function t(i){const r=uo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${G(e)} vs ${G(e.name)}`)}(s,kg.get(s),i),kg.set(s,i));const o=Za(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new cK(this.moduleType,e)}}function lv(n,e,t){const i=qr()+n,r=Ce();return r[i]===St?Fc(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function Fg(n,e,t,i){return qL(Ce(),qr(),n,e,t,i)}function cv(n,e){const t=n[e];return t===St?void 0:t}function qL(n,e,t,i,r,s){const o=e+t;return qs(n,o,r)?Fc(n,o+1,s?i.call(s,r):i(r)):cv(n,o+1)}function yn(n,e){const t=Sn();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new H("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=bc(i.type)),o=ca(E);try{const a=Op(!1),l=s();return Op(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Ce(),r,l),l}finally{ca(o)}}function wn(n,e,t){const i=n+20,r=Ce(),s=vd(r,i);return dv(r,uv(r,i)?qL(r,qr(),e,s.transform,t,s):s.transform(t))}function QL(n,e,t,i){const r=n+20,s=Ce(),o=vd(s,r);return dv(s,uv(s,r)?function(n,e,t,i,r,s,o){const a=e+t;return hf(n,a,r,s)?Fc(n,a+2,o?i.call(o,r,s):i(r,s)):cv(n,a+2)}(s,qr(),e,o.transform,t,i,o):o.transform(t,i))}function uv(n,e){return n[1].data[e].pure}function dv(n,e){return Vl.isWrapped(e)&&(e=Vl.unwrap(e),n[zs()]=St),e}function TA(n){return e=>{setTimeout(n,void 0,e)}}const Pe=class extends we{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=TA(l),a&&(a=TA(a)),c&&(c=TA(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof Ie&&e.add(d),d}};function EK(){return this._results[hg()]()}class bf{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=hg(),i=bf.prototype;i[t]||(i[t]=EK)}get changes(){return this._changes||(this._changes=new Pe)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=No(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=xw,this.reject=xw,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(I(Cf,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const fv=new _e("AppId"),rZ={provide:fv,useFactory:function(){return`${BA()}${BA()}${BA()}`},deps:[]};function BA(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const CB=new _e("Platform Initializer"),cl=new _e("Platform ID"),pv=new _e("appBootstrapListener");let Nw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Bu=new _e("LocaleId"),wB=new _e("DefaultCurrencyCode");class oZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const VA=function(n){return new xA(n)},aZ=VA,lZ=function(n){return Promise.resolve(VA(n))},EB=function(n){const e=VA(n),i=Za(uo(n).declarations).reduce((r,s)=>{const o=Wn(s);return o&&r.push(new $L(o)),r},[]);return new oZ(e,i)},cZ=EB,uZ=function(n){return Promise.resolve(EB(n))};let wf=(()=>{class n{constructor(){this.compileModuleSync=aZ,this.compileModuleAsync=lZ,this.compileModuleAndAllComponentsSync=cZ,this.compileModuleAndAllComponentsAsync=uZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const SB=new _e("compilerOptions"),hZ=(()=>Promise.resolve(0))();function jA(n){"undefined"==typeof Zone?hZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class lt{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Pe(!1),this.onMicrotaskEmpty=new Pe(!1),this.onStable=new Pe(!1),this.onError=new Pe(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=cn.requestAnimationFrame,e=cn.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(cn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,zA(n),n.isCheckStableRunning=!0,UA(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),zA(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return MB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),xB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return MB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),xB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,zA(n),UA(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!lt.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(lt.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,pZ,xw,xw);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const pZ={};function UA(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function zA(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function MB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function xB(n){n._nesting--,UA(n)}class _Z{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Pe,this.onMicrotaskEmpty=new Pe,this.onStable=new Pe,this.onError=new Pe}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let HA=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{lt.assertNotInAngularZone(),jA(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())jA(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(I(lt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),TB=(()=>{class n{constructor(){this._applications=new Map,$A.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return $A.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class yZ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let $A=new yZ,AB=!0,DB=!1;function wo(){return DB=!0,AB}let Gl;const OB=new _e("AllowMultipleToken");function IB(n,e,t=[]){const i=`Platform: ${e}`,r=new _e(i);return(s=[])=>{let o=WA();if(!o||o.injector.get(OB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Fu,useValue:"platform"});!function(n){if(Gl&&!Gl.destroyed&&!Gl.injector.get(OB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Gl=n.get(PB);const e=n.get(CB,null);e&&e.forEach(t=>t())}(Tt.create({providers:a,name:i}))}return function(n){const e=WA();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function WA(){return Gl&&!Gl.destroyed?Gl:null}let PB=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new _Z:("zone.js"===n?void 0:n)||new lt({enableLongStackTrace:wo(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:lt,useValue:a}];return a.run(()=>{const c=Tt.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Uo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{qA(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return Wy(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(Lg);return p.runInitializers(),p.donePromise.then(()=>(rA(d.injector.get(Bu,Cw)||Cw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=RB({},i);return function(n,e,t){const i=new xA(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(Yd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${G(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function RB(n,e){return Array.isArray(e)?e.reduce(RB,n):Object.assign(Object.assign({},n),e)}let Yd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new oe(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new oe(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{lt.assertNotInAngularZone(),jA(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{lt.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=ki(a,l.pipe(Vs()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof lL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Bc),a=r.create(Tt.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(HA,null),d=c&&a.injector.get(TB);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),qA(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;qA(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(pv,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(Tt),I(Uo),I(ol),I(Lg))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function qA(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const GZ=IB(null,"core",[{provide:cl,useValue:"unknown"},{provide:PB,deps:[Tt]},{provide:TB,deps:[]},{provide:Nw,deps:[]}]),KZ=[{provide:Yd,useClass:Yd,deps:[lt,Tt,Uo,ol,Lg]},{provide:iK,deps:[lt],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Lg,useClass:Lg,deps:[[new yr,Cf]]},{provide:wf,useClass:wf,deps:[]},rZ,{provide:Ag,useFactory:function(){return ZY},deps:[]},{provide:Dg,useFactory:function(){return QY},deps:[]},{provide:Bu,useFactory:function(n){return rA(n=n||"undefined"!=typeof $localize&&$localize.locale||Cw),n},deps:[[new Rd(Bu),new yr,new Xa]]},{provide:wB,useValue:"USD"}];let QZ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(I(Yd))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:KZ}),n})(),Yw=null;function Vc(){return Yw}const rt=new _e("DocumentToken");let Mf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:ZQ,token:n,providedIn:"platform"}),n})();function ZQ(){return I(a3)}let a3=(()=>{class n extends Mf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Vc().getBaseHref(this._doc)}onPopState(t){const i=Vc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Vc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){l3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){l3()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:JQ,token:n,providedIn:"platform"}),n})();function l3(){return!!window.history.pushState}function JQ(){return new a3(I(rt))}function lD(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}function c3(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function ju(n){return n&&"?"!==n[0]?"?"+n:n}let jg=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:eJ,token:n,providedIn:"root"}),n})();function eJ(n){const e=I(rt).location;return new u3(I(Mf),e&&e.origin||"")}const cD=new _e("appBaseHref");let u3=(()=>{class n extends jg{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return lD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+ju(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+ju(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+ju(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(I(Mf),I(cD,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Ug=(()=>{class n{constructor(t,i){this._subject=new Pe,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=c3(d3(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+ju(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,d3(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ju(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ju(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(I(jg),I(Mf))},n.normalizeQueryParams=ju,n.joinWithSlash=lD,n.stripTrailingSlash=c3,n.\u0275prov=ae({factory:nJ,token:n,providedIn:"root"}),n})();function nJ(){return new Ug(I(jg),I(Mf))}function d3(n){return n.replace(/\/index.html$/,"")}var Br=(()=>((Br=Br||{})[Br.Zero=0]="Zero",Br[Br.One=1]="One",Br[Br.Two=2]="Two",Br[Br.Few=3]="Few",Br[Br.Many=4]="Many",Br[Br.Other=5]="Other",Br))();const uJ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=N2(e);if(t)return t;const i=e.split("-")[0];if(t=N2(i),t)return t;if("en"===i)return D7;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[tt.PluralCase]};class rE{}let VJ=(()=>{class n extends rE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(uJ(i||this.locale)(t)){case Br.Zero:return"zero";case Br.One:return"one";case Br.Two:return"two";case Br.Few:return"few";case Br.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(I(Bu))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function b3(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}let sE=(()=>{class n{constructor(t,i,r,s){this._iterableDiffers=t,this._keyValueDiffers=i,this._ngEl=r,this._renderer=s,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(t){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&($y(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachChangedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachRemovedItem(i=>{i.previousValue&&this._toggleClass(i.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(i=>{if("string"!=typeof i.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${G(i.item)}`);this._toggleClass(i.item,!0)}),t.forEachRemovedItem(i=>this._toggleClass(i.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!0)):Object.keys(t).forEach(i=>this._toggleClass(i,!!t[i])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!1)):Object.keys(t).forEach(i=>this._toggleClass(i,!1)))}_toggleClass(t,i){(t=t.trim())&&t.split(/\s+/g).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ag),E(Dg),E(nt),E(Lc))},n.\u0275dir=he({type:n,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),n})();class UJ{constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Xl=(()=>{class n{constructor(t,i,r){this._viewContainer=t,this._template=i,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(i){throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const i=[];t.forEachOperation((r,s,o)=>{if(null==r.previousIndex){const a=this._viewContainer.createEmbeddedView(this._template,new UJ(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new C3(r,a);i.push(l)}else if(null==o)this._viewContainer.remove(null===s?void 0:s);else if(null!==s){const a=this._viewContainer.get(s);this._viewContainer.move(a,o);const l=new C3(r,a);i.push(l)}});for(let r=0;r{this._viewContainer.get(r.currentIndex).context.$implicit=r.item})}_perViewChange(t,i){t.context.$implicit=i.item}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Ag))},n.\u0275dir=he({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class C3{constructor(e,t){this.record=e,this.view=t}}let Is=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new HJ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){w3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){w3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs))},n.\u0275dir=he({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class HJ{constructor(){this.$implicit=null,this.ngIf=null}}function w3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${G(e)}'.`)}class yD{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Cv=(()=>{class n{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const i=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||i,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),i}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let i=0;i{class n{constructor(t,i,r){this.ngSwitch=r,r._addCase(),this._view=new yD(t,i)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Cv,9))},n.\u0275dir=he({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),n})(),E3=(()=>{class n{constructor(t,i,r){r._addDefault(new yD(t,i))}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Cv,9))},n.\u0275dir=he({type:n,selectors:[["","ngSwitchDefault",""]]}),n})(),M3=(()=>{class n{constructor(t,i,r){this._ngEl=t,this._differs=i,this._renderer=r,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,i){const[r,s]=t.split(".");null!=(i=null!=i&&s?`${i}${s}`:i)?this._renderer.setStyle(this._ngEl.nativeElement,r,i):this._renderer.removeStyle(this._ngEl.nativeElement,r)}_applyChanges(t){t.forEachRemovedItem(i=>this._setStyle(i.key,null)),t.forEachAddedItem(i=>this._setStyle(i.key,i.currentValue)),t.forEachChangedItem(i=>this._setStyle(i.key,i.currentValue))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Dg),E(Lc))},n.\u0275dir=he({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),n})();function Kl(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${G(n)}'`)}class WJ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class qJ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const YJ=new qJ,XJ=new WJ;let zu=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(Wy(t))return YJ;if(qN(t))return XJ;throw Kl(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(Un,16))},n.\u0275pipe=cs({name:"async",type:n,pure:!1}),n})();const tee=/#/g;let x3=(()=>{class n{constructor(t){this._localization=t}transform(t,i,r){if(null==t)return"";if("object"!=typeof i||null===i)throw Kl(n,i);return i[function(n,e,t,i){let r=`=${n}`;if(e.indexOf(r)>-1||(r=t.getPluralCategory(n,i),e.indexOf(r)>-1))return r;if(e.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${n}"`)}(t,Object.keys(i),this._localization,r)].replace(tee,t.toString())}}return n.\u0275fac=function(t){return new(t||n)(E(rE,16))},n.\u0275pipe=cs({name:"i18nPlural",type:n,pure:!0}),n})(),T3=(()=>{class n{transform(t){return JSON.stringify(t,null,2)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=cs({name:"json",type:n,pure:!1}),n})(),bn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:rE,useClass:VJ}]}),n})();const D3="browser";function xf(n){return n===D3}function wD(n){return"server"===n}class P3{}class ED extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){Yw||(Yw=n)}(new ED)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(wv=wv||document.querySelector("base"),wv?wv.getAttribute("href"):null);return null==t?null:function(n){oE=oE||document.createElement("a"),oE.setAttribute("href",n);const e=oE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){wv=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return b3(document.cookie,e)}}let oE,wv=null;const R3=new _e("TRANSITION_ID"),yee=[{provide:Cf,useFactory:function(n,e,t){return()=>{t.get(Lg).donePromise.then(()=>{const i=Vc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},cn.getAllAngularTestabilities=()=>e.getAllTestabilities(),cn.getAllAngularRootElements=()=>e.getAllRootElements(),cn.frameworkStabilizers||(cn.frameworkStabilizers=[]),cn.frameworkStabilizers.push(i=>{const r=cn.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Vc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let vee=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Ev=new _e("EventManagerPlugins");let lE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Sv=(()=>{class n extends F3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(N3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(N3))}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function N3(n){Vc().remove(n)}const xD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},TD=/%COMP%/g;function cE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let uE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new AD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Re.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new kee(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Re.ShadowDom:return new Fee(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=cE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(I(lE),I(Sv),I(fv))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class AD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(xD[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=xD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=xD[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(yo.DashCase|yo.Important)?e.style.setProperty(t,i,r&yo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&yo.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,V3(i)):this.eventManager.addEventListener(e,t,V3(i))}}class kee extends AD{constructor(e,t,i,r){super(e),this.component=i;const s=cE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(TD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(TD,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class Fee extends AD{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=cE(r.id,r.styles,[]);for(let o=0;o{class n extends MD{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const z3=["alt","control","meta","shift"],Hee={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},H3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},$ee={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Gee=(()=>{class n extends MD{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Vc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(z3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&H3.hasOwnProperty(e)&&(e=H3[e]))}return Hee[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),z3.forEach(s=>{s!=r&&$ee[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Kd=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return I(OD)},token:n,providedIn:"root"}),n})(),OD=(()=>{class n extends Kd{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case on.NONE:return i;case on.HTML:return Bo(i,"HTML")?ps(i):Y_(this._doc,String(i)).toString();case on.STYLE:return Bo(i,"Style")?ps(i):i;case on.SCRIPT:if(Bo(i,"Script"))return ps(i);throw new Error("unsafe value used in a script context");case on.URL:return Oc(i),Bo(i,"URL")?ps(i):_o(String(i));case on.RESOURCE_URL:if(Bo(i,"ResourceURL"))return ps(i);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return function(n){return new j_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new U_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Gp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new Nd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Nt(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return function(n){return new OD(n.get(rt))}(I(ku))},token:n,providedIn:"root"}),n})();const Jee=IB(GZ,"browser",[{provide:cl,useValue:D3},{provide:CB,useValue:function(){ED.makeCurrent(),SD.init()},multi:!0},{provide:rt,useFactory:function(){return function(n){di=n}(document),document},deps:[]}]),ete=[[],{provide:Fu,useValue:"root"},{provide:Uo,useFactory:function(){return new Uo},deps:[]},{provide:Ev,useClass:Nee,multi:!0,deps:[rt,lt,cl]},{provide:Ev,useClass:Gee,multi:!0,deps:[rt]},[],{provide:uE,useClass:uE,deps:[lE,Sv,fv]},{provide:_f,useExisting:uE},{provide:F3,useExisting:Sv},{provide:Sv,useClass:Sv,deps:[rt]},{provide:HA,useClass:HA,deps:[lt]},{provide:lE,useClass:lE,deps:[Ev,lt]},{provide:P3,useClass:vee,deps:[]},[]];let dE=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:fv,useValue:t.appId},{provide:R3,useExisting:fv},yee]}}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:ete,imports:[bn,QZ]}),n})();"undefined"!=typeof window&&window;class lte extends Ie{constructor(e,t){super()}schedule(e,t=0){return this}}class hE extends lte{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let G3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Zl extends G3{constructor(e,t=G3.now){super(e,()=>Zl.delegate&&Zl.delegate!==this?Zl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Zl.delegate&&Zl.delegate!==this?Zl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const dte=new class extends Zl{}(class extends hE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Ql=new oe(n=>n.complete());function fE(n){return n?function(n){return new oe(e=>n.schedule(()=>e.complete()))}(n):Ql}function st(...n){let e=n[n.length-1];return Ln(e)?(n.pop(),Ri(n,e)):Ba(n)}function zg(n,e){return new oe(e?t=>e.schedule(fte,0,{error:n,subscriber:t}):t=>t.error(n))}function fte({error:n,subscriber:e}){e.error(n)}class qo{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return st(this.value);case"E":return zg(this.error);case"C":return fE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new qo("N",e):qo.undefinedValueNotification}static createError(e){return new qo("E",void 0,e)}static createComplete(){return qo.completeNotification}}qo.completeNotification=new qo("C"),qo.undefinedValueNotification=new qo("N",void 0);class pE extends Rt{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(pE.dispatch,this.delay,new gte(e,this.destination)))}_next(e){this.scheduleMessage(qo.createNext(e))}_error(e){this.scheduleMessage(qo.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(qo.createComplete()),this.unsubscribe()}}class gte{constructor(e,t){this.notification=e,this.destination=t}}class Hg extends we{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new mte(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new Gt;if(this.isStopped||this.hasError?o=Ie.EMPTY:(this.observers.push(e),o=new oi(this,e)),r&&e.add(e=new pE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class mte{constructor(e,t){this.time=e,this.value=t}}function Ir(n,e){return"function"==typeof e?t=>t.pipe(Ir((i,r)=>li(n(i,r)).pipe(be((s,o)=>e(i,s,r,o))))):t=>t.lift(new _te(n))}class _te{constructor(e){this.project=e}call(e,t){return t.subscribe(new yte(e,this.project))}}class yte extends ei{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new $r(this),r=this.destination;r.add(i),this.innerSubscription=oo(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const gE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return gE.schedule(n,0);if(void 0===window.requestAnimationFrame)return gE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let PD;function Ate(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!PD){const t=Element.prototype;PD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&PD.call(n,e)}(n,r)||(i=s,0))),i}class Ote{constructor(e,t){this.componentFactory=t.get(ol).resolveComponentFactory(e)}create(e){return new Ite(this.componentFactory,e)}}class Ite{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new Hg(1),this.events=this.eventEmitters.pipe(Ir(i=>ki(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(lt),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=gE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=Tt.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(be(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=gE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new h_(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class Pte extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Dt(n){return null!=n&&"false"!=`${n}`}function So(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function mE(n){return Array.isArray(n)?n:[n]}function jr(n){return null==n?"":"string"==typeof n?n:`${n}px`}function Hu(n){return n instanceof nt?n.nativeElement:n}const Tf=new Zl(hE);function $g(n,e=Tf){return t=>t.lift(new Nte(n,e))}class Nte{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Lte(e,this.dueTime,this.scheduler))}}class Lte extends Rt{constructor(e,t,i){super(e),this.dueTime=t,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Bte,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function Bte(n){n.debouncedNext()}let RD=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})(),W3=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Hu(t);return new oe(r=>{const o=this._observeElement(i).subscribe(r);return()=>{o.unsubscribe(),this._unobserveElement(i)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const i=new we,r=this._mutationObserverFactory.create(s=>i.next(s));r&&r.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:r,stream:i,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:i,stream:r}=this._observedElements.get(t);i&&i.disconnect(),r.complete(),this._observedElements.delete(t)}}}return n.\u0275fac=function(t){return new(t||n)(I(RD))},n.\u0275prov=ae({factory:function(){return new n(I(RD))},token:n,providedIn:"root"}),n})(),kD=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new Pe,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=So(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe($g(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(W3),E(nt),E(lt))},n.\u0275dir=he({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),_E=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[RD]}),n})();class sr extends we{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Gt;return this._value}next(e){super.next(this._value=e)}}function Yo(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}function Qd(){}function Di(n,e,t){return function(r){return r.lift(new Kte(n,e,t))}}class Kte{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Zte(e,this.nextOrObserver,this.error,this.complete))}}class Zte extends Rt{constructor(e,t,i,r){super(e),this._tapNext=Qd,this._tapError=Qd,this._tapComplete=Qd,this._tapError=i||Qd,this._tapComplete=r||Qd,ft(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||Qd,this._tapError=t.error||Qd,this._tapComplete=t.complete||Qd)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}function Tn(n,e){return function(i){return i.lift(new Qte(n,e))}}class Qte{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new Jte(e,this.predicate,this.thisArg))}}class Jte extends Rt{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}const K3=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function _i(n){return e=>0===n?fE():e.lift(new ene(n))}class ene{constructor(e){if(this.total=e,this.total<0)throw new K3}call(e,t){return t.subscribe(new tne(e,this.total))}}class tne extends Rt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function VD(n){return e=>e.lift(new nne(n))}class nne{constructor(e){this.total=e}call(e,t){return t.subscribe(new ine(e,this.total))}}class ine extends Rt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function Xo(n,e){return t=>t.lift(new rne(n,e))}class rne{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new sne(e,this.compare,this.keySelector))}}class sne extends Rt{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}function zn(n){return e=>e.lift(new one(n))}class one{constructor(e){this.notifier=e}call(e,t){const i=new ane(e),r=oo(this.notifier,new $r(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class ane extends ei{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}let jD;try{jD="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){jD=!1}let qg,ii=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?xf(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!jD)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(I(cl))},n.\u0275prov=ae({factory:function(){return new n(I(cl))},token:n,providedIn:"root"}),n})(),Av=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const Z3=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function Q3(){if(qg)return qg;if("object"!=typeof document||!document)return qg=new Set(Z3),qg;let n=document.createElement("input");return qg=new Set(Z3.filter(e=>(n.setAttribute("type",e),n.type===e))),qg}let Dv,Af,UD;function Yg(n){return function(){if(null==Dv&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Dv=!0}))}finally{Dv=Dv||!1}return Dv}()?n:!!n.capture}function J3(){if(null==Af){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Af=!1,Af;if("scrollBehavior"in document.documentElement.style)Af=!0;else{const n=Element.prototype.scrollTo;Af=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Af}function vE(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Df(n){return n.composedPath?n.composedPath()[0]:n.target}function bE(n,e){return(n.getAttribute(e)||"").match(/\S+/g)||[]}const tV="cdk-describedby-message-container",nV="cdk-describedby-message",CE="cdk-describedby-host";let fne=0;const jc=new Map;let Ps=null,iV=(()=>{class n{constructor(t){this._document=t}describe(t,i,r){if(!this._canBeDescribed(t,i))return;const s=zD(i,r);"string"!=typeof i?(rV(i),jc.set(s,{messageElement:i,referenceCount:0})):jc.has(s)||this._createMessageElement(i,r),this._isElementDescribedByMessage(t,s)||this._addMessageReference(t,s)}removeDescription(t,i,r){if(!i||!this._isElementNode(t))return;const s=zD(i,r);if(this._isElementDescribedByMessage(t,s)&&this._removeMessageReference(t,s),"string"==typeof i){const o=jc.get(s);o&&0===o.referenceCount&&this._deleteMessageElement(s)}Ps&&0===Ps.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${CE}]`);for(let i=0;i0!=r.indexOf(nV));t.setAttribute("aria-describedby",i.join(" "))}_addMessageReference(t,i){const r=jc.get(i);(function(n,e,t){const i=bE(n,e);i.some(r=>r.trim()==t.trim())||(i.push(t.trim()),n.setAttribute(e,i.join(" ")))})(t,"aria-describedby",r.messageElement.id),t.setAttribute(CE,""),r.referenceCount++}_removeMessageReference(t,i){const r=jc.get(i);r.referenceCount--,function(n,e,t){const r=bE(n,e).filter(s=>s!=t.trim());r.length?n.setAttribute(e,r.join(" ")):n.removeAttribute(e)}(t,"aria-describedby",r.messageElement.id),t.removeAttribute(CE)}_isElementDescribedByMessage(t,i){const r=bE(t,"aria-describedby"),s=jc.get(i),o=s&&s.messageElement.id;return!!o&&-1!=r.indexOf(o)}_canBeDescribed(t,i){if(!this._isElementNode(t))return!1;if(i&&"object"==typeof i)return!0;const r=null==i?"":`${i}`.trim(),s=t.getAttribute("aria-label");return!(!r||s&&s.trim()===r)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})();function zD(n,e){return"string"==typeof n?`${e||""}/${n}`:n}function rV(n){n.id||(n.id=`${nV}-${fne++}`)}class sV{constructor(e){this._items=e,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new we,this._typeaheadSubscription=Ie.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new we,this.change=new we,e instanceof bf&&e.changes.subscribe(t=>{if(this._activeItem){const r=t.toArray().indexOf(this._activeItem);r>-1&&r!==this._activeItemIndex&&(this._activeItemIndex=r)}})}skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(Di(t=>this._pressedLetters.push(t)),$g(e),Tn(()=>this._pressedLetters.length>0),be(()=>this._pressedLetters.join(""))).subscribe(t=>{const i=this._getItemsArray();for(let r=1;r!e[s]||this._allowedModifierKeys.indexOf(s)>-1);switch(t){case 9:return void this.tabOut.next();case 40:if(this._vertical&&r){this.setNextItemActive();break}return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&r){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&r){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}return;default:return void((r||Yo(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))))}this._pressedLetters=[],e.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem}isTyping(){return this._pressedLetters.length>0}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._items.length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(e){const t=this._getItemsArray(),i="number"==typeof e?e:t.indexOf(e),r=t[i];this._activeItem=null==r?null:r,this._activeItemIndex=i}_setActiveItemByDelta(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}_setActiveInWrapMode(e){const t=this._getItemsArray();for(let i=1;i<=t.length;i++){const r=(this._activeItemIndex+e*i+t.length)%t.length;if(!this._skipPredicateFn(t[r]))return void this.setActiveItem(r)}}_setActiveInDefaultMode(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}_setActiveItemByIndex(e,t){const i=this._getItemsArray();if(i[e]){for(;this._skipPredicateFn(i[e]);)if(!i[e+=t])return;this.setActiveItem(e)}}_getItemsArray(){return this._items instanceof bf?this._items.toArray():this._items}}class oV extends sV{setActiveItem(e){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(e),this.activeItem&&this.activeItem.setActiveStyles()}}class aV extends sV{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}}let lV=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===uV(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=uV(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||cV(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(ii))},token:n,providedIn:"root"}),n})();function cV(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function uV(n){if(!cV(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class Sne{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const e=this._startAnchor,t=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),t&&(t.removeEventListener("focus",this.endAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(_i(1)).subscribe(e)}}let dV=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new Sne(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(I(lV),I(lt),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(lV),I(lt),I(rt))},token:n,providedIn:"root"}),n})();function hV(n){return 0===n.offsetX&&0===n.offsetY}function fV(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const pV=new _e("cdk-input-modality-detector-options"),Dne={ignoreKeys:[18,17,224,91,16]},Xg=Yg({passive:!0,capture:!0});let mV=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new sr(null),this._lastTouchMs=0,this._onKeydown=o=>{var a,l;(null===(l=null===(a=this._options)||void 0===a?void 0:a.ignoreKeys)||void 0===l?void 0:l.some(c=>c===o.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Df(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(hV(o)?"keyboard":"mouse"),this._mostRecentTarget=Df(o))},this._onTouchstart=o=>{fV(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Df(o))},this._options=Object.assign(Object.assign({},Dne),s),this.modalityDetected=this._modality.pipe(VD(1)),this.modalityChanged=this.modalityDetected.pipe(Xo()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,Xg),r.addEventListener("mousedown",this._onMousedown,Xg),r.addEventListener("touchstart",this._onTouchstart,Xg)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Xg),document.removeEventListener("mousedown",this._onMousedown,Xg),document.removeEventListener("touchstart",this._onTouchstart,Xg))}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt),I(rt),I(pV,8))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt),I(rt),I(pV,8))},token:n,providedIn:"root"}),n})();const _V=new _e("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),yV=new _e("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let wE=(()=>{class n{constructor(t,i,r,s){this._ngZone=i,this._defaultOptions=s,this._document=r,this._liveElement=t||this._createLiveElement()}announce(t,...i){const r=this._defaultOptions;let s,o;return 1===i.length&&"number"==typeof i[0]?o=i[0]:[s,o]=i,this.clear(),clearTimeout(this._previousTimeout),s||(s=r&&r.politeness?r.politeness:"polite"),null==o&&r&&(o=r.duration),this._liveElement.setAttribute("aria-live",s),this._ngZone.runOutsideAngular(()=>new Promise(a=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,a(),"number"==typeof o&&(this._previousTimeout=setTimeout(()=>this.clear(),o))},100)}))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement&&this._liveElement.parentNode&&(this._liveElement.parentNode.removeChild(this._liveElement),this._liveElement=null)}_createLiveElement(){const t="cdk-live-announcer-element",i=this._document.getElementsByClassName(t),r=this._document.createElement("div");for(let s=0;s{class n{constructor(t,i,r,s,o){this._ngZone=t,this._platform=i,this._inputModalityDetector=r,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new we,this._rootNodeFocusAndBlurListener=a=>{const l=Df(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let d=l;d;d=d.parentElement)c.call(this,a,d)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=Hu(t);if(!this._platform.isBrowser||1!==r.nodeType)return st(null);const s=function(n){if(function(){if(null==UD){const n="undefined"!=typeof document?document.head:null;UD=!(!n||!n.createShadowRoot&&!n.attachShadow)}return UD}()){const e=n.getRootNode?n.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}(r)||this._getDocument(),o=this._elementInfo.get(r);if(o)return i&&(o.checkChildren=!0),o.subject;const a={checkChildren:i,subject:new we,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Hu(t),r=this._elementInfo.get(i);r&&(r.subject.complete(),this._setClasses(i),this._elementInfo.delete(i),this._removeGlobalListeners(r))}focusVia(t,i,r){const s=Hu(t);s===this._getDocument().activeElement?this._getClosestElementsInfo(s).forEach(([a,l])=>this._originChanged(a,i,l)):(this._setOrigin(i),"function"==typeof s.focus&&s.focus(r))}ngOnDestroy(){this._elementInfo.forEach((t,i)=>this.stopMonitoring(i))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,i,r){r?t.classList.add(i):t.classList.remove(i)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,i){this._toggleClass(t,"cdk-focused",!!i),this._toggleClass(t,"cdk-touch-focused","touch"===i),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===i),this._toggleClass(t,"cdk-mouse-focused","mouse"===i),this._toggleClass(t,"cdk-program-focused","program"===i)}_setOrigin(t,i=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&i,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,i){const r=this._elementInfo.get(i),s=Df(t);!r||!r.checkChildren&&i!==s||this._originChanged(i,this._getFocusOrigin(s),r)}_onBlur(t,i){const r=this._elementInfo.get(i);!r||r.checkChildren&&t.relatedTarget instanceof Node&&i.contains(t.relatedTarget)||(this._setClasses(i),this._emitOrigin(r.subject,null))}_emitOrigin(t,i){this._ngZone.run(()=>t.next(i))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const i=t.rootNode,r=this._rootNodeFocusListenerCount.get(i)||0;r||this._ngZone.runOutsideAngular(()=>{i.addEventListener("focus",this._rootNodeFocusAndBlurListener,EE),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,EE)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(zn(this._stopInputModalityDetector)).subscribe(s=>{this._setOrigin(s,!0)}))}_removeGlobalListeners(t){const i=t.rootNode;if(this._rootNodeFocusListenerCount.has(i)){const r=this._rootNodeFocusListenerCount.get(i);r>1?this._rootNodeFocusListenerCount.set(i,r-1):(i.removeEventListener("focus",this._rootNodeFocusAndBlurListener,EE),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,EE),this._rootNodeFocusListenerCount.delete(i))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,i,r){this._setClasses(t,i),this._emitOrigin(r.subject,i),this._lastFocusOrigin=i}_getClosestElementsInfo(t){const i=[];return this._elementInfo.forEach((r,s)=>{(s===t||r.checkChildren&&s.contains(t))&&i.push([s,r])}),i}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(ii),I(mV),I(rt,8),I(vV,8))},n.\u0275prov=ae({factory:function(){return new n(I(lt),I(ii),I(mV),I(rt,8),I(vV,8))},token:n,providedIn:"root"}),n})();const bV="cdk-high-contrast-black-on-white",CV="cdk-high-contrast-white-on-black",HD="cdk-high-contrast-active";let wV=(()=>{class n{constructor(t,i){this._platform=t,this._document=i}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const i=this._document.defaultView||window,r=i&&i.getComputedStyle?i.getComputedStyle(t):null,s=(r&&r.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),s){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(HD),t.remove(bV),t.remove(CV),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(HD),t.add(bV)):2===i&&(t.add(HD),t.add(CV))}}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(rt))},token:n,providedIn:"root"}),n})(),Ine=(()=>{class n{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return n.\u0275fac=function(t){return new(t||n)(I(wV))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Av,_E]]}),n})();const EV=new _e("cdk-dir-doc",{providedIn:"root",factory:function(){return Ac(rt)}});let Ko=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new Pe,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(I(EV,8))},n.\u0275prov=ae({factory:function(){return new n(I(EV,8))},token:n,providedIn:"root"}),n})(),Iv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const SV=new Lu("12.2.5");class MV{}const $u="*";function Jl(n,e){return{type:7,name:n,definitions:e,options:{}}}function Mo(n,e=null){return{type:4,styles:e,timings:n}}function xV(n,e=null){return{type:2,steps:n,options:e}}function Kn(n){return{type:6,styles:n,offset:null}}function br(n,e,t){return{type:0,name:n,styles:e,options:t}}function kne(n){return{type:5,steps:n}}function Qs(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function Fne(n=null){return{type:9,options:n}}function Nne(n,e,t=null){return{type:11,selector:n,animation:e,options:t}}function TV(n){Promise.resolve(null).then(n)}class Kg{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){TV(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class AV{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,i=0,r=0;const s=this.players.length;0==s?TV(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++i==s&&this._onDestroy()}),o.onStart(()=>{++r==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(i=>{const r=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(r)})}getPosition(){const e=this.players.reduce((t,i)=>null===t||i.totalTime>t.totalTime?i:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function DV(){return"undefined"!=typeof window&&void 0!==window.document}function GD(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Jd(n){switch(n.length){case 0:return new Kg;case 1:return n[0];default:return new AV(n)}}function OV(n,e,t,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(d=>{const f=d.offset,p=f==l,g=p&&c||{};Object.keys(d).forEach(_=>{let y=_,v=d[_];if("offset"!==_)switch(y=e.normalizePropertyName(y,o),v){case"!":v=r[_];break;case $u:v=s[_];break;default:v=e.normalizeStyleValue(_,y,v,o)}g[y]=v}),p||a.push(g),c=g,l=f}),o.length){const d="\n - ";throw new Error(`Unable to animate due to the following errors:${d}${o.join(d)}`)}return a}function WD(n,e,t,i){switch(e){case"start":n.onStart(()=>i(t&&qD(t,"start",n)));break;case"done":n.onDone(()=>i(t&&qD(t,"done",n)));break;case"destroy":n.onDestroy(()=>i(t&&qD(t,"destroy",n)))}}function qD(n,e,t){const i=t.totalTime,s=YD(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,null==i?n.totalTime:i,!!t.disabled),o=n._data;return null!=o&&(s._data=o),s}function YD(n,e,t,i,r="",s=0,o){return{element:n,triggerName:e,fromState:t,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function wa(n,e,t){let i;return n instanceof Map?(i=n.get(e),i||n.set(e,i=t)):(i=n[e],i||(i=n[e]=t)),i}function IV(n){const e=n.indexOf(":");return[n.substring(1,e),n.substr(e+1)]}let XD=(n,e)=>!1,KD=(n,e)=>!1,PV=(n,e,t)=>[];const RV=GD();(RV||"undefined"!=typeof Element)&&(XD=DV()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),KD=(()=>{if(RV||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):KD}})(),PV=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{const i=t.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=n[t]}),e}let NV=(()=>{class n{validateStyleProperty(t){return ZD(t)}matchesElement(t,i){return QD(t,i)}containsElement(t,i){return JD(t,i)}query(t,i,r){return eO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new Kg(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class SE{}SE.NOOP=new NV;const tO="ng-enter",ME="ng-leave",xE="ng-trigger",TE=".ng-trigger",BV="ng-animating",nO=".ng-animating";function If(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:iO(parseFloat(e[1]),e[2])}function iO(n,e){switch(e){case"s":return 1e3*n;default:return n}}function AE(n,e,t){return n.hasOwnProperty("duration")?n:function(n,e,t){let r,s=0,o="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return e.push(`The provided timing value "${n}" is invalid.`),{duration:0,delay:0,easing:""};r=iO(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(s=iO(parseFloat(l),a[4]));const c=a[5];c&&(o=c)}else r=n;if(!t){let a=!1,l=e.length;r<0&&(e.push("Duration values below 0 are not allowed for this animation step."),a=!0),s<0&&(e.push("Delay values below 0 are not allowed for this animation step."),a=!0),a&&e.splice(l,0,`The provided timing value "${n}" is invalid.`)}return{duration:r,delay:s,easing:o}}(n,e,t)}function Zg(n,e={}){return Object.keys(n).forEach(t=>{e[t]=n[t]}),e}function eh(n,e,t={}){if(e)for(let i in n)t[i]=n[i];else Zg(n,t);return t}function jV(n,e,t){return t?e+":"+t+";":""}function UV(n){let e="";for(let t=0;t{const r=sO(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),GD()&&UV(n))}function Pf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=sO(t);n.style[i]=""}),GD()&&UV(n))}function Pv(n){return Array.isArray(n)?1==n.length?n[0]:xV(n):n}const rO=new RegExp("{{\\s*(.+?)\\s*}}","g");function zV(n){let e=[];if("string"==typeof n){let t;for(;t=rO.exec(n);)e.push(t[1]);rO.lastIndex=0}return e}function DE(n,e,t){const i=n.toString(),r=i.replace(rO,(s,o)=>{let a=e[o];return e.hasOwnProperty(o)||(t.push(`Please provide a value for the animation param ${o}`),a=""),a.toString()});return r==i?n:r}function OE(n){const e=[];let t=n.next();for(;!t.done;)e.push(t.value),t=n.next();return e}const Hne=/-+([a-z0-9])/g;function sO(n){return n.replace(Hne,(...e)=>e[1].toUpperCase())}function $ne(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function HV(n,e){return 0===n||0===e}function $V(n,e,t){const i=Object.keys(t);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(a=>{s.hasOwnProperty(a)||o.push(a),s[a]=t[a]}),o.length)for(var r=1;rfunction(n,e,t){if(":"==n[0]){const l=function(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i) *"}}(n,t);if("function"==typeof l)return void e.push(l);n=l}const i=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return t.push(`The provided transition expression "${n}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(GV(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(GV(o,r))}(i,t,e)):t.push(n),t}const PE=new Set(["true","1"]),RE=new Set(["false","0"]);function GV(n,e){const t=PE.has(n)||RE.has(n),i=PE.has(e)||RE.has(e);return(r,s)=>{let o="*"==n||n==r,a="*"==e||e==s;return!o&&t&&"boolean"==typeof r&&(o=r?PE.has(n):RE.has(n)),!a&&i&&"boolean"==typeof s&&(a=s?PE.has(e):RE.has(e)),o&&a}}const Yne=new RegExp("s*:selfs*,?","g");function aO(n,e,t){return new Xne(n).build(e,t)}class Xne{constructor(e){this._driver=e}build(e,t){const i=new Qne(t);return this._resetContextStyleTimingState(i),Ea(this,Pv(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,r=t.depCount=0;const s=[],o=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),0==a.type){const l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,s.push(this.visitState(l,t))}),l.name=c}else if(1==a.type){const l=this.visitTransition(a,t);i+=l.queryCount,r+=l.depCount,o.push(l)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:s,transitions:o,queryCount:i,depCount:r,options:null}}visitState(e,t){const i=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(i.containsDynamicStyles){const s=new Set,o=r||{};if(i.styles.forEach(a=>{if(kE(a)){const l=a;Object.keys(l).forEach(c=>{zV(l[c]).forEach(d=>{o.hasOwnProperty(d)||s.add(d)})})}}),s.size){const a=OE(s.values());t.errors.push(`state("${e.name}", ...) must define default values for all the following style substitutions: ${a.join(", ")}`)}}return{type:0,name:e.name,style:i,options:r?{params:r}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const i=Ea(this,Pv(e.animation),t);return{type:1,matchers:Gne(e.expr,t.errors),animation:i,queryCount:t.queryCount,depCount:t.depCount,options:Rf(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(i=>Ea(this,i,t)),options:Rf(e.options)}}visitGroup(e,t){const i=t.currentTime;let r=0;const s=e.steps.map(o=>{t.currentTime=i;const a=Ea(this,o,t);return r=Math.max(r,t.currentTime),a});return t.currentTime=r,{type:3,steps:s,options:Rf(e.options)}}visitAnimate(e,t){const i=function(n,e){let t=null;if(n.hasOwnProperty("duration"))t=n;else if("number"==typeof n)return lO(AE(n,e).duration,0,"");const i=n;if(i.split(/\s+/).some(s=>"{"==s.charAt(0)&&"{"==s.charAt(1))){const s=lO(0,0,"");return s.dynamic=!0,s.strValue=i,s}return t=t||AE(i,e),lO(t.duration,t.delay,t.easing)}(e.timings,t.errors);t.currentAnimateTimings=i;let r,s=e.styles?e.styles:Kn({});if(5==s.type)r=this.visitKeyframes(s,t);else{let o=e.styles,a=!1;if(!o){a=!0;const c={};i.easing&&(c.easing=i.easing),o=Kn(c)}t.currentTime+=i.duration+i.delay;const l=this.visitStyle(o,t);l.isEmptyStep=a,r=l}return t.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}}visitStyle(e,t){const i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){const i=[];Array.isArray(e.styles)?e.styles.forEach(o=>{"string"==typeof o?o==$u?i.push(o):t.errors.push(`The provided style string value ${o} is not allowed.`):i.push(o)}):i.push(e.styles);let r=!1,s=null;return i.forEach(o=>{if(kE(o)){const a=o,l=a.easing;if(l&&(s=l,delete a.easing),!r)for(let c in a)if(a[c].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:i,easing:s,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){const i=t.currentAnimateTimings;let r=t.currentTime,s=t.currentTime;i&&s>0&&(s-=i.duration+i.delay),e.styles.forEach(o=>{"string"!=typeof o&&Object.keys(o).forEach(a=>{if(!this._driver.validateStyleProperty(a))return void t.errors.push(`The provided animation property "${a}" is not a supported CSS property for animations`);const l=t.collectedStyles[t.currentQuerySelector],c=l[a];let d=!0;c&&(s!=r&&s>=c.startTime&&r<=c.endTime&&(t.errors.push(`The CSS property "${a}" that exists between the times of "${c.startTime}ms" and "${c.endTime}ms" is also being animated in a parallel animation between the times of "${s}ms" and "${r}ms"`),d=!1),s=c.startTime),d&&(l[a]={startTime:s,endTime:r}),t.options&&function(n,e,t){const i=e.params||{},r=zV(n);r.length&&r.forEach(s=>{i.hasOwnProperty(s)||t.push(`Unable to resolve the local animation param ${s} in the given list of values`)})}(o[a],t.options,t.errors)})})}visitKeyframes(e,t){const i={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),i;let s=0;const o=[];let a=!1,l=!1,c=0;const d=e.steps.map(w=>{const C=this._makeStyleAst(w,t);let x=null!=C.offset?C.offset:function(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(kE(t)&&t.hasOwnProperty("offset")){const i=t;e=parseFloat(i.offset),delete i.offset}});else if(kE(n)&&n.hasOwnProperty("offset")){const t=n;e=parseFloat(t.offset),delete t.offset}return e}(C.styles),L=0;return null!=x&&(s++,L=C.offset=x),l=l||L<0||L>1,a=a||L0&&s{const x=p>0?C==g?1:p*C:o[C],L=x*v;t.currentTime=_+y.delay+L,y.duration=L,this._validateStyleAst(w,t),w.offset=x,i.styles.push(w)}),i}visitReference(e,t){return{type:8,animation:Ea(this,Pv(e.animation),t),options:Rf(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:Rf(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:Rf(e.options)}}visitQuery(e,t){const i=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;const[s,o]=function(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(Yne,"")),[n=n.replace(/@\*/g,TE).replace(/@\w+/g,t=>TE+"-"+t.substr(1)).replace(/:animating/g,nO),e]}(e.selector);t.currentQuerySelector=i.length?i+" "+s:s,wa(t.collectedStyles,t.currentQuerySelector,{});const a=Ea(this,Pv(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:11,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:Rf(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");const i="full"===e.timings?{duration:0,delay:0,easing:"full"}:AE(e.timings,t.errors,!0);return{type:12,animation:Ea(this,Pv(e.animation),t),timings:i,options:null}}}class Qne{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function kE(n){return!Array.isArray(n)&&"object"==typeof n}function Rf(n){return n?(n=Zg(n)).params&&(n.params=function(n){return n?Zg(n):null}(n.params)):n={},n}function lO(n,e,t){return{duration:n,delay:e,easing:t}}function cO(n,e,t,i,r,s,o=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class FE{constructor(){this._map=new Map}consume(e){let t=this._map.get(e);return t?this._map.delete(e):t=[],t}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const iie=new RegExp(":enter","g"),sie=new RegExp(":leave","g");function uO(n,e,t,i,r,s={},o={},a,l,c=[]){return(new oie).buildKeyframes(n,e,t,i,r,s,o,a,l,c)}class oie{buildKeyframes(e,t,i,r,s,o,a,l,c,d=[]){c=c||new FE;const f=new dO(e,t,c,r,s,d,[]);f.options=l,f.currentTimeline.setStyles([o],null,f.errors,l),Ea(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&Object.keys(a).length){const g=p[p.length-1];g.allowOnlyTimelineStyles()||g.setStyles([a],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[cO(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const i=t.subInstructions.consume(t.element);if(i){const r=t.createSubContext(e.options),s=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,r,r.options);s!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){const i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,i){let s=t.currentTimeline.currentTime;const o=null!=i.duration?If(i.duration):null,a=null!=i.delay?If(i.delay):null;return 0!==o&&e.forEach(l=>{const c=t.appendInstructionToTimeline(l,o,a);s=Math.max(s,c.duration+c.delay)}),s}visitReference(e,t){t.updateOptions(e.options,!0),Ea(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const i=t.subContextCount;let r=t;const s=e.options;if(s&&(s.params||s.delay)&&(r=t.createSubContext(s),r.transformIntoNewTimeline(),null!=s.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=NE);const o=If(s.delay);r.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>Ea(this,o,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const i=[];let r=t.currentTimeline.currentTime;const s=e.options&&e.options.delay?If(e.options.delay):0;e.steps.forEach(o=>{const a=t.createSubContext(e.options);s&&a.delayNextStep(s),Ea(this,o,a),r=Math.max(r,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(r),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const i=e.strValue;return AE(t.params?DE(i,t.params,t.errors):i,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const i=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),r.snapshotCurrentStyles());const s=e.style;5==s.type?this.visitKeyframes(s,t):(t.incrementTime(i.duration),this.visitStyle(s,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const i=t.currentTimeline,r=t.currentAnimateTimings;!r&&i.getCurrentStyleProperties().length&&i.forwardFrame();const s=r&&r.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(s):i.setStyles(e.styles,s,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const i=t.currentAnimateTimings,r=t.currentTimeline.duration,s=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{a.forwardTime((l.offset||0)*s),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(r+s),t.previousNode=e}visitQuery(e,t){const i=t.currentTimeline.currentTime,r=e.options||{},s=r.delay?If(r.delay):0;s&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=NE);let o=i;const a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,d)=>{t.currentQueryIndex=d;const f=t.createSubContext(e.options,c);s&&f.delayNextStep(s),c===t.element&&(l=f.currentTimeline),Ea(this,e.animation,f),f.currentTimeline.applyStylesToKeyframe(),o=Math.max(o,f.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const i=t.parentContext,r=t.currentTimeline,s=e.timings,o=Math.abs(s.duration),a=o*(t.currentQueryTotal-1);let l=o*t.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime}const d=t.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;Ea(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=r.currentTime-f+(r.startTime-i.currentTimeline.startTime)}}const NE={};class dO{constructor(e,t,i,r,s,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=s,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=NE,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new LE(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const i=e;let r=this.options;null!=i.duration&&(r.duration=If(i.duration)),null!=i.delay&&(r.delay=If(i.delay));const s=i.params;if(s){let o=r.params;o||(o=this.options.params={}),Object.keys(s).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=DE(s[a],o,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const i=e.params={};Object.keys(t).forEach(r=>{i[r]=t[r]})}}return e}createSubContext(e=null,t,i){const r=t||this.element,s=new dO(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(e),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(e){return this.previousNode=NE,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){const r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=i?i:0)+e.delay,easing:""},s=new aie(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,r,s,o){let a=[];if(r&&a.push(this.element),e.length>0){e=(e=e.replace(iie,"."+this._enterClassName)).replace(sie,"."+this._leaveClassName);let c=this._driver.query(this.element,e,1!=i);0!==i&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!s&&0==a.length&&o.push(`\`query("${t}")\` returned zero elements. (Use \`query("${t}", { optional: true })\` if you wish to allow this.)`),a}}class LE{constructor(e,t,i,r){this._driver=e,this.element=t,this.startTime=i,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new LE(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||$u,this._currentKeyframe[t]=$u}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,r){t&&(this._previousKeyframe.easing=t);const s=r&&r.params||{},o=function(n,e){const t={};let i;return n.forEach(r=>{"*"===r?(i=i||Object.keys(e),i.forEach(s=>{t[s]=$u})):eh(r,!1,t)}),t}(e,this._globalTimelineStyles);Object.keys(o).forEach(a=>{const l=DE(o[a],s,i);this._pendingStyles[a]=l,this._localTimelineStyles.hasOwnProperty(a)||(this._backFill[a]=this._globalTimelineStyles.hasOwnProperty(a)?this._globalTimelineStyles[a]:$u),this._updateStyle(a,l)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(i=>{this._currentKeyframe[i]=e[i]}),Object.keys(this._localTimelineStyles).forEach(i=>{this._currentKeyframe.hasOwnProperty(i)||(this._currentKeyframe[i]=this._localTimelineStyles[i])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const i=this._styleSummary[t],r=e._styleSummary[t];(!i||r.time>i.time)&&this._updateStyle(t,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,i=1===this._keyframes.size&&0===this.duration;let r=[];this._keyframes.forEach((a,l)=>{const c=eh(a,!0);Object.keys(c).forEach(d=>{const f=c[d];"!"==f?e.add(d):f==$u&&t.add(d)}),i||(c.offset=l/this.duration),r.push(c)});const s=e.size?OE(e.values()):[],o=t.size?OE(t.values()):[];if(i){const a=r[0],l=Zg(a);a.offset=0,l.offset=1,r=[a,l]}return cO(this.element,r,s,o,this.duration,this.startTime,this.easing,!1)}}class aie extends LE{constructor(e,t,i,r,s,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:r}=this.timings;if(this._stretchStartingKeyframe&&t){const s=[],o=i+t,a=t/o,l=eh(e[0],!1);l.offset=0,s.push(l);const c=eh(e[0],!1);c.offset=YV(a),s.push(c);const d=e.length-1;for(let f=1;f<=d;f++){let p=eh(e[f],!1);p.offset=YV((t+p.offset*i)/o),s.push(p)}i=o,t=0,r="",e=s}return cO(this.element,e,this.preStyleProps,this.postStyleProps,i,t,r,!0)}}function YV(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}class hO{}class cie extends hO{normalizePropertyName(e,t){return sO(e)}normalizeStyleValue(e,t,i,r){let s="";const o=i.toString().trim();if(uie[t]&&0!==i&&"0"!==i)if("number"==typeof i)s="px";else{const a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&r.push(`Please provide a CSS unit value for ${e}:${i}`)}return o+s}}const uie=(()=>function(n){const e={};return n.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function XV(n,e,t,i,r,s,o,a,l,c,d,f,p){return{type:0,element:n,triggerName:e,isRemovalTransition:r,fromState:t,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:d,totalTime:f,errors:p}}const fO={};class KV{constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,r){return function(n,e,t,i,r){return n.some(s=>s(e,t,i,r))}(this.ast.matchers,e,t,i,r)}buildStyles(e,t,i){const r=this._stateStyles["*"],s=this._stateStyles[e],o=r?r.buildStyles(t,i):{};return s?s.buildStyles(t,i):o}build(e,t,i,r,s,o,a,l,c,d){const f=[],p=this.ast.options&&this.ast.options.params||fO,_=this.buildStyles(i,a&&a.params||fO,f),y=l&&l.params||fO,v=this.buildStyles(r,y,f),w=new Set,C=new Map,x=new Map,L="void"===r,U={params:Object.assign(Object.assign({},p),y)},$=d?[]:uO(e,t,this.ast.animation,s,o,_,v,U,c,f);let ee=0;if($.forEach(pe=>{ee=Math.max(pe.duration+pe.delay,ee)}),f.length)return XV(t,this._triggerName,i,r,L,_,v,[],[],C,x,ee,f);$.forEach(pe=>{const ve=pe.element,$e=wa(C,ve,{});pe.preStyleProps.forEach(re=>$e[re]=!0);const Xe=wa(x,ve,{});pe.postStyleProps.forEach(re=>Xe[re]=!0),ve!==t&&w.add(ve)});const fe=OE(w.values());return XV(t,this._triggerName,i,r,L,_,v,$,fe,C,x,ee)}}class fie{constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){const i={},r=Zg(this.defaultParams);return Object.keys(e).forEach(s=>{const o=e[s];null!=o&&(r[s]=o)}),this.styles.styles.forEach(s=>{if("string"!=typeof s){const o=s;Object.keys(o).forEach(a=>{let l=o[a];l.length>1&&(l=DE(l,r,t));const c=this.normalizer.normalizePropertyName(a,t);l=this.normalizer.normalizeStyleValue(a,c,l,t),i[c]=l})}}),i}}class gie{constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,this.transitionFactories=[],this.states={},t.states.forEach(r=>{this.states[r.name]=new fie(r.style,r.options&&r.options.params||{},i)}),ZV(this.states,"true","1"),ZV(this.states,"false","0"),t.transitions.forEach(r=>{this.transitionFactories.push(new KV(e,r,this.states))}),this.fallbackTransition=function(n,e,t){return new KV(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(o,a)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,r){return this.transitionFactories.find(o=>o.match(e,t,i,r))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}}function ZV(n,e,t){n.hasOwnProperty(e)?n.hasOwnProperty(t)||(n[t]=n[e]):n.hasOwnProperty(t)&&(n[e]=n[t])}const _ie=new FE;class yie{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}register(e,t){const i=[],r=aO(this._driver,t,i);if(i.length)throw new Error(`Unable to build the animation due to the following errors: ${i.join("\n")}`);this._animations[e]=r}_buildPlayer(e,t,i){const r=e.element,s=OV(0,this._normalizer,0,e.keyframes,t,i);return this._driver.animate(r,s,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){const r=[],s=this._animations[e];let o;const a=new Map;if(s?(o=uO(this._driver,t,s,tO,ME,{},{},i,_ie,r),o.forEach(d=>{const f=wa(a,d.element,{});d.postStyleProps.forEach(p=>f[p]=null)})):(r.push("The requested animation doesn't exist or has already been destroyed"),o=[]),r.length)throw new Error(`Unable to create the animation due to the following errors: ${r.join("\n")}`);a.forEach((d,f)=>{Object.keys(d).forEach(p=>{d[p]=this._driver.computeStyle(f,p,$u)})});const c=Jd(o.map(d=>{const f=a.get(d.element);return this._buildPlayer(d,{},f)}));return this._playersById[e]=c,c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw new Error(`Unable to find the timeline player referenced by ${e}`);return t}listen(e,t,i,r){const s=YD(t,"","","");return WD(this._getPlayer(e),i,s,r),()=>{}}command(e,t,i,r){if("register"==i)return void this.register(e,r[0]);if("create"==i)return void this.create(e,t,r[0]||{});const s=this._getPlayer(e);switch(i){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}}const QV="ng-animate-queued",JV="ng-animate-disabled",ej=".ng-animate-disabled",wie=[],tj={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Eie={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},fl="__ng_removed";class pO{constructor(e,t=""){this.namespaceId=t;const i=e&&e.hasOwnProperty("value");if(this.value=function(n){return null!=n?n:null}(i?e.value:e),i){const s=Zg(e);delete s.value,this.options=s}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const i=this.options.params;Object.keys(t).forEach(r=>{null==i[r]&&(i[r]=t[r])})}}}const Rv="void",gO=new pO(Rv);class Sie{constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,pl(t,this._hostClassName)}listen(e,t,i,r){if(!this._triggers.hasOwnProperty(t))throw new Error(`Unable to listen on the animation trigger event "${i}" because the animation trigger "${t}" doesn't exist!`);if(null==i||0==i.length)throw new Error(`Unable to listen on the animation trigger "${t}" because the provided event is undefined!`);if(!function(n){return"start"==n||"done"==n}(i))throw new Error(`The provided animation trigger event "${i}" for the animation trigger "${t}" is not supported!`);const s=wa(this._elementListeners,e,[]),o={name:t,phase:i,callback:r};s.push(o);const a=wa(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(pl(e,xE),pl(e,xE+"-"+t),a[t]=gO),()=>{this._engine.afterFlush(()=>{const l=s.indexOf(o);l>=0&&s.splice(l,1),this._triggers[t]||delete a[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw new Error(`The provided animation trigger "${e}" has not been registered!`);return t}trigger(e,t,i,r=!0){const s=this._getTrigger(t),o=new mO(this.id,t,e);let a=this._engine.statesByElement.get(e);a||(pl(e,xE),pl(e,xE+"-"+t),this._engine.statesByElement.set(e,a={}));let l=a[t];const c=new pO(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a[t]=c,l||(l=gO),c.value!==Rv&&l.value===c.value){if(!function(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let r=0;r{Pf(e,v),Uc(e,w)})}return}const p=wa(this._engine.playersByElement,e,[]);p.forEach(y=>{y.namespaceId==this.id&&y.triggerName==t&&y.queued&&y.destroy()});let g=s.matchTransition(l.value,c.value,e,c.params),_=!1;if(!g){if(!r)return;g=s.fallbackTransition,_=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:g,fromState:l,toState:c,player:o,isFallbackTransition:_}),_||(pl(e,QV),o.onStart(()=>{Qg(e,QV)})),o.onDone(()=>{let y=this.players.indexOf(o);y>=0&&this.players.splice(y,1);const v=this._engine.playersByElement.get(e);if(v){let w=v.indexOf(o);w>=0&&v.splice(w,1)}}),this.players.push(o),p.push(o),o}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,i)=>{delete t[e]}),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(r=>r.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const i=this._engine.driver.query(e,TE,!0);i.forEach(r=>{if(r[fl])return;const s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(o=>o.triggerLeaveAnimation(r,t,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(e,t,i,r){const s=this._engine.statesByElement.get(e);if(s){const o=[];if(Object.keys(s).forEach(a=>{if(this._triggers[a]){const l=this.trigger(e,a,Rv,r);l&&o.push(l)}}),o.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),i&&Jd(o).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){const r=new Set;t.forEach(s=>{const o=s.name;if(r.has(o))return;r.add(o);const l=this._triggers[o].fallbackTransition,c=i[o]||gO,d=new pO(Rv),f=new mO(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(e,t){const i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let r=!1;if(i.totalAnimations){const s=i.players.length?i.playersByQueriedElement.get(e):[];if(s&&s.length)r=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(e),r)i.markElementAsRemoved(this.id,e,!1,t);else{const s=e[fl];(!s||s===tj)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){pl(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(i=>{const r=i.player;if(r.destroyed)return;const s=i.element,o=this._elementListeners.get(s);o&&o.forEach(a=>{if(a.name==i.triggerName){const l=YD(s,i.triggerName,i.fromState.value,i.toState.value);l._data=e,WD(i.player,a.phase,l,a.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):t.push(i)}),this._queue=[],t.sort((i,r)=>{const s=i.transition.ast.depCount,o=r.transition.ast.depCount;return 0==s||0==o?s-o:this._engine.driver.containsElement(i.element,r.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(i=>i.element===e)||t,t}}class Mie{constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(r,s)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){const i=new Sie(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){const i=this._namespaceList.length-1;if(i>=0){let r=!1;for(let s=i;s>=0;s--)if(this.driver.containsElement(this._namespaceList[s].hostElement,t)){this._namespaceList.splice(s+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let r=this._namespaceLookup[e];r&&r.register(t,i)&&this.totalAnimations++}destroy(e,t){if(!e)return;const i=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(i.hostElement),delete this._namespaceLookup[e];const r=this._namespaceList.indexOf(i);r>=0&&this._namespaceList.splice(r,1)}),this.afterFlushAnimationsDone(()=>i.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,i=this.statesByElement.get(e);if(i){const r=Object.keys(i);for(let s=0;s=0&&this.collectedLeaveElements.splice(o,1)}if(e){const o=this._fetchNamespace(e);o&&o.insertNode(t,i)}r&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),pl(e,JV)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Qg(e,JV))}removeNode(e,t,i,r){if(BE(t)){const s=e?this._fetchNamespace(e):null;if(s?s.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r),i){const o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,r)}}else this._onRemovalComplete(t,r)}markElementAsRemoved(e,t,i,r){this.collectedLeaveElements.push(t),t[fl]={namespaceId:e,setForRemoval:r,hasAnimation:i,removedBeforeQueried:!1}}listen(e,t,i,r,s){return BE(t)?this._fetchNamespace(e).listen(t,i,r,s):()=>{}}_buildInstruction(e,t,i,r,s){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,r,e.fromState.options,e.toState.options,t,s)}destroyInnerAnimations(e){let t=this.driver.query(e,TE,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,nO,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Jd(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e[fl];if(t&&t.setForRemoval){if(e[fl]=tj,t.namespaceId){this.destroyInnerAnimations(e);const i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}this.driver.matchesElement(e,ej)&&this.markElementAsDisabled(e,!1),this.driver.query(e,ej,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,r)=>this._balanceNamespaceList(i,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],t.length?Jd(t).onDone(()=>{i.forEach(r=>r())}):i.forEach(r=>r())}}reportError(e){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${e.join("\n")}`)}_flushAnimations(e,t){const i=new FE,r=[],s=new Map,o=[],a=new Map,l=new Map,c=new Map,d=new Set;this.disabledNodes.forEach(Q=>{d.add(Q);const Ue=this.driver.query(Q,".ng-animate-queued",!0);for(let ke=0;ke{const ke=tO+y++;_.set(Ue,ke),Q.forEach(ze=>pl(ze,ke))});const v=[],w=new Set,C=new Set;for(let Q=0;Qw.add(ze)):C.add(Ue))}const x=new Map,L=rj(p,Array.from(w));L.forEach((Q,Ue)=>{const ke=ME+y++;x.set(Ue,ke),Q.forEach(ze=>pl(ze,ke))}),e.push(()=>{g.forEach((Q,Ue)=>{const ke=_.get(Ue);Q.forEach(ze=>Qg(ze,ke))}),L.forEach((Q,Ue)=>{const ke=x.get(Ue);Q.forEach(ze=>Qg(ze,ke))}),v.forEach(Q=>{this.processLeaveNode(Q)})});const U=[],$=[];for(let Q=this._namespaceList.length-1;Q>=0;Q--)this._namespaceList[Q].drainQueuedTransitions(t).forEach(ke=>{const ze=ke.player,wt=ke.element;if(U.push(ze),this.collectedEnterElements.length){const fi=wt[fl];if(fi&&fi.setForMove)return void ze.destroy()}const kn=!f||!this.driver.containsElement(f,wt),Je=x.get(wt),tr=_.get(wt),Dn=this._buildInstruction(ke,i,tr,Je,kn);if(Dn.errors&&Dn.errors.length)$.push(Dn);else{if(kn)return ze.onStart(()=>Pf(wt,Dn.fromStyles)),ze.onDestroy(()=>Uc(wt,Dn.toStyles)),void r.push(ze);if(ke.isFallbackTransition)return ze.onStart(()=>Pf(wt,Dn.fromStyles)),ze.onDestroy(()=>Uc(wt,Dn.toStyles)),void r.push(ze);Dn.timelines.forEach(fi=>fi.stretchStartingKeyframe=!0),i.append(wt,Dn.timelines),o.push({instruction:Dn,player:ze,element:wt}),Dn.queriedElements.forEach(fi=>wa(a,fi,[]).push(ze)),Dn.preStyleProps.forEach((fi,gr)=>{const ra=Object.keys(fi);if(ra.length){let Bs=l.get(gr);Bs||l.set(gr,Bs=new Set),ra.forEach(ka=>Bs.add(ka))}}),Dn.postStyleProps.forEach((fi,gr)=>{const ra=Object.keys(fi);let Bs=c.get(gr);Bs||c.set(gr,Bs=new Set),ra.forEach(ka=>Bs.add(ka))})}});if($.length){const Q=[];$.forEach(Ue=>{Q.push(`@${Ue.triggerName} has failed due to:\n`),Ue.errors.forEach(ke=>Q.push(`- ${ke}\n`))}),U.forEach(Ue=>Ue.destroy()),this.reportError(Q)}const ee=new Map,fe=new Map;o.forEach(Q=>{const Ue=Q.element;i.has(Ue)&&(fe.set(Ue,Ue),this._beforeAnimationBuild(Q.player.namespaceId,Q.instruction,ee))}),r.forEach(Q=>{const Ue=Q.element;this._getPreviousPlayers(Ue,!1,Q.namespaceId,Q.triggerName,null).forEach(ze=>{wa(ee,Ue,[]).push(ze),ze.destroy()})});const pe=v.filter(Q=>oj(Q,l,c)),ve=new Map;ij(ve,this.driver,C,c,$u).forEach(Q=>{oj(Q,l,c)&&pe.push(Q)});const Xe=new Map;g.forEach((Q,Ue)=>{ij(Xe,this.driver,new Set(Q),l,"!")}),pe.forEach(Q=>{const Ue=ve.get(Q),ke=Xe.get(Q);ve.set(Q,Object.assign(Object.assign({},Ue),ke))});const re=[],le=[],Oe={};o.forEach(Q=>{const{element:Ue,player:ke,instruction:ze}=Q;if(i.has(Ue)){if(d.has(Ue))return ke.onDestroy(()=>Uc(Ue,ze.toStyles)),ke.disabled=!0,ke.overrideTotalTime(ze.totalTime),void r.push(ke);let wt=Oe;if(fe.size>1){let Je=Ue;const tr=[];for(;Je=Je.parentNode;){const Dn=fe.get(Je);if(Dn){wt=Dn;break}tr.push(Je)}tr.forEach(Dn=>fe.set(Dn,wt))}const kn=this._buildAnimation(ke.namespaceId,ze,ee,s,Xe,ve);if(ke.setRealPlayer(kn),wt===Oe)re.push(ke);else{const Je=this.playersByElement.get(wt);Je&&Je.length&&(ke.parentPlayer=Jd(Je)),r.push(ke)}}else Pf(Ue,ze.fromStyles),ke.onDestroy(()=>Uc(Ue,ze.toStyles)),le.push(ke),d.has(Ue)&&r.push(ke)}),le.forEach(Q=>{const Ue=s.get(Q.element);if(Ue&&Ue.length){const ke=Jd(Ue);Q.setRealPlayer(ke)}}),r.forEach(Q=>{Q.parentPlayer?Q.syncPlayerEvents(Q.parentPlayer):Q.destroy()});for(let Q=0;Q!kn.destroyed);wt.length?Die(this,Ue,wt):this.processLeaveNode(Ue)}return v.length=0,re.forEach(Q=>{this.players.push(Q),Q.onDone(()=>{Q.destroy();const Ue=this.players.indexOf(Q);this.players.splice(Ue,1)}),Q.play()}),re}elementContainsData(e,t){let i=!1;const r=t[fl];return r&&r.setForRemoval&&(i=!0),this.playersByElement.has(t)&&(i=!0),this.playersByQueriedElement.has(t)&&(i=!0),this.statesByElement.has(t)&&(i=!0),this._fetchNamespace(e).elementContainsData(t)||i}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,r,s){let o=[];if(t){const a=this.playersByQueriedElement.get(e);a&&(o=a)}else{const a=this.playersByElement.get(e);if(a){const l=!s||s==Rv;a.forEach(c=>{c.queued||!l&&c.triggerName!=r||o.push(c)})}}return(i||r)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||r&&r!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){const s=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:t.triggerName;for(const l of t.timelines){const c=l.element,d=c!==s,f=wa(i,c,[]);this._getPreviousPlayers(c,d,o,a,t.toState).forEach(g=>{const _=g.getRealPlayer();_.beforeDestroy&&_.beforeDestroy(),g.destroy(),f.push(g)})}Pf(s,t.fromStyles)}_buildAnimation(e,t,i,r,s,o){const a=t.triggerName,l=t.element,c=[],d=new Set,f=new Set,p=t.timelines.map(_=>{const y=_.element;d.add(y);const v=y[fl];if(v&&v.removedBeforeQueried)return new Kg(_.duration,_.delay);const w=y!==l,C=function(n){const e=[];return sj(n,e),e}((i.get(y)||wie).map(ee=>ee.getRealPlayer())).filter(ee=>!!ee.element&&ee.element===y),x=s.get(y),L=o.get(y),U=OV(0,this._normalizer,0,_.keyframes,x,L),$=this._buildPlayer(_,U,C);if(_.subTimeline&&r&&f.add(y),w){const ee=new mO(e,a,y);ee.setRealPlayer($),c.push(ee)}return $});c.forEach(_=>{wa(this.playersByQueriedElement,_.element,[]).push(_),_.onDone(()=>function(n,e,t){let i;if(n instanceof Map){if(i=n.get(e),i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&n.delete(e)}}else if(i=n[e],i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&delete n[e]}return i}(this.playersByQueriedElement,_.element,_))}),d.forEach(_=>pl(_,BV));const g=Jd(p);return g.onDestroy(()=>{d.forEach(_=>Qg(_,BV)),Uc(l,t.toStyles)}),f.forEach(_=>{wa(r,_,[]).push(g)}),g}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new Kg(e.duration,e.delay)}}class mO{constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i,this._player=new Kg,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(i=>WD(e,t,void 0,i))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){wa(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function BE(n){return n&&1===n.nodeType}function nj(n,e){const t=n.style.display;return n.style.display=null!=e?e:"none",t}function ij(n,e,t,i,r){const s=[];t.forEach(l=>s.push(nj(l)));const o=[];i.forEach((l,c)=>{const d={};l.forEach(f=>{const p=d[f]=e.computeStyle(c,f,r);(!p||0==p.length)&&(c[fl]=Eie,o.push(c))}),n.set(c,d)});let a=0;return t.forEach(l=>nj(l,s[a++])),o}function rj(n,e){const t=new Map;if(n.forEach(a=>t.set(a,[])),0==e.length)return t;const r=new Set(e),s=new Map;function o(a){if(!a)return 1;let l=s.get(a);if(l)return l;const c=a.parentNode;return l=t.has(c)?c:r.has(c)?1:o(c),s.set(a,l),l}return e.forEach(a=>{const l=o(a);1!==l&&t.get(l).push(a)}),t}const VE="$$classes";function pl(n,e){if(n.classList)n.classList.add(e);else{let t=n[VE];t||(t=n[VE]={}),t[e]=!0}}function Qg(n,e){if(n.classList)n.classList.remove(e);else{let t=n[VE];t&&delete t[e]}}function Die(n,e,t){Jd(t).onDone(()=>n.processLeaveNode(e))}function sj(n,e){for(let t=0;tr.add(s)):e.set(n,i),t.delete(n),!0}class jE{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(r,s)=>{},this._transitionEngine=new Mie(e,t,i),this._timelineEngine=new yie(e,t,i),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(e,t,i,r,s){const o=e+"-"+r;let a=this._triggerCache[o];if(!a){const l=[],c=aO(this._driver,s,l);if(l.length)throw new Error(`The animation trigger "${r}" has failed to build due to the following errors:\n - ${l.join("\n - ")}`);a=function(n,e,t){return new gie(n,e,t)}(r,c,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,r,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,r){this._transitionEngine.insertNode(e,t,i,r)}onRemove(e,t,i,r){this._transitionEngine.removeNode(e,t,r||!1,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,r){if("@"==i.charAt(0)){const[s,o]=IV(i);this._timelineEngine.command(s,t,o,r)}else this._transitionEngine.trigger(e,t,i,r)}listen(e,t,i,r,s){if("@"==i.charAt(0)){const[o,a]=IV(i);return this._timelineEngine.listen(o,t,a,s)}return this._transitionEngine.listen(e,t,i,r,s)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function aj(n,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=_O(e[0]),e.length>1&&(i=_O(e[e.length-1]))):e&&(t=_O(e)),t||i?new Jg(n,t,i):null}class Jg{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Jg.initialStylesByElement.get(e);r||Jg.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Uc(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Uc(this._element,this._initialStyles),this._endStyles&&(Uc(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Jg.initialStylesByElement.delete(this._element),this._startStyles&&(Pf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Pf(this._element,this._endStyles),this._endStyles=null),Uc(this._element,this._initialStyles),this._state=3)}}function _O(n){let e=null;const t=Object.keys(n);for(let i=0;ithis._handleCallback(l)}apply(){(function(n,e){const t=vO(n,"").trim();let i=0;t.length&&(function(n,e){let t=0;for(let i=0;i=this._delay&&i>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),hj(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(n,e){const i=vO(n,"").split(","),r=yO(i,e);r>=0&&(i.splice(r,1),UE(n,"",i.join(",")))}(this._element,this._name))}}function uj(n,e,t){UE(n,"PlayState",t,dj(n,e))}function dj(n,e){const t=vO(n,"");return t.indexOf(",")>0?yO(t.split(","),e):yO([t],e)}function yO(n,e){for(let t=0;t=0)return t;return-1}function hj(n,e,t){t?n.removeEventListener(cj,e):n.addEventListener(cj,e)}function UE(n,e,t,i){const r=lj+e;if(null!=i){const s=n.style[r];if(s.length){const o=s.split(",");o[i]=t,t=o.join(",")}}n.style[r]=t}function vO(n,e){return n.style[lj+e]||""}class fj{constructor(e,t,i,r,s,o,a,l){this.element=e,this.keyframes=t,this.animationName=i,this._duration=r,this._delay=s,this._finalStyles=a,this._specialStyles=l,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=o||"linear",this.totalTime=r+s,this._buildStyler()}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(e=>e()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(e){this._styler.setPosition(e)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new Fie(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}beforeDestroy(){this.init();const e={};if(this.hasStarted()){const t=this._state>=3;Object.keys(this._finalStyles).forEach(i=>{"offset"!=i&&(e[i]=t?this._finalStyles[i]:oO(this.element,i))})}this.currentSnapshot=e}}class Uie extends Kg{constructor(e,t){super(),this.element=e,this._startingStyles={},this.__initialized=!1,this._styles=FV(t)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(e=>{this._startingStyles[e]=this.element.style[e]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(e=>this.element.style.setProperty(e,this._styles[e])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(e=>{const t=this._startingStyles[e];t?this.element.style.setProperty(e,t):this.element.style.removeProperty(e)}),this._startingStyles=null,super.destroy())}}class gj{constructor(){this._count=0}validateStyleProperty(e){return ZD(e)}matchesElement(e,t){return QD(e,t)}containsElement(e,t){return JD(e,t)}query(e,t,i){return eO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}buildKeyframeElement(e,t,i){i=i.map(a=>FV(a));let r=`@keyframes ${t} {\n`,s="";i.forEach(a=>{s=" ";const l=parseFloat(a.offset);r+=`${s}${100*l}% {\n`,s+=" ",Object.keys(a).forEach(c=>{const d=a[c];switch(c){case"offset":return;case"easing":return void(d&&(r+=`${s}animation-timing-function: ${d};\n`));default:return void(r+=`${s}${c}: ${d};\n`)}}),r+=`${s}}\n`}),r+="}\n";const o=document.createElement("style");return o.textContent=r,o}animate(e,t,i,r,s,o=[],a){const l=o.filter(v=>v instanceof fj),c={};HV(i,r)&&l.forEach(v=>{let w=v.currentSnapshot;Object.keys(w).forEach(C=>c[C]=w[C])});const d=function(n){let e={};return n&&(Array.isArray(n)?n:[n]).forEach(i=>{Object.keys(i).forEach(r=>{"offset"==r||"easing"==r||(e[r]=i[r])})}),e}(t=$V(e,t,c));if(0==i)return new Uie(e,d);const f="gen_css_kf_"+this._count++,p=this.buildKeyframeElement(e,f,t);(function(n){var e;const t=null===(e=n.getRootNode)||void 0===e?void 0:e.call(n);return"undefined"!=typeof ShadowRoot&&t instanceof ShadowRoot?t:document.head})(e).appendChild(p);const _=aj(e,t),y=new fj(e,t,f,i,r,s,d,_);return y.onDestroy(()=>function(n){n.parentNode.removeChild(n)}(p)),y}}class _j{constructor(e,t,i,r){this.element=e,this.keyframes=t,this.options=i,this._specialStyles=r,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,i){return e.animate(t,i)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(t=>{"offset"!=t&&(e[t]=this._finished?this._finalKeyframe[t]:oO(this.element,t))}),this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class Wie{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(yj().toString()),this._cssKeyframesDriver=new gj}validateStyleProperty(e){return ZD(e)}matchesElement(e,t){return QD(e,t)}containsElement(e,t){return JD(e,t)}query(e,t,i){return eO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}overrideWebAnimationsSupport(e){this._isNativeImpl=e}animate(e,t,i,r,s,o=[],a){if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,i,r,s,o);const d={duration:i,delay:r,fill:0==r?"both":"forwards"};s&&(d.easing=s);const f={},p=o.filter(_=>_ instanceof _j);HV(i,r)&&p.forEach(_=>{let y=_.currentSnapshot;Object.keys(y).forEach(v=>f[v]=y[v])});const g=aj(e,t=$V(e,t=t.map(_=>eh(_,!1)),f));return new _j(e,t,d,g)}}function yj(){return DV()&&Element.prototype.animate||{}}let Yie=(()=>{class n extends MV{constructor(t,i){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(i.body,{id:"0",encapsulation:Re.None,styles:[],data:{animation:[]}})}build(t){const i=this._nextAnimationId.toString();this._nextAnimationId++;const r=Array.isArray(t)?xV(t):t;return vj(this._renderer,null,i,"register",[r]),new Xie(i,this._renderer)}}return n.\u0275fac=function(t){return new(t||n)(I(_f),I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Xie extends class{}{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new Kie(this._id,e,t||{},this._renderer)}}class Kie{constructor(e,t,i,r){this.id=e,this.element=t,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return vj(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function vj(n,e,t,i,r){return n.setProperty(e,`@@${t}:${i}`,r)}const bj="@.disabled";let Zie=(()=>{class n{constructor(t,i,r){this.delegate=t,this.engine=i,this._zone=r,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),i.onRemovalComplete=(s,o)=>{o&&o.parentNode(s)&&o.removeChild(s.parentNode,s)}}createRenderer(t,i){const s=this.delegate.createRenderer(t,i);if(!(t&&i&&i.data&&i.data.animation)){let d=this._rendererCache.get(s);return d||(d=new Cj("",s,this.engine),this._rendererCache.set(s,d)),d}const o=i.id,a=i.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const l=d=>{Array.isArray(d)?d.forEach(l):this.engine.registerTrigger(o,a,t,d.name,d)};return i.data.animation.forEach(l),new Qie(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,i,r){t>=0&&ti(r)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(s=>{const[o,a]=s;o(a)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([i,r]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return n.\u0275fac=function(t){return new(t||n)(I(_f),I(jE),I(lt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Cj{constructor(e,t,i){this.namespaceId=e,this.delegate=t,this.engine=i,this.destroyNode=this.delegate.destroyNode?r=>t.destroyNode(r):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,r=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,r)}removeChild(e,t,i){this.engine.onRemove(this.namespaceId,t,this.delegate,i)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,r){this.delegate.setAttribute(e,t,i,r)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,r){this.delegate.setStyle(e,t,i,r)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){"@"==t.charAt(0)&&t==bj?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i){return this.delegate.listen(e,t,i)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class Qie extends Cj{constructor(e,t,i,r){super(t,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){"@"==t.charAt(0)?"."==t.charAt(1)&&t==bj?this.disableAnimations(e,i=void 0===i||!!i):this.engine.process(this.namespaceId,e,t.substr(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i){if("@"==t.charAt(0)){const r=function(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let s=t.substr(1),o="";return"@"!=s.charAt(0)&&([s,o]=function(n){const e=n.indexOf(".");return[n.substring(0,e),n.substr(e+1)]}(s)),this.engine.listen(this.namespaceId,r,s,o,a=>{this.factory.scheduleListenerCallback(a._data||-1,i,a)})}return this.delegate.listen(e,t,i)}}let tre=(()=>{class n extends jE{constructor(t,i,r){super(t.body,i,r)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(SE),I(hO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Zo=new _e("AnimationModuleType"),wj=[{provide:MV,useClass:Yie},{provide:hO,useFactory:function(){return new cie}},{provide:jE,useClass:tre},{provide:_f,useFactory:function(n,e,t){return new Zie(n,e,t)},deps:[uE,jE,lt]}],Ej=[{provide:SE,useFactory:function(){return"function"==typeof yj()?new Wie:new gj}},{provide:Zo,useValue:"BrowserAnimations"},...wj],Sj=[{provide:SE,useClass:NV},{provide:Zo,useValue:"NoopAnimations"},...wj];let bO=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?Sj:Ej}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:Ej,imports:[dE]}),n})();function are(n,e){if(1&n&&et(0,"mat-pseudo-checkbox",4),2&n){const t=bt();ie("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function lre(n,e){if(1&n&&(F(0,"span",5),Te(1),N()),2&n){const t=bt();Y(1),Os("(",t.group.label,")")}}const cre=["*"],Mj=new Lu("12.2.5"),dre=new _e("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let Lf,Nn=(()=>{class n{constructor(t,i,r){this._hasDoneGlobalChecks=!1,this._document=r,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=i,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!wo()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const i=getComputedStyle(t);i&&"none"!==i.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&Mj.full!==SV.full&&console.warn("The Angular Material version ("+Mj.full+") does not match the Angular CDK version ("+SV.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(I(wV),I(dre,8),I(rt))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Iv],Iv]}),n})();function em(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=Dt(e)}}}function kf(n,e){return class extends n{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const i=t||this.defaultColor;i!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),i&&this._elementRef.nativeElement.classList.add(`mat-${i}`),this._color=i)}}}function Ff(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=Dt(e)}}}function Nf(n,e=0){return class extends n{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?So(t):this.defaultTabIndex}}}function CO(n){return class extends n{constructor(...e){super(...e),this.stateChanges=new we,this.errorState=!1}updateErrorState(){const e=this.errorState,s=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);s!==e&&(this.errorState=s,this.stateChanges.next())}}}try{Lf="undefined"!=typeof Intl}catch(n){Lf=!1}let kv=(()=>{class n{isErrorState(t,i){return!!(t&&t.invalid&&(t.touched||i&&i.submitted))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})();class Ere{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const Tj={enterDuration:225,exitDuration:150},wO=Yg({passive:!0}),Aj=["mousedown","touchstart"],Dj=["mouseup","mouseleave","touchend","touchcancel"];class Oj{constructor(e,t,i,r){this._target=e,this._ngZone=t,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=Hu(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},Tj),i.animation);i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);const o=i.radius||function(n,e,t){const i=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),r=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),a=e-r.left,l=t-r.top,c=s.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=a-o+"px",d.style.top=l-o+"px",d.style.height=2*o+"px",d.style.width=2*o+"px",null!=i.color&&(d.style.backgroundColor=i.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(d),d.style.transform="scale(1)";const f=new Ere(this,d,i);return f.state=0,this._activeRipples.add(f),i.persistent||(this._mostRecentTransientRipple=f),this._runTimeoutOutsideZone(()=>{const p=f===this._mostRecentTransientRipple;f.state=1,!i.persistent&&(!p||!this._isPointerDown)&&f.fadeOut()},c),f}fadeOutRipple(e){const t=this._activeRipples.delete(e);if(e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!t)return;const i=e.element,r=Object.assign(Object.assign({},Tj),e.config.animation);i.style.transitionDuration=`${r.exitDuration}ms`,i.style.opacity="0",e.state=2,this._runTimeoutOutsideZone(()=>{e.state=3,i.parentNode.removeChild(i)},r.exitDuration)}fadeOutAll(){this._activeRipples.forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Hu(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(Aj))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(Dj),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=hV(e),i=this._lastTouchStartEvent&&Date.now(){!e.config.persistent&&(1===e.state||e.config.terminateOnPointerUp&&0===e.state)&&e.fadeOut()}))}_runTimeoutOutsideZone(e,t=0){this._ngZone.runOutsideAngular(()=>setTimeout(e,t))}_registerEvents(e){this._ngZone.runOutsideAngular(()=>{e.forEach(t=>{this._triggerElement.addEventListener(t,this,wO)})})}_removeTriggerEvents(){this._triggerElement&&(Aj.forEach(e=>{this._triggerElement.removeEventListener(e,this,wO)}),this._pointerUpEventsRegistered&&Dj.forEach(e=>{this._triggerElement.removeEventListener(e,this,wO)}))}}const Ij=new _e("mat-ripple-global-options");let Qo=(()=>{class n{constructor(t,i,r,s,o){this._elementRef=t,this._animationMode=o,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=s||{},this._rippleRenderer=new Oj(this,i,t,r)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,i=0,r){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,i,Object.assign(Object.assign({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(lt),E(ii),E(Ij,8),E(Zo,8))},n.\u0275dir=he({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&at("mat-ripple-unbounded",i.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),n})(),ec=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn,Av],Nn]}),n})(),Tre=(()=>{class n{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return n.\u0275fac=function(t){return new(t||n)(E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,i){2&t&&at("mat-pseudo-checkbox-indeterminate","indeterminate"===i.state)("mat-pseudo-checkbox-checked","checked"===i.state)("mat-pseudo-checkbox-disabled",i.disabled)("_mat-animation-noopable","NoopAnimations"===i._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,i){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),n})(),Are=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn]]}),n})();const $E=new _e("MAT_OPTION_PARENT_COMPONENT"),Dre=em(class{});let Ore=0,Pj=(()=>{class n extends Dre{constructor(t){var i;super(),this._labelId="mat-optgroup-label-"+Ore++,this._inert=null!==(i=null==t?void 0:t.inertGroups)&&void 0!==i&&i}}return n.\u0275fac=function(t){return new(t||n)(E($E,8))},n.\u0275dir=he({type:n,inputs:{label:"label"},features:[ht]}),n})();const GE=new _e("MatOptgroup");let Ire=0;class Rj{constructor(e,t=!1){this.source=e,this.isUserInput=t}}let Pre=(()=>{class n{constructor(t,i,r,s){this._element=t,this._changeDetectorRef=i,this._parent=r,this.group=s,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+Ire++,this.onSelectionChange=new Pe,this._stateChanges=new we}get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(t){this._disabled=Dt(t)}get disableRipple(){return this._parent&&this._parent.disableRipple}get active(){return this._active}get viewValue(){return(this._getHostElement().textContent||"").trim()}select(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}deselect(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}focus(t,i){const r=this._getHostElement();"function"==typeof r.focus&&r.focus(i)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!Yo(t)&&(this._selectViaInteraction(),t.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getAriaSelected(){return this.selected||!this.multiple&&null}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){const t=this.viewValue;t!==this._mostRecentViewValue&&(this._mostRecentViewValue=t,this._stateChanges.next())}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(t=!1){this.onSelectionChange.emit(new Rj(this,t))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(void 0),E(Pj))},n.\u0275dir=he({type:n,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),n})(),WE=(()=>{class n extends Pre{constructor(t,i,r,s){super(t,i,r,s)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E($E,8),E(GE,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,i){1&t&&ye("click",function(){return i._selectViaInteraction()})("keydown",function(s){return i._handleKeydown(s)}),2&t&&(sl("id",i.id),en("tabindex",i._getTabIndex())("aria-selected",i._getAriaSelected())("aria-disabled",i.disabled.toString()),at("mat-selected",i.selected)("mat-option-multiple",i.multiple)("mat-active",i.active)("mat-option-disabled",i.disabled))},exportAs:["matOption"],features:[ht],ngContentSelectors:cre,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(t,i){1&t&&(Dr(),Ct(0,are,1,2,"mat-pseudo-checkbox",0),F(1,"span",1),In(2),N(),Ct(3,lre,2,1,"span",2),et(4,"div",3)),2&t&&(ie("ngIf",i.multiple),Y(3),ie("ngIf",i.group&&i.group._inert),Y(1),ie("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},directives:[Is,Qo,Tre],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),n})();function EO(n,e,t){if(t.length){let i=e.toArray(),r=t.toArray(),s=0;for(let o=0;o{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,bn,Nn,Are]]}),n})();function zc(n,e,t,i){return ft(t)&&(i=t,t=void 0),i?zc(n,e,t).pipe(be(r=>Fe(r)?i(...r):i(r))):new oe(r=>{Fj(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function Fj(n,e,t,i,r){let s;if(function(n){return n&&"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener}(n)){const o=n;n.addEventListener(e,t,r),s=()=>o.removeEventListener(e,t,r)}else if(function(n){return n&&"function"==typeof n.on&&"function"==typeof n.off}(n)){const o=n;n.on(e,t),s=()=>o.off(e,t)}else if(function(n){return n&&"function"==typeof n.addListener&&"function"==typeof n.removeListener}(n)){const o=n;n.addListener(e,t),s=()=>o.removeListener(e,t)}else{if(!n||!n.length)throw new TypeError("Invalid event target");for(let o=0,a=n.length;oYE(n,t,e)):t=>YE(n,t)}const Lre=["underline"],Bre=["connectionContainer"],Vre=["inputContainer"],jre=["label"];function Ure(n,e){1&n&&(ff(0),F(1,"div",14),et(2,"div",15),et(3,"div",16),et(4,"div",17),N(),F(5,"div",18),et(6,"div",15),et(7,"div",16),et(8,"div",17),N(),pf())}function zre(n,e){1&n&&(F(0,"div",19),In(1,1),N())}function Hre(n,e){if(1&n&&(ff(0),In(1,2),F(2,"span"),Te(3),N(),pf()),2&n){const t=bt(2);Y(3),Ai(t._control.placeholder)}}function $re(n,e){1&n&&In(0,3,["*ngSwitchCase","true"])}function Gre(n,e){1&n&&(F(0,"span",23),Te(1," *"),N())}function Wre(n,e){if(1&n){const t=Lr();F(0,"label",20,21),ye("cdkObserveContent",function(){return Vn(t),bt().updateOutlineGap()}),Ct(2,Hre,4,1,"ng-container",12),Ct(3,$re,1,0,"ng-content",12),Ct(4,Gre,2,0,"span",22),N()}if(2&n){const t=bt();at("mat-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-form-field-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-accent","accent"==t.color)("mat-warn","warn"==t.color),ie("cdkObserveContentDisabled","outline"!=t.appearance)("id",t._labelId)("ngSwitch",t._hasLabel()),en("for",t._control.id)("aria-owns",t._control.id),Y(2),ie("ngSwitchCase",!1),Y(1),ie("ngSwitchCase",!0),Y(1),ie("ngIf",!t.hideRequiredMarker&&t._control.required&&!t._control.disabled)}}function qre(n,e){1&n&&(F(0,"div",24),In(1,4),N())}function Yre(n,e){if(1&n&&(F(0,"div",25,26),et(2,"span",27),N()),2&n){const t=bt();Y(2),at("mat-accent","accent"==t.color)("mat-warn","warn"==t.color)}}function Xre(n,e){1&n&&(F(0,"div"),In(1,5),N()),2&n&&ie("@transitionMessages",bt()._subscriptAnimationState)}function Kre(n,e){if(1&n&&(F(0,"div",31),Te(1),N()),2&n){const t=bt(2);ie("id",t._hintLabelId),Y(1),Ai(t.hintLabel)}}function Zre(n,e){if(1&n&&(F(0,"div",28),Ct(1,Kre,2,2,"div",29),In(2,6),et(3,"div",30),In(4,7),N()),2&n){const t=bt();ie("@transitionMessages",t._subscriptAnimationState),Y(1),ie("ngIf",t.hintLabel)}}const Qre=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Jre=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],Nj=new _e("MatError"),tse={transitionMessages:Jl("transitionMessages",[br("enter",Kn({opacity:1,transform:"translateY(0%)"})),Qs("void => enter",[Kn({opacity:0,transform:"translateY(-5px)"}),Mo("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let Nv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n}),n})();const Lj=new _e("MatHint");let Bf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-label"]]}),n})(),ise=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-placeholder"]]}),n})();const Bj=new _e("MatPrefix"),Vj=new _e("MatSuffix");let SO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["","matSuffix",""]],features:[At([{provide:Vj,useExisting:n}])]}),n})(),jj=0;const ose=kf(class{constructor(n){this._elementRef=n}},"primary"),zj=new _e("MAT_FORM_FIELD_DEFAULT_OPTIONS"),XE=new _e("MatFormField");let tm=(()=>{class n extends ose{constructor(t,i,r,s,o,a,l,c){super(t),this._changeDetectorRef=i,this._dir=s,this._defaults=o,this._platform=a,this._ngZone=l,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new we,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+jj++,this._labelId="mat-form-field-label-"+jj++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==c,this.appearance=o&&o.appearance?o.appearance:"legacy",this._hideRequiredMarker=!(!o||null==o.hideRequiredMarker)&&o.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const i=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&i!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Dt(t)}_shouldAlwaysFloat(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}_canLabelFloat(){return"never"!==this.floatLabel}get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}get floatLabel(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}get _control(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic}set _control(t){this._explicitFormFieldControl=t}getLabelId(){return this._hasFloatingLabel()?this._labelId:null}getConnectedOverlayOrigin(){return this._connectionContainerRef||this._elementRef}ngAfterContentInit(){this._validateControlChild();const t=this._control;t.controlType&&this._elementRef.nativeElement.classList.add(`mat-form-field-type-${t.controlType}`),t.stateChanges.pipe(ns(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(zn(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(zn(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),ki(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(ns(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(ns(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(zn(this._destroyed)).subscribe(()=>{"function"==typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this.updateOutlineGap())}):this.updateOutlineGap()})}ngAfterContentChecked(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}ngAfterViewInit(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_shouldForward(t){const i=this._control?this._control.ngControl:null;return i&&i[t]}_hasPlaceholder(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}_hasLabel(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}_shouldLabelFloat(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_hideControlPlaceholder(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}_hasFloatingLabel(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_animateAndLockLabel(){this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,zc(this._label.nativeElement,"transitionend").pipe(_i(1)).subscribe(()=>{this._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}_validatePlaceholders(){}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_getDefaultFloatLabelState(){return this._defaults&&this._defaults.floatLabel||"auto"}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&t.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const i=this._hintChildren?this._hintChildren.find(s=>"start"===s.align):null,r=this._hintChildren?this._hintChildren.find(s=>"end"===s.align):null;i?t.push(i.id):this._hintLabel&&t.push(this._hintLabelId),r&&t.push(r.id)}else this._errorChildren&&t.push(...this._errorChildren.map(i=>i.id));this._control.setDescribedByIds(t)}}_validateControlChild(){}updateOutlineGap(){const t=this._label?this._label.nativeElement:null;if(!("outline"===this.appearance&&t&&t.children.length&&t.textContent.trim()&&this._platform.isBrowser))return;if(!this._isAttachedToDOM())return void(this._outlineGapCalculationNeededImmediately=!0);let i=0,r=0;const s=this._connectionContainerRef.nativeElement,o=s.querySelectorAll(".mat-form-field-outline-start"),a=s.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const l=s.getBoundingClientRect();if(0===l.width&&0===l.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const c=this._getStartEnd(l),d=t.children,f=this._getStartEnd(d[0].getBoundingClientRect());let p=0;for(let g=0;g0?.75*p+10:0}for(let l=0;l{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn,_E],Nn]}),n})();function Bv(...n){if(1===n.length){const e=n[0];if(Fe(e))return KE(e,null);if(je(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return KE(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return KE(n=1===n.length&&Fe(n[0])?n[0]:n,null).pipe(be(t=>e(...t)))}return KE(n,null)}function KE(n,e){return new oe(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function Sa(n){return function(t){const i=new ase(n),r=t.lift(i);return i.caught=r}}class ase{constructor(e){this.selector=e}call(e,t){return t.subscribe(new lse(e,this.selector,this.caught))}}class lse extends ei{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new $r(this);this.add(i);const r=oo(t,i);r!==i&&this.add(r)}}}class cse{constructor(e){this.callback=e}call(e,t){return t.subscribe(new use(e,this.callback))}}class use extends Rt{constructor(e,t){super(e),this.add(new Ie(t))}}class $j{}class Gj{}class Gu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof Gu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new Gu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof Gu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class dse{encodeKey(e){return Wj(e)}encodeValue(e){return Wj(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const fse=/%(\d[a-f0-9])/gi,pse={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Wj(n){return encodeURIComponent(n).replace(fse,(e,t)=>{var i;return null!==(i=pse[t])&&void 0!==i?i:e})}function qj(n){return`${n}`}class th{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new dse,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new th({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(qj(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(qj(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class gse{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function Yj(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function Xj(n){return"undefined"!=typeof Blob&&n instanceof Blob}function Kj(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Vv{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==i?i:null,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new Gu),this.context||(this.context=new gse),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(d=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),d)),new Vv(i,r,o,{params:d,headers:c,context:f,reportProgress:l,responseType:s,withCredentials:a})}}var Ur=(()=>((Ur=Ur||{})[Ur.Sent=0]="Sent",Ur[Ur.UploadProgress=1]="UploadProgress",Ur[Ur.ResponseHeader=2]="ResponseHeader",Ur[Ur.DownloadProgress=3]="DownloadProgress",Ur[Ur.Response=4]="Response",Ur[Ur.User=5]="User",Ur))();class MO{constructor(e,t=200,i="OK"){this.headers=e.headers||new Gu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class xO extends MO{constructor(e={}){super(e),this.type=Ur.ResponseHeader}clone(e={}){return new xO({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class ZE extends MO{constructor(e={}){super(e),this.type=Ur.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new ZE({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class Zj extends MO{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function TO(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let im=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Vv)s=t;else{let l,c;l=r.headers instanceof Gu?r.headers:new Gu(r.headers),r.params&&(c=r.params instanceof th?r.params:new th({fromObject:r.params})),s=new Vv(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=st(s).pipe(function(n,e){return ci(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Vv||"events"===r.observe)return o;const a=o.pipe(Tn(l=>l instanceof ZE));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(be(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(be(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(be(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(be(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new th).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,TO(r,i))}post(t,i,r={}){return this.request("POST",t,TO(r,i))}put(t,i,r={}){return this.request("PUT",t,TO(r,i))}}return n.\u0275fac=function(t){return new(t||n)(I($j))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Qj{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const Jj=new _e("HTTP_INTERCEPTORS");let yse=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const vse=/^\)\]\}',?\n/;let eU=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new oe(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,_)=>r.setRequestHeader(g,_.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,_=r.statusText||"OK",y=new Gu(r.getAllResponseHeaders()),v=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new xO({headers:y,status:g,statusText:_,url:v}),o},l=()=>{let{headers:g,status:_,statusText:y,url:v}=a(),w=null;204!==_&&(w=void 0===r.response?r.responseText:r.response),0===_&&(_=w?200:0);let C=_>=200&&_<300;if("json"===t.responseType&&"string"==typeof w){const x=w;w=w.replace(vse,"");try{w=""!==w?JSON.parse(w):null}catch(L){w=x,C&&(C=!1,w={error:L,text:w})}}C?(i.next(new ZE({body:w,headers:g,status:_,statusText:y,url:v||void 0})),i.complete()):i.error(new Zj({error:w,headers:g,status:_,statusText:y,url:v||void 0}))},c=g=>{const{url:_}=a(),y=new Zj({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:_||void 0});i.error(y)};let d=!1;const f=g=>{d||(i.next(a()),d=!0);let _={type:Ur.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),"text"===t.responseType&&!!r.responseText&&(_.partialText=r.responseText),i.next(_)},p=g=>{let _={type:Ur.UploadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),i.next(_)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",f),null!==s&&r.upload&&r.upload.addEventListener("progress",p)),r.send(s),i.next({type:Ur.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",f),null!==s&&r.upload&&r.upload.removeEventListener("progress",p)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(I(P3))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const AO=new _e("XSRF_COOKIE_NAME"),DO=new _e("XSRF_HEADER_NAME");class tU{}let Cse=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=b3(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(cl),I(AO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),OO=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(tU),I(DO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),wse=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(Jj,[]);this.chain=i.reduceRight((r,s)=>new Qj(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Gj),I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Ese=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:OO,useClass:yse}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:AO,useValue:t.cookieName}:[],t.headerName?{provide:DO,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[OO,{provide:Jj,useExisting:OO,multi:!0},{provide:tU,useClass:Cse},{provide:AO,useValue:"XSRF-TOKEN"},{provide:DO,useValue:"X-XSRF-TOKEN"}]}),n})(),nU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[im,{provide:$j,useClass:wse},eU,{provide:Gj,useExisting:eU}],imports:[[Ese.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const Sse=["*"];function iU(n){return Error(`Unable to find icon with the name "${n}"`)}function rU(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function sU(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class Vf{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let jv=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new Vf(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(on.HTML,r);if(!o)throw sU(r);return this._addSvgIconConfig(t,i,new Vf("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new Vf(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(on.HTML,i);if(!s)throw sU(i);return this._addSvgIconSetConfig(t,new Vf("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(on.RESOURCE_URL,t);if(!i)throw rU(t);const r=this._cachedIconsByUrl.get(i);return r?st(QE(r)):this._loadSvgIconFromConfig(new Vf(t,null)).pipe(Di(s=>this._cachedIconsByUrl.set(i,s)),be(s=>QE(s)))}getNamedSvgIcon(t,i=""){const r=oU(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):zg(iU(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?st(QE(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(be(i=>QE(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?st(r):Bv(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(Sa(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(on.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),st(null)})))).pipe(be(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw iU(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Di(i=>t.svgText=i),be(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?st(null):this._fetchIcon(t).pipe(Di(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new cse(n))}(()=>this._inProgressUrlFetches.delete(a)),Vs());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(oU(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),aU=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Pse=aU.map(n=>`[${n}]`).join(", "),Rse=/^url\(['"]?#(.*?)['"]?\)$/;let Rs=(()=>{class n extends Ase{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=Ie.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=Dt(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){const i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(Pse),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(Rse):null;if(c){let d=r.get(a);d||(d=[],r.set(a,d)),d.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(_i(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(jv),fs("aria-hidden"),E(Dse),E(Uo))},n.\u0275cmp=Le({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(en("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),at("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[ht],ngContentSelectors:Sse,decls:1,vars:0,template:function(t,i){1&t&&(Dr(),In(0))},styles:[".mat-icon{background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],encapsulation:2,changeDetection:0}),n})(),Pr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn],Nn]}),n})();new class extends Zl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let Lse=1;const Bse=Promise.resolve(),JE={};function lU(n){return n in JE&&(delete JE[n],!0)}const cU={setImmediate(n){const e=Lse++;return JE[e]=!0,Bse.then(()=>lU(e)&&n()),e},clearImmediate(n){lU(n)}};new class extends Zl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=cU.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cU.clearImmediate(t),e.scheduled=void 0)}});function Uv(n){return!!n&&(n instanceof oe||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class Hse{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new $se(e,this.durationSelector))}}class $se extends ei{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=oo(t,new $r(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function IO(n){return!Fe(n)&&n-parseFloat(n)+1>=0}function Wse(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function eS(n,e=Tf){return function(n){return function(t){return t.lift(new Hse(n))}}(()=>function(n=0,e,t){let i=-1;return IO(e)?i=Number(e)<1?1:Number(e):Ln(e)&&(t=e),Ln(t)||(t=Tf),new oe(r=>{const s=IO(n)?n:+n-t.now();return t.schedule(Wse,s,{index:0,period:i,subscriber:r})})}(n,e))}function Hc(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new Hg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}class uU{constructor(e=!1,t,i=!0){this._multiple=e,this._emitChanges=i,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new we,t&&t.length&&(e?t.forEach(r=>this._markSelected(r)):this._markSelected(t[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...e){this._verifyValueAssignment(e),e.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...e){this._verifyValueAssignment(e),e.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(e){this.isSelected(e)?this.deselect(e):this.select(e)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(e){return this._selection.has(e)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(e){this._multiple&&this.selected&&this._selected.sort(e)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(e){this.isSelected(e)||(this._multiple||this._unmarkAll(),this._selection.add(e),this._emitChanges&&this._selectedToEmit.push(e))}_unmarkSelected(e){this.isSelected(e)&&(this._selection.delete(e),this._emitChanges&&this._deselectedToEmit.push(e))}_unmarkAll(){this.isEmpty()||this._selection.forEach(e=>this._unmarkSelected(e))}_verifyValueAssignment(e){}}let tS=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})(),rm=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new we,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new oe(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(eS(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):st()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Tn(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=Hu(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>zc(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(ii),I(rt,8))},n.\u0275prov=ae({factory:function(){return new n(I(lt),I(ii),I(rt,8))},token:n,providedIn:"root"}),n})(),jf=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new we,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){const t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){const t=this.getViewportScrollPosition(),{width:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(eS(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt),I(rt,8))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt),I(rt,8))},token:n,providedIn:"root"}),n})(),zv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),gU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Iv,Av,zv],Iv,zv]}),n})();class PO{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class sm extends PO{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Uf extends PO{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class uoe extends PO{constructor(e){super(),this.element=e instanceof nt?e.nativeElement:e}}class nS{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof sm?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Uf?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof uoe?(this._attachedPortal=e,this.attachDomPortal(e)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class doe extends nS{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let zf=(()=>{class n extends nS{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new Pe,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedPortal=null,this._attachedRef=null}attachComponentPortal(t){t.setAttachedHost(this);const i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(E(ol),E(es),E(rt))},n.\u0275dir=he({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ht]}),n})(),iS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function _U(n,e=!1){return t=>t.lift(new hoe(n,e))}class hoe{constructor(e,t){this.predicate=e,this.inclusive=t}call(e,t){return t.subscribe(new foe(e,this.predicate,this.inclusive))}}class foe extends Rt{constructor(e,t,i){super(e),this.predicate=t,this.inclusive=i,this.index=0}_next(e){const t=this.destination;let i;try{i=this.predicate(e,this.index++)}catch(r){return void t.error(r)}this.nextOrComplete(e,i)}nextOrComplete(e,t){const i=this.destination;Boolean(t)?i.next(e):(this.inclusive&&i.next(e),i.complete())}}const yU=J3();class poe{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=jr(-this._previousScrollPosition.left),e.style.top=jr(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),yU&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),yU&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class goe{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class vU{enable(){}disable(){}attach(){}}function RO(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function bU(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class moe{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:r}=this._viewportRuler.getViewportSize();RO(t,[{width:i,height:r,bottom:r,right:i,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let _oe=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new vU,this.close=o=>new goe(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new poe(this._viewportRuler,this._document),this.reposition=o=>new moe(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(I(rm),I(jf),I(lt),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rm),I(jf),I(lt),I(rt))},token:n,providedIn:"root"}),n})();class Hv{constructor(e){if(this.scrollStrategy=new vU,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class yoe{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class voe{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let CU=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})(),boe=(()=>{class n extends CU{constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);break}}}add(t){super.add(t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})(),Coe=(()=>{class n extends CU{constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Df(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(rt),I(ii))},token:n,providedIn:"root"}),n})();const nh="undefined"!=typeof window?window:{},wU=void 0!==nh.__karma__&&!!nh.__karma__||void 0!==nh.jasmine&&!!nh.jasmine||void 0!==nh.jest&&!!nh.jest||void 0!==nh.Mocha&&!!nh.Mocha;let om=(()=>{class n{constructor(t,i){this._platform=i,this._document=t}ngOnDestroy(){const t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||wU){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(d),this._keydownEvents=new we,this._outsidePointerEvents=new we,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this.hasAttached()&&this.updatePosition()}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,e&&this._detachments.next(),this._detachments.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=jr(this._config.width),e.height=jr(this._config.height),e.minWidth=jr(this._config.minWidth),e.minHeight=jr(this._config.minHeight),e.maxWidth=jr(this._config.maxWidth),e.maxHeight=jr(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;mE(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(zn(ki(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._previousHostParent.removeChild(this._host)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const EU="cdk-overlay-connected-position-bounding-box",Eoe=/([A-Za-z%]+)$/;class SU{constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new we,this._resizeSubscription=Ie.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(EU),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();const e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Hf(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(EU),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();const e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=xU(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,_=this._subtractOverflows(s.width,0-o,o+s.width-i.width),y=this._subtractOverflows(s.height,p,g),v=_*y;return{visibleArea:v,isCompletelyWithinViewport:s.width*s.height===v,fitsInViewportVertically:y===s.height,fitsInViewportHorizontally:_==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=MU(this._overlayRef.getConfig().minHeight),a=MU(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=xU(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let d=0,f=0;return d=r.width<=s.width?c||-o:e.x_&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-_/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,d=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)f=e.x,d=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),_=this._lastBoundingBoxSize.width;d=2*g,f=e.x-g,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(f=e.x-_/2)}return{top:o,left:f,bottom:a,right:p,width:d,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=jr(i.height),r.top=jr(i.top),r.bottom=jr(i.bottom),r.width=jr(i.width),r.left=jr(i.left),r.right=jr(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=jr(s)),o&&(r.maxWidth=jr(o))}this._lastBoundingBoxSize=i,Hf(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Hf(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Hf(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const d=this._viewportRuler.getViewportScrollPosition();Hf(i,this._getExactOverlayY(t,e,d)),Hf(i,this._getExactOverlayX(t,e,d))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=jr(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=jr(o.maxWidth):s&&(i.maxWidth="")),Hf(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=jr(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=jr(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:bU(e,i),isOriginOutsideView:RO(e,i),isOverlayClipped:bU(t,i),isOverlayOutsideView:RO(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&mE(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof nt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function Hf(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function MU(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(Eoe);return t&&"px"!==t?null:parseFloat(e)}return n||null}function xU(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class Soe{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new SU(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new yoe(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const TU="cdk-global-overlay-wrapper";class Moe{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(TU),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?t.justifyContent="flex-start":"center"===this._justifyContent?t.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?t.justifyContent="flex-end":"flex-end"===this._justifyContent&&(t.justifyContent="flex-start"):t.justifyContent=this._justifyContent,t.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(TU),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let xoe=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new Moe}connectedTo(t,i,r){return new Soe(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new SU(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(I(jf),I(rt),I(ii),I(om))},n.\u0275prov=ae({factory:function(){return new n(I(jf),I(rt),I(ii),I(om))},token:n,providedIn:"root"}),n})(),Toe=0,Jo=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=d,this._location=f,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new Hv(t);return o.direction=o.direction||this._directionality.value,new woe(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+Toe++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Yd)),new doe(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(I(_oe),I(om),I(ol),I(xoe),I(boe),I(Tt),I(lt),I(rt),I(Ko),I(Ug),I(Coe))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Aoe=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],AU=new _e("cdk-connected-overlay-scroll-strategy");let Doe=(()=>{class n{constructor(t){this.elementRef=t}}return n.\u0275fac=function(t){return new(t||n)(E(nt))},n.\u0275dir=he({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),n})(),DU=(()=>{class n{constructor(t,i,r,s,o){this._overlay=t,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=Ie.EMPTY,this._attachSubscription=Ie.EMPTY,this._detachSubscription=Ie.EMPTY,this._positionSubscription=Ie.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Pe,this.positionChange=new Pe,this.attach=new Pe,this.detach=new Pe,this.overlayKeydown=new Pe,this.overlayOutsideClick=new Pe,this._templatePortal=new Uf(i,r),this._scrollStrategyFactory=s,this.scrollStrategy=this._scrollStrategyFactory()}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}get hasBackdrop(){return this._hasBackdrop}set hasBackdrop(t){this._hasBackdrop=Dt(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=Dt(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=Dt(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=Dt(t)}get push(){return this._push}set push(t){this._push=Dt(t)}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this._attachOverlay():this._detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Aoe);const t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=t.detachments().subscribe(()=>this.detach.emit()),t.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),27===i.keyCode&&!this.disableClose&&!Yo(i)&&(i.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{this.overlayOutsideClick.next(i)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),i=new Hv({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(i.width=this.width),(this.height||0===this.height)&&(i.height=this.height),(this.minWidth||0===this.minWidth)&&(i.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(t){const i=this.positions.map(r=>({originX:r.originX,originY:r.originY,overlayX:r.overlayX,overlayY:r.overlayY,offsetX:r.offsetX||this.offsetX,offsetY:r.offsetY||this.offsetY,panelClass:r.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const t=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(t),t}_attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(t=>{this.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(_U(()=>this.positionChange.observers.length>0)).subscribe(t=>{this.positionChange.emit(t),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()}))}_detachOverlay(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Xs),E(es),E(AU),E(Ko,8))},n.\u0275dir=he({type:n,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[qn]}),n})();const Ioe={provide:AU,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};let $v=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[Jo,Ioe],imports:[[Iv,iS,gU],gU]}),n})();const OU=["mat-button",""],IU=["*"],Roe=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],koe=kf(em(Ff(class{constructor(n){this._elementRef=n}})));let $f=(()=>{class n extends koe{constructor(t,i,r){super(t),this._focusMonitor=i,this._animationMode=r,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const s of Roe)this._hasHostAttributes(s)&&this._getHostElement().classList.add(s);t.nativeElement.classList.add("mat-button-base"),this.isRoundButton&&(this.color="accent")}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}focus(t,i){t?this._focusMonitor.focusVia(this._getHostElement(),t,i):this._getHostElement().focus(i)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(i=>this._getHostElement().hasAttribute(i))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-icon-button",""],["button","mat-fab",""],["button","mat-mini-fab",""],["button","mat-stroked-button",""],["button","mat-flat-button",""]],viewQuery:function(t,i){if(1&t&&ni(Qo,5),2&t){let r;Mt(r=xt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,i){2&t&&(en("disabled",i.disabled||null),at("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-button-disabled",i.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[ht],attrs:OU,ngContentSelectors:IU,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,i){1&t&&(Dr(),F(0,"span",0),In(1),N(),et(2,"span",1),et(3,"span",2)),2&t&&(Y(2),at("mat-button-ripple-round",i.isRoundButton||i.isIconButton),ie("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",i.isIconButton)("matRippleTrigger",i._getHostElement()))},directives:[Qo],styles:[".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:.04}@media(hover: none){.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-icon-button,.mat-stroked-button,.mat-flat-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-button.mat-button-disabled,.mat-icon-button.mat-button-disabled,.mat-stroked-button.mat-button-disabled,.mat-flat-button.mat-button-disabled{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button.mat-button-disabled{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}._mat-animation-noopable.mat-raised-button{transition:none;animation:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-ripple.mat-ripple,.mat-stroked-button .mat-button-focus-overlay{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab.mat-button-disabled{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-fab{transition:none;animation:none}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab.mat-button-disabled{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-mini-fab{transition:none;animation:none}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button i,.mat-icon-button .mat-icon{line-height:24px}.mat-button-ripple.mat-ripple,.mat-button-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1),background-color 200ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n"],encapsulation:2,changeDetection:0}),n})(),Gf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn],Nn]}),n})();class RU extends Rt{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class Foe extends Rt{constructor(e,t,i){super(),this.parent=e,this.outerValue=t,this.outerIndex=i,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function kU(n,e,t,i,r=new Foe(n,t,i)){if(!r.closed)return e instanceof oe?e.subscribe(r):Pi(e)(r)}const FU={};function or(...n){let e,t;return Ln(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&Fe(n[0])&&(n=n[0]),Ba(n,t).lift(new NU(e))}class NU{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Noe(e,this.resultSelector))}}class Noe extends RU{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(FU),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i{class n{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):Boe}matchMedia(t){return this._platform.WEBKIT&&function(n){if(!LU.has(n))try{am||(am=document.createElement("style"),am.setAttribute("type","text/css"),document.head.appendChild(am)),am.sheet&&(am.sheet.insertRule(`@media ${n} {.fx-query-test{ }}`,0),LU.add(n))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return n.\u0275fac=function(t){return new(t||n)(I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(ii))},token:n,providedIn:"root"}),n})();function Boe(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let kO=(()=>{class n{constructor(t,i){this._mediaMatcher=t,this._zone=i,this._queries=new Map,this._destroySubject=new we}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return VU(mE(t)).some(r=>this._registerQuery(r).mql.matches)}observe(t){let s=or(VU(mE(t)).map(o=>this._registerQuery(o).observable));return s=YE(s.pipe(_i(1)),s.pipe(VD(1),$g(0))),s.pipe(be(o=>{const a={matches:!1,breakpoints:{}};return o.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const i=this._mediaMatcher.matchMedia(t),s={observable:new oe(o=>{const a=l=>this._zone.run(()=>o.next(l));return i.addListener(a),()=>{i.removeListener(a)}}).pipe(ns(i),be(({matches:o})=>({query:t,matches:o})),zn(this._destroySubject)),mql:i};return this._queries.set(t,s),s}}return n.\u0275fac=function(t){return new(t||n)(I(BU),I(lt))},n.\u0275prov=ae({factory:function(){return new n(I(BU),I(lt))},token:n,providedIn:"root"}),n})();function VU(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}function Voe(n,e){if(1&n){const t=Lr();F(0,"div",1),F(1,"button",2),ye("click",function(){return Vn(t),bt().action()}),Te(2),N(),N()}if(2&n){const t=bt();Y(2),Ai(t.data.action)}}function joe(n,e){}const FO=new _e("MatSnackBarData");class rS{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const Uoe=Math.pow(2,31)-1;class NO{constructor(e,t){this._overlayRef=t,this._afterDismissed=new we,this._afterOpened=new we,this._onAction=new we,this._dismissedByAction=!1,this.containerInstance=e,this.onAction().subscribe(()=>this.dismiss()),e._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,Uoe))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}let zoe=(()=>{class n{constructor(t,i){this.snackBarRef=t,this.data=i}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return n.\u0275fac=function(t){return new(t||n)(E(NO),E(FO))},n.\u0275cmp=Le({type:n,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-simple-snackbar"],decls:3,vars:2,consts:[["class","mat-simple-snackbar-action",4,"ngIf"],[1,"mat-simple-snackbar-action"],["mat-button","",3,"click"]],template:function(t,i){1&t&&(F(0,"span"),Te(1),N(),Ct(2,Voe,3,1,"div",0)),2&t&&(Y(1),Ai(i.data.message),Y(1),ie("ngIf",i.hasAction))},directives:[Is,$f],styles:[".mat-simple-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.mat-simple-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.mat-simple-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .mat-simple-snackbar-action{margin-left:-8px;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),n})();const Hoe={snackBarState:Jl("state",[br("void, hidden",Kn({transform:"scale(0.8)",opacity:0})),br("visible",Kn({transform:"scale(1)",opacity:1})),Qs("* => visible",Mo("150ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void, * => hidden",Mo("75ms cubic-bezier(0.4, 0.0, 1, 1)",Kn({opacity:0})))])};let $oe=(()=>{class n extends nS{constructor(t,i,r,s,o){super(),this._ngZone=t,this._elementRef=i,this._changeDetectorRef=r,this._platform=s,this.snackBarConfig=o,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new we,this._onExit=new we,this._onEnter=new we,this._animationState="void",this.attachDomPortal=a=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(a)),this._live="assertive"!==o.politeness||o.announcementMessage?"off"===o.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(t)}onAnimationEnd(t){const{fromState:i,toState:r}=t;if(("void"===r&&"void"!==i||"hidden"===r)&&this._completeExit(),"visible"===r){const s=this._onEnter;this._ngZone.run(()=>{s.next(),s.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}ngOnDestroy(){this._destroyed=!0,this._completeExit()}_completeExit(){this._ngZone.onMicrotaskEmpty.pipe(_i(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(r=>t.classList.add(r)):t.classList.add(i)),"center"===this.snackBarConfig.horizontalPosition&&t.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&t.classList.add("mat-snack-bar-top")}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),i=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&i){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(r=document.activeElement),t.removeAttribute("aria-hidden"),i.appendChild(t),null==r||r.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return n.\u0275fac=function(t){return new(t||n)(E(lt),E(nt),E(Un),E(ii),E(rS))},n.\u0275cmp=Le({type:n,selectors:[["snack-bar-container"]],viewQuery:function(t,i){if(1&t&&ni(zf,7),2&t){let r;Mt(r=xt())&&(i._portalOutlet=r.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,i){1&t&&qy("@state.done",function(s){return i.onAnimationEnd(s)}),2&t&&Sg("@state",i._animationState)},features:[ht],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,i){1&t&&(F(0,"div",0),Ct(1,joe,0,0,"ng-template",1),N(),et(2,"div")),2&t&&(Y(2),en("aria-live",i._live)("role",i._role))},directives:[zf],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[Hoe.snackBarState]}}),n})(),UU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[$v,iS,bn,Gf,Nn],Nn]}),n})();const zU=new _e("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new rS}});let Woe=(()=>{class n{constructor(t,i,r,s,o,a){this._overlay=t,this._live=i,this._injector=r,this._breakpointObserver=s,this._parentSnackBar=o,this._defaultConfig=a,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=zoe,this.snackBarContainerComponent=$oe,this.handsetCssClass="mat-snack-bar-handset"}get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}openFromComponent(t,i){return this._attach(t,i)}openFromTemplate(t,i){return this._attach(t,i)}open(t,i="",r){const s=Object.assign(Object.assign({},this._defaultConfig),r);return s.data={message:t,action:i},s.announcementMessage===t&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,i){const s=Tt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:rS,useValue:i}]}),o=new sm(this.snackBarContainerComponent,i.viewContainerRef,s),a=t.attach(o);return a.instance.snackBarConfig=i,a.instance}_attach(t,i){const r=Object.assign(Object.assign(Object.assign({},new rS),this._defaultConfig),i),s=this._createOverlay(r),o=this._attachSnackBarContainer(s,r),a=new NO(o,s);if(t instanceof Xs){const l=new Uf(t,null,{$implicit:r.data,snackBarRef:a});a.instance=o.attachTemplatePortal(l)}else{const l=this._createInjector(r,a),c=new sm(t,void 0,l),d=o.attachComponentPortal(c);a.instance=d.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(zn(s.detachments())).subscribe(l=>{const c=s.overlayElement.classList;l.matches?c.add(this.handsetCssClass):c.remove(this.handsetCssClass)}),r.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(a,r),this._openedSnackBarRef=a,this._openedSnackBarRef}_animateSnackBar(t,i){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),i.duration&&i.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(i.duration))}_createOverlay(t){const i=new Hv;i.direction=t.direction;let r=this._overlay.position().global();const s="rtl"===t.direction,o="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!s||"end"===t.horizontalPosition&&s,a=!o&&"center"!==t.horizontalPosition;return o?r.left("0"):a?r.right("0"):r.centerHorizontally(),"top"===t.verticalPosition?r.top("0"):r.bottom("0"),i.positionStrategy=r,this._overlay.create(i)}_createInjector(t,i){return Tt.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:NO,useValue:i},{provide:FO,useValue:t.data}]})}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(wE),I(Tt),I(kO),I(n,12),I(zU))},n.\u0275prov=ae({factory:function(){return new n(I(Jo),I(wE),I(ku),I(kO),I(n,12),I(zU))},token:n,providedIn:UU}),n})();function De(n,e,t,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function bs(n,e){return function(t,i){e(t,i,n)}}function Ge(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function gl(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function WU(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function BO(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||WU()}const qU="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",oS=BO();class Koe{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function VO(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const YU={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function XU(n){return"string"==typeof n?YU[n.toUpperCase()]||YU.WHITE:n}function aS(n,e){if(!n)throw new Error(e||"Assertion failed")}const tc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},Gv=tc.window||tc.self||tc.global,KU=tc.process||{};function lm(){let n;if(oS&&Gv.performance)n=Gv.performance.now();else if(KU.hrtime){const e=KU.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const cm={debug:oS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},iae={enabled:!0,level:0};function ml(){}const ZU={},QU={once:!0};function rae(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let jO=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=qU,this._startTs=lm(),this._deltaTs=lm(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Koe("__probe-".concat(this.id,"__"),iae),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((lm()-this._startTs).toPrecision(10))}getDelta(){return Number((lm()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){aS(t,i)}warn(t){return this._getLogFunction(0,t,cm.warn,arguments,QU)}error(t){return this._getLogFunction(0,t,cm.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,cm.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,cm.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,cm.debug||cm.info,arguments,QU)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||ml,r&&[r],{tag:rae(i)}):ml}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?oS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=VO(r,e,t);console.log(...s)},r.src=n,ml}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...VO(n,e,t)),ml;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...VO(r,e,t)),r.src=n.toDataURL(),ml}return ml}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=Ve(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):ml}({image:r,message:s,scale:o}):ml}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||ml)}group(t,i,r={collapsed:!1}){r=ez({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ml)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=JU(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=ez({logLevel:t,message:i,args:s,opts:o}),aS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=lm();const a=o.tag||o.message;if(o.once){if(ZU[a])return ml;ZU[a]=lm()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!oS&&"string"==typeof n&&(e&&(e=XU(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=XU(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return ml}}return n.VERSION=qU,n})();function JU(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return aS(Number.isFinite(e)&&e>=0),e}function ez(n){const{logLevel:e,message:t}=n;n.logLevel=JU(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return aS("string"===r||"object"===r),Object.assign(n,n.opts)}const Zn=new jO({id:"deck"}),Hn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Hn,"IDENTITY",{get:()=>Zn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const $c={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},tz={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},ct=new jO({id:"luma.gl"});function xo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function lS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Mn(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function cS(n){return xo(lS(n),"Invalid WebGLRenderingContext"),n}function To(n){return xo(Mn(n),"Requires WebGL2"),n}var Zi=Ve(761);const Wv={};const qv=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Zi.CO.console&&Zi.CO.console.log&&Zi.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Wf.prototype.VERTEX_ARRAY_BINDING_OES=34229,Wf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iMn(n)?void 0:0,Mae={3074:n=>Mn(n)?void 0:36064,35723:n=>Mn(n)?void 0:4352,35977:Li,32937:Li,36795:(n,e)=>{const t=Mn(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(rz);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(rz);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:Li,35071:Li,37447:Li,36063:(n,e)=>{if(!Mn(n)){const t=n.getExtension(iz);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Li,35374:Li,35377:Li,34852:n=>{if(!Mn(n)){const e=n.getExtension(iz);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(nz)?2147483647:65535,33001:n=>n.getExtension(nz)?16777216:65535,33e3:n=>16777216,37157:Li,35373:Li,35657:Li,36183:Li,37137:Li,34045:Li,35978:Li,35979:Li,35968:Li,35376:Li,35375:Li,35659:Li,37154:Li,35371:Li,35658:Li,35076:Li,35077:Li,35380:Li},sz="ANGLE_instanced_arrays",oz={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{xo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[sz]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){xo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{xo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{xo(!1)},deleteQuery:()=>{xo(!1)},beginQuery:()=>{xo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},UO={readBuffer:(n,e,t)=>{Mn(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Mn(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!Mn(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Mn(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=Mae[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function Bae(n,{extension:e,target:t,target2:i}){const r=oz[e];xo(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new Wf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&Bae(n,{extension:t,target:n.luma,target2:n})}(n,oz),function(n,{target:e,target2:t}){Object.keys(UO).forEach(i=>{if("function"==typeof UO[i]){const r=n[i]?n[i].bind(n):()=>{},s=UO[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const zO={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ih=(n,e,t)=>e?n.enable(t):n.disable(t),az=(n,e,t)=>n.hint(t,e),Ma=(n,e,t)=>n.pixelStorei(t,e);function Yv(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Uae={3042:ih,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:ih,2885:(n,e)=>n.cullFace(e),2929:ih,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:ih,35723:az,36006:(n,e)=>{const t=Mn(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:az,2849:(n,e)=>n.lineWidth(e),32823:ih,32824:"polygonOffset",10752:"polygonOffset",35977:ih,32938:"sampleCoverage",32939:"sampleCoverage",3089:ih,3088:(n,e)=>n.scissor(...e),2960:ih,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:Ma,3317:Ma,37440:Ma,37441:Ma,37443:Ma,3330:Ma,3332:Ma,3331:Ma,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Ma,32878:Ma,3316:Ma,3315:Ma,32877:Ma,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=Yv(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Yv(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=Yv(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Yv(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=Yv(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Cr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const zae={blendEquation:(n,e,t)=>n.blendEquationSeparate(Cr(32777,e,t),Cr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Cr(32969,e,t),Cr(32968,e,t),Cr(32971,e,t),Cr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Cr(32824,e,t),Cr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Cr(32938,e,t),Cr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Cr(2962,e,t),Cr(2967,e,t),Cr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Cr(34816,e,t),Cr(36003,e,t),Cr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Cr(2964,e,t),Cr(2965,e,t),Cr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Cr(34817,e,t),Cr(34818,e,t),Cr(34819,e,t))},lz={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Gc=(n,e)=>n.isEnabled(e),cz={3042:Gc,2884:Gc,2929:Gc,3024:Gc,32823:Gc,32926:Gc,32928:Gc,3089:Gc,2960:Gc,35977:Gc};function uz(n){for(const e in n)return!1;return!0}function Hae(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||zO)){const r=e,s=cz[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=cz[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},zO),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){xo(this.stateStack.length>0),Wu(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){xo(void 0!==s);const o=e[s],a=this.cache[s];Hae(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function hz(n,e={}){const{enable:t=!0,copyState:i}=e;if(xo(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new Wae(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in lz)$ae(n,o,lz[o]);dz(n,"getParameter"),dz(n,"isEnabled")}return n.state.enable=t,n}function fz(n){xo(n.state),n.state.pop()}function Wu(n,e){if(xo(lS(n),"setParameters requires a WebGL context"),uz(e))return;const t={};for(const r in e){const s=Number(r),o=Uae[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)zae[r](n,e,i)}function nc(n,e,t){if(uz(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||hz(n,{copyState:!1}),n.state.push()}(n),Wu(n,e),i)r=t(n),fz(n);else try{r=t(n)}finally{fz(n)}return r}function um(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function HO(n,e,t=!0){return function(n,e,t,i,r){const s=pz(n[0],e,t);let o=gz(n[1],e,i,r),a=pz(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=gz(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,um(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function pz(n,e,t){return Math.min(Math.round(n*e),t-1)}function gz(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const $O=(0,Zi.jU)(),Qae=$O&&"undefined"!=typeof document,mz={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function _z(n={}){xo($O,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},mz,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(Qae&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=GO(r,n),function(n){const e=Mn(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);ct.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function GO(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},mz,e);const{manageState:t,debug:i}=e;return t&&hz(n,{copyState:!1,log:(...r)=>ct.log(1,...r)()}),$O&&i&&(Zi.CO.makeDebugContext?(n=Zi.CO.makeDebugContext(n,e),ct.level=Math.max(ct.level,1)):ct.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function yz(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class vz{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=yz(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(yz()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class WO{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof vz?e:new vz(t,i)),this.stats[t]}}const Xv="8.5.7",qf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new WO({id:e})),this.stats.get(e)}};if(Zi.CO.luma&&Zi.CO.luma.VERSION!==Xv)throw new Error(`luma.gl - multiple VERSIONs detected: ${Zi.CO.luma.VERSION} vs 8.5.7`);function Qe(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function qO(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return Qe(void 0!==i,`Accessing undefined constant GL.${e}`),i}function rh(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Zi.CO.luma||((0,Zi.jU)()&&ct.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Zi.CO.luma=Zi.CO.luma||{VERSION:Xv,version:Xv,log:ct,stats:qf,globals:{modules:{},nodeIO:{}}});const YO={};function Wc(n="id"){return YO[n]=YO[n]||1,`${n}-${YO[n]++}`}function bz(n){return Qe("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function dm(n){let e=!0;for(const t in n){e=!1;break}return e}function Cz(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw ct.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const hm="Resource subclass must define virtual methods";class qu{constructor(e,t={}){cS(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||Wc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){Qe(e=qO(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Mn(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=Mn(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?rh(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=rh(this.gl,o[f]))}}return o}setParameter(e,t){Qe(e=qO(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Mn(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=qO(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return Cz(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(hm)}_deleteHandle(){throw new Error(hm)}_bindHandle(e){throw new Error(hm)}_getOptsFromHandle(){throw new Error(hm)}_getParameter(e,t){throw new Error(hm)}_setParameter(e,t){throw new Error(hm)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=qf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;qf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=qf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=qf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function XO(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Kv(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function ule({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return ea.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ea.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=KO("Accessor",e,hle)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const Ez={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},fle={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Ez},ple={removedProps:Ez};class Si extends qu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/ea.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ea.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=KO("Buffer",e,fle),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=KO("Buffer",e,ple))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ea(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;Qe(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(To(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return To(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){To(this.gl);const s=Kv(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return Qe((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(Qe(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){Qe(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=XO(e);return Qe(s),this.setAccessor(new ea(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){Qe(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/Kv(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ea(this.accessor,{type:XO(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return ct.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return ct.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return ct.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return ct.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ea(this.accessor,e),this}}const ZO={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},Sz={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},Mz={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},_le=[9729,9728],xz=Zi.CO.WebGLBuffer||function(){};class fm extends qu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=ZO[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Mn(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=ZO[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=Wc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(C=>this.initialize(Object.assign({},e,{pixels:C,data:C}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:y=!1,mipmaps:v=!0}=e;const{depth:w=0}=e;return({width:f,height:p,compressed:y,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:y,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=w,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),v&&this._isNPOT()&&(ct.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),v=!1,this._updateForNPOT(l)),this.mipmaps=v,this.setImageData({data:t,width:f,height:p,depth:w,format:s,type:_,dataFormat:g,border:o,mipmaps:v,parameters:c,compressed:y}),v&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:y}=this;y.bindTexture(this.target,this.handle);let w,v=null;return({data:c,dataType:v}=this._getDataType({data:c,compressed:_})),nc(this.gl,l,()=>{switch(v){case"null":y.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":y.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":w=To(y),w.bindBuffer(35052,c.handle||c),w.texImage2D(t,r,s,f,p,o,g,d,a),w.bindBuffer(35052,null);break;case"browser-object":Mn(y)?y.texImage2D(t,r,s,f,p,o,g,d,c):y.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[C,x]of c.entries())y.compressedTexImage2D(t,C,x.format,x.width,x.height,o,x.data);break;default:Qe(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(Sz[this.dataFormat]||4)*(Mz[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:y={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),Qe(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const v=i;i=v.data,o=v.shape[0],a=v.shape[1]}i instanceof Si&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),nc(this.gl,y,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof xz){const v=To(this.gl);v.bindBuffer(35052,i),v.texSubImage2D(e,l,r,s,o,a,f,d,g),v.bindBuffer(35052,null)}else Mn(this.gl)?To(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return ct.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof Si?{data:e.handle,dataType:"buffer"}:e instanceof xz?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=ZO[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},Qe(r,"Could not deduced texture size"),Qe(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),Qe(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Qe(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Mn(this.gl)||!this.width||!this.height||bz(this.width)&&bz(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===_le.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function yle(n,e){return Qe("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class xa extends fm{static isSupported(e,t){return fm.isSupported(e,t)}constructor(e,t={}){cS(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:yle(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Yf="EXT_color_buffer_float",Tz={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:Yf,bpp:2},33327:{gl2:Yf,bpp:4},34842:{gl2:Yf,bpp:8},33326:{gl2:Yf,bpp:4},33328:{gl2:Yf,bpp:8},34836:{gl2:Yf,bpp:16},35898:{gl2:Yf,bpp:4}};class pm extends qu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Mn(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,Tz)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return Qe(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Mn(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Tz[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const Pz="clear: bad arguments";function JO(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),Qe(0!==o,Pz),nc(n,s,()=>{n.clear(o)})}function Rz(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function un(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){Rz(s,i,r,o,a,"next",l)}function a(l){Rz(s,i,r,o,a,"throw",l)}o(void 0)})}}const eI=[34069,34070,34071,34072,34073,34074];let Mle=(()=>{class n extends fm{constructor(t,i={}){cS(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return un(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(eI.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),eI.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&ct.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((y,v)=>{t&&i?d.texImage2D(g,v,a,t,i,o,a,l,y):d.texImage2D(g,v,a,a,l,y)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=eI,n})();class xle extends fm{static isSupported(e){return Mn(e)}constructor(e,t={}){To(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),nc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof Si&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(Sz[this.dataFormat]||4)*(Mz[this.type]||1),"Texture"),this.loaded=!0,this}}function Ale(n,e){const{gl:t,width:i,height:r,id:s}=n;return new is(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function uS(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof is?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Ale(n),deleteFramebuffer:!0}}(n);Qe(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),Qe(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(Kv(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Qe(!1),0}}(t))}(o,c,r,a,l),c=c||XO(o);const y=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,y||null),f&&d.delete(),o}function tI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=uS(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=ule({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return Qe(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&ct.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){Qe(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof pm)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(is.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&JO(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){To(n),nc(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:Qe(!1,Pz)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return ct.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return ct.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return ct.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return ct.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return ct.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return ct.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=To(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=rh(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?rh(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?rh(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(tI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>ct.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=tI(this,{targetMaxHeight:100});return ct.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new xa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new pm(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new pm(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&Qe(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof pm?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:To(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:Qe(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return Mn(n)?n:null}(this.gl);t?t.readBuffer(e):Qe(36064===e||1029===e,kz),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=To(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):Qe(1===e.length&&(36064===e[0]||1029===e[0]),kz)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in Fz)void 0===n.luma.caps[e]&&(n.luma.caps[e]=Lz(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}is.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const Fz={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new xa(n,{format:6408,type:5126,dataFormat:6408}),t=new is(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function nI(n,e){return Nz(n,e)}function Nz(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>Lz(n,t))}function Lz(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=Fz[e];let i;Qe(t,e);const r=Mn(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:Qe(!1);return i}(n,e)),n.luma.caps[e]||ct.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class iI{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},jle=(Math,1/180*Math.PI),Qi={};function zle(n,{precision:e=Qi.precision||4}={}){return n=function(n){return Math.round(n/Qi.EPSILON)*Qi.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function sh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Yu(n,e,t){if(sh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*jle,void 0)}(n)}function Xf(n,e,t){return Yu(n,i=>Math.max(e,Math.min(t,i)))}function dS(n,e,t){return sh(n)?n.map((i,r)=>dS(i,e[r],t)):t*e+(1-t)*n}function eb(n,e,t){const i=Qi.EPSILON;t&&(Qi.EPSILON=t);try{if(n===e)return!0;if(sh(n)&&sh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+zle(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(Yz.length=n.length,i=Yz):i=qz,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function Kz(n){return n&&n[Symbol.asyncIterator]}function lI(n,e=(()=>!0)){return Array.isArray(n)?Zz(n,e,[]):e(n)?[n]:[]}function Zz(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function Qz(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",J(J(J({},Mce[n.type]),e),n)):null}function Jz(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function e4(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function t4(n){n.push(n.shift())}function uI(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function n4({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=uI(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const w=s;s=(C,x)=>t._normalizeConstant(w(C,x))}const _=p?(w,C)=>s(g,C):(w,C)=>s(g.subarray(w,w+a),C),y=n.getData({length:i}),v=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return cI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===gS||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=gS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wce}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==gS}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const v=f*a+l;for(let w=0;wd?c.set(x,y):(e._normalizeValue(x,w.target,0),Cce({target:c,source:w.target,start:y,count:L}));y+=L*d}else e._normalizeValue(x,c,y),y+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let hI={};function eo(n){Zn.level>0&&hI[n]&&hI[n].call(...arguments)}function Ta(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const i4="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Ace=`#version 300 es\n${i4}`;function r4(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function s4(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Ace:e>300?`#version ${e}\n${i4}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Ta(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class o4 extends qu{static isSupported(e){return Mn(e)}constructor(e,t={}){To(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,dm(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,ct.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof Si?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Pce{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof Si?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Qe(Mn(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new o4(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],Qe(i[s]instanceof Si)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new Si(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function a4(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const ib="vs",Fce={[ib]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},mS="__LUMA_INJECT_DECLARATIONS__",l4=/void\s+main\s*\([^)]*\)\s*\{\n?/,c4=/}\n?[^{}]*$/,pI=[];function u4(n,e,t,i=!1){const r=e===ib;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),pI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(c4,l=>a+l));break;case"fs:#decl":r||(n=n.replace(mS,a));break;case"fs:#main-start":r||(n=n.replace(l4,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(c4,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(mS,""),i&&(n=n.replace(/\}\s*$/,s=>s+Fce[e])),n}function gI(n){const e={};return Ta(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const Nce={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},_S="transform_uSize_",d4="transform_position";const $ce={10241:9728,10240:9728,10242:33071,10243:33071};class Wce{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${_S}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${_S}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=uS(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Ta(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new Si(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new is(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters($ce)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){Qe(n instanceof xa||n instanceof Mle||n instanceof xle);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const y=function(n,e){const t={},i=function(n){return r4(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${_S}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Ta(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(y){const{updatedLine:v,inject:w}=y;f[g]=v,c=gI([c,w]),Object.assign(a,y.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=r4(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){Qe(i);const p=`${_S}${t}`;c=gI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${d4} = transform_getPos(${p});\n gl_Position = vec4(${d4}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=gI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||s4({version:a4(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Nce].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const mI={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function Yce(n){let e=h4(n);return"object"===e?n?"type"in n?Object.assign({},n,mI[n.type]):"value"in n?(e=h4(n.value),Object.assign({type:e},n,mI[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},mI[e])}function h4(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class _I{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Ta("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=Yce(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Ta(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Ta(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Qce(n){return function(n){const e={},t={};return yI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(p4(n))}function yI({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof _I||(Ta("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ta(t.name,"shader module has no name"),(t=new _I(t)).dependencies=p4(t.dependencies)),t))}const vI={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},Kf={};function oue(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(vI).forEach(n=>{Kf[n]=n});const bI={};function g4(n,e,t={}){const i=vI[e];if(Ta(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in bI)return bI[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),bI[e]=l,l}function yS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=vI[e];Ta(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Ta(!1===r||!0===r),r}(n,t))}function mm(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const m4=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],uue=[...m4,[mm("attribute"),"in $1"],[mm("varying"),"out $1"]],due=[...m4,[mm("varying"),"in $1"]],_4=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],hue=[..._4,[mm("in"),"attribute $1"],[mm("out"),"varying $1"]],fue=[..._4,[mm("in"),"varying $1"]],CI="gl_FragColor",wI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,pue=/void\s+main\s*\([^)]*\)\s*\{\n?/;function vS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const yue=`\n\n${mS}\n\n`,y4={[ib]:"vertex",fs:"fragment"};function v4(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Ta("string"==typeof t,"shader source must be a string");const f=i===ib,p=t.split("\n");let g=100,_="",y=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],y=p.slice(1).join("\n")):_=`#version ${g}`;const v={};r.forEach($=>{Object.assign(v,$.getDefines())}),Object.assign(v,s);let w=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${y4[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${y4[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:oue(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return yS(n,Kf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),yS(n,Kf.GLSL_DERIVATIVES)&&g4(n,Kf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),yS(n,Kf.GLSL_FRAG_DATA)&&g4(n,Kf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),yS(n,Kf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(v)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const C=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),x={},L={},U={};for(const $ in a){const ee="string"==typeof a[$]?{injection:a[$],order:0}:a[$],fe=$.match(/^(v|f)s:(#)?([\w-]+)$/);if(fe){const ve=fe[3];fe[2]?"decl"===ve?L[$]=[ee]:U[$]=[ee]:x[$]=[ee]}else U[$]=[ee]}for(const $ of r){d&&$.checkDeprecations(y,d),w+=$.getModuleSource(i,g);const fe=$.injections[i];for(const pe in fe){const ve=pe.match(/^(v|f)s:#([\w-]+)$/);if(ve){const Xe="decl"===ve[2]?L:U;Xe[pe]=Xe[pe]||[],Xe[pe].push(fe[pe])}else x[pe]=x[pe]||[],x[pe].push(fe[pe])}}return w+=yue,w=u4(w,i,L),w+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(C[i],x),w+=y,w=u4(w,i,U),w=function(n,e,t){switch(e){case 300:return t?vS(n,uue):function(n){const e=(n=vS(n,due)).match(wI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${CI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(pue,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${CI}\\b`,"g"),t)}return n}(n);case 100:return t?vS(n,hue):function(n){const e=(n=vS(n,fue)).match(wI);if(e){const t=e[1];n=n.replace(wI,"").replace(new RegExp(`\\b${t}\\b`,"g"),CI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(w,l?100:g,f),w}function Cue(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Tue={5126:Ji.bind(null,"uniform1fv",Aa,1,to),35664:Ji.bind(null,"uniform2fv",Aa,2,to),35665:Ji.bind(null,"uniform3fv",Aa,3,to),35666:Ji.bind(null,"uniform4fv",Aa,4,to),5124:Ji.bind(null,"uniform1iv",oh,1,to),35667:Ji.bind(null,"uniform2iv",oh,2,to),35668:Ji.bind(null,"uniform3iv",oh,3,to),35669:Ji.bind(null,"uniform4iv",oh,4,to),35670:Ji.bind(null,"uniform1iv",oh,1,to),35671:Ji.bind(null,"uniform2iv",oh,2,to),35672:Ji.bind(null,"uniform3iv",oh,3,to),35673:Ji.bind(null,"uniform4iv",oh,4,to),35674:Ji.bind(null,"uniformMatrix2fv",Aa,4,Ku),35675:Ji.bind(null,"uniformMatrix3fv",Aa,9,Ku),35676:Ji.bind(null,"uniformMatrix4fv",Aa,16,Ku),35678:Fs,35680:Fs,5125:Ji.bind(null,"uniform1uiv",bS,1,to),36294:Ji.bind(null,"uniform2uiv",bS,2,to),36295:Ji.bind(null,"uniform3uiv",bS,3,to),36296:Ji.bind(null,"uniform4uiv",bS,4,to),35685:Ji.bind(null,"uniformMatrix2x3fv",Aa,6,Ku),35686:Ji.bind(null,"uniformMatrix2x4fv",Aa,8,Ku),35687:Ji.bind(null,"uniformMatrix3x2fv",Aa,6,Ku),35688:Ji.bind(null,"uniformMatrix3x4fv",Aa,12,Ku),35689:Ji.bind(null,"uniformMatrix4x2fv",Aa,8,Ku),35690:Ji.bind(null,"uniformMatrix4x3fv",Aa,12,Ku),35678:Fs,35680:Fs,35679:Fs,35682:Fs,36289:Fs,36292:Fs,36293:Fs,36298:Fs,36299:Fs,36300:Fs,36303:Fs,36306:Fs,36307:Fs,36308:Fs,36311:Fs},Aue={},Due={},Oue={},b4=[0];function EI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(b4[0]=n,n=b4);const r=n.length;if(r%e&&ct.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Ji(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{Qe(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return S4(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:E4(s,c),warnings:E4(o,c)}}(i,this.source,this.shaderType,this.id);throw ct.error(`GLSL compilation errors in ${r}\n${s}`)(),ct.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class SI extends rb{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class MI extends rb{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const rs=5126,sb=5124,ob=5125,xI={[rs]:[rs,1,"float"],35664:[rs,2,"vec2"],35665:[rs,3,"vec3"],35666:[rs,4,"vec4"],[sb]:[sb,1,"int"],35667:[sb,2,"ivec2"],35668:[sb,3,"ivec3"],35669:[sb,4,"ivec4"],[ob]:[ob,1,"uint"],36294:[ob,2,"uvec2"],36295:[ob,3,"uvec3"],36296:[ob,4,"uvec4"],35670:[rs,1,"bool"],35671:[rs,2,"bvec2"],35672:[rs,3,"bvec3"],35673:[rs,4,"bvec4"],35674:[rs,8,"mat2"],35685:[rs,8,"mat2x3"],35686:[rs,8,"mat2x4"],35675:[rs,12,"mat3"],35687:[rs,12,"mat3x2"],35688:[rs,12,"mat3x4"],35676:[rs,16,"mat4"],35689:[rs,16,"mat4x2"],35690:[rs,16,"mat4x3"]};function O4(n){const e=xI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function I4(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=rs}for(const t in xI){const[i,r,s]=xI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class pde{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!Mn(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=O4(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ea(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=O4(i),l={location:e,name:t,accessor:new ea({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const gde=35981,mde=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class R4 extends qu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",mde),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=gde}=e;return this.hash=t||"",this.vs="string"==typeof i?new SI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new MI(this.gl,{id:`${e.id}-fs`,source:r}):r,Qe(this.vs instanceof SI),Qe(this.fs instanceof MI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(To(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new pde(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:y,samplers:v}){if((y||v)&&(ct.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(y||{})),ct.priority>=e){const w=g?g.id:"default",C=`mode=${rh(this.gl,t)} verts=${i} instances=${c} indexType=${rh(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${w}`;ct.log(e,C)()}return Qe(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const w=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Qe(!1),0}}(t);p.begin(w)}this._bindTextures(),nc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Mn(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){ct.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Rue(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof is&&(s=s.texture),s instanceof fm)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&kue(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new SI({handle:r});break;case 35632:i.fs=new MI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=Wc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),ct.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),ct.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||ct.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(x=>this._getHash(x.name)).sort(),g=o.map(x=>this._getHash(x)),_=Object.keys(r).sort(),y=Object.keys(s).sort(),v=[],w=[];for(const x of _)v.push(this._getHash(x)),v.push(this._getHash(r[x]));for(const x of y)w.push(this._getHash(x)),w.push(this._getHash(s[x]));const C=`${d}/${f}D${v.join("/")}M${p.join("/")}I${w.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[C]){const x=function(n,e){const{vs:t,fs:i}=e,r=Qce(e.modules||[]);return{gl:n,vs:v4(n,Object.assign({},e,{source:t,type:ib,modules:r})),fs:v4(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Cue(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[C]=new R4(this.gl,{hash:C,vs:x.vs,fs:x.fs,varyings:o,bufferMode:a}),this._getUniforms[C]=x.getUniforms||(L=>{}),this._useCounts[C]=0}return this._useCounts[C]++,this._programCache[C]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":Gv.chrome?"Chrome":Gv.safari?"Safari":Gv.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Da(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Da.MAX_ATTRIBUTES=Da.MAX_ATTRIBUTES||e.getParameter(34921),Da.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Da._setConstantFloatArray(e,t,i);break;case Int32Array:Da._setConstantIntArray(e,t,i);break;case Uint32Array:Da._setConstantUintArray(e,t,i);break;default:Qe(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Da.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return Qe(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(Qe(Mn(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Da.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new Si(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!ES||ES.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Ede=/^(.+)__LOCATION_([0-9]+)$/,Sde=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Mde{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Da(e),Cz(this,"VertexArray","v6.0",Sde),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new Si(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,ct.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ea.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return Qe(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Ede.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof Si)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof Si)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof Si))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof Si){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return ct.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function lb(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=lb(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function k4(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof Si){const p=e,{data:g,changed:_}=p.getDebugData();let y;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?y=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${rh(r,s)})`:(c=!0,y=`${l} bytes`),{[i]:`${d}${lb(f,{size:o,isInteger:c})}`,"Format ":y}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${lb(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Ade(n,e){const{type:t,size:i}=e,r=I4(t,i);return r?`${n} (${r.name})`:n}function F4({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){Qe(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:lb(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function TI({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?lb(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function N4(n){const{type:e,size:t}=n.accessor,i=I4(e,t);return i?`${i.name} ${n.name}`:n.name}const Ide={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rde(n,e){const{attributeMap:t=Ide}=e||{};return t&&t[n]||n}function kde(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Qe(Number.isFinite(e.size),`attribute ${n} needs size`)}const L4=()=>{},Lde={};class SS{constructor(e,t={}){const{id:i=Wc("model")}=t;Qe(lS(e)),this.id=i,this.gl=e,this.id=t.id||Wc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||ab.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},Qe(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return Qe(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return Qe(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Rde(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=J({},o);delete c.value,i[a]=[new Si(n,l),c],kde(s,c)}}if(r){const s=r.value||r;Qe(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new Si(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(dm(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return JO(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),ct.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&ct.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:y,instanceCount:v}=this,{onBeforeRender:w=L4,onAfterRender:C=L4}=this.props;w(),this.program.setUniforms(this.uniforms);const x=this.program.draw(Object.assign(Lde,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:y,instanceCount:v,offset:f?g:0}));return C(),ct.priority>=2&&this._logDrawCallEnd(c,l,i),x}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return ct.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Qe(t instanceof R4,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new Mde(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof Si&&t.delete()}}_setAnimationProps(e){this.animated&&Qe(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(dm(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new o4(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:ct.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=k4(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Ade(s.name,a)}`),t[o]=k4(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=F4({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=F4({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&ct.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&ct.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${N4(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${N4(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);ct.table(e,s)(),ct.table(e,o)(),ct.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),ct.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class AI{static isSupported(e){return Mn(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();Qe(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new SS(t,Object.assign({},e,{fs:e.fs||s4({version:a4(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(dm(n.feedbackBuffers)&&dm(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Pce(e,t)),function(n){return!(dm(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new Wce(e,t)),Qe(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function MS(){}const jde={onStart:MS,onUpdate:MS,onInterrupt:MS,onEnd:MS};class cb{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=J(J({},jde),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const Yde={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new cb(i),this.attribute=t,this.attributeInTransition=new dI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=e4(e.size);return new AI(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new Si(e,r),new Si(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;t4(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)n4(J({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=uI(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:Jz(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new cb(i),this.attribute=t,this.attributeInTransition=new dI(e,an(J({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new xa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new is(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=e4(e.size);return new AI(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new Si(e,r),new Si(e,r),new Si(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)n4(J({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=uI(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:Jz(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),t4(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),uS(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class Xde{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=AI.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Zn.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=Yde[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Zn.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const B4="attributeManager.invalidate";class the{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new Xde(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;eo("attribute.updateStart",t),t.allocate(i)&&eo("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,eo("attribute.updateEnd",t,i))}}function j4(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function U4(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=Qz(r)))return;const o=she[r.type];if(!o)return void Zn.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(an(J({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const xS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:ahe}=xS;function uhe(n,e){if(!n.transitions)return null;const t={},i=OI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&DI(n[r],e[r],s)&&(t[r]=!0)}return t}function z4({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=DI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=DI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function DI(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function fhe(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!vhe(i[r],e[r])){t=n(i),e=i;break}return t}}function bhe(n,e){if(!e)return n;const t=J(J({},n),e);if("defines"in e&&(t.defines=J(J({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=J({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function AS(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],y=e[13],v=e[14],w=e[15],C=t*a-i*o,x=t*l-r*o,L=t*c-s*o,U=i*l-r*a,$=i*c-s*a,ee=r*c-s*l,fe=d*y-f*_,pe=d*v-p*_,ve=d*w-g*_,$e=f*v-p*y,Xe=f*w-g*y,re=p*w-g*v,le=C*re-x*Xe+L*$e+U*ve-$*pe+ee*fe;return le?(n[0]=(a*re-l*Xe+c*$e)*(le=1/le),n[1]=(r*Xe-i*re-s*$e)*le,n[2]=(y*ee-v*$+w*U)*le,n[3]=(p*$-f*ee-g*U)*le,n[4]=(l*ve-o*re-c*pe)*le,n[5]=(t*re-r*ve+s*pe)*le,n[6]=(v*L-_*ee-w*x)*le,n[7]=(d*ee-p*L+g*x)*le,n[8]=(o*Xe-a*ve+c*fe)*le,n[9]=(i*ve-t*Xe-s*fe)*le,n[10]=(_*$-y*L+w*C)*le,n[11]=(f*L-d*$-g*C)*le,n[12]=(a*pe-o*$e-l*fe)*le,n[13]=(t*$e-i*pe+r*fe)*le,n[14]=(y*x-_*U-v*C)*le,n[15]=(d*U-f*x+p*C)*le,n):null}function qc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],y=e[12],v=e[13],w=e[14],C=e[15],x=t[0],L=t[1],U=t[2],$=t[3];return n[0]=x*i+L*a+U*f+$*y,n[1]=x*r+L*l+U*p+$*v,n[2]=x*s+L*c+U*g+$*w,n[3]=x*o+L*d+U*_+$*C,n[4]=(x=t[4])*i+(L=t[5])*a+(U=t[6])*f+($=t[7])*y,n[5]=x*r+L*l+U*p+$*v,n[6]=x*s+L*c+U*g+$*w,n[7]=x*o+L*d+U*_+$*C,n[8]=(x=t[8])*i+(L=t[9])*a+(U=t[10])*f+($=t[11])*y,n[9]=x*r+L*l+U*p+$*v,n[10]=x*s+L*c+U*g+$*w,n[11]=x*o+L*d+U*_+$*C,n[12]=(x=t[12])*i+(L=t[13])*a+(U=t[14])*f+($=t[15])*y,n[13]=x*r+L*l+U*p+$*v,n[14]=x*s+L*c+U*g+$*w,n[15]=x*o+L*d+U*_+$*C,n}function ub(n,e,t){var o,a,l,c,d,f,p,g,_,y,v,w,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],y=e[9],v=e[10],w=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=y,n[10]=v,n[11]=w,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+y*s+e[13],n[14]=l*i+p*r+v*s+e[14],n[15]=c*i+g*r+w*s+e[15]),n}function db(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function $4(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function G4(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function W4(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function q4(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],y=n[13],v=n[14],w=n[15],C=e[0],x=e[1],L=e[2],U=e[3],$=e[4],ee=e[5],fe=e[6],pe=e[7],ve=e[8],$e=e[9],Xe=e[10],re=e[11],le=e[12],Oe=e[13],Q=e[14],Ue=e[15];return Math.abs(t-C)<=Vi*Math.max(1,Math.abs(t),Math.abs(C))&&Math.abs(i-x)<=Vi*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(r-L)<=Vi*Math.max(1,Math.abs(r),Math.abs(L))&&Math.abs(s-U)<=Vi*Math.max(1,Math.abs(s),Math.abs(U))&&Math.abs(o-$)<=Vi*Math.max(1,Math.abs(o),Math.abs($))&&Math.abs(a-ee)<=Vi*Math.max(1,Math.abs(a),Math.abs(ee))&&Math.abs(l-fe)<=Vi*Math.max(1,Math.abs(l),Math.abs(fe))&&Math.abs(c-pe)<=Vi*Math.max(1,Math.abs(c),Math.abs(pe))&&Math.abs(d-ve)<=Vi*Math.max(1,Math.abs(d),Math.abs(ve))&&Math.abs(f-$e)<=Vi*Math.max(1,Math.abs(f),Math.abs($e))&&Math.abs(p-Xe)<=Vi*Math.max(1,Math.abs(p),Math.abs(Xe))&&Math.abs(g-re)<=Vi*Math.max(1,Math.abs(g),Math.abs(re))&&Math.abs(_-le)<=Vi*Math.max(1,Math.abs(_),Math.abs(le))&&Math.abs(y-Oe)<=Vi*Math.max(1,Math.abs(y),Math.abs(Oe))&&Math.abs(v-Q)<=Vi*Math.max(1,Math.abs(v),Math.abs(Q))&&Math.abs(w-Ue)<=Vi*Math.max(1,Math.abs(w),Math.abs(Ue))}function Y4(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function DS(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new ta(4);ta!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const X4=[0,0,0,0],Whe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],qhe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Yhe=[0,0,0],Xhe=[0,0,0],Khe=TS(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=X4,l=X4,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=K4(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=DS([],l,o),s=i||s,o=qc([],r,s),o=qc([],o,Whe)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:Yhe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Hn.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Hn.LNGLAT:case Hn.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Hn.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function K4(n,e,t=Xhe){let r,i=t,s=!0;switch(r=e===Hn.LNGLAT_OFFSETS||e===Hn.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case $c.WEB_MERCATOR:(e===Hn.LNGLAT||e===Hn.CARTESIAN)&&(s=!1);break;case $c.WEB_MERCATOR_AUTO_OFFSET:e===Hn.LNGLAT?i=r:e===Hn.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case $c.IDENTITY:i=n.position.map(Math.fround);break;case $c.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class efe extends rI{get ELEMENTS(){return Xu(!1),0}get RANK(){return Xu(!1),0}toString(){let e="[";if(Qi.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new Lt).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return W4(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],y=n[14],v=n[15];return(e*o-t*s)*(f*v-p*y)-(e*a-i*s)*(d*v-p*_)+(e*l-r*s)*(d*y-f*_)+(t*a-i*o)*(c*v-p*g)-(t*l-r*o)*(c*y-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return AS(this,this),this.check()}multiplyLeft(e){return qc(this,e,this),this.check()}multiplyRight(e){return qc(this,this,e),this.check()}rotateX(e){return $4(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return G4(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,y,v,w,C,x,L,U,$,ee,fe,pe,ve,$e,Xe,re,le,Oe,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*sc+rc)/(2*rc),512*(rc+Math.log(Math.tan(e5+e*sc*.5)))/(2*rc)]}function ah([n,e]){const t=n/512*(2*rc)-rc,i=2*(Math.atan(Math.exp(e/512*(2*rc)-rc))-e5);return[t*RI,i*RI]}function IS({latitude:n,longitude:e,highPrecision:t=!1}){Zu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*sc),o=512/360,a=o/s,l=512/kI/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=sc*Math.tan(n*sc)/s,f=512/kI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function n5(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=IS({longitude:t,latitude:i,highPrecision:!0}),d=Sm(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=ah(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function i5({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return ub(o,o,[0,0,-i]),$4(o,o,-e*sc),G4(o,o,t*sc),db(o,o,[r/=n,r,r]),s&&ub(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function r5({width:n,height:e,fovy:t=PS(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=PS(i));const a=.5*t*sc,l=s5(t),c=r*sc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function PS(n){return 2*Math.atan(.5/n)*RI}function s5(n){return.5/Math.tan(.5*n*sc)}function FI(n,e){const[t,i,r=0]=n;return Zu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Em(e,[t,i,r,1])}function Zf(n,e,t=0){const[i,r,s]=n;if(Zu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Em(e,[i,r,s,1]);const o=Em(e,[i,r,0,1]),a=Em(e,[i,r,1,1]),l=o[2],c=a[2];return Z4([],o,a,l===c?0:((t||0)-l)/(c-l))}function o5({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Zu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new RS({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],y=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Zu(y[0]>0&&y[1]>0);const v=y[0]/_[0],w=y[1]/_[1],U=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/v,(g[1]+p[1])/2+(s.bottom-s.top)/2/w]),$=Math.min(r,f.zoom+PI(Math.abs(Math.min(v,w))));return Zu(Number.isFinite($)),{longitude:U[0],latitude:U[1],zoom:$}}const a5=Math.PI/180;function l5(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*a5:Math.atan(.5/n.altitude))>(90-n.pitch)*a5-.01?(l=c5(n,0,e),c=c5(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function c5(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Em(i,[e,0,1,1]),s=Em(i,[e,n.height,1,1]),c=ah(Z4([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class RS{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=PS(l=1.5):null===c?c=PS(l):null===l&&(l=s5(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=IS({longitude:r,latitude:i}),y=Sm([r,i]);y[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(y,y,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=r5({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return W4([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=i5({height:t,scale:g,center:y,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=y,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];qc(s,s,i),qc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];db(o,o,[e/2,-t/2,1]),ub(o,o,[1,-1,0]),qc(o,o,s);const a=AS([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof RS&&e.width===this.width&&e.height===this.height&&q4(e.projectionMatrix,this.projectionMatrix)&&q4(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=FI(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=Zf([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Sm(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=ah(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Sm(e)}unprojectFlat(e){return ah(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=Zf(t,this.pixelUnprojectionMatrix),s=Cm([],Sm(e),II([],i));return ah(Cm([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=o5(Object.assign({width:i,height:r,bounds:e},t));return new RS({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return l5(this,e.z||0)}}const hfe=Math.PI/180,ffe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],NI=[0,0,0],gfe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Mm=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?$c.WEB_MERCATOR:$c.WEB_MERCATOR_AUTO_OFFSET:$c.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&eb(t.projectionMatrix,this.projectionMatrix)&&eb(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=FI(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=Zf([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Sm(t):t}unprojectFlat(t){return this.isGeospatial?ah(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?IS({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends Mm{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:y=1.5}=t;const v=Math.pow(2,s);g=g||1,_=_||1,y=Math.max(.75,y);const{fov:w,aspect:C,focalDistance:x,near:L,far:U}=r5({width:g,height:_,pitch:o,altitude:y,nearZMultiplier:l,farZMultiplier:c});let $=i5({height:_,pitch:o,bearing:a,scale:v,altitude:y});p&&($=(new Lt).translate([512*p,0,0]).multiplyLeft($)),super(an(J({},t),{width:g,height:_,viewMatrix:$,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:w,aspect:C,focalDistance:x,near:L,far:U})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=y,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(an(J({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return n5(t,i)}panByPosition(t,i){const r=Zf(i,this.pixelUnprojectionMatrix),o=Cm([],this.projectFlat(t),II([],r)),a=Cm([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=l5(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=o5(J({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function LI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof p5){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function g5(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=DS([],[o,a,l,1],t)),i){case Hn.LNGLAT:return LI([o,a,l],e,s);case Hn.LNGLAT_OFFSETS:return LI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Hn.METER_OFFSETS:return LI(n5(r,[o,a,l]),e,s);case Hn.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const yfe={10241:9987,10240:9729,10242:33071,10243:33071},BI={},Cfe={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||pb(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>VI(n,e)},accessor:{validate(n,e){const t=kS(n);return"function"===t||t===kS(e.value)},equal:(n,e,t)=>"function"==typeof e||VI(n,e)},array:{validate:(n,e)=>e.optional&&!n||pb(n),equal:(n,e,t)=>t.compare?VI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof xa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new xa(t,an(J({},e),{parameters:J(J(J({},yfe),i),n.props.textureParameters)}));return BI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof xa)||BI[n.id]&&(n.delete(),delete BI[n.id])}(n)}}};function VI(n,e){if(n===e)return!0;if(!pb(n)||!pb(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=kfe,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Pfe]||{},i=e[Ife]||e,r=e[Rfe]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(Kz(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return un(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=UI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const v=_,{dataTransform:w}=i.component?i.component.props:{};a=w?w(v,a):a.concat(v),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(v){d=!0,f=v}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const y=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;y&&y(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:v5,ASYNC_RESOLVED:b5,ASYNC_DEFAULTS:Ffe}=xS,Nfe={};let Lfe=0,Bfe=(()=>{class n{constructor(){this.props=Sfe.apply(this,arguments),this.id=this.props.id,this.count=Lfe++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[Ffe])s in i[b5]?r[s]=i[b5][s]:s in i[v5]&&(r[s]=i[v5][s]);return new this.constructor(J(J(J({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new y5({})}}return n.componentName="Component",n.defaultProps=Nfe,n})();class Vfe extends y5{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const oc=n=>"function"==typeof n,lh=n=>null!==n&&"object"==typeof n,w5=n=>lh(n)&&n.constructor==={}.constructor,jfe=n=>n&&"function"==typeof n[Symbol.iterator],Ufe=n=>n&&"function"==typeof n[Symbol.asyncIterator],mb=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,xm=n=>"undefined"!=typeof Blob&&n instanceof Blob,E5=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||lh(n)&&oc(n.tee)&&oc(n.cancel)&&oc(n.getReader))(n)||(n=>lh(n)&&oc(n.read)&&oc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Qf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function zI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function HI(n){var e,t;let i;return Qf(n,"null loader"),Qf(zI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=an(J({},n=n[0]),{options:J(J({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Yc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},$I=Yc.global||Yc.self||Yc.window||{},qfe="object"!=typeof process||"[object process]"!==String(process)||process.browser,S5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);S5&&parseFloat(S5[1]);const WI={};function Yfe(n){for(const e in WI)n.startsWith(e)&&(n=n.replace(e,WI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const Xfe=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Kfe=/^([-\w.]+\/[-\w.+]+)/;function Zfe(n){const e=Kfe.exec(n);return e?e[1]:n}function M5(n){const e=Xfe.exec(n);return e?e[1]:""}const Qfe=/\?.*/;function BS(n){if(mb(n)){const e=qI(n.url||"");return{url:e,type:Zfe(n.headers.get("content-type")||"")||M5(e)}}return xm(n)?{url:qI(n.name||""),type:n.type||""}:"string"==typeof n?{url:qI(n),type:M5(n)}:{url:"",type:""}}function Jfe(n){return mb(n)?n.headers["content-length"]||-1:xm(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function qI(n){return n.replace(Qfe,"")}function x5(n){return YI.apply(this,arguments)}function YI(){return(YI=un(function*(n){if(mb(n))return n;const e={},t=Jfe(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=BS(n);r&&(e["content-type"]=r);const s=yield npe(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function epe(n){return XI.apply(this,arguments)}function XI(){return(XI=un(function*(n){if(!n.ok){const e=yield tpe(n);throw new Error(e)}})).apply(this,arguments)}function tpe(n){return KI.apply(this,arguments)}function KI(){return(KI=un(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function npe(n){return ZI.apply(this,arguments)}function ZI(){return(ZI=un(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${ipe(n.slice(0,5))}`:null})).apply(this,arguments)}function ipe(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const D5={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Yt(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},ope={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function JI(){$I.loaders=$I.loaders||{};const{loaders:n}=$I;return n._state=n._state||{},n._state}const eP=()=>{const n=JI();return n.globalOptions=n.globalOptions||J({},D5),n.globalOptions};function ape(n,e,t,i){return t=t||[],function(n,e){I5(n,null,D5,ope,e);for(const t of e)I5(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=J({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new rpe),R5(r,eP()),R5(r,e),r}(e,n,i)}function O5(n,e){const t=eP(),i=n||t;return"function"==typeof i.fetch?i.fetch:lh(i.fetch)?r=>T5(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:T5}function I5(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&lh(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)A5.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=cpe(a,r);A5.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function cpe(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function R5(n,e){for(const t in e)t in e&&(n[t]=w5(e[t])&&w5(n[t])?J(J({},n[t]),e[t]):e[t])}function Xc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function hpe(n,e="3.0.12"){return Xc(n,"no worker provided"),!(!e||!n.version)}const Kc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},fpe=Kc.global||Kc.self||Kc.window||{},tP="object"!=typeof process||"[object process]"!==String(process)||process.browser,nP="function"==typeof importScripts,ppe="undefined"!=typeof window&&void 0!==window.orientation,k5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),iP=(k5&&parseFloat(k5[1]),new Map);function F5(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function N5(n,e=!0,t){const i=t||new Set;if(n)if(L5(n))i.add(n);else if(L5(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)N5(n[r],e,i);return void 0===t?Array.from(i):[]}function L5(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const rP=()=>{};class B5{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Yt(this,"name",void 0),Yt(this,"source",void 0),Yt(this,"url",void 0),Yt(this,"terminated",!1),Yt(this,"worker",void 0),Yt(this,"onMessage",void 0),Yt(this,"onError",void 0),Yt(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Xc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=rP,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=rP,this.onError=rP,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||N5(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){Xc(n.source&&!n.url||!n.source&&n.url);let e=iP.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?F5(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),iP.set(n.url,e)),n.source&&(e=F5(n.source),iP.set(n.source,e))),Xc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class ype{constructor(e,t){Yt(this,"name",void 0),Yt(this,"workerThread",void 0),Yt(this,"isRunning",void 0),Yt(this,"result",void 0),Yt(this,"_resolve",void 0),Yt(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Xc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Xc(this.isRunning),this.isRunning=!1,this._reject(e)}}class vpe{constructor(e){Yt(this,"name","unnamed"),Yt(this,"source",void 0),Yt(this,"url",void 0),Yt(this,"maxConcurrency",1),Yt(this,"maxMobileConcurrency",1),Yt(this,"onDebug",()=>{}),Yt(this,"reuseWorkers",!0),Yt(this,"props",{}),Yt(this,"jobQueue",[]),Yt(this,"idleQueue",[]),Yt(this,"count",0),Yt(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=J(J({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return un(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return un(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new ype(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class Qu{static isSupported(){return B5.isSupported()}static getWorkerFarm(e={}){return Qu._workerFarm=Qu._workerFarm||new Qu({}),Qu._workerFarm.setProps(e),Qu._workerFarm}constructor(e){Yt(this,"props",void 0),Yt(this,"workerPools",new Map),this.props=J({},bpe),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=J(J({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new vpe({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function wpe(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return Xc(r),r}function Epe(n,e){return!!Qu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Spe(n,e,t,i,r){return sP.apply(this,arguments)}function sP(){return(sP=un(function*(n,e,t,i,r){const s=n.id,o=wpe(n,t),l=Qu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Mpe.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Mpe(n,e,t,i){return oP.apply(this,arguments)}function oP(){return(oP=un(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}Yt(Qu,"_workerFarm",void 0);var j5=Ve(521);function U5(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return j5.toArrayBuffer?j5.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Dpe(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function z5(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Ope(n){return lP.apply(this,arguments)}function lP(){return(lP=un(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=UI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Dpe(...e)})).apply(this,arguments)}const Rpe=262144;function H5(n){this.wrapped=n}function _b(n){return new H5(n)}function yb(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof H5;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function uP(n){return function(){return new yb(n.apply(this,arguments))}}function dP(){return(dP=uP(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(pP)}function Upe(n,e,t){return gP.apply(this,arguments)}function gP(){return(gP=un(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return jpe(n,e);if(xm(n)&&(n=yield x5(n)),mb(n)){const r=n;return yield epe(r),e.binary?yield r.arrayBuffer():yield r.text()}if(E5(n)&&(n=Vpe(n,t)),jfe(n)||Ufe(n))return Ope(n);throw new Error(pP)})).apply(this,arguments)}function Hpe(n,e,t=null){if(t)return t;const i=J({fetch:O5(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function $pe(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const G5=()=>{const n=JI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function W5(n){const e=G5();n=Array.isArray(n)?n:[n];for(const t of n){const i=HI(t);e.find(r=>i===r)||e.unshift(i)}}const Wpe=/\.([^.]+)$/;function qpe(n){return yP.apply(this,arguments)}function yP(){return(yP=un(function*(n,e=[],t,i){if(!Y5(n))return null;let r=q5(n,e,an(J({},t),{nothrow:!0}),i);if(r)return r;if(xm(n)&&(r=q5(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(X5(n));return r})).apply(this,arguments)}function q5(n,e=[],t,i){if(!Y5(n))return null;if(e&&!Array.isArray(e))return HI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...G5()),function(n){for(const e of n)HI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=BS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=vP(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&Wpe.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||vP(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Jpe(e,t))return t}else if(ArrayBuffer.isView(e)){if(K5(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&K5(e,0,t))return t;return null}(e,n),a=a||vP(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(X5(n));return s}function Y5(n){return!(n instanceof Response&&204===n.status)}function X5(n){const{url:e,type:t}=BS(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?bP(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?bP(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function vP(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Jpe(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function K5(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Zc=new Uint8ClampedArray(0);const uge={data:{type:"data",value:lge,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=an(J({},r),{fetch:an(J({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:jS(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):jS(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Hn.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let SP=(()=>{class n extends Bfe{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=g5(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=FI(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=J({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Hn.DEFAULT&&(t=i.isGeospatial?Hn.LNGLAT:Hn.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=K4(t,i,r),f=g5(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Hn.DEFAULT||t===Hn.LNGLAT||t===Hn.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){ic(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=bhe(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!cge({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Zc.length/3);if(this.internalState.usesPickingColorCache=!0,rZ5&&Zn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Zc=Qv.allocate(Zc,i,{size:3,copy:!0,maxCount:Math.max(i,Z5)});const s=Math.floor(Zc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&eo("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=z4({newProps:n,oldProps:e,propTypes:OI(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&H4(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&H4(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:fhe(n,e),transitionsChanged:uhe(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=OI(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new the(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){ic(!this.internalState&&!this.state),ic(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Vfe({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Zn.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ohe(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){eo("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=uge,n})(),hge=(()=>{class n extends SP{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:w,_subLayerProps:C}=this.props,x={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:w},L=C&&C[t.id],U=L&&L.updateTriggers,$=t.id||"sublayer";if(L){const ee=this.constructor._propTypes,fe=t.type?t.type._propTypes:{};for(const pe in L){const ve=fe[pe]||ee[pe];ve&&"accessor"===ve.type&&(L[pe]=this.getSubLayerAccessor(L[pe]))}}Object.assign(x,t,L),x.id="".concat(this.props.id,"-").concat($),x.updateTriggers=J(J({all:this.props.updateTriggers.all},t.updateTriggers),U);for(const ee of v){const fe=ee.getSubLayerProps.call(this,ee);fe&&Object.assign(x,fe,{updateTriggers:Object.assign(x.updateTriggers,fe.updateTriggers)})}return x}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=lI(t,Boolean),this.internalState.subLayers=t),eo("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const fge=/([0-9]+\.?[0-9]*)(%|px)/;function US(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(fge);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function zS(n,e){return n.relative?Math.round(n.position*e):n.position}function vb(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&vb(i,r)))return!1}return!0}class MP{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=Mm}=e;ic(!p||p instanceof Mm),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=an(J({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):vb(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=J({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:zS(this._x,e),y:zS(this._y,t),width:zS(this._width,e),height:zS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),J(J({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(J(J(J({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=US(e),this._y=US(t),this._width=US(i),this._height=US(r)}}const bb=()=>{},Q5={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:bb,onTransitionInterrupt:bb,onTransitionEnd:bb};class pge{constructor(e,t={}){this.ControllerState=e,this.props=J(J({},Q5),t),this.propsInTransition=null,this.transition=new cb(t.timeline),this.onViewStateChange=t.onViewStateChange||bb,this.onStateChange=t.onStateChange||bb,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=J(J({},Q5),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=J(J({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(J(J({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const J5=["longitude","latitude","zoom","bearing","pitch"],mge=["longitude","latitude","zoom"];class eH extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!eb(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];ic(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:J5,extract:J5,required:mge}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=dS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(J(J({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,dS(e.around,t.around,i)))}return r}}const ch={transitionDuration:0},_ge={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},$S=n=>1-(1-n)*(1-n),Tm_WHEEL=["wheel"],Tm_PAN=["panstart","panmove","panend"],Tm_PINCH=["pinchstart","pinchmove","pinchend"],Tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Tm_DOUBLE_TAP=["doubletap"],Tm_KEYBOARD=["keydown"];class xP{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new pge(e,an(J({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&an(J({},_ge),{transitionInterpolator:new eH({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(J(J({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Tm_WHEEL,d&&i),this.toggleEvents(Tm_PAN,d&&(r||s)),this.toggleEvents(Tm_PINCH,d&&(a||l)),this.toggleEvents(Tm_TRIPLE_PAN,d&&l),this.toggleEvents(Tm_DOUBLE_TAP,d&&o),this.toggleEvents(Tm_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=J(J({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,ch,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,an(J({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,ch,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,ch,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,ch,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,an(J({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?an(J({},t),{transitionInterpolator:new eH(an(J({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:ch}}class tH{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const uh_target=[0,0,0];class GS extends tH{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=uh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:w}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:w},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=J({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(an(J({},this._viewportProps),{zoom:a}));return this._getUpdatedState(J({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),Xf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new GS(J(J(J({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Xf(r,i,t),e.rotationX=Xf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class vge extends xP{constructor(e){super(GS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class bge extends xP{constructor(e){e.dragMode=e.dragMode||"pan",super(GS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Cge=(new Lt).lookAt({eye:[0,0,1]});function wge({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new Lt).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Ege extends Mm{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(an(J({},e),{longitude:null,position:a,viewMatrix:Cge.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:wge({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Cm([],e,II([],Zf(t,this.pixelUnprojectionMatrix)));return{target:Cm([],this.center,r)}}}let Sge=(()=>{class n extends MP{constructor(t){super(an(J({},t),{type:Ege}))}get controller(){return this._getControllerProps({type:bge})}}return n.displayName="OrthographicView",n})();const WS=Math.PI/180;function Mge({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*WS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new Lt).lookAt({eye:l,up:a});c.rotateX(i*WS),"Z"===t?c.rotateZ(r*WS):c.rotateY(r*WS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class xge extends Mm{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(an(J({},e),{longitude:null,viewMatrix:Mge({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=Zf([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let Tge=(()=>{class n extends MP{constructor(t={}){const{orbitAxis:i="Z"}=t;super(an(J({},t),{orbitAxis:i,type:xge}))}get controller(){return this._getControllerProps({type:vge})}}return n.displayName="OrbitView",n})();const Age=[255,255,255],Dge=1;let Oge=0;class nH{constructor(e={}){const{color:t=Age}=e,{intensity:i=Dge}=e;this.id=e.id||"ambient-".concat(Oge++),this.color=t,this.intensity=i,this.type="ambient"}}const Ige=[255,255,255],Pge=1,Rge=[0,0,-1];let kge=0;class iH{constructor(e={}){const{color:t=Ige}=e,{intensity:i=Pge}=e,{direction:r=Rge}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(kge++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Js(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class rH{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=J({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class TP extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=J({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Wu(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Wu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=sH(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dJO(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Wu(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||sH(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class Bge extends TP{constructor(e,t){super(e,t),this.shadowMap=new xa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new pm(e,{format:33189,width:1,height:1}),this.fbo=new is(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;nc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=um(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(an(J({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const jge=Object.keys(Hn).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Hn[n],";")).join(""),Uge=Object.keys($c).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat($c[n],";")).join(""),zge="".concat(jge,"\n").concat(Uge,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),Hge={},AP={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:zge,getUniforms:function(n=Hge){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Hn.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Hn.DEFAULT&&(i=n.isGeospatial?Hn.LNGLAT:Hn.CARTESIAN);const o=Khe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||qhe,o}(n):{}}},qge=TS(function({viewport:n,center:e}){return new Lt(n.viewProjectionMatrix).invert().transform(e)}),Yge=TS(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=Zf([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new Js(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new Lt).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),Xge=[0,0,0,1],Kge=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],DP={name:"shadow",dependencies:[AP],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||Xge,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=qge({viewport:n.viewport,center:e.project_uCenter}),r=[],s=Yge({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},tme={color:[255,255,255],intensity:1},oH=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],nme=[0,0,0,200/255];class OP extends rH{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=nme,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=ab.getDefaultProgramManager(e),DP&&this.programManager.addDefaultModule(DP)),this.dummyShadowMap||(this.dummyShadowMap=new xa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(DP),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new Lt).lookAt({eye:new Js(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=rme++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class sme{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=jS(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class ome{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new sme(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const ame=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},AP],lme=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function cme(n){const e=ab.getDefaultProgramManager(n);for(const t of ame)e.addDefaultModule(t);for(const t of lme)e.addShaderHook(t);return e}const hme=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class fme{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new ome({gl:e,protocol:"deck://"}),this.context=an(J({},hme),{layerManager:this,gl:e,deck:t,programManager:e&&cme(e),stats:i||new WO({id:"deck.gl"}),viewport:r||new Mm({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new aH,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){eo("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=lI(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return eo("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Zn.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Zn.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class pme{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=lI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!vb(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Zn.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(J({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=an(J(J(J({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class mme extends tH{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:w,startPitch:C,startZoom:x,normalize:L}={}){ic(Number.isFinite(s)),ic(Number.isFinite(r)),ic(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:L}),this._state={startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:w,startPitch:C,startZoom:x},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(an(J({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(an(J({},this._viewportProps),{zoom:o}));return this._getUpdatedState(J({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=J({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(J(J(J({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Xf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Xf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=J4(t+180,360)-180),(o<-180||o>180)&&(o=J4(o+180,360)-180);const a=PI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=ah([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Xf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Xf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class _me extends xP{constructor(e){e.dragMode=e.dragMode||"pan",super(mme,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(J(J({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let yme=(()=>{class n extends MP{constructor(t){super(an(J({},t),{type:p5}))}get controller(){return this._getControllerProps({type:_me})}}return n.displayName="MapView",n})();const vme=new OP;class bme{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!vb(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof OP)||this._internalEffects.push(vme)}}class Cme extends TP{}const cH={blendFunc:[1,0,32771,0],blendEquation:32774};class uH extends TP{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,nc(_,an(J({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},cH),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:an(J({},cH),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return J(J({},e.props.parameters),i)}}class Eme{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Cme(e),this.pickLayersPass=new uH(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||is.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(an(J({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,eo("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new is(this.gl),new is(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const Sme={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Mme({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let v=0;v=0){const C=v+o-t,x=C*C+y;x<=d&&(d=x,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),y=e[g];if(y){const v=y.decodePickingColor(_),w=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:y,pickedObjectIndex:v,pickedX:o+(f/4-w*l),pickedY:a+w}}Zn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Sme}function dH({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Tme(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(y=>y.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=dH(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=J({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=hH({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function hH({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Dme{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new uH(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?J(J({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new is(e),is.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new is(e),this.depthFBO.attach({36064:new xa(e,{format:Mn(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Zn.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:dH({viewports:i,x:r,y:s})};this._resizeBuffer();const f=um(this.gl),p=HO(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:y,height:v}=this.pickingFBO,w=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:y,deviceHeight:v});let C;const x=[],L={};for(let U=0;U=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Zn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:w,width:y.x+y.width-g,height:_-w},pass:"picking:".concat(l),redrawReason:l}),layers:e}),U=new Map,$=Number.isFinite(c);for(let ee=0;ee=c);ee++){const fe=L[ee];let pe={color:fe.pickedColor,layer:null,index:fe.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};pe=hH({layer:fe.pickedLayer,info:pe,mode:l}),U.has(pe.object)||U.set(pe.object,pe)}return Array.from(U.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return uS(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Ome={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Ime{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Ome),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function fH(n,e){if(!n)throw new Error(e)}const Qc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},pH=Qc.global||Qc.self||Qc.window,Rme="object"!=typeof process||"[object process]"!==String(process)||process.browser,gH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:kme}=(gH&&parseFloat(gH[1]),pH),IP="undefined"!=typeof Image,PP="undefined"!=typeof ImageBitmap,Fme=Boolean(kme),RP=!!Rme||Fme;function mH(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function _H(n){switch(mH(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const Bme=/^data:image\/svg\+xml/,Vme=/\.svg((\?|#).*)?$/;function kP(n){return n&&(Bme.test(n)||Vme.test(n))}function jme(n,e){if(kP(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return vH(n,e)}function vH(n,e){if(kP(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function bH(n,e,t){return FP.apply(this,arguments)}function FP(){return(FP=un(function*(n,e,t){const i=jme(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield Ume(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function Ume(n,e){return NP.apply(this,arguments)}function NP(){return(NP=un(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const zme={};let CH=!0;function Hme(n,e,t){return LP.apply(this,arguments)}function LP(){return(LP=un(function*(n,e,t){let i;i=kP(t)?yield bH(n,e,t):vH(n,t);const r=e&&e.imagebitmap;return yield $me(i,r)})).apply(this,arguments)}function $me(n){return BP.apply(this,arguments)}function BP(){return(BP=un(function*(n,e=null){if((Gme(e)||!CH)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),CH=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function Gme(n){for(const e in n||zme)return!1;return!0}const Jc=!1,Cb=!0;function VP(n){const e=wb(n);return function(n){const e=wb(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Jc)?{mimeType:"image/png",width:e.getUint32(16,Jc),height:e.getUint32(20,Jc)}:null}(e)||function(n){const e=wb(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Jc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Jc)?{mimeType:"image/gif",width:e.getUint16(6,Cb),height:e.getUint16(8,Cb)}:null}(e)||function(n){const e=wb(n);return e.byteLength>=14&&16973===e.getUint16(0,Jc)&&e.getUint32(2,Cb)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Cb),height:e.getUint32(22,Cb)}:null}(e)}function wb(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function Zme(n,e){const{mimeType:t}=VP(n)||{},{_parseImageNode:i}=pH;return fH(i),i(n,t,e)}function jP(){return(jP=un(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(Jme(r)){case"imagebitmap":a=yield Hme(n,e,s);break;case"image":a=yield bH(n,e,s);break;case"data":a=yield Zme(n,e);break;default:fH(!1)}return"data"===r&&(a=_H(a)),a})).apply(this,arguments)}function Jme(n){switch(n){case"auto":case"data":return function(){if(PP)return"imagebitmap";if(IP)return"image";if(RP)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return PP||IP||RP;case"imagebitmap":return PP;case"image":return IP;case"data":return RP;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const wH={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return jP.apply(this,arguments)},tests:[n=>Boolean(VP(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},t_e={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},Eb="8.5.8",qS=Zi.CO.deck&&Zi.CO.deck.VERSION;if(qS&&qS!==Eb)throw new Error("deck.gl - multiple versions detected: ".concat(qS," vs ").concat(Eb));qS||(Zn.log(1,"deck.gl ".concat(Eb))(),Zi.CO.deck=Object.assign(Zi.CO.deck||{},{VERSION:Eb,version:Eb,log:Zn,_registerLoggers:function(n){hI=n}}),W5([t_e,[wH,{imagebitmap:{premultiplyAlpha:"none"}}]]));const n_e=Zi.CO.deck;class YS extends qu{static isSupported(e,t=[]){const i=Mn(e),r=Nz(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:Qe(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return YS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const EH=(0,Zi.jU)()&&"undefined"!=typeof document;let h_e=0;class f_e{constructor(e={}){const{onCreateContext:t=(v=>_z(v)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=qf.get("animation-loop-"+h_e++)}=e;let{useDevicePixels:y=!0}=e;"useDevicePixelRatio"in e&&(ct.deprecated("useDevicePixelRatio","useDevicePixels")(),y=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:y}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return Qe("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=YS.isSupported(this.gl,["timers"])?new YS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return un(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return ct.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=EH?new Promise((e,t)=>{EH&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?GO(this.props.gl,e):this.onCreateContext(e),!lS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Wu(n,zO)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(ct.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(ct.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new is(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var p_e=Ve(524),XS=Ve.n(p_e);const g_e={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(XS().MouseInput);const v_e=XS().Manager,eu=XS(),b_e=eu?[[eu.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[eu.Rotate,{enable:!1}],[eu.Pinch,{enable:!1}],[eu.Swipe,{enable:!1}],[eu.Pan,{threshold:0,enable:!1}],[eu.Press,{enable:!1}],[eu.Tap,{event:"doubletap",taps:2,enable:!1}],[eu.Tap,{event:"anytap",enable:!1}],[eu.Tap,{enable:!1}]]:null,xH={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},C_e={doubletap:["tap"]},w_e={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},zP={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},E_e={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},TH={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},S_e="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",Am="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let AH=!1;try{const n={get passive(){return AH=!0,!0}};Am.addEventListener("test",n,n),Am.removeEventListener("test",n,n)}catch(n){}const M_e=-1!==S_e.indexOf("firefox"),{WHEEL_EVENTS:x_e}=zP,OH=4.000244140625;class D_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=x_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!AH&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;Am.WheelEvent&&(M_e&&e.deltaMode===Am.WheelEvent.DOM_DELTA_PIXEL&&(t/=Am.devicePixelRatio),e.deltaMode===Am.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%OH==0&&(t=Math.floor(t/OH)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:O_e}=zP,IH="pointermove",PH="pointerover",RH="pointerout",kH="pointerleave";class I_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=O_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===IH&&(this.enableMoveEvent=t),e===PH&&(this.enableOverEvent=t),e===RH&&(this.enableOutEvent=t),e===kH&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:PH,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:RH,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:kH,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:IH,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:P_e}=zP,FH="keydown";class R_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=P_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===FH&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:FH,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const LH="contextmenu";class k_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===LH&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:LH,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const F_e={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},BH={srcElement:"root",priority:0};class q_e{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},BH,i):BH;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&xH[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new D_e(e,this._onOtherEvent,{enable:!1}),this.moveInput=new I_e(e,this._onOtherEvent,{enable:!1}),this.keyInput=new R_e(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new k_e(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=C_e[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=TH[e]||e;let c=a.get(l);c||(c=new q_e(this),a.set(l,c),c.recognizerName=E_e[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(TH[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=w_e[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function ep(){}const VH={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:ep,onResize:ep,onViewStateChange:ep,onInteractionStateChange:ep,onBeforeRender:ep,onAfterRender:ep,onLoad:ep,onError:(n,e)=>Zn.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class ZS{constructor(e){e=J(J({},VH),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Zn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Zi.qs)()&&Zn.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new WO({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Qv.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Zn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Zn.removed("onLayerClick","onClick")(),e.initialViewState&&!vb(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](J({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),ic(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new f_e({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>_z(an(J(J({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new yme({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,GO(e,{enable:!0,copyState:!0})),this.tooltip=new Ime(this.canvas),Wu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new aH;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new X_e(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in tz)this.eventManager.on(r,this._onEvent);this.viewManager=new pme({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new fme(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new bme,this.deckRenderer=new Eme(e),this.deckPicker=new Dme(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Wu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(J({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Zn.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=an(J({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=tz[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=qf.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}ZS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(rH)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},ZS.defaultProps=VH,ZS.VERSION=n_e.VERSION;const jH={name:"project32",dependencies:[AP],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},UH="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",Q_e={lightSources:{}};function GP({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const WP={name:"lights",vs:UH,fs:UH,getUniforms:function zH(n=Q_e){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?GP(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=GP(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=GP(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return zH({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},eye={};const nye={name:"phong-lighting",dependencies:[WP],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=eye){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},rye={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},GH=J({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=rye){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),WH={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class QS{static get DRAW_MODE(){return WH}constructor(e={}){const{id:t=Wc("geometry"),drawMode:i=WH.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?J({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,Qe(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(Qe(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return Qe(Number.isFinite(i)),i}}const qP=Math.PI/180,JS=new Float32Array(16),qH=new Float32Array(12);function YH(n,e,t){const i=e[0]*qP,r=e[1]*qP,s=e[2]*qP,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function XH(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const KH={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let y;g?(JS.set(a),y=XH(JS)):(y=qH,YH(y,r,s),y.set(o,9)),n.value=new Float32Array(y)}else{let y=e*n.size;const{iterable:v,objectInfo:w}=Xz(i,e,t);for(const C of v){let x;w.index++,g?(JS.set(c?a:a(C,w)),x=XH(JS)):(x=qH,YH(x,f?r:r(C,w),d?s:s(C,w)),x.set(p?o:o(C,w),9)),_[y++]=x[0],_[y++]=x[1],_[y++]=x[2],_[y++]=x[3],_[y++]=x[4],_[y++]=x[5],_[y++]=x[6],_[y++]=x[7],_[y++]=x[8],_[y++]=x[9],_[y++]=x[10],_[y++]=x[11]}}}};function ZH(n,e){return e===Hn.CARTESIAN||e===Hn.METER_OFFSETS||e===Hn.DEFAULT&&!n.isGeospatial}function QH(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Zn.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function lye(n,e){if(n.attributes)return QH(n.attributes,e),n instanceof QS?n:new QS(n);if(n.positions||n.POSITION)return QH(n,e),new QS({attributes:n});throw Error("Invalid mesh")}const cye={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let uye=(()=>{class n extends SP{getShaders(){const t=!Mn(this.context.gl),i={};return nI(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[jH,nye,GH],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:KH}),this.setState({emptyTexture:new xa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||ZH(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new SS(this.context.gl,an(J({},this.getShaders()),{id:this.props.id,geometry:lye(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=cye,n})();const JH={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[WP]};class Dm{constructor(e={}){const{id:t}=e;this.id=t||Wc(this.constructor.name),this.display=!0,this.position=new Js,this.rotation=new Js,this.scale=new Js(1,1,1),this.matrix=new Lt,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return Qe(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return Qe(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return Qe(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){Qe(e),t=t||this.matrix;const i=new Lt(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class Sb extends Dm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;ct.assert(t.every(i=>i instanceof Dm),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new Lt}={}){const i=new Lt(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Sb?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function e8(){var n=new ta(4);return ta!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function t8(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function n8(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var r8=Y4,Mye=function(){var n=Vz(),e=jz(1,0,0),t=jz(0,1,0);return function(i,r,s){var o=Uz(r,s);return o<-.999999?(fS(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&fS(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),t8(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(fS(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();e8(),e8(),function(){var n=new ta(9);ta!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const xye=[0,0,0,1],Aye={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Dye={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function a8(n){if(!n._animation){const e=Dye[n.componentType],t=Aye[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return t8(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=ks(e)}get y(){return this[1]}set y(e){this[1]=ks(e)}get z(){return this[2]}set z(e){this[2]=ks(e)}get w(){return this[3]}set w(e){this[3]=ks(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return Mye(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Xu(!t),n8(this,this,e),this.check()}multiplyLeft(e,t){return Xu(!t),n8(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return r8(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=xye,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,y,v,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>Vi?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-i)*p)/_,v=Math.sin(i*p)/_):(y=1-i,v=i),n[0]=y*r+v*l,n[1]=y*s+v*c,n[2]=y*o+v*d,n[3]=y*a+v*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),hS(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class Nye{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:ct.warn(`Bad animation path ${s}`)()}Qe(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){YP.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:a8(e.accessors[a]),interpolation:l,output:a8(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Nye({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Bye extends Dm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof SS?(this.model=e,this._setModelNodeProps(t)):this.model=new SS(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class Vye{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},nI(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new xa(this.gl,J({id:e.name||e.id,parameters:J(J({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(ct.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function l8(n,e){return Mn(n)?`#version 300 es\n${e}`:e}const Hye={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$ye={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Gye{constructor(e,t={}){this.gl=e,this.options=Object.assign({},$ye,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Lye(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Sb({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new Sb({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new Lt).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new Sb({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){ct.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new Vye(n,e);ct.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new Bye(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[JH],defines:a.defines,parameters:a.parameters,vs:l8(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:l8(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),ct.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new Si(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ea({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Hye[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function c8(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new Om(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Om(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Om){const o=e;t=o.fields,i=f8(f8(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new Om(s,i)}}function f8(n,e){return new Map([...n||new Map,...e||new Map])}let ar,p8,g8,m8,_8,y8,v8,b8;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(ar||(ar={}));class XP{static isNull(e){return e&&e.typeId===ar.Null}static isInt(e){return e&&e.typeId===ar.Int}static isFloat(e){return e&&e.typeId===ar.Float}static isBinary(e){return e&&e.typeId===ar.Binary}static isUtf8(e){return e&&e.typeId===ar.Utf8}static isBool(e){return e&&e.typeId===ar.Bool}static isDecimal(e){return e&&e.typeId===ar.Decimal}static isDate(e){return e&&e.typeId===ar.Date}static isTime(e){return e&&e.typeId===ar.Time}static isTimestamp(e){return e&&e.typeId===ar.Timestamp}static isInterval(e){return e&&e.typeId===ar.Interval}static isList(e){return e&&e.typeId===ar.List}static isStruct(e){return e&&e.typeId===ar.Struct}static isUnion(e){return e&&e.typeId===ar.Union}static isFixedSizeBinary(e){return e&&e.typeId===ar.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===ar.FixedSizeList}static isMap(e){return e&&e.typeId===ar.Map}static isDictionary(e){return e&&e.typeId===ar.Dictionary}get typeId(){return ar.NONE}compareTo(e){return this===e}}Symbol,Symbol,p8=Symbol.toStringTag;class Im extends XP{constructor(e,t){super(),Yt(this,"isSigned",void 0),Yt(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return ar.Int}get[p8](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class tve extends Im{constructor(){super(!0,8)}}class nve extends Im{constructor(){super(!0,16)}}class ive extends Im{constructor(){super(!0,32)}}class rve extends Im{constructor(){super(!1,8)}}class sve extends Im{constructor(){super(!1,16)}}class ove extends Im{constructor(){super(!1,32)}}g8=Symbol.toStringTag;class C8 extends XP{constructor(e){super(),Yt(this,"precision",void 0),this.precision=e}get typeId(){return ar.Float}get[g8](){return"Float"}toString(){return`Float${this.precision}`}}class ave extends C8{constructor(){super(32)}}class lve extends C8{constructor(){super(64)}}Symbol,Symbol,m8=Symbol.toStringTag,_8=Symbol.toStringTag,y8=Symbol.toStringTag,v8=Symbol.toStringTag,b8=Symbol.toStringTag;class cve extends XP{constructor(e,t){super(),Yt(this,"listSize",void 0),Yt(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return ar.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[b8](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class tM{constructor(e,t,i=!1,r=new Map){Yt(this,"name",void 0),Yt(this,"type",void 0),Yt(this,"nullable",void 0),Yt(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new tM(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function w8(n,e,t){const i=t?E8(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new tve;case Uint8Array:return new rve;case Int16Array:return new nve;case Uint16Array:return new sve;case Int32Array:return new ive;case Uint32Array:return new ove;case Float32Array:return new ave;case Float64Array:return new lve;default:throw new Error("array type not supported")}}(e.value);return new tM(n,new cve(e.size,new tM("value",r)),!1,i)}function E8(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const S8={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},fve={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class gve{constructor(e){Yt(this,"draco",void 0),Yt(this,"decoder",void 0),Yt(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=E8(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=w8(o,n[o],s[o]);r.push(l)}if(t){const o=w8("indices",t);r.push(o)}return new Om(r,i)}(l.attributes,a,l.indices);return an(J({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var nM=Ve(125);const JP={};function eR(n){return tR.apply(this,arguments)}function tR(){return(tR=un(function*(n,e=null,t={}){return e&&(n=bve(n,e,t)),JP[n]=JP[n]||Cve(n),yield JP[n]})).apply(this,arguments)}function bve(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:tP?t.CDN?(Xc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):nP?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Cve(n){return nR.apply(this,arguments)}function nR(){return(nR=un(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():tP?nP?importScripts(n):wve(yield(yield fetch(n)).text(),n):nM.requireFromFile&&(yield nM.requireFromFile(n))})).apply(this,arguments)}function wve(n,e){if(!tP)return nM.requireFromString&&nM.requireFromString(n,e);if(nP)return eval.call(fpe,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Eve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Sve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Mve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Mb;function Tve(n){return iR.apply(this,arguments)}function iR(){return(iR=un(function*(n){const e=n.modules||{};return Mb=e.draco3d?Mb||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Mb||Ave(n),yield Mb})).apply(this,arguments)}function Ave(n){return sR.apply(this,arguments)}function sR(){return(sR=un(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield eR(Eve,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield eR(Sve,"draco",n),yield eR(Mve,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Dve(e,t)})).apply(this,arguments)}function Dve(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(an(J({},t),{onModuleLoaded:r=>i({draco:r})}))})}const aR=an(J({},h8),{parse:function(n,e){return lR.apply(this,arguments)}});function lR(){return(lR=un(function*(n,e){const{draco:t}=yield Tve(e),i=new gve(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Tb(n,e){return Qf(n>=0),Qf(e>0),n+(e-1)&~(e-1)}function Pve(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+Tb(i.byteLength,4)}const M8=["SCALAR","VEC2","VEC3","VEC4"],Rve=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],kve=new Map(Rve),Fve={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nve={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lve={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function x8(n){return M8[n-1]||M8[0]}function T8(n){const e=kve.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function A8(n,e){const t=Lve[n.componentType],i=Fve[n.type],s=n.count*i,o=n.count*i*Nve[n.componentType];return Oa(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const Bve={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class hh{constructor(e){Yt(this,"gltf",void 0),Yt(this,"sourceBuffers",void 0),Yt(this,"byteLength",void 0),this.gltf=e||{json:J({},Bve),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return Oa(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=A8(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return Oa(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Oa(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=VP(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Oa(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Tb(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:x8(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:T8(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Pve(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Xve(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function Kve(n){return dR.apply(this,arguments)}function dR(){return(dR=un(function*(n){const e=new hh(n),{json:t}=e;e.removeExtension(rM);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,rM)})).apply(this,arguments)}function Zve(n){const e=new hh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,rM,{}),e.addExtension(rM))}function Qve(n){return hR.apply(this,arguments)}function hR(){return(hR=un(function*(n){const e=new hh(n),{json:t}=e,i=e.getExtension(Pm);i&&(e.json.lights=i.lights,e.removeExtension(Pm));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Pm);s&&(r.light=s.light),e.removeObjectExtension(r,Pm)}})).apply(this,arguments)}function Jve(n){return fR.apply(this,arguments)}function fR(){return(fR=un(function*(n){const e=new hh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Pm);Oa(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Pm,i);delete e.json.lights}})).apply(this,arguments)}function ebe(n){return pR.apply(this,arguments)}function pR(){return(pR=un(function*(n){const e=new hh(n),{json:t}=e,i=e.getExtension(sM);if(i){const r=nbe(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,sM);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=ibe(s.technique,e)),e.removeObjectExtension(s,sM)}e.removeExtension(sM)}})).apply(this,arguments)}function tbe(n,e){return gR.apply(this,arguments)}function gR(){return(gR=un(function*(n,e){})).apply(this,arguments)}function nbe(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function ibe(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const I8={KHR_draco_mesh_compression:_t,KHR_materials_unlit:k,KHR_lights_punctual:It,KHR_techniques_webgl:Pt};function rbe(n){return mR.apply(this,arguments)}function mR(){return(mR=un(function*(n,e={},t){for(const r in I8){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield I8[r].decode(n,e,t))}})).apply(this,arguments)}const P8={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},obe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class abe{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new hh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,D8);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(D8)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in P8)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in P8)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=obe[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function lbe(n,e={}){return(new abe).normalize(n,e)}const cbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ube={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_l={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},dbe={magFilter:_l.TEXTURE_MAG_FILTER,minFilter:_l.TEXTURE_MIN_FILTER,wrapS:_l.TEXTURE_WRAP_S,wrapT:_l.TEXTURE_WRAP_T},hbe={[_l.TEXTURE_MAG_FILTER]:_l.LINEAR,[_l.TEXTURE_MIN_FILTER]:_l.NEAREST_MIPMAP_LINEAR,[_l.TEXTURE_WRAP_S]:_l.REPEAT,[_l.TEXTURE_WRAP_]:_l.REPEAT};class gbe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Oa(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=J({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=J({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=J({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=J({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=J({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=J({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=J({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return ube[n]}(e.componentType),e.components=function(n){return cbe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=A8(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):hbe,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return dbe[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function mbe(n,e){return(new gbe).postProcess(n,e)}const R8=1735152710,Rm=!0;function yR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Tb(i,4)}function vR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Tb(i,4)}function Abe(n,e){return bR.apply(this,arguments)}function bR(){return(bR=un(function*(n,e,t=0,i,r){var s,o,a,l;Dbe(n,e,t,i),lbe(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Obe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Ibe(n,i,r);c.push(f)}const d=rbe(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?mbe(n,i):n})).apply(this,arguments)}function Dbe(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=R8}=t,s=i.getUint32(e,!1);return s===r||s===R8}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?c8(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?c8(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,Rm),a=r.getUint32(t+8,Rm);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){Qf(n.header.byteLength>20);const i=e.getUint32(t+0,Rm),r=e.getUint32(t+4,Rm);return t+=8,Qf(0===r),yR(n,e,t,i),(t+=i)+vR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Qf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,Rm),s=e.getUint32(t+4,Rm);switch(t+=8,s){case 1313821514:yR(n,e,t,r);break;case 5130562:vR(n,e,t,r);break;case 0:i.strict||yR(n,e,t,r);break;case 1:i.strict||vR(n,e,t,r)}t+=Tb(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),Oa("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Oa(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Obe(n,e,t){return CR.apply(this,arguments)}function CR(){return(CR=un(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield Fbe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function Fbe(n){return xR.apply(this,arguments)}function xR(){return(xR=un(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const k8=[255,255,255,255],Bbe={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:k8},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[km]};let Vbe=(()=>{class n extends SP{getShaders(){const t=[jH,GH];return"pbr"===this.props._lighting&&t.push(JH),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:k8,transition:!0},instanceModelMatrix:KH})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Dm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Gye(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=J({gltf:l},c),function(n){return MR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Zn.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Dm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Zn.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Zn.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Dm&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:J({isInstanced:!0,transpileToGLSL100:!Mn(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:ZH(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=Bbe,n})();const jbe=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Ube=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),zbe=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Hbe=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),$be={POSITION:{size:3,value:new Float32Array(Ube)},NORMAL:{size:3,value:new Float32Array(zbe)},TEXCOORD_0:{size:2,value:new Float32Array(Hbe)}};class Gbe extends QS{constructor(e={}){const{id:t=Wc("cube-geometry")}=e;super(an(J({},e),{id:t,indices:{size:1,value:new Uint16Array(jbe)},attributes:J(J({},$be),e.attributes)}))}}class tu{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new S){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new S){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new S){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new S){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new S){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new S){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new S){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=qbe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=Ybe;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(F8),F8.almostEquals(e,t)}clone(){return new S(this.x,this.y,this.z)}}S.ZERO=void 0,S.UNIT_X=void 0,S.UNIT_Y=void 0,S.UNIT_Z=void 0,S.ZERO=new S(0,0,0),S.UNIT_X=new S(1,0,0),S.UNIT_Y=new S(0,1,0),S.UNIT_Z=new S(0,0,1);const qbe=new S,Ybe=new S,F8=new S;class Mi{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new S,this.upperBound=new S,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=L8;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=L8;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const N8=new S,L8=[new S,new S,new S,new S,new S,new S,new S,new S];class Rr{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new S){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=Kbe;e.tangents(i,Zbe),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(zi(e.length(),2)*zi(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new Rr){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new Rr){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new Rr){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new S){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new Rr(this.x,this.y,this.z,this.w)}slerp(e,t,i=new Rr){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,y,v,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-t)*p)/_,v=Math.sin(t*p)/_):(y=1-t,v=t),i.x=y*r+v*l,i.y=y*s+v*c,i.z=y*o+v*d,i.w=y*a+v*f,i}integrate(e,t,i,r=new Rr){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const Kbe=new S,Zbe=new S,Qbe={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let ut=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=Qbe,n})();class Qn{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new S,this.quaternion=new Rr,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Qn.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Qn.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new S){return i.vsub(e,r),t.conjugate(V8),V8.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new S){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new S){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new S){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const V8=new Rr;class tp extends ut{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:ut.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new S;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=y,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new S,d=new S,f=new S,p=new S,g=new S,_=new S;let y=Number.MAX_VALUE;const v=this;if(v.uniqueAxes)for(let w=0;w!==v.uniqueAxes.length;w++){i.vmult(v.uniqueAxes[w],c);const C=v.testSepAxis(c,e,t,i,r,s);if(!1===C)return!1;C0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){tp.project(this,e,i,r,TR),tp.project(t,e,s,o,AR);const l=TR[0],c=TR[1],d=AR[0],f=AR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?dt.STATIC:dt.DYNAMIC,typeof e.type==typeof dt.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=dt.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new S,this.quaternion=new Rr,this.initQuaternion=new Rr,this.previousQuaternion=new Rr,this.interpolatedQuaternion=new Rr,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new S,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new S,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new S,this.invInertia=new S,this.invInertiaWorld=new tu,this.invMassSolve=0,this.invInertiaSolve=new S,this.invInertiaWorldSolve=new tu,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new S(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new S(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new Mi,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new S,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=dt.AWAKE,this.wakeUpAfterNarrowphase=!1,e===dt.SLEEPING&&this.dispatchEvent(dt.wakeupEvent)}sleep(){this.sleepState=dt.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=zi(this.sleepSpeedLimit,2);t===dt.AWAKE&&ir?this.wakeUp():t===dt.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(dt.sleepEvent))}}updateSolveMassProperties(){this.sleepState===dt.SLEEPING||this.type===dt.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new S){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new S){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new S,s=new Rr;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=t0e,o=n0e,a=this.quaternion,l=this.aabb,c=i0e;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=r0e,r=s0e;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new S){if(this.type!==dt.DYNAMIC)return;this.sleepState===dt.SLEEPING&&this.wakeUp();const i=o0e;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new S){if(this.type!==dt.DYNAMIC)return;const i=a0e,r=l0e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===dt.DYNAMIC&&(this.sleepState===dt.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new S){if(this.type!==dt.DYNAMIC)return;this.sleepState===dt.SLEEPING&&this.wakeUp();const i=t,r=c0e;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=u0e;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new S){if(this.type!==dt.DYNAMIC)return;const i=d0e,r=h0e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=f0e;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),aM.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new S;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==dt.DYNAMIC&&this.type!==dt.KINEMATIC||this.sleepState===dt.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,y=this.angularFactor,v=l.x*y.x,w=l.y*y.y,C=l.z*y.z;s.x+=e*(_[0]*v+_[1]*w+_[2]*C),s.y+=e*(_[3]*v+_[4]*w+_[5]*C),s.z+=e*(_[6]*v+_[7]*w+_[8]*C),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}dt.idCounter=0,dt.COLLIDE_EVENT_NAME="collide",dt.DYNAMIC=1,dt.STATIC=2,dt.KINEMATIC=4,dt.AWAKE=0,dt.SLEEPY=1,dt.SLEEPING=2,dt.wakeupEvent={type:"wakeup"},dt.sleepyEvent={type:"sleepy"},dt.sleepEvent={type:"sleep"};const t0e=new S,n0e=new Rr,i0e=new Mi,r0e=new tu,s0e=new tu,o0e=new S,a0e=new S,l0e=new S,c0e=new S,u0e=new S,d0e=new S,h0e=new S,f0e=new S;new S,new S;class lM{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new S,this.rayToWorld=new S,this.hitNormalWorld=new S,this.hitPointWorld=new S,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let j8,U8,z8,H8,$8,G8,W8;j8=ut.types.SPHERE,U8=ut.types.PLANE,z8=ut.types.BOX,H8=ut.types.CYLINDER,$8=ut.types.CONVEXPOLYHEDRON,G8=ut.types.HEIGHTFIELD,W8=ut.types.TRIMESH;class zr{get[j8](){return this._intersectSphere}get[U8](){return this._intersectPlane}get[z8](){return this._intersectBox}get[H8](){return this._intersectConvex}get[$8](){return this._intersectConvex}get[G8](){return this._intersectHeightfield}get[W8](){return this._intersectTrimesh}constructor(e=new S,t=new S){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new S,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=zr.ANY,this.result=new lM,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||zr.ANY,this.result=t.result||new lM,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(q8),PR.length=0,e.broadphase.aabbQuery(e,q8,PR),this.intersectBodies(PR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=b0e,s=C0e;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new S(0,0,1);t.vmult(c,c);const d=new S;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&y<=1&&(o.lerp(a,y,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=x0e,l=X8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,v=_.distanceTo(this.to),w=c?c.length:d.length,C=this.result;for(let x=0;!C.shouldStop&&xv||this.reportIntersection(a,na,s,r,L)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=T0e,l=R0e,c=k0e,d=X8,f=A0e,p=D0e,g=O0e,_=P0e,y=I0e,v=e.indices,w=this.from,C=this.to,x=this.direction;c.position.copy(i),c.quaternion.copy(t),Qn.vectorToLocalFrame(i,t,x,f),Qn.pointToLocalFrame(i,t,w,p),Qn.pointToLocalFrame(i,t,C,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const L=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let U=0,$=l.length;!this.result.shouldStop&&U!==$;U++){const ee=l[U];e.getNormal(ee,a),e.getVertex(v[3*ee],ac),ac.vsub(p,d);const fe=f.dot(a),pe=a.dot(d)/fe;if(pe<0)continue;f.scale(pe,na),na.vadd(p,na),e.getVertex(v[3*ee+1],iu),e.getVertex(v[3*ee+2],ru);const ve=na.distanceSquared(p);!zr.pointInTriangle(na,iu,ac,ru)&&!zr.pointInTriangle(na,ac,iu,ru)||ve>L||(Qn.vectorToWorldFrame(t,a,y),Qn.pointToWorldFrame(i,t,na,_),this.reportIntersection(y,_,s,r,ee))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case zr.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case zr.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var su=Ve(517);function Bm(n,e,t){e||(e=new Lt(Lt.IDENTITY));const i=new Lt(Lt.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new Lt(Lt.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new Lt(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===Bm(s,r,t))return!1;return!0}function j6(){W5([h8,km])}function U6(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||Bm(r,new Lt(Lt.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function NR(n,e){return gl(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield VS(i,km,{DracoLoader:aR,gltf:{decompressMeshes:!0,postProcess:!0}});return U6(n.scenegraphNode,r)})}function FEe(n,e){return gl(this,void 0,void 0,function*(){return U6(n,yield e)})}function LR(n,e,t){if(e&&0!==e.length)return new uye(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Hn.CARTESIAN,data:e,mesh:new Gbe,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let LEe=(()=>{class n extends hge{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),j6()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){gl(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new Lt(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new Mi({lowerBound:new S(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new S(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield jS(o.scenegraph,km,{DracoLoader:aR,decompress:!0,postProcess:!0});for(const l of a.scenes)Bm(l,new Lt(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new Mi({lowerBound:new S(...p.map((_,y)=>Math.min(_,g[y]))),upperBound:new S(...g.map((_,y)=>Math.max(_,p[y])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=NR({scenegraph:l.scenegraph},n.gltfCache));return[LR("cubes",i,{wireframe:!1,pickable:!1}),LR("pickableCubes",r,{wireframe:!1,pickable:!0}),LR("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new Vbe({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Hn.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?FEe(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function z6(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),z6(t,e);return e}let VEe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new LEe({}),this.nodeClickSubject=new we,this.nodeHoverStartSubject=new we,this.nodeHoverStopSubject=new we,this.sceneRotationSubject=new sr([0,0]),this.nodeDragStartSubject=new we,this.nodeDragSubject=new we,this.nodeDragEndSubject=new we,this.nodeClick$=this.nodeClickSubject.pipe(Vs()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Vs()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Vs()),this.sceneRotation$=this.sceneRotationSubject.pipe(Vs()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Vs()),this.nodeDrag$=this.nodeDragSubject.pipe(Vs()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Vs());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Sge({flipY:!1,near:-1e3}):new Tge({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new OP({ambientLight:new nH({color:[255,255,255],intensity:10})})]),this.deck=new ZS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return gl(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new Lt([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return gl(this,void 0,void 0,function*(){j6();const i=yield NR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)Bm(o,e=new Lt(e||Lt.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new Lt(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new Lt(e||Lt.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new Mi({lowerBound:new S(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new S(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of z6(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new S(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new Lt(Lt.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new Lt(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return De([su.ZP],n.prototype,"_onHover",null),De([su.ZP],n.prototype,"_onClick",null),De([su.ZP],n.prototype,"_onViewStateChange",null),De([su.ZP],n.prototype,"_onDragStart",null),De([su.ZP],n.prototype,"_onDrag",null),De([su.ZP],n.prototype,"_onDragEnd",null),n})();function jEe(n,e){return n===e}function UEe(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let BR=(()=>{class n{constructor(){this.bootstrap$=new Hg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const VR=new _e("INITIAL_STATE_TOKEN");let $Ee=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const $6=new _e("Internals.StateContextFactory"),G6=new _e("Internals.StateFactory");function W6(n,e){return e?t=>t.pipe(W6((i,r)=>li(n(i,r)).pipe(be((s,o)=>e(i,s,r,o))))):t=>t.lift(new GEe(n))}class GEe{constructor(e){this.project=e}call(e,t){return t.subscribe(new WEe(e,this.project))}}class WEe extends ei{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new $r(this),i=this.destination;i.add(t);const r=oo(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function _M(n=null){return e=>e.lift(new qEe(n))}class qEe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new YEe(e,this.defaultValue))}}class YEe extends Rt{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}const Ia={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let q6=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return wD(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return lt.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return lt.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof lt||console.warn(Ia.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(cl))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Y6=new _e("ROOT_STATE_TOKEN"),X6=new _e("FEATURE_STATE_TOKEN"),jR=new _e("NGXS_PLUGINS"),K6=new _e("NG_TEST_MODE"),Z6=new _e("NG_DEV_MODE"),sd="NGXS_META",Q6="NGXS_OPTIONS_META",UR="NGXS_SELECTOR_META";let op=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=q6}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class XEe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const J6=new _e("NGXS_EXECUTION_STRATEGY");function ap(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const zR=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},Vm=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),HR=n=>n&&"object"==typeof n&&!Array.isArray(n),$R=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(HR(n)&&HR(t))for(const i in t)HR(t[i])?(n[i]||Object.assign(n,{[i]:{}}),$R(n[i],t[i])):Object.assign(n,{[i]:t[i]});return $R(n,...e)};function Fb(n){return n[sd]}function qR(n){return n[UR]}function t$(n,e){const t=Vm(e.currentAppState,n.path),i=Vm(e.newAppState,n.path);return new XEe(t,i,!n.isInitialised)}function rSe(...n){return function(n,e,t=aSe){const i=function(n){return n.reduce((e,t)=>(e[ap(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Tn(t=>{const i=ap(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function aSe(){return be(n=>n.action)}function yM(n){return e=>new oe(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let vM=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(I(J6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class uSe extends we{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let bM=(()=>{class n extends uSe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),dSe=(()=>{class n extends oe{constructor(t,i){super(r=>{const s=t.pipe(yM(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(I(bM),I(vM))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const n$=n=>(...e)=>n.shift()(...e,(...i)=>n$(n)(...i));let CM=(()=>{class n extends sr{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),YR=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(I(n,12),I(jR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),XR=(()=>{class n extends we{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),i$=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Uo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(yM(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?st(this._stateStream.getValue()):Bv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!ap(t))return zg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return n$([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(Hc())}getActionResultStream(t){return this._actionResults.pipe(Tn(i=>i.action===t&&"DISPATCHED"!==i.status),_i(1),Hc())}createDispatchObservable(t){return t.pipe(W6(i=>{switch(i.status){case"SUCCESSFUL":return st(this._stateStream.getValue());case"ERRORED":return zg(i.error);default:return Ql}})).pipe(Hc())}}return n.\u0275fac=function(t){return new(t||n)(I(Tt),I(bM),I(XR),I(YR),I(CM),I(vM))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const r$=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&r$(n[i])}),n};let s$=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(I(Z6),I(K6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),o$=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Ia.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ia.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(I(s$),I(op))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Um=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=r$(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(I(CM),I(i$),I(op),I(o$))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),wM=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Vm(l,t.path)}function s(l,c){const d=zR(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=t$(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Ia.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ia.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(I(Um))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class EM{static stateNameErrorMessage(e){return Ia.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ia.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Ia.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=Fb(e);if(!t)throw new Error(Ia.STATE_DECORATOR());return t}}EM.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let zm=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=H6(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(EM.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[sd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[sd];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[sd].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[sd];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>zR(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Tn(t=>"DISPATCHED"===t.status),ci(({action:t})=>this.invokeActions(this._actions,t).pipe(be(()=>({action:t,status:"SUCCESSFUL"})),_M({action:t,status:"CANCELED"}),Sa(i=>st({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=ap(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=li(d)),d instanceof oe?(d=d.pipe(_M({})),l.options.cancelUncompleted&&(d=d.pipe(zn(t.pipe(rSe(i)))))):d=st({}).pipe(Hc()),s.push(d)}catch(d){s.push(zg(d))}}}return s.length||s.push(st({})),Bv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=EM.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==Vm(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(I(Tt),I(op),I(n,12),I(bM),I(XR),I(wM),I(VR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),KR=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Tn(()=>!!i),Di(()=>this.invokeInit(i.states)),ci(()=>this.bootstrapper.appBootstrapped$),Tn(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=t$(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Um),I(wM),I(BR))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();let ph=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(be(i),Sa(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?st(void 0):zg(r)}),Xo(),yM(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(_i(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(yM(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=qR(n)||Fb(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(I(CM),I(Um),I(op),I(vM),I(zm),I(VR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Nb=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(I(ph),I(op))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class c${static get type(){return"@@INIT"}}class u${constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const MM=new Hg(1);let vSe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&wo();MM.next(t)}catch(n){MM.next(!1)}finally{MM.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new c$,l)}}return n.\u0275fac=function(t){return new(t||n)(I(zm),I(Um),I(ph),I(Nb),I(Y6,8),I(KR))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),bSe=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new u$(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(I(ph),I(Um),I(zm),I(X6,8),I(KR))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();class ia{static forRoot(e=[],t={}){return{ngModule:vSe,providers:[zm,wM,dSe,bM,BR,o$,s$,KR,i$,XR,Um,vM,ph,CM,Nb,YR,...e,...ia.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:bSe,providers:[zm,YR,...e,{provide:X6,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:K6,useValue:HEe},{provide:Z6,useValue:wo},{provide:J6,useClass:t.executionStrategy||q6},{provide:Y6,useValue:e},{provide:ia.ROOT_OPTIONS,useValue:t},{provide:op,useFactory:ia.ngxsConfigFactory,deps:[ia.ROOT_OPTIONS]},{provide:pv,useFactory:ia.appBootstrapListenerFactory,multi:!0,deps:[BR]},{provide:VR,useFactory:ia.getInitialState},{provide:$6,useExisting:wM},{provide:G6,useExisting:zm}]}static ngxsConfigFactory(e){return $R(new op,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return $Ee.pop()}}function gh(n){return i=>{!function(n){MM.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ia.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(sd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,sd,{value:e})}return Fb(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[Q6]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;EM.checkCorrectStateName(d),s.hasOwnProperty(sd)&&(r.actions=Object.assign({},r.actions,(s[sd]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[Q6]=a}}ia.\u0275fac=function(e){return new(e||ia)},ia.\u0275mod=xe({type:ia}),ia.\u0275inj=Ee({}),ia.ROOT_OPTIONS=new _e("ROOT_OPTIONS");let d$=(()=>{class n{constructor(t,i){this._renderer=t,this._elementRef=i,this.onChange=r=>{},this.onTouched=()=>{}}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return n.\u0275fac=function(t){return new(t||n)(E(Lc),E(nt))},n.\u0275dir=he({type:n}),n})(),lp=(()=>{class n extends d${}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,features:[ht]}),n})();const Ao=new _e("NgValueAccessor"),ASe={provide:Ao,useExisting:T(()=>Lb),multi:!0},OSe=new _e("CompositionEventMode");let Lb=(()=>{class n extends d${constructor(t,i,r){super(t,i),this._compositionMode=r,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const n=Vc()?Vc().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return n.\u0275fac=function(t){return new(t||n)(E(Lc),E(nt),E(OSe,8))},n.\u0275dir=he({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,i){1&t&&ye("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},features:[At([ASe]),ht]}),n})();function mh(n){return null==n||0===n.length}function f$(n){return null!=n&&"number"==typeof n.length}const ws=new _e("NgValidators"),_h=new _e("NgAsyncValidators"),ISe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class p${static min(e){return function(n){return e=>{if(mh(e.value)||mh(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t{if(mh(e.value)||mh(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}(e)}static required(e){return function(n){return mh(n.value)?{required:!0}:null}(e)}static requiredTrue(e){return function(n){return!0===n.value?null:{required:!0}}(e)}static email(e){return function(n){return mh(n.value)||ISe.test(n.value)?null:{email:!0}}(e)}static minLength(e){return function(n){return e=>mh(e.value)||!f$(e.value)?null:e.value.lengthf$(e.value)&&e.value.length>n?{maxlength:{requiredLength:n,actualLength:e.value.length}}:null}(e)}static pattern(e){return function(n){if(!n)return yh;let e,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),i=>{if(mh(i.value))return null;const r=i.value;return e.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}(e)}static nullValidator(e){return null}static compose(e){return A$(e)}static composeAsync(e){return D$(e)}}function yh(n){return null}function E$(n){return null!=n}function S$(n){const e=Wy(n)?li(n):n;return yw(e),e}function M$(n){let e={};return n.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function x$(n,e){return e.map(t=>t(n))}function T$(n){return n.map(e=>function(n){return!n.validate}(e)?e:t=>e.validate(t))}function A$(n){if(!n)return null;const e=n.filter(E$);return 0==e.length?null:function(t){return M$(x$(t,e))}}function ZR(n){return null!=n?A$(T$(n)):null}function D$(n){if(!n)return null;const e=n.filter(E$);return 0==e.length?null:function(t){return Bv(x$(t,e).map(S$)).pipe(be(M$))}}function QR(n){return null!=n?D$(T$(n)):null}function O$(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function I$(n){return n._rawValidators}function P$(n){return n._rawAsyncValidators}function JR(n){return n?Array.isArray(n)?n:[n]:[]}function xM(n,e){return Array.isArray(n)?n.includes(e):n===e}function R$(n,e){const t=JR(e);return JR(n).forEach(r=>{xM(t,r)||t.push(r)}),t}function k$(n,e){return JR(e).filter(t=>!xM(n,t))}let F$=(()=>{class n{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=ZR(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=QR(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,i){return!!this.control&&this.control.hasError(t,i)}getError(t,i){return this.control?this.control.getError(t,i):null}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n}),n})(),Do=(()=>{class n extends F${get formDirective(){return null}get path(){return null}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,features:[ht]}),n})();class lc extends F${constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let ek=(()=>{class n extends class{constructor(e){this._cd=e}is(e){var t,i,r;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(r=null===(i=this._cd)||void 0===i?void 0:i.control)||void 0===r?void 0:r[e])}}{constructor(t){super(t)}}return n.\u0275fac=function(t){return new(t||n)(E(lc,2))},n.\u0275dir=he({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,i){2&t&&at("ng-untouched",i.is("untouched"))("ng-touched",i.is("touched"))("ng-pristine",i.is("pristine"))("ng-dirty",i.is("dirty"))("ng-valid",i.is("valid"))("ng-invalid",i.is("invalid"))("ng-pending",i.is("pending"))},features:[ht]}),n})();function Bb(n,e){ik(n,e),e.valueAccessor.writeValue(n.value),function(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&B$(n,e)})}(n,e),function(n,e){const t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&B$(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function(n,e){if(e.valueAccessor.setDisabledState){const t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function DM(n,e,t=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),IM(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function OM(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function ik(n,e){const t=I$(n);null!==e.validator?n.setValidators(O$(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const i=P$(n);null!==e.asyncValidator?n.setAsyncValidators(O$(i,e.asyncValidator)):"function"==typeof i&&n.setAsyncValidators([i]);const r=()=>n.updateValueAndValidity();OM(e._rawValidators,r),OM(e._rawAsyncValidators,r)}function IM(n,e){let t=!1;if(null!==n){if(null!==e.validator){const r=I$(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.validator);s.length!==r.length&&(t=!0,n.setValidators(s))}}if(null!==e.asyncValidator){const r=P$(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.asyncValidator);s.length!==r.length&&(t=!0,n.setAsyncValidators(s))}}}const i=()=>{};return OM(e._rawValidators,i),OM(e._rawAsyncValidators,i),t}function B$(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function V$(n,e){ik(n,e)}function rk(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}function j$(n,e){n._syncPendingControls(),e.forEach(t=>{const i=t.control;"submit"===i.updateOn&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function sk(n,e){if(!e)return null;let t,i,r;return Array.isArray(e),e.forEach(s=>{s.constructor===Lb?t=s:function(n){return Object.getPrototypeOf(n.constructor)===lp}(s)?i=s:r=s}),r||i||t||null}function PM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const Vb="VALID",RM="INVALID",Hm="PENDING",jb="DISABLED";function ok(n){return(lk(n)?n.validators:n)||null}function U$(n){return Array.isArray(n)?ZR(n):n||null}function ak(n,e){return(lk(e)?e.asyncValidators:n)||null}function z$(n){return Array.isArray(n)?QR(n):n||null}function lk(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}class ck{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=U$(this._rawValidators),this._composedAsyncValidatorFn=z$(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===Vb}get invalid(){return this.status===RM}get pending(){return this.status==Hm}get disabled(){return this.status===jb}get enabled(){return this.status!==jb}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=U$(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=z$(e)}addValidators(e){this.setValidators(R$(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(R$(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(k$(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(k$(e,this._rawAsyncValidators))}hasValidator(e){return xM(this._rawValidators,e)}hasAsyncValidator(e){return xM(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Hm,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=jb,this.errors=null,this._forEachChild(i=>{i.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(i=>i(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Vb,this._forEachChild(i=>{i.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Vb||this.status===Hm)&&this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?jb:Vb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Hm,this._hasOwnPendingAsyncValidator=!0;const t=S$(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(i=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(i,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(n,e,t){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=n;return e.forEach(r=>{i=i instanceof uk?i.controls.hasOwnProperty(r)?i.controls[r]:null:i instanceof $Se&&i.at(r)||null}),i}(this,e)}getError(e,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Pe,this.statusChanges=new Pe}_calculateStatus(){return this._allControlsDisabled()?jb:this.errors?RM:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Hm)?Hm:this._anyControlsHaveStatus(RM)?RM:Vb}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){lk(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class vh extends ck{constructor(e=null,t,i){super(ok(t),ak(i,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(i=>i(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){PM(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){PM(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class uk extends ck{constructor(e,t,i){super(ok(t),ak(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t instanceof vh?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>!!i._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error(`Cannot find form control with name: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const i=this.controls[t];if(this.contains(t)&&e(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,i)=>((t.enabled||this.disabled)&&(e[i]=t.value),e))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class $Se extends ck{constructor(e,t,i){super(ok(t),ak(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,i={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((i,r)=>{this._throwIfControlMissing(r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof vh?e.value:e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce((t,i)=>!!i._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error(`Cannot find form control at index ${e}`)}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const GSe={provide:Do,useExisting:T(()=>cp)},Ub=(()=>Promise.resolve(null))();let cp=(()=>{class n extends Do{constructor(t,i){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Pe,this.form=new uk({},ZR(t),QR(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){Ub.then(()=>{const i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),Bb(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){Ub.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name),PM(this._directives,t)})}addFormGroup(t){Ub.then(()=>{const i=this._findContainer(t.path),r=new uk({});V$(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){Ub.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){Ub.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,j$(this.form,this._directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10))},n.\u0275dir=he({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,i){1&t&&ye("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[At([GSe]),ht]}),n})();const qSe={provide:lc,useExisting:T(()=>dk)},W$=(()=>Promise.resolve(null))();let dk=(()=>{class n extends lc{constructor(t,i,r,s){super(),this.control=new vh,this._registered=!1,this.update=new Pe,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=sk(0,s)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),rk(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(n,e){return[...e.path,n]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Bb(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){W$.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const i=t.isDisabled.currentValue,r=""===i||i&&"false"!==i;W$.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable()})}}return n.\u0275fac=function(t){return new(t||n)(E(Do,9),E(ws,10),E(_h,10),E(Ao,10))},n.\u0275dir=he({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[At([qSe]),ht,qn]}),n})(),X$=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const hk=new _e("NgModelWithFormControlWarning"),QSe={provide:lc,useExisting:T(()=>kM)};let kM=(()=>{class n extends lc{constructor(t,i,r,s){super(),this._ngModelWarningConfig=s,this.update=new Pe,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=sk(0,r)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const i=t.form.previousValue;i&&DM(i,this,!1),Bb(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}rk(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&DM(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_isControlChanged(t){return t.hasOwnProperty("form")}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10),E(Ao,10),E(hk,8))},n.\u0275dir=he({type:n,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[At([QSe]),ht,qn]}),n._ngModelWarningSentOnce=!1,n})();const JSe={provide:Do,useExisting:T(()=>$m)};let $m=(()=>{class n extends Do{constructor(t,i){super(),this.validators=t,this.asyncValidators=i,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Pe,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(IM(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const i=this.form.get(t.path);return Bb(i,t),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}removeControl(t){DM(t.control||null,t,!1),PM(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this.submitted=!0,j$(this.form,this.directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const i=t.control,r=this.form.get(t.path);i!==r&&(DM(i||null,t),r instanceof vh&&(Bb(r,t),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const i=this.form.get(t.path);V$(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const i=this.form.get(t.path);i&&function(n,e){return IM(n,e)}(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){ik(this.form,this),this._oldForm&&IM(this._oldForm,this)}_checkFormPresent(){}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10))},n.\u0275dir=he({type:n,selectors:[["","formGroup",""]],hostBindings:function(t,i){1&t&&ye("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[At([JSe]),ht,qn]}),n})(),uG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[X$]]}),n})(),yk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[uG]}),n})(),vk=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:hk,useValue:t.warnOnNgModelWithFormControl}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[uG]}),n})();function zb(n){return new oe(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?li(t):fE()).subscribe(e)})}function bk(n,e=Tf){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new yMe(i,e))}class yMe{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new Ck(e,this.delay,this.scheduler))}}class Ck extends Rt{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(Ck.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new vMe(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(qo.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(qo.createComplete()),this.unsubscribe()}}class vMe{constructor(e,t){this.time=e,this.notification=t}}const pG=Yg({passive:!0});let gG=(()=>{class n{constructor(t,i){this._platform=t,this._ngZone=i,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return Ql;const i=Hu(t),r=this._monitoredElements.get(i);if(r)return r.subject;const s=new we,o="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||i.classList.contains(o)?"cdk-text-field-autofill-end"===l.animationName&&i.classList.contains(o)&&(i.classList.remove(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!1}))):(i.classList.add(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{i.addEventListener("animationstart",a,pG),i.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(i,{subject:s,unlisten:()=>{i.removeEventListener("animationstart",a,pG)}}),s}stopMonitoring(t){const i=Hu(t),r=this._monitoredElements.get(i);r&&(r.unlisten(),r.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((t,i)=>this.stopMonitoring(i))}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt))},token:n,providedIn:"root"}),n})(),mG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Av]]}),n})();const NMe=new _e("MAT_INPUT_VALUE_ACCESSOR"),LMe=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let BMe=0;const VMe=CO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let Hb=(()=>{class n extends VMe{constructor(t,i,r,s,o,a,l,c,d,f){super(a,s,o,r),this._elementRef=t,this._platform=i,this._autofillMonitor=c,this._formField=f,this._uid="mat-input-"+BMe++,this.focused=!1,this.stateChanges=new we,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._required=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(_=>Q3().has(_));const p=this._elementRef.nativeElement,g=p.nodeName.toLowerCase();this._inputValueAccessor=l||p,this._previousNativeValue=this.value,this.id=this.id,i.IOS&&d.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",_=>{const y=_.target;!y.value&&0===y.selectionStart&&0===y.selectionEnd&&(y.setSelectionRange(1,1),y.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===g,this._isTextarea="textarea"===g,this._isInFormField=!!f,this._isNativeSelect&&(this.controlType=p.multiple?"mat-native-select-multiple":"mat-native-select")}get disabled(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Dt(t),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(t){this._id=t||this._uid}get required(){return this._required}set required(t){this._required=Dt(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&Q3().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(t){t!==this.value&&(this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=Dt(t)}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}ngDoCheck(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}_focusChanged(t){t!==this.focused&&(this.focused=t,this.stateChanges.next())}_onInput(){}_dirtyCheckPlaceholder(){var t,i;const r=(null===(i=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===i?void 0:i.call(t))?null:this.placeholder;if(r!==this._previousPlaceholder){const s=this._elementRef.nativeElement;this._previousPlaceholder=r,r?s.setAttribute("placeholder",r):s.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){LMe.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const t=this._elementRef.nativeElement,i=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&i&&i.label)}return this.focused||!this.empty}setDescribedByIds(t){t.length?this._elementRef.nativeElement.setAttribute("aria-describedby",t.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(ii),E(lc,10),E(cp,8),E($m,8),E(kv),E(NMe,10),E(gG),E(lt),E(XE,8))},n.\u0275dir=he({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:9,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&t&&(sl("disabled",i.disabled)("required",i.required),en("id",i.id)("data-placeholder",i.placeholder)("readonly",i.readonly&&!i._isNativeSelect||null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required),at("mat-input-server",i._isServer))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[At([{provide:Nv,useExisting:n}]),ht,qn]}),n})(),$b=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[kv],imports:[[mG,Lv,Nn],mG,Lv]}),n})();function lr(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>be(function(n,e){return i=>{let r=i;for(let s=0;si.lift(new $Me(n,e,t.leading,t.trailing))}class $Me{constructor(e,t,i,r){this.duration=e,this.scheduler=t,this.leading=i,this.trailing=r}call(e,t){return t.subscribe(new GMe(e,this.duration,this.scheduler,this.leading,this.trailing))}}class GMe extends Rt{constructor(e,t,i,r,s){super(e),this.duration=t,this.scheduler=i,this.leading=r,this.trailing=s,this._hasTrailingValue=!1,this._trailingValue=null}_next(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(WMe,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)}}function WMe(n){const{subscriber:e}=n;e.clearThrottle()}var vG=Ve(266);const qMe={tooltipState:Jl("state",[br("initial, void, hidden",Kn({opacity:0,transform:"scale(0)"})),br("visible",Kn({transform:"scale(1)"})),Qs("* => visible",Mo("200ms cubic-bezier(0, 0, 0.2, 1)",kne([Kn({opacity:0,transform:"scale(0)",offset:0}),Kn({opacity:.5,transform:"scale(0.99)",offset:.5}),Kn({opacity:1,transform:"scale(1)",offset:1})]))),Qs("* => hidden",Mo("100ms cubic-bezier(0, 0, 0.2, 1)",Kn({opacity:0})))])},bG="tooltip-panel",CG=Yg({passive:!0}),wG=new _e("mat-tooltip-scroll-strategy"),ZMe={provide:wG,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition({scrollThrottle:20})}},QMe=new _e("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let e1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p,g){this._overlay=t,this._elementRef=i,this._scrollDispatcher=r,this._viewContainerRef=s,this._ngZone=o,this._platform=a,this._ariaDescriber=l,this._focusMonitor=c,this._dir=f,this._defaultOptions=p,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new we,this._handleKeydown=_=>{this._isTooltipVisible()&&27===_.keyCode&&!Yo(_)&&(_.preventDefault(),_.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=d,this._document=g,p&&(p.position&&(this.position=p.position),p.touchGestures&&(this.touchGestures=p.touchGestures)),f.change.pipe(zn(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),o.runOutsideAngular(()=>{i.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var i;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(i=this._tooltipInstance)||void 0===i||i.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}get message(){return this._message}set message(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")})}))}get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(zn(this._destroyed)).subscribe(t=>{t?"keyboard"===t&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const t=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),t.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(([i,r])=>{t.removeEventListener(i,r,CG)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay){if(this.disabled||!this.message||this._isTooltipVisible()&&!this._tooltipInstance._showTimeoutId&&!this._tooltipInstance._hideTimeoutId)return;const i=this._createOverlay();this._detach(),this._portal=this._portal||new sm(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=i.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(zn(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}hide(t=this.hideDelay){this._tooltipInstance&&this._tooltipInstance.hide(t)}toggle(){this._isTooltipVisible()?this.hide():this.show()}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(){if(this._overlayRef)return this._overlayRef;const t=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),i=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return i.positionChanges.pipe(zn(this._destroyed)).subscribe(r=>{this._updateCurrentPositionClass(r.connectionPair),this._tooltipInstance&&r.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:i,panelClass:`${this._cssClassPrefix}-${bG}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(zn(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(zn(this._destroyed)).subscribe(()=>{var r;return null===(r=this._tooltipInstance)||void 0===r?void 0:r._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const i=t.getConfig().positionStrategy,r=this._getOrigin(),s=this._getOverlayPosition();i.withPositions([this._addOffset(Object.assign(Object.assign({},r.main),s.main)),this._addOffset(Object.assign(Object.assign({},r.fallback),s.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i||"below"==i?r={originX:"center",originY:"above"==i?"top":"bottom"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={originX:"start",originY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={originX:"end",originY:"center"});const{x:s,y:o}=this._invertPosition(r.originX,r.originY);return{main:r,fallback:{originX:s,originY:o}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i?r={overlayX:"center",overlayY:"bottom"}:"below"==i?r={overlayX:"center",overlayY:"top"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={overlayX:"end",overlayY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={overlayX:"start",overlayY:"center"});const{x:s,y:o}=this._invertPosition(r.overlayX,r.overlayY);return{main:r,fallback:{overlayX:s,overlayY:o}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(_i(1),zn(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,i){return"above"===this.position||"below"===this.position?"top"===i?i="bottom":"bottom"===i&&(i="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:i}}_updateCurrentPositionClass(t){const{overlayY:i,originX:r,originY:s}=t;let o;if(o="center"===i?this._dir&&"rtl"===this._dir.value?"end"===r?"left":"right":"start"===r?"left":"right":"bottom"===i&&"top"===s?"above":"below",o!==this._currentPosition){const a=this._overlayRef;if(a){const l=`${this._cssClassPrefix}-${bG}-`;a.removePanelClass(l+this._currentPosition),a.addPanelClass(l+o)}this._currentPosition=o}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",()=>{this._setupPointerExitEventsIfNeeded(),this.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",()=>{this._setupPointerExitEventsIfNeeded(),clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>this.show(),500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",()=>this.hide()],["wheel",i=>this._wheelListener(i)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const i=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",i],["touchcancel",i])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([i,r])=>{this._elementRef.nativeElement.addEventListener(i,r,CG)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const i=this._document.elementFromPoint(t.clientX,t.clientY),r=this._elementRef.nativeElement;i!==r&&!r.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const i=this._elementRef.nativeElement,r=i.style;("on"===t||"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName)&&(r.userSelect=r.msUserSelect=r.webkitUserSelect=r.MozUserSelect="none"),("on"===t||!i.draggable)&&(r.webkitUserDrag="none"),r.touchAction="none",r.webkitTapHighlightColor="transparent"}}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(nt),E(rm),E(es),E(lt),E(ii),E(iV),E(hl),E(void 0),E(Ko),E(void 0),E(rt))},n.\u0275dir=he({type:n,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),n})(),cc=(()=>{class n extends e1e{constructor(t,i,r,s,o,a,l,c,d,f,p,g){super(t,i,r,s,o,a,l,c,d,f,p,g),this._tooltipComponent=n1e}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(nt),E(rm),E(es),E(lt),E(ii),E(iV),E(hl),E(wG),E(Ko,8),E(QMe,8),E(rt))},n.\u0275dir=he({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[ht]}),n})(),t1e=(()=>{class n{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new we}show(t){clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(()=>{this._visibility="visible",this._showTimeoutId=void 0,this._onShow(),this._markForCheck()},t)}hide(t){clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._visibility="hidden",this._hideTimeoutId=void 0,this._markForCheck()},t)}afterHidden(){return this._onHide}isVisible(){return"visible"===this._visibility}ngOnDestroy(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}_animationStart(){this._closeOnInteraction=!1}_animationDone(t){const i=t.toState;"hidden"===i&&!this.isVisible()&&this._onHide.next(),("visible"===i||"hidden"===i)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return n.\u0275fac=function(t){return new(t||n)(E(Un))},n.\u0275dir=he({type:n}),n})(),n1e=(()=>{class n extends t1e{constructor(t,i){super(t),this._breakpointObserver=i,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return n.\u0275fac=function(t){return new(t||n)(E(Un),E(kO))},n.\u0275cmp=Le({type:n,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,i){2&t&&gf("zoom","visible"===i._visibility?1:null)},features:[ht],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,i){if(1&t&&(F(0,"div",0),ye("@state.start",function(){return i._animationStart()})("@state.done",function(s){return i._animationDone(s)}),yn(1,"async"),Te(2),N()),2&t){let r;at("mat-tooltip-handset",null==(r=wn(1,5,i._isHandset))?null:r.matches),ie("ngClass",i.tooltipClass)("@state",i._visibility),Y(2),Ai(i.message)}},directives:[sE],pipes:[zu],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[qMe.tooltipState]},changeDetection:0}),n})(),uc=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[ZMe],imports:[[Ine,bn,$v,Nn],Nn,zv]}),n})();const i1e=["sliderWrapper"],yl=Yg({passive:!1}),l1e={provide:Ao,useExisting:T(()=>wk),multi:!0};class c1e{}const u1e=Nf(kf(em(class{constructor(n){this._elementRef=n}}),"accent"));let wk=(()=>{class n extends u1e{constructor(t,i,r,s,o,a,l,c){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this._dir=s,this._ngZone=a,this._animationMode=c,this._invert=!1,this._max=100,this._min=0,this._step=1,this._thumbLabel=!1,this._tickInterval=0,this._value=null,this._vertical=!1,this.change=new Pe,this.input=new Pe,this.valueChange=new Pe,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=Ie.EMPTY,this._pointerDown=d=>{this.disabled||this._isSliding||!Gb(d)&&0!==d.button||this._ngZone.run(()=>{this._touchId=Gb(d)?function(n,e){for(let t=0;t{if("pointer"===this._isSliding){const f=EG(d,this._touchId);if(f){d.preventDefault();const p=this.value;this._lastPointerEvent=d,this._updateValueFromPosition(f),p!=this.value&&this._emitInputEvent()}}},this._pointerUp=d=>{"pointer"===this._isSliding&&(!Gb(d)||"number"!=typeof this._touchId||Ek(d.changedTouches,this._touchId))&&(d.preventDefault(),this._removeGlobalEvents(),this._isSliding=null,this._touchId=void 0,this._valueOnSlideStart!=this.value&&!this.disabled&&this._emitChangeEvent(),this._valueOnSlideStart=this._lastPointerEvent=null)},this._windowBlur=()=>{this._lastPointerEvent&&this._pointerUp(this._lastPointerEvent)},this._document=l,this.tabIndex=parseInt(o)||0,a.runOutsideAngular(()=>{const d=t.nativeElement;d.addEventListener("mousedown",this._pointerDown,yl),d.addEventListener("touchstart",this._pointerDown,yl)})}get invert(){return this._invert}set invert(t){this._invert=Dt(t)}get max(){return this._max}set max(t){this._max=So(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=So(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=So(t,this._step),this._step%1!=0&&(this._roundToDecimal=this._step.toString().split(".").pop().length),this._changeDetectorRef.markForCheck()}get thumbLabel(){return this._thumbLabel}set thumbLabel(t){this._thumbLabel=Dt(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?So(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let i=So(t,0);this._roundToDecimal&&i!==this.min&&i!==this.max&&(i=parseFloat(i.toFixed(this._roundToDecimal))),this._value=i,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=Dt(t)}get displayValue(){return this.displayWith?this.displayWith(this.value):this._roundToDecimal&&this.value&&this.value%1!=0?this.value.toFixed(this._roundToDecimal):this.value||0}focus(t){this._focusHostElement(t)}blur(){this._blurHostElement()}get percent(){return this._clamp(this._percent)}_shouldInvertAxis(){return this.vertical?!this.invert:this.invert}_isMinValue(){return 0===this.percent}_getThumbGap(){return this.disabled?7:this._isMinValue()&&!this.thumbLabel?this._isActive?10:7:0}_getTrackBackgroundStyles(){const i=this.vertical?`1, ${1-this.percent}, 1`:1-this.percent+", 1, 1";return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"-":""}${this._getThumbGap()}px) scale3d(${i})`}}_getTrackFillStyles(){const t=this.percent,r=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${r})`,display:0===t?"none":""}}_getTicksContainerStyles(){return{transform:`translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"-":""}${this._tickIntervalPercent/2*100}%)`}}_getTicksStyles(){let t=100*this._tickIntervalPercent,a={backgroundSize:this.vertical?`2px ${t}%`:`${t}% 2px`,transform:`translateZ(0) translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"":"-"}${t/2}%)${this.vertical||"rtl"!=this._getDirection()?"":" rotate(180deg)"}`};if(this._isMinValue()&&this._getThumbGap()){const l=this._shouldInvertAxis();let c;c=this.vertical?l?"Bottom":"Top":l?"Right":"Left",a[`padding${c}`]=`${this._getThumbGap()}px`}return a}_getThumbContainerStyles(){const t=this._shouldInvertAxis();return{transform:`translate${this.vertical?"Y":"X"}(-${100*(("rtl"!=this._getDirection()||this.vertical?t:!t)?this.percent:1-this.percent)}%)`}}_shouldInvertMouseCoords(){const t=this._shouldInvertAxis();return"rtl"!=this._getDirection()||this.vertical?t:!t}_getDirection(){return this._dir&&"rtl"==this._dir.value?"rtl":"ltr"}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{this._isActive=!!t&&"keyboard"!==t,this._changeDetectorRef.detectChanges()}),this._dir&&(this._dirChangeSubscription=this._dir.change.subscribe(()=>{this._changeDetectorRef.markForCheck()}))}ngOnDestroy(){const t=this._elementRef.nativeElement;t.removeEventListener("mousedown",this._pointerDown,yl),t.removeEventListener("touchstart",this._pointerDown,yl),this._lastPointerEvent=null,this._removeGlobalEvents(),this._focusMonitor.stopMonitoring(this._elementRef),this._dirChangeSubscription.unsubscribe()}_onMouseenter(){this.disabled||(this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent())}_onFocus(){this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent()}_onBlur(){this.onTouched()}_onKeydown(t){if(this.disabled||Yo(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const i=this.value;switch(t.keyCode){case 33:this._increment(10);break;case 34:this._increment(-10);break;case 35:this.value=this.max;break;case 36:this.value=this.min;break;case 37:this._increment("rtl"==this._getDirection()?1:-1);break;case 38:this._increment(1);break;case 39:this._increment("rtl"==this._getDirection()?-1:1);break;case 40:this._increment(-1);break;default:return}i!=this.value&&(this._emitInputEvent(),this._emitChangeEvent()),this._isSliding="keyboard",t.preventDefault()}_onKeyup(){"keyboard"===this._isSliding&&(this._isSliding=null)}_getWindow(){return this._document.defaultView||window}_bindGlobalEvents(t){const i=this._document,r=Gb(t),o=r?"touchend":"mouseup";i.addEventListener(r?"touchmove":"mousemove",this._pointerMove,yl),i.addEventListener(o,this._pointerUp,yl),r&&i.addEventListener("touchcancel",this._pointerUp,yl);const a=this._getWindow();void 0!==a&&a&&a.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,yl),t.removeEventListener("mouseup",this._pointerUp,yl),t.removeEventListener("touchmove",this._pointerMove,yl),t.removeEventListener("touchend",this._pointerUp,yl),t.removeEventListener("touchcancel",this._pointerUp,yl);const i=this._getWindow();void 0!==i&&i&&i.removeEventListener("blur",this._windowBlur)}_increment(t){this.value=this._clamp((this.value||0)+this.step*t,this.min,this.max)}_updateValueFromPosition(t){if(!this._sliderDimensions)return;let o=this._clamp(((this.vertical?t.y:t.x)-(this.vertical?this._sliderDimensions.top:this._sliderDimensions.left))/(this.vertical?this._sliderDimensions.height:this._sliderDimensions.width));if(this._shouldInvertMouseCoords()&&(o=1-o),0===o)this.value=this.min;else if(1===o)this.value=this.max;else{const a=this._calculateValue(o),l=Math.round((a-this.min)/this.step)*this.step+this.min;this.value=this._clamp(l,this.min,this.max)}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.value),this.valueChange.emit(this.value),this.change.emit(this._createChangeEvent())}_emitInputEvent(){this.input.emit(this._createChangeEvent())}_updateTickIntervalPercent(){if(this.tickInterval&&this._sliderDimensions)if("auto"==this.tickInterval){let t=this.vertical?this._sliderDimensions.height:this._sliderDimensions.width,s=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=s/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let i=new c1e;return i.source=this,i.value=t,i}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,i=0,r=1){return Math.max(i,Math.min(t,r))}_getSliderDimensions(){return this._sliderWrapper?this._sliderWrapper.nativeElement.getBoundingClientRect():null}_focusHostElement(t){this._elementRef.nativeElement.focus(t)}_blurHostElement(){this._elementRef.nativeElement.blur()}writeValue(t){this.value=t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Un),E(Ko,8),fs("tabindex"),E(lt),E(rt),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-slider"]],viewQuery:function(t,i){if(1&t&&ni(i1e,5),2&t){let r;Mt(r=xt())&&(i._sliderWrapper=r.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()})("keydown",function(s){return i._onKeydown(s)})("keyup",function(){return i._onKeyup()})("mouseenter",function(){return i._onMouseenter()})("selectstart",function(s){return s.preventDefault()}),2&t&&(sl("tabIndex",i.tabIndex),en("aria-disabled",i.disabled)("aria-valuemax",i.max)("aria-valuemin",i.min)("aria-valuenow",i.value)("aria-valuetext",null==i.valueText?i.displayValue:i.valueText)("aria-orientation",i.vertical?"vertical":"horizontal"),at("mat-slider-disabled",i.disabled)("mat-slider-has-ticks",i.tickInterval)("mat-slider-horizontal",!i.vertical)("mat-slider-axis-inverted",i._shouldInvertAxis())("mat-slider-invert-mouse-coords",i._shouldInvertMouseCoords())("mat-slider-sliding",i._isSliding)("mat-slider-thumb-label-showing",i.thumbLabel)("mat-slider-vertical",i.vertical)("mat-slider-min-value",i._isMinValue())("mat-slider-hide-last-tick",i.disabled||i._isMinValue()&&i._getThumbGap()&&i._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{disabled:"disabled",color:"color",tabIndex:"tabIndex",invert:"invert",max:"max",min:"min",step:"step",thumbLabel:"thumbLabel",tickInterval:"tickInterval",value:"value",vertical:"vertical",displayWith:"displayWith",valueText:"valueText"},outputs:{change:"change",input:"input",valueChange:"valueChange"},exportAs:["matSlider"],features:[At([l1e]),ht],decls:13,vars:6,consts:[[1,"mat-slider-wrapper"],["sliderWrapper",""],[1,"mat-slider-track-wrapper"],[1,"mat-slider-track-background",3,"ngStyle"],[1,"mat-slider-track-fill",3,"ngStyle"],[1,"mat-slider-ticks-container",3,"ngStyle"],[1,"mat-slider-ticks",3,"ngStyle"],[1,"mat-slider-thumb-container",3,"ngStyle"],[1,"mat-slider-focus-ring"],[1,"mat-slider-thumb"],[1,"mat-slider-thumb-label"],[1,"mat-slider-thumb-label-text"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"div",2),et(3,"div",3),et(4,"div",4),N(),F(5,"div",5),et(6,"div",6),N(),F(7,"div",7),et(8,"div",8),et(9,"div",9),F(10,"div",10),F(11,"span",11),Te(12),N(),N(),N(),N()),2&t&&(Y(3),ie("ngStyle",i._getTrackBackgroundStyles()),Y(1),ie("ngStyle",i._getTrackFillStyles()),Y(1),ie("ngStyle",i._getTicksContainerStyles()),Y(1),ie("ngStyle",i._getTicksStyles()),Y(1),ie("ngStyle",i._getThumbContainerStyles()),Y(5),Ai(i.displayValue))},directives:[M3],styles:['.mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:"";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n'],encapsulation:2,changeDetection:0}),n})();function Gb(n){return"t"===n.type[0]}function EG(n,e){let t;return t=Gb(n)?"number"==typeof e?Ek(n.touches,e)||Ek(n.changedTouches,e):n.touches[0]||n.changedTouches[0]:n,t?{x:t.clientX,y:t.clientY}:void 0}function Ek(n,e){for(let t=0;t{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn],Nn]}),n})();function h1e(n,e){}class Sk{constructor(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.maxWidth="80vw",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.autoFocus=!0,this.restoreFocus=!0,this.closeOnNavigation=!0}}const f1e={dialogContainer:Jl("dialogContainer",[br("void, exit",Kn({opacity:0,transform:"scale(0.7)"})),br("enter",Kn({transform:"none"})),Qs("* => enter",Mo("150ms cubic-bezier(0, 0, 0.2, 1)",Kn({transform:"none",opacity:1}))),Qs("* => void, * => exit",Mo("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",Kn({opacity:0})))])};let p1e=(()=>{class n extends nS{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new Pe,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_initializeWithAttachedContent(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()}attachComponentPortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(t)}_recaptureFocus(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()}_trapFocus(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()}_restoreFocus(){const t=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&t&&"function"==typeof t.focus){const i=vE(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_setupFocusTrap(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)}_capturePreviouslyFocusedElement(){this._document&&(this._elementFocusedBeforeDialogWasOpened=vE())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=vE();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(dV),E(Un),E(rt,8),E(Sk),E(hl))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&ni(zf,7),2&t){let r;Mt(r=xt())&&(i._portalOutlet=r.first)}},features:[ht]}),n})(),g1e=(()=>{class n extends p1e{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275cmp=Le({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&qy("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(sl("id",i._id),en("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),Sg("@dialogContainer",i._state))},features:[ht],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&Ct(0,h1e,0,0,"ng-template",0)},directives:[zf],styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[f1e.dialogContainer]}}),n})(),m1e=0;class Gm{constructor(e,t,i="mat-dialog-"+m1e++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new we,this._afterClosed=new we,this._beforeClosed=new we,this._state=0,t._id=i,t._animationStateChanged.pipe(Tn(r=>"opened"===r.state),_i(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Tn(r=>"closed"===r.state),_i(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Tn(r=>27===r.keyCode&&!this.disableClose&&!Yo(r))).subscribe(r=>{r.preventDefault(),Mk(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():Mk(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Tn(t=>"closing"===t.state),_i(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.totalTime+100)}),this._state=1,this._containerInstance._startExitAnimation()}afterOpened(){return this._afterOpened}afterClosed(){return this._afterClosed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._overlayRef.backdropClick()}keydownEvents(){return this._overlayRef.keydownEvents()}updatePosition(e){let t=this._getPositionStrategy();return e&&(e.left||e.right)?e.left?t.left(e.left):t.right(e.right):t.centerHorizontally(),e&&(e.top||e.bottom)?e.top?t.top(e.top):t.bottom(e.bottom):t.centerVertically(),this._overlayRef.updatePosition(),this}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function Mk(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const xk=new _e("MatDialogData"),_1e=new _e("mat-dialog-default-options"),MG=new _e("mat-dialog-scroll-strategy"),v1e={provide:MG,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.block()}};let b1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=d,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new we,this._afterOpenedAtThisLevel=new we,this._ariaHiddenElements=new Map,this.afterAllClosed=zb(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(ns(void 0))),this._scrollStrategy=a}get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){const t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}open(t,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new Sk)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new Hv({positionStrategy:this._overlay.position().global(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,disposeOnNavigation:t.closeOnNavigation});return t.backdropClass&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Tt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:Sk,useValue:i}]}),o=new sm(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Xs)i.attachTemplatePortal(new Uf(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new sm(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Ko,null,vt.Optional))&&o.push({provide:Ko,useValue:{value:t.direction,change:st()}}),Tt.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Tt),E(void 0),E(void 0),E(om),E(void 0),E(Su),E(Su),E(_e))},n.\u0275dir=he({type:n}),n})(),Wm=(()=>{class n extends b1e{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,Gm,g1e,xk)}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(Tt),I(Ug,8),I(_1e,8),I(MG),I(n,12),I(om))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),w1e=0,xG=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+w1e++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.id):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{const t=this._dialogRef._containerInstance;t&&!t._ariaLabelledBy&&(t._ariaLabelledBy=this.id)})}}return n.\u0275fac=function(t){return new(t||n)(E(Gm,8),E(nt),E(Wm))},n.\u0275dir=he({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&sl("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),TG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();let Tk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[Wm,v1e],imports:[[$v,iS,Nn],Nn]}),n})();const Ak=new _e("CdkAccordion");let M1e=0,T1e=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=Ie.EMPTY,this.closed=new Pe,this.opened=new Pe,this.destroyed=new Pe,this.expandedChange=new Pe,this.id="cdk-accordion-child-"+M1e++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=Dt(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ak,12),E(Un),E(tS))},n.\u0275dir=he({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[At([{provide:Ak,useValue:void 0}])]}),n})(),A1e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const D1e=["body"];function O1e(n,e){}const I1e=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],P1e=["mat-expansion-panel-header","*","mat-action-row"];function R1e(n,e){1&n&&et(0,"span",2),2&n&&ie("@indicatorRotate",bt()._getExpandedState())}const k1e=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],F1e=["mat-panel-title","mat-panel-description","*"],Dk=new _e("MAT_ACCORDION"),DG="225ms cubic-bezier(0.4,0.0,0.2,1)",OG={indicatorRotate:Jl("indicatorRotate",[br("collapsed, void",Kn({transform:"rotate(0deg)"})),br("expanded",Kn({transform:"rotate(180deg)"})),Qs("expanded <=> collapsed, void => collapsed",Mo(DG))]),bodyExpansion:Jl("bodyExpansion",[br("collapsed, void",Kn({height:"0px",visibility:"hidden"})),br("expanded",Kn({height:"*",visibility:"visible"})),Qs("expanded <=> collapsed, void => collapsed",Mo(DG))])};let N1e=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(E(Xs))},n.\u0275dir=he({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),L1e=0;const IG=new _e("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let NM=(()=>{class n extends T1e{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new Pe,this.afterCollapse=new Pe,this._inputChanges=new we,this._headerId="mat-expansion-panel-header-"+L1e++,this._bodyAnimationDone=new we,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(Xo((c,d)=>c.fromState===d.fromState&&c.toState===d.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=Dt(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe(ns(null),Tn(()=>this.expanded&&!this._portal),_i(1)).subscribe(()=>{this._portal=new Uf(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(E(Dk,12),E(Un),E(tS),E(es),E(rt),E(Zo,8),E(IG,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,N1e,5),2&t){let s;Mt(s=xt())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&ni(D1e,5),2&t){let r;Mt(r=xt())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&at("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[At([{provide:Dk,useValue:void 0}]),ht,qn],ngContentSelectors:P1e,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,i){1&t&&(Dr(I1e),In(0),F(1,"div",0,1),ye("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),F(3,"div",2),In(4,1),Ct(5,O1e,0,0,"ng-template",3),N(),In(6,2),N()),2&t&&(Y(1),ie("@bodyExpansion",i._getExpandedState())("id",i.id),en("aria-labelledby",i._headerId),Y(4),ie("cdkPortalOutlet",i._portal))},directives:[zf],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[OG.bodyExpansion]},changeDetection:0}),n})();class V1e{}const j1e=Nf(V1e);let LM=(()=>{class n extends j1e{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=Ie.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Tn(d=>!(!d.hideToggle&&!d.togglePosition))):Ql;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=ki(t.opened,t.closed,c,t._inputChanges.pipe(Tn(d=>!!(d.hideToggle||d.disabled||d.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Tn(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case 32:case 13:Yo(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return n.\u0275fac=function(t){return new(t||n)(E(NM,1),E(nt),E(hl),E(Un),E(IG,8),E(Zo,8),fs("tabindex"))},n.\u0275cmp=Le({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&ye("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(en("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),gf("height",i._getHeaderHeight()),at("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[ht],ngContentSelectors:F1e,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(Dr(k1e),F(0,"span",0),In(1),In(2,1),In(3,2),N(),Ct(4,R1e,1,1,"span",1)),2&t&&(Y(4),ie("ngIf",i._showToggle()))},directives:[Is],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[OG.indicatorRotate]},changeDetection:0}),n})(),PG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),n})(),Ok=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn,A1e,iS]]}),n})();var RG=Ve(478);Object.create(Error.prototype);const $1e=["*"];var VM=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(VM||(VM={})),VM))();class W1e{}const FG=new _e("SECURITY_CONTEXT");let Ik=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new RG.Renderer},this.options=s}get options(){return this._options}set options(t){this._options=Object.assign(Object.assign({},this.initialMarkedOptions),t)}get renderer(){return this.options.renderer}set renderer(t){this.options.renderer=t}compile(t,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=RG.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}getSource(t){if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(t,{responseType:"text"}).pipe(be(i=>this.handleExtension(t,i)))}highlight(t){if(xf(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!xf(this.platform))return t;if("undefined"==typeof katex||void 0===katex.renderToString)throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");return t.replace(/\$([^\s][^$]*?[^\s])\$/gm,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!xf(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!xf(this.platform))return t;if("undefined"==typeof joypixels||void 0===joypixels.shortnameToUnicode)throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(t)}trimIndentation(t){if(!t)return"";let i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(I(cl),I(FG),I(im,8),I(W1e,8),I(Kd))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),NG=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new Pe,this.load=new Pe,this.ready=new Pe,this._emoji=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1}get emoji(){return this._emoji}set emoji(t){this._emoji=this.coerceBooleanProperty(t)}get katex(){return this._katex}set katex(t){this._katex=this.coerceBooleanProperty(t)}get lineHighlight(){return this._lineHighlight}set lineHighlight(t){this._lineHighlight=this.coerceBooleanProperty(t)}get lineNumbers(){return this._lineNumbers}set lineNumbers(t){this._lineNumbers=this.coerceBooleanProperty(t)}ngOnChanges(){null==this.data?null==this.src||this.handleSrc():this.handleData()}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion()}render(t,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,this.handlePlugins(),this.markdownService.highlight(this.element.nativeElement),this.ready.emit()}coerceBooleanProperty(t){return null!=t&&"false"!=`${String(t)}`}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe(t=>{this.render(t),this.load.emit(t)},t=>this.error.emit(t))}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,VM.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;s{class n{static forRoot(t){return{ngModule:n,providers:[Ik,t&&t.loader||[],t&&t.markedOptions||[],{provide:FG,useValue:t&&null!=t.sanitize?t.sanitize:on.HTML}]}}static forChild(){return{ngModule:n}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function LG(n,e,t){return t?LG(n,e).pipe(be(i=>Fe(i)?t(...i):t(i))):new oe(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(ft(e))return()=>e(r,s)})}function jM(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new J1e(n,t))}}class J1e{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new exe(e,this.observables,this.project))}}class exe extends RU{constructor(e,t,i){super(e),this.observables=t,this.project=i,this.toRespond=[];const r=t.length;this.values=new Array(r);for(let s=0;s0){const s=r.indexOf(i);-1!==s&&r.splice(s,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}class txe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new nxe(e,this.accumulator,this.seed,this.hasSeed))}}class nxe extends Rt{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class sxe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new oxe(e,this.predicate))}}class oxe extends Rt{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const axe=["youtubeContainer"];let jG=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new we,this._destroyed=new we,this._playerChanges=new sr(void 0),this._videoId=new sr(void 0),this._height=new sr(390),this._width=new sr(640),this._startSeconds=new sr(void 0),this._endSeconds=new sr(void 0),this._suggestedQuality=new sr(void 0),this._playerVars=new sr(void 0),this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange"),this._isBrowser=xf(i)}get videoId(){return this._videoId.value}set videoId(t){this._videoId.next(t)}get height(){return this._height.value}set height(t){this._height.next(t||390)}get width(){return this._width.value}set width(t){this._width.next(t||640)}set startSeconds(t){this._startSeconds.next(t)}set endSeconds(t){this._endSeconds.next(t)}set suggestedQuality(t){this._suggestedQuality.next(t)}get playerVars(){return this._playerVars.value}set playerVars(t){this._playerVars.next(t)}ngOnInit(){if(!this._isBrowser)return;let t=st(!0);if(!window.YT||!window.YT.Player){const r=new we;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(_i(1),ns(!1))}const i=function(n,e,t,i,r,s,o){const a=or([e,s]).pipe(jM(or([i,r])),be(([l,c])=>{const[d,f]=l,[p,g]=c;return d?{videoId:d,playerVars:f,width:p,height:g}:void 0}));return or([n,a,st(o)]).pipe(function(n){return Er(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&Fe(n[0])&&(n=n[0].slice()),t=>t.lift.call(li([t,...n]),new NU(e))}(n),function(n){return e=>e.lift(new sxe(n))}(([e,t])=>!t),be(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new txe(n,e,t))}}(fxe,void 0),Xo())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Di(r=>{this._playerChanges.next(r)}),ci(e=>e?UG(e)?st(e):new oe(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{UG(r)||r.destroy()})(e)}}).pipe(_i(1),ns(void 0)):st(void 0)),zn(this._destroyed),pc(new we));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){or([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){or([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=or([t,i]).pipe(be(([d,f])=>({startSeconds:d,endSeconds:f}))),a=o.pipe(Rk(n,d=>!!d&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(d))),l=e.pipe(Rk(n,(d,f)=>!!d&&d.videoId!==f));ki(n.pipe(Rk(or([e,o]),([d,f],p)=>!(!p||d==p.videoId&&!f.startSeconds&&!f.endSeconds))),l,a).pipe(jM(or([n,e,o,r])),be(([d,f])=>f),zn(s)).subscribe(([d,f,p,g])=>{!f||!d||(d.videoId=f,d.cueVideoById(Object.assign({videoId:f,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.connect()}createEventsBoundInZone(){return{}}ngAfterViewInit(){this._youtubeContainer.next(this.youtubeContainer.nativeElement)}ngOnDestroy(){this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._videoId.complete(),this._height.complete(),this._width.complete(),this._startSeconds.complete(),this._endSeconds.complete(),this._suggestedQuality.complete(),this._youtubeContainer.complete(),this._playerVars.complete(),this._destroyed.next(),this._destroyed.complete()}playVideo(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}pauseVideo(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}stopVideo(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}seekTo(t,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}mute(){this._player?this._player.mute():this._getPendingState().muted=!0}unMute(){this._player?this._player.unMute():this._getPendingState().muted=!1}isMuted(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}setVolume(t){this._player?this._player.setVolume(t):this._getPendingState().volume=t}getVolume(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}setPlaybackRate(t){if(this._player)return this._player.setPlaybackRate(t);this._getPendingState().playbackRate=t}getPlaybackRate(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}getAvailablePlaybackRates(){return this._player?this._player.getAvailablePlaybackRates():[]}getVideoLoadedFraction(){return this._player?this._player.getVideoLoadedFraction():0}getPlayerState(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}getCurrentTime(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}getPlaybackQuality(){return this._player?this._player.getPlaybackQuality():"default"}getAvailableQualityLevels(){return this._player?this._player.getAvailableQualityLevels():[]}getDuration(){return this._player?this._player.getDuration():0}getVideoUrl(){return this._player?this._player.getVideoUrl():""}getVideoEmbedCode(){return this._player?this._player.getVideoEmbedCode():""}_getPendingState(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}_initializePlayer(t,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Ir(i=>i?LG(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):st()),i=>new oe(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),zn(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(E(lt),E(cl))},n.\u0275cmp=Le({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&ni(axe,5),2&t){let r;Mt(r=xt())&&(i.youtubeContainer=r.first)}},inputs:{videoId:"videoId",height:"height",width:"width",startSeconds:"startSeconds",endSeconds:"endSeconds",suggestedQuality:"suggestedQuality",playerVars:"playerVars",showBeforeIframeApiLoads:"showBeforeIframeApiLoads"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},decls:2,vars:0,consts:[["youtubeContainer",""]],template:function(t,i){1&t&&et(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function fxe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function UG(n){return"getPlayerStatus"in n}function Rk(n,e){return Er(jM(n),Tn(([t,i])=>e(i,t)),be(([t])=>t))}let mxe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function qb(n){return!0===n}function no(n){return null==n}function Pa(n){return!no(n)}function kk(n){return Boolean(n)}function $G(n){return no(n)?n:JSON.parse(JSON.stringify(n))}const zM=n=>{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&zM(n[o])}),n};function GG(n){return Pa(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const YG="NGXS_DATA_META",Nk="NGXS_META",XG="NGXS_ARGUMENT_REGISTRY_META";let KG=(()=>{class n{constructor(t){this.sequence$=new sr(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(I(ph,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function Yb(n){return n[YG]}let Ra=(()=>{class n{constructor(t,i,r){n.store=t.get(ph),n.ngZone=t.get(lt),n.factory=i,n.context=r,n.computed=t.get(KG)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(I(Tt),I(G6),I($6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class kr{constructor(){kr.statesCachedMeta.clear()}static createStateContext(e){return Ra.context.createStateContext(e)}static ensureMappedState(e){if(no(Ra.factory)||no(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(Pa(e.name)?kr.statesCachedMeta.get(e.name):null)||kr.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Yb(kr.getStateClassByInstance(e)))&&void 0!==t?t:null;if(no(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=kr.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=kr.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=Pa(e.name)?null===(t=Ra.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Pa(i)&&Pa(e.name)&&kr.statesCachedMeta.set(e.name,i),i}}kr.statesCachedMeta=new Map,kr.\u0275fac=function(e){return new(e||kr)},kr.\u0275prov=ae({token:kr,factory:kr.\u0275fac}),new Hg(1);class Vxe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Pa(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function ZG(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function QG(n){var e;const t=ZG(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=$G(void 0===t.defaults?{}:t.defaults);if(i.length){if(GG(s))return function(n,e){return e.reduce((t,i)=>{const r=ZG(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=QG(i),t},null!=n?n:{})}(s,i);throw new Vxe(s)}return s}function eW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function tW(){var n,e;return null!==(e=null===(n=null==Ra?void 0:Ra.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function Hxe(n){let e=!1;return Uv(n)&&(e=!0),e}function Lk(n){return n[XG]}class $xe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class Gxe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(kk(this.argumentMap.has(e))||kk(this.payloadMap.has(e)))throw new $xe(e,t)}}function Bk(n){return wo()?zM(n):n}function Kxe(n){return{enumerable:!0,configurable:!0,get(){const e=Yb(n),t=kr.ensureMappedState(e.stateMeta);return kr.createStateContext(t)}}}function Vk(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>wo()?zM(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}function ri(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(GG(i))for(;null!==i;){if(qb(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return no(eW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),eW(n)}(this),o=null==s?void 0:s.get(i);if(qb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(no(o)||o.sequenceId!==tW()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:tW(),isObservable:Hxe(l)}),l}return o.value},t}}const tTe={cancelUncompleted:!0,insideZone:!1};function Xt(n=tTe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=kr.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=Lk(r);if(no(f)){const C=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),x=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var C;return qb(n.insideZone)?null===(C=Ra.ngZone)||void 0===C||C.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Uv(l)?st(null).pipe(be(()=>l)):l};const v=kr.createAction(f,o,g),w=Ra.store.dispatch(v);return Uv(l)?function(n,e){return Bv([n,e]).pipe(be(t=>t.pop()))}(w,l):l},i}}function Es(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return no(Lk(t))&&Object.defineProperties(t,{[XG]:{enumerable:!0,configurable:!0,value:new Gxe}}),Lk(t)})(e,t).createPayloadType(r,t,i)}}function Ch(){return n=>{const e=function(n){if(function(n){return!kk(n)}(n.hasOwnProperty(Nk))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,Nk,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[Nk]}(n)}(n);if(no(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=Yb(n))&&void 0!==e?e:null;return(no(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,YG,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Yb(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>$G(t)},context:Kxe(n)})}(n,e,QG(n)),function(n){var e,t;const i=Yb(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(Pa(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Pa(this[s]))return this[s];if(no(Ra.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ra.store.select(n).pipe(be(o=>wo()?zM(o):o),Hc({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}var $M=(()=>(function(n){n.ID="id"}($M||($M={})),$M))(),Xb=(()=>(function(n){n.ASC="asc",n.DESC="desc"}(Xb||(Xb={})),Xb))();let jk=(()=>{class n{constructor(){this.browserStorageEvents$=new we,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),rTe=(()=>{class n extends jk{get snapshot(){return Bk(this.getState())}get ctx(){return Vk(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([Xt(),bs(0,Es("patchValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"patchState",null),De([Xt(),bs(0,Es("stateValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setState",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),n})(),sTe=(()=>{class n extends jk{constructor(){super(...arguments),this.primaryKey=$M.ID,this.comparator=null}get snapshot(){return Bk(this.getState())}get ids(){return this.snapshot.ids}get entities(){return this.snapshot.entities}get entitiesArray(){const t=this.snapshot;return t.ids.map(i=>t.entities[i])}get ids$(){return this.state$.pipe(be(t=>t.ids))}get entities$(){return this.state$.pipe(be(t=>t.entities))}get entitiesArray$(){return this.state$.pipe(be(t=>t.ids.map(i=>t.entities[i])))}get ctx(){return Vk(this.context)}setComparator(t){return this.comparator=t,this}dispatch(t){return this.ctx.dispatch(t)}getState(){return this.ctx.getState()}selectId(t){var i;return null===(i=t)||void 0===i?void 0:i[this.primaryKey]}selectOne(t){var i;return null!==(i=this.snapshot.entities[t])&&void 0!==i?i:null}selectAll(){const t=this.getState();return t.ids.map(i=>t.entities[i])}reset(){this.setEntitiesState(this.initialState),this.markAsDirtyAfterReset()}addOne(t){this.addEntityOne(t)}addMany(t){this.addEntitiesMany(t)}setOne(t){this.setEntityOne(t)}setMany(t){this.setEntitiesMany(t)}setAll(t){this.setEntitiesAll(t)}updateOne(t){this.updateEntitiesMany([t])}updateMany(t){this.updateEntitiesMany(t)}upsertOne(t){this.upsertEntitiesMany([t])}upsertMany(t){this.upsertEntitiesMany(t)}removeOne(t){this.removeEntitiesMany([t])}removeMany(t){this.removeEntitiesMany(t)}removeByEntity(t){const i=this.selectId(t);this.removeEntitiesMany([i])}removeByEntities(t){const i=[];for(const r of t){const s=this.selectId(r);i.push(s)}this.removeEntitiesMany(i)}removeAll(){this.setEntitiesState(this.initialState)}sort(t){this.comparator=null!=t?t:this.comparator,no(this.comparator)?console.warn("You must set the compare function before sorting."):this.setEntitiesState(this.getState())}addEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);r in i.entities||this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}addEntitiesMany(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities||a in r||(s.push(a),r[a]=o)}s.length&&this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,...s],entities:Object.assign(Object.assign({},i.entities),r)}))}setEntitiesAll(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in r||(s.push(a),r[a]=o)}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:s,entities:r}))}setEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);this.setEntitiesState(Object.assign(Object.assign({},i),r in i.entities?{entities:Object.assign(Object.assign({},i.entities),{[r]:t})}:{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}setEntitiesMany(t){for(const i of t)this.setEntityOne(i)}updateEntitiesMany(t){const i=this.getState(),r=t.filter(a=>a.id in i.entities);if(0===r.length)return;const s=this.generateKeyMap(i),o=Object.assign({},i.entities);for(const a of r){const l=this.updateOrigin(o,a),c=this.selectIdValue(l);c!==a.id&&(delete s[a.id],delete o[a.id]),s[a.id]=c,o[c]=l}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.map(a=>{var l;return null!==(l=s[a])&&void 0!==l?l:a}),entities:o}))}upsertEntitiesMany(t){const i=this.getState(),r=[],s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities?r.push({id:a,changes:o}):s.push(o)}this.updateMany(r),this.addMany(s)}removeEntitiesMany(t){const i=this.getState(),r=this.generateKeyMap(i),s=Object.assign({},i.entities);for(const o of t)o in s&&(delete r[o],delete s[o]);this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.filter(o=>o in r),entities:s}))}setEntitiesState(t){const i=this.sortKeysByComparator(t.ids,t.entities);this.ctx.setState(Object.assign(Object.assign({},t),{ids:i,entities:t.entities}))}sortKeysByComparator(t,i){if(no(this.comparator))return t;const r=t.slice(),s=this.comparator;return"function"==typeof s?r.sort((o,a)=>s(i[o],i[a])):this.sortByComparatorOptions(r,s,i)}sortByComparatorOptions(t,i,r){switch(null==i?void 0:i.sortByOrder){case Xb.ASC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?-1:0}(null==i?void 0:i.sortBy,r[s],r[o]));case Xb.DESC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?-1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?1:0}(null==i?void 0:i.sortBy,r[s],r[o]));default:return wo()&&console.warn(`Invalid --\x3e { sortByOrder: "${null==i?void 0:i.sortByOrder}" } not supported!`),t}}generateKeyMap(t){return t.ids.reduce((i,r)=>(i[r]=r,i),{})}updateOrigin(t,i){return Object.assign(Object.assign({},t[i.id]),i.changes)}selectIdValue(t){const i=this.selectId(t);return no(i)&&wo()&&console.warn(`The entity passed to the 'selectId' implementation returned ${i}.`,"You should probably provide your own 'selectId' implementation.","The entity that was passed:",t,"The current `selectId` implementation: (entity: V): K => entity.id"),i}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([ri(),Ge("design:type",Array),Ge("design:paramtypes",[])],n.prototype,"ids",null),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"entities",null),De([ri(),Ge("design:type",Array),Ge("design:paramtypes",[])],n.prototype,"entitiesArray",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"ids$",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"entities$",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"entitiesArray$",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"addOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"addMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"setMany",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"setAll",null),De([Xt(),bs(0,Es("update")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"updateOne",null),De([Xt(),bs(0,Es("updates")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"updateMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"upsertOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"upsertMany",null),De([Xt(),bs(0,Es("id")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"removeOne",null),De([Xt(),bs(0,Es("ids")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"removeMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"removeByEntity",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"removeByEntities",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"removeAll",null),De([Xt(),bs(0,Es("comparator")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"sort",null),n})(),qm=(()=>{class n extends jk{get snapshot(){return Bk(this.getState())}get ctx(){return Vk(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([Xt(),bs(0,Es("patchValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"patchState",null),De([Xt(),bs(0,Es("stateValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setState",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),n})();function Uk(){return Tn(n=>null!=n)}const oTe={};function zk(...n){const e=n[n.length-1];let t=n,i=oTe;return"object"==typeof e&&(i=e,t=t.slice(0,-1)),r=>r.pipe(lr(...t),Xo(i.compare),Hc(1))}const Jm=new _e("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),dF=new _e("ngx-window",{providedIn:"root",factory:()=>function(n){return xf(n)?window:null}(Ac(cl))}),_De=new _e("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Ac(dF))}),hF=new _e("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Ac(dF),Ac(_De))});let io=(()=>{class n{constructor(t,i,r){this.settings=t,this._document=i,this._gtag=r}get document(){return this._document}throw(t){(this.settings.enableTracing||wo())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((i,[r,s])=>Object.defineProperty(i,r,{value:s,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(i=>void 0!==i))}catch(i){this.throw(i)}}event(t,i,r,s,o){try{const a=new Map;i&&a.set("event_category",i),r&&a.set("event_label",r),s&&a.set("value",s),void 0!==o&&a.set("interaction",o);const l=this.toKeyValue(a);l?this.gtag("event",t,l):this.gtag("event",t)}catch(a){this.throw(a)}}pageView(t,i,r,s){try{const o=new Map([["page_path",t]]);i&&o.set("page_title",i),(r||this.document)&&o.set("page_location",r||this.document.location.href),s&&Object.entries(s).map(([a,l])=>o.set(a,l)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(o))}catch(o){this.throw(o)}}appView(t,i,r,s,o){try{const a=new Map([["screen_name",t],["app_name",i]]);r&&a.set("app_id",r),s&&a.set("app_version",s),o&&a.set("app_installer_id",o),this.gtag("event","screen_view",this.toKeyValue(a))}catch(a){this.throw(a)}}set(...t){try{this._gtag("set",...t)}catch(i){this.throw(i)}}exception(t,i){try{const r=new Map;t&&r.set("description",t),i&&r.set("fatal",i),this.toKeyValue(r)?this.gtag("event","exception",this.toKeyValue(r)):this.gtag("event","exception")}catch(r){this.throw(r)}}}return n.\u0275fac=function(t){return new(t||n)(I(Jm),I(rt),I(hF))},n.\u0275prov=ae({factory:function(){return new n(I(Jm),I(rt),I(hF))},token:n,providedIn:"root"}),n})();const bDe={provide:Cf,multi:!0,useFactory:function(n,e,t){return()=>gl(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(wo()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(wo()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));t||wo()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),n.uri=n.uri||`https://www.googletagmanager.com/gtag/js?id=${n.trackingCode}`,n.initCommands=null!==(i=null==n?void 0:n.initCommands)&&void 0!==i?i:[],n.initCommands.find(o=>"config"===o.command)||n.initCommands.unshift({command:"config",values:[n.trackingCode]}),n.initCommands.find(o=>"js"===o.command)||n.initCommands.unshift({command:"js",values:[new Date]});for(const o of n.initCommands)e(o.command,...o.values);const r=t.createElement("script");r.async=!0,r.src=n.uri,n.nonce&&r.setAttribute("nonce",n.nonce),t.getElementsByTagName("head")[0].appendChild(r)})},deps:[Jm,hF,rt]};new _e("ngx-google-analytics-routing-settings",{factory:()=>({})});let fF=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:Jm,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},bDe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[]]}),n})(),o0=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new Hg(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),SDe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new Ie,this.token=r,this.subscriptions.add(t.consentChange.subscribe(s=>this.toggleGoogleAnalytics("rescinded"===s)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return n.\u0275fac=function(t){return new(t||n)(I(o0),I(dF),I(Jm))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const MDe=new _e("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),rq=[o0,SDe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new Ie;try{this.storage=localStorage}catch(r){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(r=>this.saveConsent(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,i;const r=null===(i=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===i?void 0:i.call(t,this.key);if(null==r)return"not-set";const s=r.trim().toLowerCase();switch(s){case"given":case"rescinded":return s;default:return"not-set"}}saveConsent(t){var i,r;null===(r=null===(i=this.storage)||void 0===i?void 0:i.setItem)||void 0===r||r.call(i,this.key,t)}}return n.\u0275fac=function(t){return new(t||n)(I(o0),I(MDe))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})()];function TDe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let DDe=(()=>{class n{static forRoot(t){const{providers:i=[]}=fF.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[TDe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[...rq,{provide:Cf,multi:!0,useFactory:()=>()=>{},deps:rq}],imports:[[fF]]}),n})();const ODe=["bodyCanvas"];let IDe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Pe,this.nodeDrag=new Pe,this.nodeClick=new Pe,this.nodeHoverStart=new Pe,this.nodeHoverStop=new Pe,this.initialized=new Pe,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return gl(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new VEe({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))],this.initialized.emit()})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&ni(ODe,5,nt),2&t){let r;Mt(r=xt())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&et(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),PDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})();function LDe(n,e){if(1&n&&(F(0,"li",4),Te(1),yn(2,"json"),N()),2&n){const t=e.$implicit;Y(1),bw(" ",t[0],": ",wn(2,2,t[1])," ")}}function BDe(n,e){if(1&n&&(F(0,"div",1),F(1,"div"),Te(2),N(),F(3,"ul",2),Ct(4,LDe,3,4,"li",3),N(),N()),2&n){const t=e.$implicit;Y(2),Ai(t[0]),Y(2),ie("ngForOf",t[1])}}let VDe=(()=>{class n{constructor(t,i){this.clsName="ccf-store-debug",this.root={},this.subscriptions=new Ie;const r=t.subscribe(s=>{this.root=s,i.markForCheck()});this.subscriptions.add(r)}get data(){return Object.entries(this.root).map(([s,o])=>[s,Object.entries(o)]).filter(([s,o])=>o.length>0)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(ph),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-store-debug"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:1,vars:1,consts:[["class","state",4,"ngFor","ngForOf"],[1,"state"],[1,"kvlist"],["class","kvpair",4,"ngFor","ngForOf"],[1,"kvpair"]],template:function(t,i){1&t&&Ct(0,BDe,5,2,"div",0),2&t&&ie("ngForOf",i.data)},directives:[Xl],pipes:[T3],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),n})(),jDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})();new _e("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const GDe=["carouselContainer"],WDe=["itemlist"],qDe=["itemcontainer"];function YDe(n,e){if(1&n&&(F(0,"div",14),Te(1),N()),2&n){const t=bt().$implicit,i=bt();Y(1),Ai(i.occurenceData[t.id]||0)}}function XDe(n,e){if(1&n){const t=Lr();F(0,"div",9),ye("click",function(){const s=Vn(t).$implicit;return bt().selectOrgan(s)}),et(1,"mat-icon",10),F(2,"div",11),F(3,"div",12),Te(4),N(),Ct(5,YDe,2,1,"div",13),N(),N()}if(2&n){const t=e.$implicit,i=bt();at("disabled",t.disabled)("selected",i.isSelected(t)),Y(1),Yy("svgIcon",t.src),Y(3),Ai(t.name),Y(1),ie("ngIf",void 0!==t.numResults)}}const a0=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_54449"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/FMA_7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/FMA_7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let oq=(()=>{class n{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=a0,this.selectedOrgans=[],this.organsChanged=new Pe,this.onLeft=!0,this.onRight=!1,this.step=72}set occurenceData(t){this._occurenceData=t}get occurenceData(){return this._occurenceData}ngAfterViewInit(){const{carouselContainer:t}=this;this.sensor=new vG.ResizeSensor(t.nativeElement,()=>{this.set()})}ngOnChanges(t){"organList"in t&&this.set()}ngOnDestroy(){this.sensor.detach()}get error(){return!(!this.displayErrors||0===this.selectedOrgans.length)}shift(t){const{itemList:i}=this;let r=parseInt(i.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(r="right"===t?r-this.step:r+this.step,i.nativeElement.style.left=r+"px",this.setLeftRight(r))}scroll(t){this.timeoutHandler=setInterval(()=>{this.shift(t)},200)}stopScroll(){this.timeoutHandler&&(clearInterval(this.timeoutHandler),this.timeoutHandler=void 0)}selectOrgan(t){this.selectedOrgans=this.multiselect?this.selectedOrgans.includes(t)?this.selectedOrgans.filter(i=>t!==i):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:i,carouselContainer:r}=this,s=parseInt(t.nativeElement.style.left,10)||0;if(t.nativeElement.offsetWidth>=this.organList.length*this.step)t.nativeElement.style.left="0px",this.onLeft=!0,this.onRight=!0;else{this.setLeftRight(s);const o=this.step*Math.floor(r.nativeElement.offsetWidth/this.step)-64;i.nativeElement.style.width=`${o}px`}}setWidth(){const{itemContainer:t,carouselContainer:i}=this,r=this.step*Math.floor(i.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${r}px`}setLeftRight(t){const{itemContainer:i}=this;this.onLeft=0===t,this.onRight=t<=i.nativeElement.offsetWidth-this.organList.length*this.step}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-organ-selector"]],viewQuery:function(t,i){if(1&t&&(ni(GDe,7),ni(WDe,7),ni(qDe,7)),2&t){let r;Mt(r=xt())&&(i.carouselContainer=r.first),Mt(r=xt())&&(i.itemList=r.first),Mt(r=xt())&&(i.itemContainer=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[qn],decls:11,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],[1,"carousel-left-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item",3,"click"],[1,"carousel-icon",3,"svgIcon"],[1,"carousel-text-container"],[1,"carousel-text"],["class","num-results",4,"ngIf"],[1,"num-results"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"mat-icon",2),ye("touchstart",function(){return i.scroll("left")})("touchend",function(){return i.stopScroll()})("click",function(){return i.shift("left")})("mousedown",function(){return i.scroll("left")})("mouseup",function(){return i.stopScroll()}),Te(3,"chevron_left"),N(),F(4,"div",3,4),F(6,"div",5,6),Ct(8,XDe,6,7,"div",7),N(),N(),F(9,"mat-icon",8),ye("touchstart",function(){return i.scroll("right")})("touchend",function(){return i.stopScroll()})("click",function(){return i.shift("right")})("mousedown",function(){return i.scroll("right")})("mouseup",function(){return i.stopScroll()}),Te(10,"chevron_right"),N(),N()),2&t&&(at("error",i.error),ie("matTooltipDisabled",i.multiselect),Y(2),at("disabled",i.onLeft),Y(6),ie("ngForOf",i.organList),Y(1),at("disabled",i.onRight))},directives:[cc,Rs,Xl,Is],styles:["[_nghost-%COMP%] .container[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;justify-content:space-between}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{font-size:2rem;transform:scaleY(1.2);height:2rem;width:2rem;cursor:pointer}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon.disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon.disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{text-align:left}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{overflow:hidden;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{position:relative;left:0rem;display:flex;transition:all .2s linear;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;padding:.25rem .5rem;height:100%;transition:.6s}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-icon[_ngcontent-%COMP%]{text-align:center;width:3.5rem;height:2rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:4rem;justify-content:center;text-align:center}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .carousel-text[_ngcontent-%COMP%]{display:flex;justify-content:center;font-size:.625rem;max-width:3.5rem;line-height:.8rem;min-height:1.6rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{font-size:.6875rem;line-height:1.5}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .error-message[_ngcontent-%COMP%]{color:red;height:1rem}[_nghost-%COMP%] .error-message.hidden[_ngcontent-%COMP%]{opacity:0}"]}),n})(),aq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,uc]]}),n})(),KDe=(()=>{class n{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Pe,this.visibilityToggle=new Pe,this.opacityReset=new Pe}ngOnInit(){this.prevOpacity=this.visible?0:20}reset(){this.prevOpacity=20}changeOpacity(t){this.opacity=parseInt(t,10),this.opacityChange.emit(this.opacity)}toggleVisibility(){const t=this.opacity;this.opacity=this.prevOpacity,this.prevOpacity=t,this.visibilityToggle.emit(),this.opacityChange.emit(this.opacity)}resetOpacity(){this.prevOpacity=0,this.opacityReset.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{opacity:"opacity",visible:"visible"},outputs:{opacityChange:"opacityChange",visibilityToggle:"visibilityToggle",opacityReset:"opacityReset"},decls:10,vars:17,consts:[[1,"slider-box"],[1,"slider-and-label"],[1,"slider",3,"step","min","max","value","input"],[1,"opacity-value"],[1,"icons"],["matRipple","","svgIcon","app:visibility_off",1,"visibility","icon","invisible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","","svgIcon","app:visibility_on",1,"visibility","icon","visible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"mat-slider",2),ye("input",function(s){return i.changeOpacity(s.value)}),N(),F(3,"span",3),Te(4),N(),N(),F(5,"div",4),F(6,"mat-icon",5),ye("click",function(){return i.toggleVisibility()}),N(),F(7,"mat-icon",6),ye("click",function(){return i.toggleVisibility()}),N(),F(8,"mat-icon",7),ye("click",function(){return i.resetOpacity()}),Te(9,"refresh"),N(),N(),N()),2&t&&(Y(2),at("disabled",!i.visible),ie("step",1)("min",0)("max",100)("value",i.opacity),Y(2),Os("",i.opacity,"%"),Y(2),at("hidden",i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(1),at("hidden",!i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(1),ie("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[wk,Rs,Qo],styles:["[_nghost-%COMP%]{height:2.25rem;display:flex;align-items:center;justify-content:space-between;border-radius:.1875rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%]{width:60%;display:flex;align-items:center;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .mat-slider-wrapper{top:1.125rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .opacity-value[_ngcontent-%COMP%]{width:1.5rem;margin-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%]{display:flex;cursor:pointer!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{margin-right:1rem;padding:.25rem;cursor:pointer;transition:.6s;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility[_ngcontent-%COMP%]{transition:.6s;cursor:pointer;padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),n})(),lq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,SG,ec]]}),n})();function ZDe(n,e){if(1&n&&(F(0,"div",15),et(1,"youtube-player",16),N()),2&n){const t=bt(3);Y(1),Yy("videoId",t.videoID)}}function QDe(n,e){if(1&n&&(F(0,"mat-expansion-panel",10),F(1,"mat-expansion-panel-header"),F(2,"h2",11),Te(3),N(),N(),F(4,"div",12),et(5,"markdown",13),Ct(6,ZDe,2,1,"div",14),N(),N()),2&n){const t=bt(),i=t.index,r=t.$implicit;ie("expanded",0===i),Y(3),Ai(r.title),Y(2),at("first",0===i),ie("data",r.content),Y(1),ie("ngIf",0===i)}}function JDe(n,e){if(1&n&&(F(0,"div",8),Ct(1,QDe,7,6,"mat-expansion-panel",9),N()),2&n){const t=e.$implicit;Y(1),ie("ngIf",t)}}let eOe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.videoID}ngOnInit(){const t=document.createElement("script");t.src="https://www.youtube.com/iframe_api",document.body.appendChild(t)}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return n.\u0275fac=function(t){return new(t||n)(E(Gm),E(xk))},n.\u0275cmp=Le({type:n,selectors:[["ccf-info-dialog"]],decls:10,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography","dialog-content"],["class","panel",4,"ngFor","ngForOf"],[1,"panel"],[3,"expanded",4,"ngIf"],[3,"expanded"],[1,"no-header-margin"],[1,"top-padding"],[1,"variable-binding",3,"data"],["class","video-player",4,"ngIf"],[1,"video-player"],[3,"videoId"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),F(3,"mat-icon",3),ye("click",function(){return i.close()}),Te(4,"clear"),N(),N(),F(5,"div",4),F(6,"h2",5),Te(7),N(),F(8,"mat-dialog-content",6),Ct(9,JDe,2,1,"div",7),N(),N(),N(),N()),2&t&&(Y(7),Ai(i.infoTitle),Y(2),ie("ngForOf",i.documentationContents))},directives:[Rs,xG,TG,Xl,Is,NM,LM,NG,jG],styles:[".mat-dialog-container{padding:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;text-align:left}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.5rem;margin-bottom:1rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;cursor:pointer}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:2.25rem;text-align:center}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:1rem;margin-top:0;margin-bottom:.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{margin-bottom:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .no-header-margin[_ngcontent-%COMP%]{font-weight:300;margin-bottom:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%]{display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%] markdown[_ngcontent-%COMP%] ul{margin-top:0;padding-left:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{height:50rem;min-height:10rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%]{font-weight:300}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:3rem;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%]{position:relative;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%] iframe{width:100%;height:100%;max-height:17.5rem}"]}),n})(),tOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,Ok,mxe,Z1e.forRoot({})]]}),n})(),iOe=(()=>{class n{constructor(t){this.http=t,this.markdownContent=new sr([])}readMarkdown(){this.http.get("assets/docs/README.md",{responseType:"text"}).subscribe(t=>{const i=this.parseMarkdown(t);this.markdownContent.next(i)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.split("\n\n");i.push({title:o[0],content:o.splice(1).join("\n\n")})}return i}}return n.\u0275fac=function(t){return new(t||n)(I(im))},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),rOe=(()=>{class n{constructor(t,i){this.dialog=t,this.infoButtonService=i,this.infoTitle="",this.subscriptions=new Ie,this.subscriptions.add(i.markdownContent.subscribe(r=>{r.length&&this.launchInfoDialog(r)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){this.dialog.open(eOe,{autoFocus:!1,panelClass:"modal-animated",width:"60rem",data:{title:this.infoTitle,content:t,videoID:this.videoID}})}onDialogButtonClick(){this.infoButtonService.readMarkdown()}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(iOe))},n.\u0275cmp=Le({type:n,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID"},decls:3,vars:0,consts:[[1,"info-button-wrapper"],["aria-hidden","false","aria-label","Page information",1,"ccf-info-button",3,"click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"mat-icon",1),ye("click",function(){return i.onDialogButtonClick()}),Te(2," info "),N(),N())},directives:[Rs],styles:[".info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.65rem;transition:.6s}.info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.5rem;vertical-align:sub}"]}),n})(),sOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,tOe,Pr,nU]]}),n})(),oOe=(()=>{class n{constructor(t){this.el=t}onInputChange(t){const i=this.el.nativeElement.value;this.el.nativeElement.value=i.replace(/[^0-9]*/g,""),i!==this.el.nativeElement.value&&t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(nt))},n.\u0275dir=he({type:n,selectors:[["input","ccfNumbersOnly",""]],hostBindings:function(t,i){1&t&&ye("input",function(s){return i.onInputChange(s)})}}),n})(),aOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),cq=(()=>{class n{get obj(){const t=this.findGlobalObject();return Object.defineProperties(this,{obj:{configurable:!1,writable:!1,value:t}}),t}has(t){const{obj:i}=this;return null!=i&&t in i}get(t,i){var r;const{obj:s}=this;return null!==(r=s&&s[t])&&void 0!==r?r:i}set(t,i){const{obj:r}=this;r&&(r[t]=i)}remove(t){const{obj:i}=this;i&&delete i[t]}findGlobalObject(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof window)return window;if("undefined"!=typeof self)return self;try{return new Function("return this;")()}catch(t){}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Eh=(()=>{let n=class extends qm{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Uk(),Hc(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(lr(...t),Xo(),Hc(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(lr(...t),Xo(),Hc(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri()],n.prototype,"config$",null),n=De([Ch(),gh({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();let dOe=(()=>{class n{constructor(t,i){t&&function(n,e){zc(n,"mousemove").pipe(yG(1e3),be(r=>{const{clientWidth:s,clientHeight:o}=n,{clientX:a,clientY:l}=r;return[a,l,s,o].join("_")})).subscribe(r=>e.event("webpage","mousemove",r))}(t.body,i)}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(io))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function hOe(n,e){if(1&n){const t=Lr();F(0,"button",1),ye("click",function(){return Vn(t),bt().submit(!0)}),Te(1),N()}if(2&n){const t=bt();Y(1),Os(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function fOe(n,e){if(1&n){const t=Lr();F(0,"button",1),ye("click",function(){return Vn(t),bt().submit(!1)}),Te(1,"Opt out"),N()}}let pOe=(()=>{class n{constructor(t,i,r){this.consentService=i,this.data=r,this.clsName="ccf-tracking-popup",this.container=t.nativeElement}get allowTelemetry(){return this.consentService.consent}dismiss(){this.data.preClose()}submit(t){this.consentService.setConsent(t?"given":"rescinded"),this.dismiss()}showButton(t){const{allowTelemetry:i}=this;return"not-set"===i||("opt-in"===t?"rescinded"===i:"given"===i)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(o0),E(FO))},n.\u0275cmp=Le({type:n,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,i){1&t&&(F(0,"p"),Te(1,"We log usage to improve this service."),N(),Ct(2,hOe,2,1,"button",0),Ct(3,fOe,2,0,"button",0)),2&t&&(Y(2),ie("ngIf",i.showButton("opt-in")),Y(1),ie("ngIf",i.showButton("opt-out")))},directives:[Is,$f],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:400px;color:#ffffffb3;background:#323232;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;z-index:9999}[_nghost-%COMP%] p[_ngcontent-%COMP%]{margin:24px}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin:1rem;min-width:6rem;background-color:#007cbe;display:flex;justify-content:center}"],changeDetection:0}),n})(),gOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf]]}),n})();function a1(n){return Array.isArray(n)?n.join(","):`${n}`}a1([1,110]),a1([13,83]),a1(["http://purl.obolibrary.org/obo/UBERON_0013702"]);const bOe={initialConfig:{},parse:{},rename:{}};class COe{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},bOe),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let wOe=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new COe(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=he({type:n,features:[qn]}),n})();const EOe={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var mF,SOe=Ve(815);class xOe{constructor(e){this.value=e}call(e,t){return t.subscribe(new TOe(e,this.value))}}class TOe extends Rt{constructor(e,t){super(e),this.value=t}_next(e){this.destination.next(this.value)}}class DOe{constructor(e){this.notifier=e}call(e,t){return t.subscribe(new OOe(e,this.notifier))}}class OOe extends ei{constructor(e,t){super(e),this.hasValue=!1;const i=new $r(this);this.add(i),this.innerSubscription=i;const r=oo(t,i);r!==i&&(this.add(r),this.innerSubscription=r)}_next(e){this.hasValue&&super._next(e)}notifyNext(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()}notifyComplete(){}}function pF(n){return"function"==typeof n}function hq(n){return void 0===n}function POe(n,e,t){return function(r){let s=!!n;return function(n){return"function"==typeof n}(n)&&(s=n(r)),function(n,e){return pF(n)?n(e):hq(n)?e:n}(s?e:t,r)}}function ROe(n,e){return function(i){if(function(n){return null===n||hq(n)}(n)&&i)return i;if(!Array.isArray(i))return[n];const r=i.slice();let s=0;return e>0&&(s=e),r.splice(s,0,n),r}}function l0(n){return function(t){let i=null;for(const r in n){const s=n[r],o=t[r],a=pF(s)?s(o):s;a!==o&&(i||(i=Object.assign({},t)),i[r]=a)}return i||t}}const Sh={production:!0,disableDbWorker:!0,dbOptions:{ccfOwlUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf.owl",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(mF=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==mF?mF:""},skipUnsavedChangesConfirmation:!1,googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};let Ui=class extends qm{constructor(e){super(),this.globalConfig=e,this.user$=this.state$.pipe(lr("user")),this.registrationStarted$=this.state$.pipe(zk("registrationStarted")),this.useCancelRegistrationCallback$=this.state$.pipe(lr("useCancelRegistrationCallback")),this.registrationCallbackSet$=this.state$.pipe(lr("registrationCallbackSet"))}get skipConfirmation$(){return this.state$.pipe(zk("skipConfirmation"))}get globalSkipConfirmation$(){return this.globalConfig.getOption("skipUnsavedChangesConfirmation").pipe(be(e=>null!=e?e:Sh.skipUnsavedChangesConfirmation),Xo())}get hasChanges$(){return this.state$.pipe(zk("hasChanges"))}ngxsOnInit(){super.ngxsOnInit(),this.globalConfig.config$.pipe(_i(1),Di(e=>this.setState(l0({registrationCallbackSet:!!e.register,useCancelRegistrationCallback:!!e.cancelRegistration,user:POe(!!e.user,e.user)})))).subscribe(),this.initSkipConfirmationListeners()}cancelRegistration(){const{globalConfig:{snapshot:{cancelRegistration:e}},snapshot:{useCancelRegistrationCallback:t,skipConfirmation:i}}=this;t&&(i||confirm("Changes you made may not be saved."))&&(null==e||e())}setUseCancelRegistrationCallback(e){this.ctx.patchState({useCancelRegistrationCallback:e})}setUserName(e){this.ctx.setState(l0({user:l0(e)}))}registrationStarted(){this.ctx.setState(l0({registrationStarted:!0}))}setHasChanges(){const{snapshot:{registrationStarted:e,hasChanges:t}}=this;e&&!t&&this.ctx.patchState({hasChanges:!0})}clearHasChanges(){this.ctx.patchState({hasChanges:!1})}initSkipConfirmationListeners(){const e=i=>this.patchState({skipConfirmation:i});this.globalSkipConfirmation$.pipe(Tn(i=>i)).subscribe(e),this.hasChanges$.pipe(jM(this.globalSkipConfirmation$),be(([i,r])=>r||!i),Xo()).subscribe(e);const t=i=>(i.preventDefault(),i.returnValue="Changes you made may not be saved.",i.returnValue);this.skipConfirmation$.subscribe(i=>{i?removeEventListener("beforeunload",t):addEventListener("beforeunload",t)})}};Ui.\u0275fac=function(e){return new(e||Ui)(I(Eh))},Ui.\u0275prov=ae({token:Ui,factory:Ui.\u0275fac}),De([ri()],Ui.prototype,"skipConfirmation$",null),De([ri()],Ui.prototype,"globalSkipConfirmation$",null),De([ri()],Ui.prototype,"hasChanges$",null),De([Xt()],Ui.prototype,"setUseCancelRegistrationCallback",null),De([Xt()],Ui.prototype,"setUserName",null),De([Xt()],Ui.prototype,"registrationStarted",null),De([Xt()],Ui.prototype,"setHasChanges",null),De([Xt()],Ui.prototype,"clearHasChanges",null),Ui=De([Ch(),gh({name:"page",defaults:{user:{firstName:"",lastName:""},registrationStarted:!1,useCancelRegistrationCallback:!1,registrationCallbackSet:!1,skipConfirmation:!0,hasChanges:!1}})],Ui);let dc=class extends qm{constructor(e,t){super(),this.globals=e,this.globalConfig=t}ngxsOnInit(){super.ngxsOnInit(),this.getSourceDB().subscribe(e=>{this.setState(e),Sh.production||this.globals.set("db",e)})}getSourceDB(){return this.globalConfig.getOption("baseHref").pipe(be(e=>(null!=e?e:"")+"assets/reference-organ-data.json"),Ir(e=>li(fetch(e)).pipe(Ir(t=>t.json()),Sa(()=>Ql))))}normalizePlacement(e){const i=this.snapshot.placementPatches[null==e?void 0:e.target];if(i){const r=function(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(Jv),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}(new Lt(Lt.IDENTITY),i),s={x:e.x_translation,y:e.y_translation,z:e.z_translation},[o,a,l]=r.transformAsPoint([s.x,s.y,s.z],[]),c=Object.assign(Object.assign({},e),{target:i.target});return c.x_translation=o,c.y_translation=a,c.z_translation=l,c}return e}getReferenceOrganIri(e,t,i,r){const s=this.snapshot;"KIDNEY"!==e.toUpperCase()&&(i=""),(null==r?void 0:r.sex)&&(t=r.sex);const o=[e,t,i||(null==r?void 0:r.side)].join("|").toUpperCase(),a=Object.keys(s.organIRILookup).find(l=>l.toUpperCase().endsWith(o));return a?s.organIRILookup[a]:void 0}getOrganData(e){var t,i,r;const o=this.snapshot.organSpatialEntities[e];if(!o)return;const a=null!==(t=o.label)&&void 0!==t?t:"",l=a0.find(c=>a.endsWith(c.organ));return l?{organ:l,sex:null===(i=o.sex)||void 0===i?void 0:i.toLowerCase(),side:null===(r=o.side)||void 0===r?void 0:r.toLowerCase()}:void 0}};dc.\u0275fac=function(e){return new(e||dc)(I(cq),I(Eh))},dc.\u0275prov=ae({token:dc,factory:dc.\u0275fac}),dc=De([Ch(),gh({name:"reference",defaults:{organIRILookup:{},organSpatialEntities:{},anatomicalStructures:{},extractionSets:{},sceneNodeLookup:{},simpleSceneNodeLookup:{},placementPatches:{}}})],dc);const _F=a0;let si=class extends qm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.id$=this.state$.pipe(lr("id")),this.blockSize$=this.state$.pipe(lr("blockSize")),this.rotation$=this.state$.pipe(lr("rotation")),this.position$=this.state$.pipe(lr("position")),this.slicesConfig$=this.state$.pipe(lr("slicesConfig")),this.viewType$=this.state$.pipe(lr("viewType")),this.viewSide$=this.state$.pipe(lr("viewSide")),this.organ$=this.state$.pipe(lr("organ")),this.organIri$=this.state$.pipe(lr("organIri")),this.organDimensions$=this.state$.pipe(lr("organDimensions")),this.sex$=this.state$.pipe(lr("sex")),this.side$=this.state$.pipe(lr("side")),this.showPrevious$=this.state$.pipe(lr("showPrevious")),this.extractionSites$=this.state$.pipe(lr("extractionSites")),this.anatomicalStructures$=this.state$.pipe(lr("anatomicalStructures")),this.extractionSets$=this.state$.pipe(lr("extractionSets"))}get modelChanged$(){const e=["viewType","viewSide","showPrevious"],t=Object.keys(this.initialState).filter(i=>!e.includes(i));return this.state$.pipe(yG(0,void 0,{leading:!1,trailing:!0}),Xo((i,r)=>{for(const s of t)if(i[s]!==r[s])return!1;return!0}),e=>e.lift(new xOe(void 0)))}ngxsOnInit(){super.ngxsOnInit(),this.referenceData=this.injector.get(dc),this.page=this.injector.get(Ui),this.globalConfig.getOption("organ").pipe(Uk(),Ir(e=>{var t,i;const r=e.name.toLowerCase(),s=e.side;let a=this.idMatches(e.ontologyId,s);return a||(a=this.nameMatches(r,s)),a?(this.ctx.patchState({organ:a,sex:null===(t=e.sex)||void 0===t?void 0:t.toLowerCase(),side:null===(i=null==a?void 0:a.side)||void 0===i?void 0:i.toLowerCase()}),this.referenceData.state$.pipe($g(100),_i(1),bk(200),Di(()=>this.onOrganIriChange()))):Ql})).subscribe(),this.modelChanged$.pipe(function(n){return e=>e.lift(new DOe(n))}(this.page.registrationStarted$.pipe(Tn(e=>e),bk(5)))).subscribe(()=>this.page.setHasChanges())}idMatches(e,t){return a0.find(i=>!(!e||i.id!==e||i.side&&i.side!==t))}nameMatches(e,t){return a0.find(i=>i.side?i.organ.toLowerCase()===e&&i.side===t:i.organ.toLowerCase()===e)}setBlockSize(e){this.ctx.patchState({blockSize:e})}setRotation(e){this.ctx.patchState({rotation:e})}setPosition(e){this.ctx.patchState({position:e})}setSlicesConfig(e){this.ctx.patchState({slicesConfig:e})}setViewType(e){this.ctx.patchState({viewType:e})}setViewSide(e){this.ctx.patchState({viewSide:e})}get defaultPosition(){const e=this.snapshot.organDimensions;return{x:e.x+2*this.snapshot.blockSize.x,y:e.y/2,z:e.z/2}}setOrgan(e){this.ctx.patchState({organ:e}),e.side&&this.ctx.patchState({side:e.side}),this.onOrganIriChange()}setSex(e){this.ctx.patchState({sex:e}),this.onOrganIriChange()}setSide(e){this.ctx.patchState({side:e}),this.onOrganIriChange()}setShowPrevious(e){this.ctx.patchState({showPrevious:e})}setExtractionSites(e){this.ctx.patchState({extractionSites:e})}setAnatomicalStructures(e){this.ctx.patchState({anatomicalStructures:e})}setExtractionSets(e){this.ctx.patchState({extractionSets:e})}toggleRegistrationBlocksVisibility(e,t){if(this.setShowPrevious(e),e){const i=t.map(r=>{var s;return Object.assign(Object.assign({},r),{opacity:Math.min(20,null!==(s=r.opacity)&&void 0!==s?s:20)})});this.setAnatomicalStructures(i)}else this.setAnatomicalStructures(t)}onOrganIriChange(){var e,t,i,r,s;const o=this.referenceData.getReferenceOrganIri((null===(e=this.snapshot.organ)||void 0===e?void 0:e.organ)||"",this.snapshot.sex,this.snapshot.side,this.snapshot.organ),a={x:100,y:100,z:100};if((null===(t=this.snapshot.organ)||void 0===t?void 0:t.sex)&&this.ctx.patchState({sex:null===(i=this.snapshot.organ)||void 0===i?void 0:i.sex}),o){const l=this.referenceData.snapshot,c={};for(const p of l.anatomicalStructures[o]||[]){const g=null!==(r=p.representation_of)&&void 0!==r?r:p["@id"];c[g]||(c[g]={id:null!==(s=p.representation_of)&&void 0!==s?s:p["@id"],name:p.label,visible:!0,opacity:20,tooltip:p.comment})}this.ctx.patchState({anatomicalStructures:Object.values(c)});const d=(l.extractionSets[o]||[]).map(p=>({name:p.label,sites:(0,SOe.sortBy)(p.extractionSites.map(g=>({id:g["@id"],name:g.label,visible:!1,opacity:0,tooltip:g.comment})),"name")}));this.ctx.patchState({extractionSets:d}),this.ctx.patchState({extractionSites:d.length>0?d[0].sites:[]});const f=l.organSpatialEntities[o];a.x=f.x_dimension,a.y=f.y_dimension,a.z=f.z_dimension}this.ctx.patchState({organIri:o,organDimensions:a}),this.ctx.patchState({position:this.defaultPosition})}};si.\u0275fac=function(e){return new(e||si)(I(Tt),I(Eh))},si.\u0275prov=ae({token:si,factory:si.\u0275fac}),De([ri()],si.prototype,"modelChanged$",null),De([Xt()],si.prototype,"setBlockSize",null),De([Xt()],si.prototype,"setRotation",null),De([Xt()],si.prototype,"setPosition",null),De([Xt()],si.prototype,"setSlicesConfig",null),De([Xt()],si.prototype,"setViewType",null),De([Xt()],si.prototype,"setViewSide",null),De([ri()],si.prototype,"defaultPosition",null),De([Xt()],si.prototype,"setOrgan",null),De([Xt()],si.prototype,"setSex",null),De([Xt()],si.prototype,"setSide",null),De([Xt()],si.prototype,"setShowPrevious",null),De([Xt()],si.prototype,"setExtractionSites",null),De([Xt()],si.prototype,"setAnatomicalStructures",null),De([Xt()],si.prototype,"setExtractionSets",null),si=De([Ch(),gh({name:"model",defaults:{id:"",label:"",organ:{src:"",name:""},organIri:"",organDimensions:{x:90,y:90,z:90},sex:"male",side:"left",blockSize:{x:10,y:10,z:10},rotation:{x:0,y:0,z:0},position:{x:0,y:0,z:0},slicesConfig:{thickness:NaN,numSlices:NaN},viewType:"register",viewSide:"anterior",showPrevious:!1,extractionSites:[],anatomicalStructures:[],extractionSets:[]}})],si);const mq=new _e("Default theme class");let yF=(()=>{class n{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(t){const{injector:i,location:r}=t;i.get(n).initialize(r,i)}getTheme(){return this.theme}setTheme(t){t!==this.theme&&(this.applyThemeClass(this.theme,"remove"),this.applyThemeClass(t),this.theme=t)}resetTheme(){this.setTheme(this.defaultTheme)}initialize(t,i){this.element=t,this.injector=i,this.applyThemeClass(this.getTheme())}applyThemeClass(t,i="add"){var r;const{element:s,injector:o}=this;if(!t||!s||!o)return;const a=o.get(Lc,null);if(!a)return;const l=s.nativeElement,c=null===(r=o.get(om,null))||void 0===r?void 0:r.getContainerElement(),d="add"===i?"addClass":"removeClass";a[d](l,t),c&&a[d](c,t)}}return n.\u0275fac=function(t){return new(t||n)(I(mq,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),FOe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-name-input",this.firstNameValidator=new vh("",[p$.required]),this.lastNameValidator=new vh("",[p$.required]),this._name={firstName:"",lastName:""},this.nameChange=new Pe}get name(){return this._name}set name(t){this._name=t,this.firstNameValidator.setValue((null==t?void 0:t.firstName)||""),this.lastNameValidator.setValue((null==t?void 0:t.lastName)||"")}updateName(t,i){const r=t.target;this.name=Object.assign(Object.assign({},this.name),{[i]:r.value}),this.ga.event("name_updated","name_input",i),this.nameChange.emit(this.name)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-name-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{name:"name"},outputs:{nameChange:"nameChange"},decls:8,vars:2,consts:[[1,"field"],[1,"text","label"],["matInput","","matTooltip","Add your first name.",1,"input",3,"value","input"],["matInput","","matTooltip","Add your last name.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"mat-form-field",0),F(1,"mat-label",1),Te(2,"First Name "),N(),F(3,"input",2),ye("input",function(s){return i.updateName(s,"firstName")}),N(),N(),F(4,"mat-form-field",0),F(5,"mat-label",1),Te(6,"Last Name "),N(),F(7,"input",3),ye("input",function(s){return i.updateName(s,"lastName")}),N(),N()),2&t&&(Y(3),ie("value",i.firstNameValidator.value),Y(4),ie("value",i.lastNameValidator.value))},directives:[tm,Bf,Hb,cc],styles:["[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:left;width:100%}"],changeDetection:0}),n})();const NOe=["thumbContainer"],LOe=["toggleBar"],BOe=["input"],VOe=function(n){return{enterDuration:n}},jOe=["*"],UOe=new _e("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let zOe=0;const HOe={provide:Ao,useExisting:T(()=>_q),multi:!0};class $Oe{constructor(e,t){this.source=e,this.checked=t}}const GOe=Nf(kf(Ff(em(class{constructor(n){this._elementRef=n}}))));let _q=(()=>{class n extends GOe{constructor(t,i,r,s,o,a){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this.defaults=o,this._onChange=l=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++zOe,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new Pe,this.toggleChange=new Pe,this.tabIndex=parseInt(s)||0,this.color=this.defaultColor=o.color||"accent",this._noopAnimations="NoopAnimations"===a}get required(){return this._required}set required(t){this._required=Dt(t)}get checked(){return this._checked}set checked(t){this._checked=Dt(t),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new $Oe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Un),fs("tabindex"),E(UOe),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(ni(NOe,5),ni(LOe,5),ni(BOe,5)),2&t){let r;Mt(r=xt())&&(i._thumbEl=r.first),Mt(r=xt())&&(i._thumbBarEl=r.first),Mt(r=xt())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(sl("id",i.id),en("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),at("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[At([HOe]),ht],ngContentSelectors:jOe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"div",2,3),F(4,"input",4,5),ye("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),N(),F(6,"div",6,7),et(8,"div",8),F(9,"div",9),et(10,"div",10),N(),N(),N(),F(11,"span",11,12),ye("cdkObserveContent",function(){return i._onLabelTextChange()}),F(13,"span",13),Te(14,"\xa0"),N(),In(15),N(),N()),2&t){const r=Ys(1),s=Ys(12);en("for",i.inputId),Y(2),at("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),Y(2),ie("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),en("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),Y(5),ie("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Fg(18,VOe,i._noopAnimations?0:150))}},directives:[Qo,kD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),yq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),vq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[yq,ec,Nn,_E],yq,Nn]}),n})(),vF=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-labeled-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new Pe}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.ga.event("slide_toggle_toggled","slide_toggle",this.value),this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-labeled-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{labels:"labels",value:"value",disabled:"disabled"},outputs:{valueChange:"valueChange"},decls:6,vars:12,consts:[[1,"slide-label",3,"click"],[1,"slider",3,"disabled","checked","change"],["toggle",""]],template:function(t,i){if(1&t){const r=Lr();F(0,"span",0),ye("click",function(){Vn(r);const o=Ys(3);return i.left||o.toggle(),i.updateToggle(!0)}),Te(1),N(),F(2,"mat-slide-toggle",1,2),ye("change",function(o){return i.updateToggle(!o.checked)}),N(),F(4,"span",0),ye("click",function(){Vn(r);const o=Ys(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Te(5),N()}2&t&&(at("disabled",i.disabled)("highlighted",i.left),Y(1),Ai(i.labels[0]),Y(1),ie("disabled",i.disabled)("checked",!i.left),Y(2),at("disabled",i.disabled)("highlighted",!i.left),Y(1),Ai(i.labels[1]))},directives:[_q],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%;cursor:not-allowed}"],changeDetection:0}),n})();const YOe=function(){return["Male","Female"]},XOe=function(n){return[n]};let KOe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.dialogRef=r,this.clsName="ccf-registration-content",this.sexByLabel$=this.model.sex$.pipe(be(s=>"female"===s?"Female":"Male")),this.organList=_F,r.disableClose=!0}setSexFromLabel(t){this.currentSex=t,this.sexSelected=!0}checkNameValid(t){this.nameValid=t.firstName.length>0&&t.lastName.length>0}organSelect(t){this.currentOrgan=t,this.organSelected=!0}registerButtonClick(t){t&&t.preventDefault(),this.organSelected&&this.nameValid&&this.closeDialog()}closeDialog(){this.model.setSex("Female"===this.currentSex?"female":"male"),this.model.setOrgan(this.currentOrgan),this.dialogRef.close(!0),this.page.registrationStarted()}}return n.\u0275fac=function(t){return new(t||n)(E(Ui),E(si),E(Gm))},n.\u0275cmp=Le({type:n,selectors:[["ccf-registration-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:17,vars:17,consts:[[1,"modal"],["mat-dialog-content",""],[3,"name","nameChange"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"labels","value","valueChange"],[1,"selector-label"],[1,"selector-container"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],["mat-button","",1,"registration-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"ccf-name-input",2),ye("nameChange",function(s){return i.page.setUserName(s),i.checkNameValid(s)}),yn(3,"async"),N(),F(4,"div",3),F(5,"div",4),Te(6,"Donor Sex:"),N(),F(7,"ccf-labeled-slide-toggle",5),ye("valueChange",function(s){return i.setSexFromLabel(s)}),yn(8,"async"),N(),N(),F(9,"div",6),Te(10,"Select an organ"),N(),F(11,"div",7),F(12,"ccf-organ-selector",8,9),ye("organsChanged",function(s){return i.organSelect(s[0])}),yn(14,"async"),N(),N(),N(),F(15,"button",10),ye("click",function(s){return i.registerButtonClick(s)}),Te(16,"START REGISTRATION"),N(),N()),2&t&&(Y(2),ie("name",wn(3,8,i.page.user$)),Y(5),ie("labels",lv(14,YOe))("value",wn(8,10,i.sexByLabel$)),Y(5),ie("organList",i.organList)("selectedOrgans",Fg(15,XOe,wn(14,12,i.model.organ$))),Y(3),at("disabled",!i.organSelected||!i.nameValid),ie("matTooltip",i.organSelected&&i.nameValid?"":"Required: Enter first and last name, and select an organ"))},directives:[FOe,cc,vF,oq,$f],pipes:[zu],styles:[".modal[_ngcontent-%COMP%]{padding:1rem;border-radius:4px;width:35rem;height:22rem}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}.modal[_ngcontent-%COMP%] .selector-label[_ngcontent-%COMP%]{font-weight:600;height:3rem;line-height:3rem}.modal[_ngcontent-%COMP%] .selector-container[_ngcontent-%COMP%]{height:4rem;width:31rem;margin:0 auto}.modal[_ngcontent-%COMP%] .registration-button[_ngcontent-%COMP%]{display:block;margin:2rem auto 0}"],changeDetection:0}),n})(),ZOe=(()=>{class n{constructor(t,i,r){this.dialog=t,this.page=i,this.model=r,this.clsName="ccf-registration-modal"}ngOnInit(){or([this.page.user$,this.model.organ$]).pipe($g(500),_i(1),Di(([t,i])=>{""!==t.firstName&&""!==t.lastName&&""!==i.src||this.openDialog()})).subscribe()}openDialog(){this.dialog.open(KOe,{autoFocus:!1})}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(Ui),E(si))},n.\u0275cmp=Le({type:n,selectors:[["ccf-registration-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:0,vars:0,template:function(t,i){},encapsulation:2}),n})();function QOe(n,e){1&n&&function(n,e,t){ff(n,e,t),pf()}(0)}function JOe(n,e){if(1&n){const t=Lr();F(0,"div",4),ye("click",function(){return Vn(t),bt().page.cancelRegistration()}),F(1,"mat-icon",5),Te(2,"chevron_left"),N(),F(3,"span",6),Te(4,"BACK"),N(),N()}}function eIe(n,e){1&n&&(F(0,"a",7),et(1,"mat-icon",8),N())}let tIe=(()=>{class n{constructor(t){this.page=t,this.clsName="ccf-header"}}return n.\u0275fac=function(t){return new(t||n)(E(Ui))},n.\u0275cmp=Le({type:n,selectors:[["ccf-header"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:7,vars:5,consts:[[4,"ngIf","ngIfThen","ngIfElse"],["backButton",""],["logo",""],[1,"filler"],["rel","noreferrer noopener",1,"link","home",3,"click"],[1,"icon","backbutton"],[1,"text"],["href","https://ingest.hubmapconsortium.org/","rel","noreferrer noopener","matTooltip","Human BioMolecular Atlas Project","matTooltipPosition","right",1,"link","hubmap"],["svgIcon","app:logo",1,"icon","logo"]],template:function(t,i){if(1&t&&(Ct(0,QOe,1,0,"ng-container",0),yn(1,"async"),Ct(2,JOe,5,0,"ng-template",null,1,Rw),Ct(4,eIe,2,0,"ng-template",null,2,Rw),et(6,"div",3)),2&t){const r=Ys(3),s=Ys(5);ie("ngIf",wn(1,3,i.page.useCancelRegistrationCallback$))("ngIfThen",r)("ngIfElse",s)}},directives:[Is,Rs,cc],pipes:[zu],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid}[_nghost-%COMP%] .text[_ngcontent-%COMP%]{padding:.25rem 0;height:2rem;display:flex;align-items:center;font-weight:lighter;font-size:1.5rem}[_nghost-%COMP%] .link[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;text-decoration:none;padding:.25rem 0}[_nghost-%COMP%] .home[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{transition:color .6s}[_nghost-%COMP%] .home[_ngcontent-%COMP%] .backbutton[_ngcontent-%COMP%]{font-size:2.25rem;width:2.25rem;height:2.25rem}[_nghost-%COMP%] .hubmap[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;margin-right:1rem}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}"],changeDetection:0}),n})();const bq={isolated:!0},Cq=new _e("Message service configuration",{providedIn:"root",factory:()=>bq});let nIe=(()=>{class n{constructor(t,i,r){this.source=t,this.channel=i,this.messages=r}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Tn(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Tn(i=>i.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Tn(i=>t.includes(i.source)))}nextMessageId(){return n.counter++}}return n.counter=0,n})();const c0=(()=>{class n{constructor(t,i){this.config=t,this.parent=i,this.channel=new we,this.messages=t.isolated||!i?this.channel.asObservable():li([this.channel,i.messages.pipe(_U(()=>!this.channel.closed))]).pipe(ao())}ngOnDestroy(){this.channel.complete()}connect(t){return new nIe(t,this.channel,this.messages)}}return n.\u0275fac=function(t){return new(t||n)(I(Cq),I(n,12))},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),iIe=["*"];let l1=(()=>{class n{constructor(t,i){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new Ie;const r=t.connect(this).getMessages();this.subscriptions.add(r.subscribe(s=>{this.handleMessage(s)&&i.markForCheck()}))}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){switch(t.payload.type){case"drawer-containers-changed":return this.drawers=t.payload.drawers,this.updateFaded(),!0;case"drawer-initialized":return this.animationsEnabled=!0,!0;case"drawer-toggled":{const i=t.source.position,{opened:r,width:s,margin:o}=t.payload;return this.updateMargin(i,r,s,o),this.updateFaded(),!0}default:return!1}}updateMargin(t,i,r,s){const o=i?r+s:s;"start"===t?this.leftMargin=o:this.rightMargin=o}updateFaded(){const[t,i]=this.drawers;this.faded=!!((null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==i?void 0:i.opened)&&(null==i?void 0:i.expanded))}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,i){2&t&&(Sg("@fadeInOut",i.faded),Fn(i.className),gf("margin-left",i.leftMargin,"px")("margin-right",i.rightMargin,"px"),at("cff-drawer-content-animations",i.animationsEnabled))},ngContentSelectors:iIe,decls:1,vars:0,template:function(t,i){1&t&&(Dr(),In(0))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;z-index:2;overflow:auto}.cff-drawer-content-animations[_nghost-%COMP%]{transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:margin-left,margin-right}"],data:{animation:[Jl("fadeInOut",[br("false",Kn({opacity:1})),br("true",Kn({opacity:0})),Qs("false <=> true",Mo("1s"))])]},changeDetection:0}),n})();const rIe=["*"],bF={params:{width:0,margin:0,margin2:0}};class sIe{constructor(){this.initialized=!1,this.deferred=new Promise(e=>{this.resolve=e})}set(){this.initialized=!0,this.resolve()}wait(){return gl(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let CF=(()=>{class n{constructor(t,i,r){this.element=r,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Pe(!0),this.expandedChange=new Pe(!0),this.stateChange=new Pe(!0),this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._measuredWidth=0,this.width=0,this._measuredMargin=0,this.margin2=0,this.initialized=new sIe,this.subscriptions=new Ie,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(s=>{this.handleMessage(s)&&i.markForCheck()}))}get classEnd(){return"end"===this.position}get position(){return this._position}set position(t){this._position=t||"start"}get opened(){return this._opened}set opened(t){this.toggle(Dt(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(Dt(t))}get expandedStateObj(){return{value:this.expandedState2,params:{width:this.width,margin:this.measuredMargin,margin2:this.margin2}}}get measuredWidth(){if(this._measuredWidth>0)return this._measuredWidth;const t=this.element.nativeElement;if(!t)return 0;const i=t.getBoundingClientRect(),r=i.right-i.left;return 0===r?0:(this._measuredWidth=r,r)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const s=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),o=Number(s.slice(0,-2));return this._measuredMargin=o,o}ngAfterViewInit(){this.initialized.set(),setTimeout(()=>this.channel.sendMessage({type:"drawer-initialized"}))}ngOnDestroy(){this.subscriptions.unsubscribe()}open(){this.toggle(!0)}close(){this.toggle(!1)}toggle(t=!this.opened){this.opened!==t&&(t?this.openedState=this.initialized.valueOf()?"open":"open-instant":(this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._expanded=!1),this._opened=t,this.sendToggle())}openExpanded(){this.toggleExpanded(!0)}closeExpanded(){this.toggleExpanded(!1)}toggleExpanded(t=!this.expanded){this.expanded!==t&&(t?this.expandedState=this.initialized.valueOf()?"open":"open-instant":(this.expandedState="closed",this.expandedState2="collapsed"),this._expanded=t,this.sendToggle())}closeOpenDone(){this.openedChange.emit(this.opened)}expandCollapseDone(){this.expandedChange.emit(this.expanded)}sendToggle(){return gl(this,void 0,void 0,function*(){yield this.initialized.wait(),this.channel.sendMessage({type:"drawer-toggled",opened:this.opened,expanded:this.expanded,width:this.measuredWidth,margin:this.measuredMargin}),this.stateChange.emit()})}handleMessage(t){switch(t.payload.type){case"drawer-toggled":return this.syncExpanded(t.source),!0;default:return!1}}syncExpanded(t){(this.expanded||t.expanded)&&(this.expanded&&t.expanded?this.expandedState2=t.expandedState2="half":this.expanded?t.opened?(this.expandedState2="extended",this.width=t.measuredWidth+t.measuredMargin):(this.expandedState2="full",this.margin2=t.measuredMargin):this.opened?(t.expandedState2="extended",t.width=this.measuredWidth+this.measuredMargin):(t.expandedState2="full",t.margin2=this.measuredMargin))}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un),E(nt))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,i){1&t&&qy("@openClose.done",function(){return i.closeOpenDone()})("@expandCollapse.done",function(){return i.expandCollapseDone()}),2&t&&(Sg("@openClose",i.openedState)("@expandCollapse",i.expandedStateObj),Fn(i.className),at("ccf-drawer-end",i.classEnd)("ccf-drawer-opened",i.opened)("ccf-drawer-expanded",i.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:rIe,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,i){1&t&&(Dr(),F(0,"div",0),In(1),N())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%)}.ccf-drawer-end[_nghost-%COMP%]{right:0;transform:translate(100%)}[_nghost-%COMP%] .cff-drawer-inner-container[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}"],data:{animation:[Jl("openClose",[br("open, open-instant",Kn({transform:"none"})),br("closed",Kn({})),Qs("closed => open-instant",Mo(0)),Qs("closed <=> open, open-instant => closed",Mo(".5s ease-in-out"))]),Jl("expandCollapse",[br("collapsed",Kn({})),br("half",Kn({width:"calc(50% - {{ margin }}px)"}),bF),br("extended",Kn({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),bF),br("full",Kn({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),bF),Qs("* <=> *",Mo(".5s ease-in-out"))])]},changeDetection:0}),n})();function oIe(n,e){1&n&&(F(0,"ccf-drawer-content"),In(1,2),N())}const aIe=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],lIe=["ccf-drawer","ccf-drawer-content","*"];function wq(n){throw new Error(`Multiple drawers in position ${n}`)}let cIe=(()=>{class n{constructor(t,i){this.cdr=i,this.className="ccf-drawer-container",this.subscriptions=new Ie,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(r=>{this.handleMessage(r)&&i.markForCheck()}))}get content(){var t;return null!==(t=this.content1.first)&&void 0!==t?t:this.content2.first}get hasWrappedContent(){return 0!==this.content1.length}ngAfterViewInit(){this.drawers.changes.pipe(ns(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(ns(null)).subscribe(()=>{this.channel.sendMessage({type:"content-container-changed",content:this.content}),this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return!0}validateDrawers(){const t=this.drawers.toArray(),i=t.filter(s=>"start"===s.position),r=t.filter(s=>"end"===s.position);return i.length>1&&wq("start"),r.length>1&&wq("end"),[i[0],r[0]]}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-container"]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,CF,5),Fi(r,l1,5)),2&t){let s;Mt(s=xt())&&(i.drawers=s),Mt(s=xt())&&(i.content1=s)}},viewQuery:function(t,i){if(1&t&&ni(l1,5),2&t){let r;Mt(r=xt())&&(i.content2=r)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.className)},exportAs:["ccfDrawerContainer"],features:[At([c0])],ngContentSelectors:lIe,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&(Dr(aIe),In(0),In(1,1),Ct(2,oIe,2,0,"ccf-drawer-content",0)),2&t&&(Y(2),ie("ngIf",!i.hasWrappedContent))},directives:[Is,l1],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),n})();var c1,uIe=Ve(457),dIe=new Uint8Array(16);function hIe(){if(!c1&&!(c1="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c1(dIe)}const fIe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,gIe=function(n){return"string"==typeof n&&fIe.test(n)};for(var Ls=[],wF=0;wF<256;++wF)Ls.push((wF+256).toString(16).substr(1));const vIe=function(n,e,t){var i=(n=n||{}).random||(n.rng||hIe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(Ls[n[e+0]]+Ls[n[e+1]]+Ls[n[e+2]]+Ls[n[e+3]]+"-"+Ls[n[e+4]]+Ls[n[e+5]]+"-"+Ls[n[e+6]]+Ls[n[e+7]]+"-"+Ls[n[e+8]]+Ls[n[e+9]]+"-"+Ls[n[e+10]]+Ls[n[e+11]]+Ls[n[e+12]]+Ls[n[e+13]]+Ls[n[e+14]]+Ls[n[e+15]]).toLowerCase();if(!gIe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function Eq(n){const e=new Lt(n.transformMatrix),t=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return new Mi({lowerBound:new S(...t.map((r,s)=>Math.min(r,i[s]))),upperBound:new S(...i.map((r,s)=>Math.max(r,t[s])))})}let ss=class extends qm{constructor(e){super(),this.injector=e,this.gizmo$=st([{"@id":"http://purl.org/ccf/latest/ccf.owl#VHMaleOrgans_VHM_Spleen_Colic_Surface","@type":"SpatialSceneNode",scenegraph:"https://hubmapconsortium.github.io/ccf-3d-reference-object-library/Assets/body4Mesh_1338.glb",transformMatrix:new Lt(Lt.IDENTITY).scale([2,2,2]).rotateY(Jv(0)),tooltip:"Gizmo",unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!1,color:[255,255,255,255],opacity:1}])}get nodes$(){return or([this.placementCube$,this.referenceOrganNodes$,this.previousRegistrationNodes$,this.nodeCollisions$]).pipe(be(([e,t,i,r])=>[...e,...i,...t,...this.snapshot.showCollisions?r:[]]))}get rotatedNodes$(){return or([this.rotation$,this.nodes$]).pipe(be(([e,t])=>0===e?t:t.map(i=>Object.assign(Object.assign({},i),{transformMatrix:new Lt(Lt.IDENTITY).rotateY(Jv(e)).multiplyRight(i.transformMatrix)}))))}get referenceOrganNodes$(){return or([this.model.anatomicalStructures$,this.model.extractionSites$,this.model.organIri$]).pipe($g(400),be(([e,t,i])=>this.createSceneNodes(i,[...e,...t])))}get referenceOrganSimpleNodes$(){return or([this.model.anatomicalStructures$,this.model.organIri$,this.referenceData.state$]).pipe(be(([e,t,i])=>e.map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.simpleSceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[t]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.simpleSceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])))}get nodeCollisions$(){return or([this.referenceOrganSimpleNodes$,this.placementCube$]).pipe(Tn(([e,t])=>t.length>0),be(([e,t])=>{const i=Eq(t[0]);return e.filter(r=>i.overlaps(Eq(r)))}))}get previousRegistrationNodes$(){return or([this.model.organIri$,this.model.showPrevious$,this.registration.previousRegistrations$]).pipe(be(([e,t,i])=>t?i.map(r=>{const s=Array.isArray(r.placement)?r.placement[0]:r.placement;if(s.target===e){const o=this.model.snapshot.organDimensions,a=[o.x,o.y,o.z].map(l=>-l/1e3/2);return{"@id":r["@id"],"@type":"SpatialSceneNode",transformMatrix:new Lt(Lt.IDENTITY).translate([s.x_translation,s.y_translation,s.z_translation].map((l,c)=>l/1e3+a[c])).rotateXYZ([s.x_rotation,s.y_rotation,s.z_rotation].map(Jv)).scale([r.x_dimension,r.y_dimension,r.z_dimension].map(l=>l/1e3/2)),color:[25,118,210,200],tooltip:r.label,unpickable:!0}}}).filter(r=>!!r):[]))}get placementCube$(){return or([this.model.viewType$,this.model.blockSize$,this.model.rotation$,this.model.position$,this.model.organ$]).pipe(be(([e,t,i,r,s])=>""===s.src?[]:[this.placementCube]))}get placementCube(){const{viewType:e,blockSize:t,rotation:i,position:r,organDimensions:s}=this.model.snapshot,o=[s.x,s.y,s.z].map(a=>-a/1e3/2);return{"@id":"#DraftPlacement","@type":"SpatialSceneNode",transformMatrix:new Lt(Lt.IDENTITY).translate([r.x,r.y,r.z].map((a,l)=>a/1e3+o[l])).rotateXYZ([i.x,i.y,i.z].map(Jv)).scale([t.x,t.y,t.z].map(a=>a/1e3/2)),color:[255,255,0,200],tooltip:"Draft Placement",unpickable:"3d"===e}}get rotation$(){return this.model.viewSide$.pipe(be(e=>{let t=0;switch(e){case"left":t=-90;break;case"right":t=90;break;case"posterior":t=180}return t}))}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(si),this.registration=this.injector.get(wr),this.referenceData=this.injector.get(dc)}createSceneNodes(e,t){const i=this.referenceData.snapshot;return t.filter(r=>r.visible&&r.opacity&&r.opacity>0).map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.sceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[e]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.sceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])}};ss.\u0275fac=function(e){return new(e||ss)(I(Tt))},ss.\u0275prov=ae({token:ss,factory:ss.\u0275fac}),De([ri()],ss.prototype,"nodes$",null),De([ri()],ss.prototype,"rotatedNodes$",null),De([ri()],ss.prototype,"referenceOrganNodes$",null),De([ri()],ss.prototype,"referenceOrganSimpleNodes$",null),De([ri()],ss.prototype,"nodeCollisions$",null),De([ri()],ss.prototype,"previousRegistrationNodes$",null),De([ri()],ss.prototype,"placementCube$",null),De([ri()],ss.prototype,"placementCube",null),De([ri()],ss.prototype,"rotation$",null),ss=De([Ch(),gh({name:"scene",defaults:{showCollisions:!Sh.production}})],ss);let Io=class extends sTe{constructor(e){super(),this.injector=e,this._latestTags=[]}get tags$(){return or([this.entities$,this.scene.nodeCollisions$]).pipe(be(([e,t])=>{const i=[],r=new Set,s=new Set;Object.entries(e).forEach(([o,a])=>{"removed"===a.type?s.add(o):(r.add(o),i.push(a))});for(const o of t){const a=o.representation_of;a&&!s.has(a)&&!r.has(a)&&(r.add(a),i.push({id:a,label:o.tooltip,type:"assigned"}))}return i}))}get latestTags(){return this._latestTags}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(si),this.scene=this.injector.get(ss),this.page=this.injector.get(Ui),this.tags$.subscribe(e=>{this._latestTags=e}),this.entities$.subscribe(()=>this.page.setHasChanges())}addTags(e){for(const t of e)this.addTagRaw(t)}addTag(e){this.addTagRaw(e)}removeTag(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"removed"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"removed"}))}searchExternal(e,t){const i=this.model.snapshot.anatomicalStructures.filter(r=>-1!==r.name.toLowerCase().indexOf(e.toLowerCase()));return[{totalCount:i.length,results:i.map(r=>({id:r.id,label:r.name,type:"added"})).slice(0,t)}]}addTagRaw(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"added"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"added"}))}};Io.\u0275fac=function(e){return new(e||Io)(I(Tt))},Io.\u0275prov=ae({token:Io,factory:Io.\u0275fac}),De([ri()],Io.prototype,"tags$",null),De([Xt()],Io.prototype,"addTags",null),De([Xt()],Io.prototype,"addTag",null),De([Xt()],Io.prototype,"removeTag",null),De([su.ak],Io.prototype,"searchExternal",null),Io=De([Ch(),gh({name:"tags",defaults:Object.assign({},{ids:[],entities:{}})})],Io);let wr=class extends qm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.displayErrors$=this.state$.pipe(lr("displayErrors"))}get metadata$(){return or([this.page.state$,this.model.state$,this.tags.tags$]).pipe(be(([e,t,i])=>this.buildMetadata(e,t,i)))}get jsonld$(){return or([this.page.state$,this.model.state$,this.tags.tags$]).pipe(be(([e,t,i])=>this.buildJsonLd(e,t,i)))}get valid$(){return or([this.page.state$,this.model.state$]).pipe(be(()=>this.isValid))}get previousRegistrations$(){const{globalConfig:e,state$:t}=this;return or([t.pipe(lr("registrations")),e.getOption("fetchPreviousRegistrations").pipe(Ir(s=>{var o;return null!==(o=null==s?void 0:s())&&void 0!==o?o:[[]]}),ns([]))]).pipe(be(([s,o])=>[...s,...o]))}get currentIdentifier(){return vIe()}get currentDate(){return(new Date).toISOString().split("T")[0]}ngxsOnInit(){super.ngxsOnInit(),this.page=this.injector.get(Ui),this.model=this.injector.get(si),this.tags=this.injector.get(Io),this.refData=this.injector.get(dc),this.globalConfig.config$.pipe(_i(1),Di(({useDownload:e,register:t})=>this.ctx.patchState({useRegistrationCallback:!(e||!t)}))).subscribe(),this.globalConfig.getOption("editRegistration").pipe(Uk(),Di(e=>this.editRegistration(e))).subscribe()}editRegistration(e){return gl(this,void 0,void 0,function*(){const t=this.refData.normalizePlacement(Array.isArray(e.placement)?e.placement[0]:e.placement),i=this.refData.getOrganData(t.target);this.page.setUserName({firstName:e.creator_first_name,lastName:e.creator_last_name}),i&&(this.model.setOrgan(i.organ),i.sex&&this.model.setSex(i.sex),i.side&&this.model.setSide(i.side)),this.model.setBlockSize({x:e.x_dimension,y:e.y_dimension,z:e.z_dimension}),this.model.setRotation({x:t.x_rotation,y:t.y_rotation,z:t.z_rotation}),this.model.setSlicesConfig({thickness:e.slice_thickness||NaN,numSlices:e.slice_count||NaN}),yield new Promise(s=>{setTimeout(s,1e3)}),this.model.setPosition({x:t.x_translation,y:t.y_translation,z:t.z_translation});const r=new Set(e.ccf_annotations);this.tags.addTags(this.model.snapshot.anatomicalStructures.filter(s=>r.has(s.id)).map(s=>({id:s.id,label:s.name,type:"added"})))})}setUseRegistrationCallback(e){this.ctx.patchState({useRegistrationCallback:e})}setDisplayErrors(e){this.ctx.patchState({displayErrors:e})}addRegistration(e){this.ctx.setState(l0({registrations:ROe(e)}))}isDataValid(e,t){return[e.user.firstName,e.user.lastName,t.organ.src,t.organ.name,t.organ.organ].every(r=>!!r)}get isValid(){return this.isDataValid(this.page.snapshot,this.model.snapshot)}register(e){if(!this.isValid)return;const{globalConfig:{snapshot:{register:t}},page:i,model:r,snapshot:s}=this,o=this.buildJsonLd(i.snapshot,r.snapshot,this.tags.latestTags),a=JSON.stringify(o,void 0,2);if(e||void 0===e&&s.useRegistrationCallback)null==t||t(a);else{const l=new Blob([a],{type:"application/json",endings:"native"});(0,uIe.saveAs)(l,"registration-data.json")}this.addRegistration(o),this.setDisplayErrors(!1),this.page.clearHasChanges()}buildMetadata(e,t,i){const r=[];return e.registrationCallbackSet||r.push({label:"First Name",value:e.user.firstName},{label:"Last Name",value:e.user.lastName}),r.push({label:"Reference Organ Name",value:t.organ.name},{label:"Tissue Block Dimensions (mm)",value:this.xyzTripletToString(t.blockSize)},{label:"Tissue Block Position (mm)",value:this.xyzTripletToString(t.position)},{label:"Tissue Block Rotation",value:this.xyzTripletToString(t.rotation)},{label:"Anatomical Structure Tags",value:i.map(s=>s.label).join(", ")},{label:"Time Stamp",value:this.currentDate},{label:"Alignment ID",value:this.currentIdentifier}),r}buildJsonLd(e,t,i){var r,s;return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}`,"@type":"SpatialEntity",label:t.label||void 0,creator:`${e.user.firstName} ${e.user.lastName}`,creator_first_name:e.user.firstName,creator_last_name:e.user.lastName,creation_date:this.currentDate,ccf_annotations:i.map(o=>o.id),slice_thickness:(null===(r=t.slicesConfig)||void 0===r?void 0:r.thickness)||void 0,slice_count:(null===(s=t.slicesConfig)||void 0===s?void 0:s.numSlices)||void 0,x_dimension:+t.blockSize.x.toFixed(3),y_dimension:+t.blockSize.y.toFixed(3),z_dimension:+t.blockSize.z.toFixed(3),dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}_placement`,"@type":"SpatialPlacement",target:t.organIri,placement_date:this.currentDate,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:+t.rotation.x.toFixed(3),y_rotation:+t.rotation.y.toFixed(3),z_rotation:+t.rotation.z.toFixed(3),rotation_order:"XYZ",rotation_units:"degree",x_translation:+t.position.x.toFixed(3),y_translation:+t.position.y.toFixed(3),z_translation:+t.position.z.toFixed(3),translation_units:"millimeter"}}}xyzTripletToString(e){return`${Math.round(e.x)}, ${Math.round(e.y)}, ${Math.round(e.z)}`}};wr.\u0275fac=function(e){return new(e||wr)(I(Tt),I(Eh))},wr.\u0275prov=ae({token:wr,factory:wr.\u0275fac}),De([ri()],wr.prototype,"metadata$",null),De([ri()],wr.prototype,"jsonld$",null),De([ri()],wr.prototype,"valid$",null),De([ri()],wr.prototype,"previousRegistrations$",null),De([ri()],wr.prototype,"currentIdentifier",null),De([ri()],wr.prototype,"currentDate",null),De([Xt()],wr.prototype,"setUseRegistrationCallback",null),De([Xt()],wr.prototype,"setDisplayErrors",null),De([Xt()],wr.prototype,"addRegistration",null),De([ri()],wr.prototype,"isValid",null),wr=De([Ch(),gh({name:"registration",defaults:{useRegistrationCallback:!1,displayErrors:!1,registrations:[]}})],wr);let Sq=(()=>{class n{constructor(){this._vertical=!1,this._inset=!1}get vertical(){return this._vertical}set vertical(t){this._vertical=Dt(t)}get inset(){return this._inset}set inset(t){this._inset=Dt(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(t,i){2&t&&(en("aria-orientation",i.vertical?"vertical":"horizontal"),at("mat-divider-vertical",i.vertical)("mat-divider-horizontal",!i.vertical)("mat-divider-inset",i.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(t,i){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),n})(),EF=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn],Nn]}),n})();function CIe(n,e){if(1&n){const t=Lr();F(0,"mat-icon",2),ye("click",function(){return Vn(t),bt().setAllOpacity(20)}),Te(1,"refresh"),N()}2&n&&ie("matRippleCentered",!0)("matRippleUnbounded",!0)}function wIe(n,e){if(1&n){const t=Lr();F(0,"div",3),ye("mouseenter",function(){const s=Vn(t).$implicit;return bt().mouseOver(s)})("mouseleave",function(){return Vn(t),bt().mouseOut()}),et(1,"mat-icon",4),F(2,"div",5),Te(3),N(),F(4,"div",6),F(5,"ccf-opacity-slider",7,8),ye("opacityChange",function(r){return Vn(t),bt().updateOpacity(r)})("opacityReset",function(){return Vn(t),bt().resetItem()})("visibilityToggle",function(){const s=Vn(t).$implicit;return bt().toggleVisibility(s)}),N(),N(),N()}if(2&n){const t=e.$implicit,i=bt();at("selected",!!i.selection&&i.getId(0,i.selection)===i.getId(0,t)),Y(1),at("fade",!t.visible),Y(1),at("hidden",t.id===(null==i.selection?null:i.selection.id)),Yy("title",t.name),Y(1),Ai(t.name),Y(1),at("hidden",t.id!==(null==i.selection?null:i.selection.id)),Y(1),ie("visible",t.visible)("opacity",i.selection?null==i.selection?null:i.selection.opacity:20)}}let EIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-menu",this.hover=new Pe,this.itemsChange=new Pe}toggleVisibility(t){t=Object.assign(Object.assign({},t),{visible:!t.visible}),this.selection&&t.id===this.selection.id&&(this.selection=Object.assign(Object.assign({},this.selection),{visible:t.visible})),this.ga.event("visibility_toggled","visibility_menu",""+t.id,+t.visible),this.updateOpacity(t.opacity)}mouseOver(t){this.selection=t===this.selection?void 0:t,this.hover.emit(t)}mouseOut(){this.selection=void 0,this.hover.emit(void 0)}updateOpacity(t){if(!this.selection)return;const i=Object.assign(Object.assign({},this.selection),{opacity:t});this.selection=i,this.items=this.items.map(r=>r.id===i.id?i:r),this.ga.event("opacity_update","visibility_menu",""+i.id,i.opacity),this.itemsChange.emit(this.items)}resetItem(){if(this.selection){const t=Object.assign(Object.assign({},this.selection),{opacity:20,visible:!0});this.selection=t,this.items=this.items.map(i=>i.id===t.id?t:i),this.ga.event("item_reset","visibility_menu",""+t.id),this.itemsChange.emit(this.items)}}setAllOpacity(t){this.items=this.items.map(i=>Object.assign(Object.assign({},i),{opacity:t,visible:!0})),this.ga.event("all_items_opacity_update","visibility_menu",void 0,t),this.itemsChange.emit(this.items)}getId(t,i){return i.id}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-visibility-menu"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{items:"items",selection:"selection"},outputs:{hover:"hover",itemsChange:"itemsChange"},decls:2,vars:3,consts:[["class","icon reset","matRipple","",3,"matRippleCentered","matRippleUnbounded","click",4,"ngIf"],["class","item-entry",3,"selected","mouseenter","mouseleave",4,"ngFor","ngForOf","ngForTrackBy"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"item-entry",3,"mouseenter","mouseleave"],["svgIcon","app:opacity",1,"opacity-icon"],[1,"item-name",3,"title"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider",""]],template:function(t,i){1&t&&(Ct(0,CIe,2,2,"mat-icon",0),Ct(1,wIe,7,12,"div",1)),2&t&&(ie("ngIf",i.items.length),Y(1),ie("ngForOf",i.items)("ngForTrackBy",i.getId))},directives:[Is,Xl,Rs,Qo,KDe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;margin-right:0;margin-left:0;max-height:18rem;overflow-y:auto;scrollbar-width:thin}[_nghost-%COMP%] .icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s;position:absolute;top:3rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%]{display:flex;height:2.25rem;align-items:center;flex-shrink:0;position:relative}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]{z-index:1;transition:.6s}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:.5rem;opacity:1;transition-duration:.4s;transition-timing-function:ease-in-out;transition-property:opacity;max-width:calc(100% - 2.5rem)}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:calc(100% - 2rem);transition-duration:.3s;transition-timing-function:ease-in-out;transition-property:opacity;left:2rem;position:absolute;opacity:1}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.1s;transition-timing-function:ease-in-out;transition-property:opacity}"],changeDetection:0}),n})();const SIe=["*"],Mq=new _e("MatChipRemove"),xq=new _e("MatChipAvatar"),Tq=new _e("MatChipTrailingIcon");class MIe{constructor(e){this._elementRef=e}}const xIe=Nf(kf(Ff(MIe),"primary"),-1);let u0=(()=>{class n extends xIe{constructor(t,i,r,s,o,a,l,c){super(t),this._ngZone=i,this._changeDetectorRef=o,this._hasFocus=!1,this.chipListSelectable=!0,this._chipListMultiple=!1,this._chipListDisabled=!1,this._selected=!1,this._selectable=!0,this._disabled=!1,this._removable=!0,this._onFocus=new we,this._onBlur=new we,this.selectionChange=new Pe,this.destroyed=new Pe,this.removed=new Pe,this._addHostClassName(),this._chipRippleTarget=a.createElement("div"),this._chipRippleTarget.classList.add("mat-chip-ripple"),this._elementRef.nativeElement.appendChild(this._chipRippleTarget),this._chipRipple=new Oj(this,i,this._chipRippleTarget,r),this._chipRipple.setupTriggerEvents(t),this.rippleConfig=s||{},this._animationsDisabled="NoopAnimations"===l,this.tabIndex=null!=c&&parseInt(c)||-1}get rippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||!!this.rippleConfig.disabled}get selected(){return this._selected}set selected(t){const i=Dt(t);i!==this._selected&&(this._selected=i,this._dispatchSelectionChange())}get value(){return void 0!==this._value?this._value:this._elementRef.nativeElement.textContent}set value(t){this._value=t}get selectable(){return this._selectable&&this.chipListSelectable}set selectable(t){this._selectable=Dt(t)}get disabled(){return this._chipListDisabled||this._disabled}set disabled(t){this._disabled=Dt(t)}get removable(){return this._removable}set removable(t){this._removable=Dt(t)}get ariaSelected(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null}_addHostClassName(){const t="mat-basic-chip",i=this._elementRef.nativeElement;i.hasAttribute(t)||i.tagName.toLowerCase()===t?i.classList.add(t):i.classList.add("mat-standard-chip")}ngOnDestroy(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()}select(){this._selected||(this._selected=!0,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}deselect(){this._selected&&(this._selected=!1,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}selectViaInteraction(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0),this._changeDetectorRef.markForCheck())}toggleSelected(t=!1){return this._selected=!this.selected,this._dispatchSelectionChange(t),this._changeDetectorRef.markForCheck(),this.selected}focus(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0}remove(){this.removable&&this.removed.emit({chip:this})}_handleClick(t){this.disabled?t.preventDefault():t.stopPropagation()}_handleKeydown(t){if(!this.disabled)switch(t.keyCode){case 46:case 8:this.remove(),t.preventDefault();break;case 32:this.selectable&&this.toggleSelected(!0),t.preventDefault()}}_blur(){this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this._ngZone.run(()=>{this._hasFocus=!1,this._onBlur.next({chip:this})})})}_dispatchSelectionChange(t=!1){this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(lt),E(ii),E(Ij,8),E(Un),E(rt),E(Zo,8),fs("tabindex"))},n.\u0275dir=he({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,xq,5),Fi(r,Tq,5),Fi(r,Mq,5)),2&t){let s;Mt(s=xt())&&(i.avatar=s.first),Mt(s=xt())&&(i.trailingIcon=s.first),Mt(s=xt())&&(i.removeIcon=s.first)}},hostAttrs:["role","option",1,"mat-chip","mat-focus-indicator"],hostVars:14,hostBindings:function(t,i){1&t&&ye("click",function(s){return i._handleClick(s)})("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i.focus()})("blur",function(){return i._blur()}),2&t&&(en("tabindex",i.disabled?null:i.tabIndex)("disabled",i.disabled||null)("aria-disabled",i.disabled.toString())("aria-selected",i.ariaSelected),at("mat-chip-selected",i.selected)("mat-chip-with-avatar",i.avatar)("mat-chip-with-trailing-icon",i.trailingIcon||i.removeIcon)("mat-chip-disabled",i.disabled)("_mat-animation-noopable",i._animationsDisabled))},inputs:{color:"color",disableRipple:"disableRipple",tabIndex:"tabIndex",selected:"selected",value:"value",selectable:"selectable",disabled:"disabled",removable:"removable"},outputs:{selectionChange:"selectionChange",destroyed:"destroyed",removed:"removed"},exportAs:["matChip"],features:[ht]}),n})(),Aq=(()=>{class n{constructor(t,i){this._parentChip=t,"BUTTON"===i.nativeElement.nodeName&&i.nativeElement.setAttribute("type","button")}_handleClick(t){const i=this._parentChip;i.removable&&!i.disabled&&i.remove(),t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(u0),E(nt))},n.\u0275dir=he({type:n,selectors:[["","matChipRemove",""]],hostAttrs:[1,"mat-chip-remove","mat-chip-trailing-icon"],hostBindings:function(t,i){1&t&&ye("click",function(s){return i._handleClick(s)})},features:[At([{provide:Mq,useExisting:n}])]}),n})();const Dq=new _e("mat-chips-default-options"),DIe=CO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let OIe=0;class IIe{constructor(e,t){this.source=e,this.value=t}}let Oq=(()=>{class n extends DIe{constructor(t,i,r,s,o,a,l){super(a,s,o,l),this._elementRef=t,this._changeDetectorRef=i,this._dir=r,this.controlType="mat-chip-list",this._lastDestroyedChipIndex=null,this._destroyed=new we,this._uid="mat-chip-list-"+OIe++,this._tabIndex=0,this._userTabIndex=null,this._onTouched=()=>{},this._onChange=()=>{},this._multiple=!1,this._compareWith=(c,d)=>c===d,this._required=!1,this._disabled=!1,this.ariaOrientation="horizontal",this._selectable=!0,this.change=new Pe,this.valueChange=new Pe,this.ngControl&&(this.ngControl.valueAccessor=this)}get selected(){var t,i;return this.multiple?(null===(t=this._selectionModel)||void 0===t?void 0:t.selected)||[]:null===(i=this._selectionModel)||void 0===i?void 0:i.selected[0]}get role(){return this.empty?null:"listbox"}get multiple(){return this._multiple}set multiple(t){this._multiple=Dt(t),this._syncChipsState()}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this.writeValue(t),this._value=t}get id(){return this._chipInput?this._chipInput.id:this._uid}get required(){return this._required}set required(t){this._required=Dt(t),this.stateChanges.next()}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get focused(){return this._chipInput&&this._chipInput.focused||this._hasFocusedChip()}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this.chips||0===this.chips.length)}get shouldLabelFloat(){return!this.empty||this.focused}get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Dt(t),this._syncChipsState()}get selectable(){return this._selectable}set selectable(t){this._selectable=Dt(t),this.chips&&this.chips.forEach(i=>i.chipListSelectable=this._selectable)}set tabIndex(t){this._userTabIndex=t,this._tabIndex=t}get chipSelectionChanges(){return ki(...this.chips.map(t=>t.selectionChange))}get chipFocusChanges(){return ki(...this.chips.map(t=>t._onFocus))}get chipBlurChanges(){return ki(...this.chips.map(t=>t._onBlur))}get chipRemoveChanges(){return ki(...this.chips.map(t=>t.destroyed))}ngAfterContentInit(){this._keyManager=new aV(this.chips).withWrap().withVerticalOrientation().withHomeAndEnd().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe(zn(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.tabOut.pipe(zn(this._destroyed)).subscribe(()=>{this._allowFocusEscape()}),this.chips.changes.pipe(ns(null),zn(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>{this._syncChipsState()}),this._resetChips(),this._initializeSelection(),this._updateTabIndex(),this._updateFocusForDestroyedChips(),this.stateChanges.next()})}ngOnInit(){this._selectionModel=new uU(this.multiple,void 0,!1),this.stateChanges.next()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==this._disabled&&(this.disabled=!!this.ngControl.disabled))}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()}registerInput(t){this._chipInput=t,this._elementRef.nativeElement.setAttribute("data-mat-chip-input",t.id)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}writeValue(t){this.chips&&this._setSelectionByValue(t,!1)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}onContainerClick(t){this._originatesFromChip(t)||this.focus()}focus(t){this.disabled||this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(t),this.stateChanges.next()))}_focusInput(t){this._chipInput&&this._chipInput.focus(t)}_keydown(t){const i=t.target;i&&i.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())}_updateTabIndex(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)}_updateFocusForDestroyedChips(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){const t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=null}_isValidIndex(t){return t>=0&&tr.deselect()),Array.isArray(t))t.forEach(r=>this._selectValue(r,i)),this._sortValues();else{const r=this._selectValue(t,i);r&&i&&this._keyManager.setActiveItem(r)}}_selectValue(t,i=!0){const r=this.chips.find(s=>null!=s.value&&this._compareWith(s.value,t));return r&&(i?r.selectViaInteraction():r.select(),this._selectionModel.select(r)),r}_initializeSelection(){Promise.resolve().then(()=>{(this.ngControl||this._value)&&(this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value,!1),this.stateChanges.next())})}_clearSelection(t){this._selectionModel.clear(),this.chips.forEach(i=>{i!==t&&i.deselect()}),this.stateChanges.next()}_sortValues(){this._multiple&&(this._selectionModel.clear(),this.chips.forEach(t=>{t.selected&&this._selectionModel.select(t)}),this.stateChanges.next())}_propagateChanges(t){let i=null;i=Array.isArray(this.selected)?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.change.emit(new IIe(this,i)),this.valueChange.emit(i),this._onChange(i),this._changeDetectorRef.markForCheck()}_blur(){this._hasFocusedChip()||this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(()=>{this.focused||this._markAsTouched()}):this._markAsTouched())}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}_allowFocusEscape(){-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(()=>{this._tabIndex=this._userTabIndex||0,this._changeDetectorRef.markForCheck()}))}_resetChips(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()}_dropSubscriptions(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=null)}_listenToChipsSelection(){this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(t=>{t.source.selected?this._selectionModel.select(t.source):this._selectionModel.deselect(t.source),this.multiple||this.chips.forEach(i=>{!this._selectionModel.isSelected(i)&&i.selected&&i.deselect()}),t.isUserInput&&this._propagateChanges()})}_listenToChipsFocus(){this._chipFocusSubscription=this.chipFocusChanges.subscribe(t=>{let i=this.chips.toArray().indexOf(t.chip);this._isValidIndex(i)&&this._keyManager.updateActiveItem(i),this.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(()=>{this._blur(),this.stateChanges.next()})}_listenToChipsRemoved(){this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(t=>{const i=t.chip,r=this.chips.toArray().indexOf(t.chip);this._isValidIndex(r)&&i._hasFocus&&(this._lastDestroyedChipIndex=r)})}_originatesFromChip(t){let i=t.target;for(;i&&i!==this._elementRef.nativeElement;){if(i.classList.contains("mat-chip"))return!0;i=i.parentElement}return!1}_hasFocusedChip(){return this.chips&&this.chips.some(t=>t._hasFocus)}_syncChipsState(){this.chips&&this.chips.forEach(t=>{t._chipListDisabled=this._disabled,t._chipListMultiple=this.multiple})}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(Ko,8),E(cp,8),E($m,8),E(kv),E(lc,10))},n.\u0275cmp=Le({type:n,selectors:[["mat-chip-list"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,u0,5),2&t){let s;Mt(s=xt())&&(i.chips=s)}},hostAttrs:[1,"mat-chip-list"],hostVars:15,hostBindings:function(t,i){1&t&&ye("focus",function(){return i.focus()})("blur",function(){return i._blur()})("keydown",function(s){return i._keydown(s)}),2&t&&(sl("id",i._uid),en("tabindex",i.disabled?null:i._tabIndex)("aria-describedby",i._ariaDescribedby||null)("aria-required",i.role?i.required:null)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-multiselectable",i.multiple)("role",i.role)("aria-orientation",i.ariaOrientation),at("mat-chip-list-disabled",i.disabled)("mat-chip-list-invalid",i.errorState)("mat-chip-list-required",i.required))},inputs:{ariaOrientation:["aria-orientation","ariaOrientation"],multiple:"multiple",compareWith:"compareWith",value:"value",required:"required",placeholder:"placeholder",disabled:"disabled",selectable:"selectable",tabIndex:"tabIndex",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},exportAs:["matChipList"],features:[At([{provide:Nv,useExisting:n}]),ht],ngContentSelectors:SIe,decls:2,vars:0,consts:[[1,"mat-chip-list-wrapper"]],template:function(t,i){1&t&&(Dr(),F(0,"div",0),In(1),N())},styles:['.mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:"";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n'],encapsulation:2,changeDetection:0}),n})();const kIe={separatorKeyCodes:[13]};let Iq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[kv,{provide:Dq,useValue:kIe}],imports:[[Nn]]}),n})(),FIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-toggle",this.visible=!1,this.toggleLabel="",this.disabled=!1,this.visibilityChanged=new Pe}toggleVisibility(){this.visible=!this.visible,this.ga.event("visibility_toggled","visibility_toggle",""+this.visible),this.visibilityChanged.emit(this.visible)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-visibility-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{visible:"visible",toggleLabel:"toggleLabel",disabled:"disabled"},outputs:{visibilityChanged:"visibilityChanged"},decls:8,vars:9,consts:[[1,"toggle-div"],[1,"toggle-wrapper",3,"click"],[1,"icon-background"],["svgIcon","app:visibility_off_cube",1,"icon","block"],[1,"icon","green"],[1,"toggle-label"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"mat-chip",1),ye("click",function(){return i.toggleVisibility()}),F(2,"div",2),et(3,"mat-icon",3),F(4,"mat-icon",4),Te(5,"done"),N(),N(),F(6,"div",5),Te(7),N(),N(),N()),2&t&&(Y(1),at("disabled",i.disabled),Y(1),at("disabled",i.disabled),Y(1),at("hidden",i.visible),Y(1),at("hidden",!i.visible),Y(3),Ai(i.toggleLabel))},directives:[u0,Rs],styles:["[_nghost-%COMP%]{height:3rem;display:flex;align-items:center}[_nghost-%COMP%] .mat-chip{padding:0!important}[_nghost-%COMP%] .mat-chip.disabled{cursor:not-allowed!important}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;padding-top:1.5rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;display:flex;padding-left:.5rem;cursor:pointer;align-items:center;position:relative;border-width:.075rem;border-style:solid;height:2.25rem;border-radius:1.5rem;transition:background-color .2s ease-in-out}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%]{border-radius:1.5rem;height:2.06rem;width:2.06rem;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transition:.6s;position:absolute}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.block[_ngcontent-%COMP%]{width:1.125rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .toggle-label[_ngcontent-%COMP%]{font-weight:bold;margin-left:.5rem;padding-right:1.25rem;padding-left:.25rem}"],changeDetection:0}),n})();const NIe=["fileInput"];let LIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-json-file-reader",this.label="Upload",this.parsedJson=new Pe}triggerFileInput(){this.fileInput.nativeElement.click()}handleFile(t){const i=t.target;if(!i.files)return;const r=i.files[0],s=new FileReader;s.onload=()=>{const o=JSON.parse(s.result);this.ga.event("json_file_load_end","json_file_reader"),this.parsedJson.emit(o)},this.ga.event("json_file_load_start","json_file_reader"),s.readAsText(r)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-json-file-reader"]],viewQuery:function(t,i){if(1&t&&ni(NIe,5),2&t){let r;Mt(r=xt())&&(i.fileInput=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{label:"label"},outputs:{parsedJson:"parsedJson"},decls:4,vars:1,consts:[["mat-button","",1,"upload-button",3,"click"],["type","file","accept","application/JSON","name","fileInput","id","fileInput",2,"display","none",3,"change"],["fileInput",""]],template:function(t,i){1&t&&(F(0,"button",0),ye("click",function(){return i.triggerFileInput()}),Te(1),N(),F(2,"input",1,2),ye("change",function(s){return i.handleFile(s)}),N()),2&t&&(Y(1),Ai(i.label))},directives:[$f],styles:["[_nghost-%COMP%] .upload-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;cursor:pointer;font-weight:500}"]}),n})(),BIe=(()=>{class n{constructor(){this.clsName="ccf-details-label",this.details=[]}arrayToString(t){return t.join(", ")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-details-label"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{details:"details"},decls:1,vars:1,template:function(t,i){1&t&&Te(0),2&t&&Ai(i.arrayToString(i.details))},styles:["[_nghost-%COMP%]{display:block;height:2.25rem}"],changeDetection:0}),n})();const VIe=["trigger"],jIe=["panel"];function UIe(n,e){if(1&n&&(F(0,"span",8),Te(1),N()),2&n){const t=bt();Y(1),Ai(t.placeholder)}}function zIe(n,e){if(1&n&&(F(0,"span",12),Te(1),N()),2&n){const t=bt(2);Y(1),Ai(t.triggerValue)}}function HIe(n,e){1&n&&In(0,0,["*ngSwitchCase","true"])}function $Ie(n,e){1&n&&(F(0,"span",9),Ct(1,zIe,2,1,"span",10),Ct(2,HIe,1,0,"ng-content",11),N()),2&n&&(ie("ngSwitch",!!bt().customTrigger),Y(2),ie("ngSwitchCase",!0))}function GIe(n,e){if(1&n){const t=Lr();F(0,"div",13),F(1,"div",14,15),ye("@transformPanel.done",function(r){return Vn(t),bt()._panelDoneAnimatingStream.next(r.toState)})("keydown",function(r){return Vn(t),bt()._handleKeydown(r)}),In(3,1),N(),N()}if(2&n){const t=bt();ie("@transformPanelWrap",void 0),Y(1),function(n,e,t){zl(go,Nc,pg(Ce(),n,e,t),!0)}("mat-select-panel ",t._getPanelTheme(),""),gf("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),ie("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),en("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const WIe=[[["mat-select-trigger"]],"*"],qIe=["mat-select-trigger","*"],Pq={transformPanelWrap:Jl("transformPanelWrap",[Qs("* => void",Nne("@transformPanel",[Fne()],{optional:!0}))]),transformPanel:Jl("transformPanel",[br("void",Kn({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),br("showing",Kn({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),br("showing-multiple",Kn({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Qs("void => *",Mo("120ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void",Mo("100ms 25ms linear",Kn({opacity:0})))])};let Rq=0;const Fq=new _e("mat-select-scroll-strategy"),ZIe=new _e("MAT_SELECT_CONFIG"),QIe={provide:Fq,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};class JIe{constructor(e,t){this.source=e,this.value=t}}const ePe=Ff(Nf(em(CO(class{constructor(n,e,t,i,r){this._elementRef=n,this._defaultErrorStateMatcher=e,this._parentForm=t,this._parentFormGroup=i,this.ngControl=r}})))),Nq=new _e("MatSelectTrigger");let tPe=(()=>{class n extends ePe{constructor(t,i,r,s,o,a,l,c,d,f,p,g,_,y){var v,w,C;super(o,s,l,c,f),this._viewportRuler=t,this._changeDetectorRef=i,this._ngZone=r,this._dir=a,this._parentFormField=d,this._liveAnnouncer=_,this._defaultOptions=y,this._panelOpen=!1,this._compareWith=(x,L)=>x===L,this._uid="mat-select-"+Rq++,this._triggerAriaLabelledBy=null,this._destroy=new we,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+Rq++,this._panelDoneAnimatingStream=new we,this._overlayPanelClass=(null===(v=this._defaultOptions)||void 0===v?void 0:v.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(C=null===(w=this._defaultOptions)||void 0===w?void 0:w.disableOptionCentering)&&void 0!==C&&C,this.ariaLabel="",this.optionSelectionChanges=zb(()=>{const x=this.options;return x?x.changes.pipe(ns(x),Ir(()=>ki(...x.map(L=>L.onSelectionChange)))):this._ngZone.onStable.pipe(_i(1),Ir(()=>this.optionSelectionChanges))}),this.openedChange=new Pe,this._openedStream=this.openedChange.pipe(Tn(x=>x),be(()=>{})),this._closedStream=this.openedChange.pipe(Tn(x=>!x),be(()=>{})),this.selectionChange=new Pe,this.valueChange=new Pe,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==y?void 0:y.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=y.typeaheadDebounceInterval),this._scrollStrategyFactory=g,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(p)||0,this.id=this.id}get focused(){return this._focused||this._panelOpen}get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get required(){return this._required}set required(t){this._required=Dt(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=Dt(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=Dt(t)}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){(t!==this._value||this._multiple&&Array.isArray(t))&&(this.options&&this._setSelectionByValue(t),this._value=t)}get typeaheadDebounceInterval(){return this._typeaheadDebounceInterval}set typeaheadDebounceInterval(t){this._typeaheadDebounceInterval=So(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new uU(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Xo(),zn(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(zn(this._destroy)).subscribe(t=>{t.added.forEach(i=>i.select()),t.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(ns(null),zn(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?i.setAttribute("aria-labelledby",t):i.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}ngOnChanges(t){t.disabled&&this.stateChanges.next(),t.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}ngOnDestroy(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}close(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}writeValue(t){this.value=t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){const t=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&t.reverse(),t.join(", ")}return this._selectionModel.selected[0].viewValue}_isRtl(){return!!this._dir&&"rtl"===this._dir.value}_handleKeydown(t){this.disabled||(this.panelOpen?this._handleOpenKeydown(t):this._handleClosedKeydown(t))}_handleClosedKeydown(t){const i=t.keyCode,r=40===i||38===i||37===i||39===i,s=13===i||32===i,o=this._keyManager;if(!o.isTyping()&&s&&!Yo(t)||(this.multiple||t.altKey)&&r)t.preventDefault(),this.open();else if(!this.multiple){const a=this.selected;o.onKeydown(t);const l=this.selected;l&&a!==l&&this._liveAnnouncer.announce(l.viewValue,1e4)}}_handleOpenKeydown(t){const i=this._keyManager,r=t.keyCode,s=40===r||38===r,o=i.isTyping();if(s&&t.altKey)t.preventDefault(),this.close();else if(o||13!==r&&32!==r||!i.activeItem||Yo(t))if(!o&&this._multiple&&65===r&&t.ctrlKey){t.preventDefault();const a=this.options.some(l=>!l.disabled&&!l.selected);this.options.forEach(l=>{l.disabled||(a?l.select():l.deselect())})}else{const a=i.activeItemIndex;i.onKeydown(t),this._multiple&&s&&t.shiftKey&&i.activeItem&&i.activeItemIndex!==a&&i.activeItem._selectViaInteraction()}else t.preventDefault(),i.activeItem._selectViaInteraction()}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_onAttached(){this._overlayDir.positionChange.pipe(_i(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()})}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value),this.stateChanges.next()})}_setSelectionByValue(t){if(this._selectionModel.selected.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(i=>this._selectValue(i)),this._sortValues();else{const i=this._selectValue(t);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const i=this.options.find(r=>{if(this._selectionModel.isSelected(r))return!1;try{return null!=r.value&&this._compareWith(r.value,t)}catch(s){return!1}});return i&&this._selectionModel.select(i),i}_initKeyManager(){this._keyManager=new oV(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(zn(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(zn(this._destroy)).subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){const t=ki(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(zn(t)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),ki(...this.options.map(i=>i._stateChanges)).pipe(zn(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,i){const r=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(r!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),i&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),i&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),r!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((i,r)=>this.sortComparator?this.sortComparator(i,r,t):t.indexOf(i)-t.indexOf(r)),this.stateChanges.next()}}_propagateChanges(t){let i=null;i=this.multiple?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}_canOpen(){var t;return!this._panelOpen&&!this.disabled&&(null===(t=this.options)||void 0===t?void 0:t.length)>0}focus(t){this._elementRef.nativeElement.focus(t)}_getPanelAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(i?i+" ":"")+this.ariaLabelledby:i}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let r=(i?i+" ":"")+this._valueId;return this.ariaLabelledby&&(r+=" "+this.ariaLabelledby),r}_panelDoneAnimating(t){this.openedChange.emit(t)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}return n.\u0275fac=function(t){return new(t||n)(E(jf),E(Un),E(lt),E(kv),E(nt),E(Ko,8),E(cp,8),E($m,8),E(XE,8),E(lc,10),fs("tabindex"),E(Fq),E(wE),E(ZIe,8))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&(ni(VIe,5),ni(jIe,5),ni(DU,5)),2&t){let r;Mt(r=xt())&&(i.trigger=r.first),Mt(r=xt())&&(i.panel=r.first),Mt(r=xt())&&(i._overlayDir=r.first)}},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[ht,qn]}),n})(),nPe=(()=>{class n extends tPe{constructor(){super(...arguments),this._scrollTop=0,this._triggerFontSize=0,this._transformOrigin="top",this._offsetY=0,this._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}]}_calculateOverlayScroll(t,i,r){const s=this._getItemHeight();return Math.min(Math.max(0,s*t-i+s/2),r)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(zn(this._destroy)).subscribe(()=>{this.panelOpen&&(this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._changeDetectorRef.markForCheck())})}open(){super._canOpen()&&(super.open(),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const i=EO(t,this.options,this.optionGroups),r=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===i?0:function(n,e,t,i){return nt+i?Math.max(0,n-i+e):t}((t+i)*r,r,this.panel.nativeElement.scrollTop,256)}_positioningSettled(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}_panelDoneAnimating(t){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),super._panelDoneAnimating(t)}_getChangeEvent(t){return new JIe(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),i=this._viewportRuler.getViewportSize(),r=this._isRtl(),s=this.multiple?56:32;let o;if(this.multiple)o=40;else if(this.disableOptionCentering)o=16;else{let c=this._selectionModel.selected[0]||this.options.first;o=c&&c.group?32:16}r||(o*=-1);const a=0-(t.left+o-(r?s:0)),l=t.right+o-i.width+(r?0:s);a>0?o+=a+8:l>0&&(o-=l+8),this._overlayDir.offsetX=Math.round(o),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,i,r){const s=this._getItemHeight(),o=(s-this._triggerRect.height)/2,a=Math.floor(256/s);let l;return this.disableOptionCentering?0:(l=0===this._scrollTop?t*s:this._scrollTop===r?(t-(this._getItemCount()-a))*s+(s-(this._getItemCount()*s-256)%s):i-s/2,Math.round(-1*l-o))}_checkOverlayWithinViewport(t){const i=this._getItemHeight(),r=this._viewportRuler.getViewportSize(),s=this._triggerRect.top-8,o=r.height-this._triggerRect.bottom-8,a=Math.abs(this._offsetY),c=Math.min(this._getItemCount()*i,256)-a-this._triggerRect.height;c>o?this._adjustPanelUp(c,o):a>s?this._adjustPanelDown(a,s,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,i){const r=Math.round(t-i);this._scrollTop-=r,this._offsetY-=r,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,i,r){const s=Math.round(t-i);if(this._scrollTop+=s,this._offsetY+=s,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=r)return this._scrollTop=r,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),i=this._getItemCount(),r=Math.min(i*t,256),o=i*t-r;let a;a=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),a+=EO(a,this.options,this.optionGroups);const l=r/2;this._scrollTop=this._calculateOverlayScroll(a,l,o),this._offsetY=this._calculateOverlayOffsetY(a,l,o),this._checkOverlayWithinViewport(o)}_getOriginBasedOnOption(){const t=this._getItemHeight(),i=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-i+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275cmp=Le({type:n,selectors:[["mat-select"]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,Nq,5),Fi(r,WE,5),Fi(r,GE,5)),2&t){let s;Mt(s=xt())&&(i.customTrigger=s.first),Mt(s=xt())&&(i.options=s),Mt(s=xt())&&(i.optionGroups=s)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,i){1&t&&ye("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),2&t&&(en("id",i.id)("tabindex",i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-describedby",i._ariaDescribedby||null)("aria-activedescendant",i._getAriaActiveDescendant()),at("mat-select-disabled",i.disabled)("mat-select-invalid",i.errorState)("mat-select-required",i.required)("mat-select-empty",i.empty)("mat-select-multiple",i.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[At([{provide:Nv,useExisting:n},{provide:$E,useExisting:n}]),ht],ngContentSelectors:qIe,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(t,i){if(1&t&&(Dr(WIe),F(0,"div",0,1),ye("click",function(){return i.toggle()}),F(3,"div",2),Ct(4,UIe,2,1,"span",3),Ct(5,$Ie,3,2,"span",4),N(),F(6,"div",5),et(7,"div",6),N(),N(),Ct(8,GIe,4,14,"ng-template",7),ye("backdropClick",function(){return i.close()})("attach",function(){return i._onAttached()})("detach",function(){return i.close()})),2&t){const r=Ys(1);en("aria-owns",i.panelOpen?i.id+"-panel":null),Y(3),ie("ngSwitch",i.empty),en("id",i._valueId),Y(1),ie("ngSwitchCase",!0),Y(1),ie("ngSwitchCase",!1),Y(3),ie("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",r)("cdkConnectedOverlayOpen",i.panelOpen)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayMinWidth",null==i._triggerRect?null:i._triggerRect.width)("cdkConnectedOverlayOffsetY",i._offsetY)}},directives:[Doe,Cv,vD,DU,E3,sE],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[Pq.transformPanelWrap,Pq.transformPanel]},changeDetection:0}),n})(),Lq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[QIe],imports:[[bn,$v,qE,Nn],zv,Lv,qE,Nn]}),n})();function iPe(n,e){if(1&n&&(F(0,"mat-option",5),Te(1),N()),2&n){const t=e.$implicit;ie("value",t),Y(1),bw(" ",t.name," (",t.sites.length,") ")}}function rPe(n,e){if(1&n){const t=Lr();F(0,"mat-form-field",1),F(1,"mat-label",2),Te(2,"Landmark Set"),N(),F(3,"mat-select",3),ye("selectionChange",function(r){return Vn(t),bt().extractionSetChanged(r.value)}),Ct(4,iPe,2,3,"mat-option",4),N(),N()}if(2&n){const t=bt();Y(3),ie("value",t.sets[0]),Y(1),ie("ngForOf",t.sets)}}let sPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-extraction-set-dropdown",this.setChange=new Pe}extractionSetChanged(t){this.selected=t,this.ga.event("selected_extraction_set_change","extraction_set_dropdown",t.name),this.setChange.emit(t)}isMultiple(){return this.sets.length>1}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-extraction-set-dropdown"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{sets:"sets"},outputs:{setChange:"setChange"},decls:1,vars:1,consts:[["class","dropdown-form-field","appearance","fill",4,"ngIf"],["appearance","fill",1,"dropdown-form-field"],[1,"extraction-dropdown-label"],["disableOptionCentering","true","panelClass","extraction-set-panel",3,"value","selectionChange"],["class","extraction-set-options",3,"value",4,"ngFor","ngForOf"],[1,"extraction-set-options",3,"value"]],template:function(t,i){1&t&&Ct(0,rPe,5,2,"mat-form-field",0),2&t&&ie("ngIf",i.isMultiple())},directives:[Is,tm,Bf,nPe,Xl,WE],styles:[".extraction-set-panel{box-shadow:0 0 .3rem .1rem #9e9e9e;position:absolute;top:-1rem;left:1rem;width:10.5rem} .extraction-set-panel .extraction-set-options{height:2.5rem!important} .extraction-set-panel .extraction-set-options:first-child{margin-top:.5rem} .extraction-set-panel .extraction-set-options:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .mat-form-field{width:10.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper{padding-bottom:.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-flex{padding:0}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:.75rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:none} .cdk-overlay-pane{min-width:0rem!important}"],changeDetection:0}),n})();function oPe(n,e){if(1&n&&(ff(0),et(1,"ccf-details-label",19),yn(2,"async"),pf()),2&n){const t=bt();Y(1),ie("details",wn(2,1,t.detailsLabels$))}}function aPe(n,e){if(1&n){const t=Lr();F(0,"div",9),F(1,"ccf-extraction-set-dropdown",20,21),ye("setChange",function(r){return Vn(t),bt().model.setExtractionSites(r.sites)}),yn(3,"async"),N(),F(4,"ccf-visibility-menu",22),ye("itemsChange",function(r){return Vn(t),bt().model.setExtractionSites(r)})("hover",function(r){return Vn(t),bt().updateExtractionSiteTooltip(r)}),yn(5,"async"),N(),N()}if(2&n){const t=bt();Y(1),ie("sets",wn(3,2,t.model.extractionSets$)),Y(3),ie("items",wn(5,4,t.model.extractionSites$))}}function lPe(n,e){if(1&n&&(F(0,"div",23),Te(1),N()),2&n){const t=bt();Y(1),Os(" ",t.extractionSiteTooltip," ")}}const cPe=function(){return["Male","Female"]};let uPe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.registration=r,this.clsName="ccf-left-sidebar",this.disableSlider=!1,this.modalClosed=!1,this.sexByLabel$=this.model.sex$.pipe(be(s=>"female"===s?"Female":"Male")),this.sideByLabel$=this.model.side$.pipe(be(s=>"left"===s?"L":"R")),this.organSelected$=this.model.organ$.pipe(be(s=>void 0!==s)),this.detailsLabels$=or([this.model.organ$,this.model.side$,this.model.sex$]).pipe(be(([s,o,a])=>[null==s?void 0:s.name,o,a])),this.extractionSiteTooltip="",this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures],this.organList=_F}updateExtractionSiteTooltip(t){this.extractionSiteTooltip=(null==t?void 0:t.tooltip)?t.tooltip:""}setSexFromLabel(t){this.model.setSex("Female"===t?"female":"male")}setSideFromLabel(t){this.model.setSide("L"===t?"left":"right")}togglePreviousRegistrationBlocks(t){t&&(this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures]),this.model.toggleRegistrationBlocksVisibility(t,this.previousVisibilityItems)}updateRegistration(t){this.registration.editRegistration(t)}}return n.\u0275fac=function(t){return new(t||n)(E(Ui),E(si),E(wr))},n.\u0275cmp=Le({type:n,selectors:[["ccf-left-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{disableSlider:"disableSlider",modalClosed:"modalClosed"},decls:31,vars:22,consts:[[1,"scroll-wrapper"],[1,"container"],[4,"ngIf"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"disabled","labels","value","valueChange"],[1,"anatomical-structures-menu",3,"expanded"],[1,"expansion-header"],["matTooltip","Use opacity icons to change visibility of anatomical structures",1,"expansion-title"],[1,"expansion-content"],[3,"items","itemsChange"],[1,"extraction-menu",3,"expanded"],["matTooltip","Some organs have predefined landmarks to guide manual tissue registration--you can turn these on/off.",1,"expansion-title"],["class","expansion-content",4,"ngIf"],["toggleLabel","Previously Registered Blocks","matTooltip","If you previously registered tissue blocks, you can turn their positions on/off.",3,"visible","disabled","visibilityChanged"],[1,"space"],["class","extraction-site-tooltip mat-elevation-z8",4,"ngIf"],[1,"filler"],["label","UPLOAD PREVIOUS REGISTRATION DATA",3,"parsedJson"],[3,"details"],[3,"sets","setChange"],["dropdown",""],[3,"items","itemsChange","hover"],[1,"extraction-site-tooltip","mat-elevation-z8"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),Ct(2,oPe,3,3,"ng-container",2),yn(3,"async"),F(4,"div",3),F(5,"div",4),Te(6,"Donor Sex:"),N(),F(7,"ccf-labeled-slide-toggle",5),ye("valueChange",function(s){return i.setSexFromLabel(s)}),yn(8,"async"),N(),N(),et(9,"mat-divider"),F(10,"mat-expansion-panel",6),F(11,"mat-expansion-panel-header",7),F(12,"mat-panel-title",8),Te(13,"Anatomical Structures"),N(),N(),F(14,"div",9),F(15,"ccf-visibility-menu",10),ye("itemsChange",function(s){return i.model.setAnatomicalStructures(s)}),yn(16,"async"),N(),N(),N(),et(17,"mat-divider"),F(18,"mat-expansion-panel",11),F(19,"mat-expansion-panel-header",7),F(20,"mat-panel-title",12),Te(21,"Landmarks"),N(),N(),Ct(22,aPe,6,6,"div",13),yn(23,"async"),N(),et(24,"mat-divider"),F(25,"ccf-visibility-toggle",14),ye("visibilityChanged",function(s){return i.togglePreviousRegistrationBlocks(s)}),yn(26,"async"),N(),et(27,"div",15),Ct(28,lPe,2,1,"div",16),et(29,"div",17),F(30,"ccf-json-file-reader",18),ye("parsedJson",function(s){return i.updateRegistration(s)}),N(),N(),N()),2&t&&(Y(2),ie("ngIf",wn(3,11,i.page.registrationCallbackSet$)),Y(5),ie("disabled",i.disableSlider)("labels",lv(21,cPe))("value",wn(8,13,i.sexByLabel$)),Y(3),ie("expanded",i.modalClosed),Y(5),ie("items",wn(16,15,i.model.anatomicalStructures$)),Y(3),ie("expanded",i.modalClosed),Y(4),ie("ngIf",wn(23,17,i.organSelected$)),Y(3),ie("visible",wn(26,19,i.model.showPrevious$))("disabled",i.disableSlider),Y(3),ie("ngIf",i.extractionSiteTooltip.length>0))},directives:[Is,cc,vF,Sq,NM,LM,PG,EIe,FIe,LIe,BIe,sPe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{overflow-y:scroll;height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:1.5rem;margin-right:.375rem;min-height:100%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .space[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .ccf-organ-selector[_ngcontent-%COMP%]{margin-top:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .expansion-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header{-webkit-user-select:none;-moz-user-select:none;padding:0;font-weight:bold;height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator{display:flex;align-items:center;justify-content:center;height:24px;width:24px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%]{margin-bottom:.75rem;text-align:center;margin-top:2.25rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%]{width:100%;font-size:.9rem;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-site-tooltip[_ngcontent-%COMP%]{position:absolute;top:4rem;left:27rem;width:21rem;padding:1rem;border-radius:.5rem;border:1px solid;z-index:2}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})(),dPe=(()=>{class n{constructor(t,i,r){this.drawer=t,this.cdr=r,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new Ie;const s=i.connect(this);this.subscriptions.add(s.getMessagesFromSource(t).subscribe(o=>{this.handleMessage(o)&&r.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",i="arrow_left";return"end"===this.position&&([t,i]=[i,t]),this.opened?i:t}ngAfterViewInit(){setTimeout(()=>{this.position=this.drawer.position,this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return"drawer-toggled"===t.payload.type&&(this.opened=t.payload.opened,!0)}toggle(){const t=this.drawer,{opened:i,expanded:r}=t;i?r?t.closeExpanded():t.close():t.open()}}return n.\u0275fac=function(t){return new(t||n)(E(CF),E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,i){2&t&&(Fn(i.className),at("ccf-drawer-toggle-button-end",i.classEnd))},decls:4,vars:4,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,i){1&t&&(F(0,"mat-icon",0),ye("click",function(){return i.toggle()}),Te(1," arrow_right\n"),N(),F(2,"mat-icon",0),ye("click",function(){return i.toggle()}),Te(3," arrow_left\n"),N()),2&t&&(at("hidden","arrow_left"===i.icon),Y(2),at("hidden","arrow_right"===i.icon))},directives:[Rs],styles:["[_nghost-%COMP%]{position:absolute;top:calc(50% - 2.0625rem);right:-1.0625rem;width:1.0625rem;height:3rem;border-radius:0 .25rem .25rem 0;cursor:pointer;transition:.25s}.ccf-drawer-toggle-button-end[_nghost-%COMP%]{right:unset;left:calc(-1rem - 1px);border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{position:absolute;right:0rem;transition:.6s;padding-left:.15rem}[_nghost-%COMP%] .expand-collapse-icon.hidden[_ngcontent-%COMP%]{opacity:0}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}.mat-icon[_ngcontent-%COMP%]{right:.3rem;top:.675rem;padding-top:.05rem}"],changeDetection:0}),n})();const Bq={x:10,y:10,z:10};let hPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-block-size-input",this.blockSize=Bq,this.blockSizeChange=new Pe}updateBlockSizes(t,i){const r=t.target;this.blockSize=Object.assign(Object.assign({},this.blockSize),{[i]:+r.value}),this.ga.event("block_size_change","block_size_input",i,this.blockSize[i]),this.blockSizeChange.emit(this.blockSize)}refreshBlockSize(){this.blockSize=Bq,this.ga.event("block_size_reset","block_size_input"),this.blockSizeChange.emit(this.blockSize)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-block-size-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{blockSize:"blockSize"},outputs:{blockSizeChange:"blockSizeChange"},decls:19,vars:5,consts:[["matTooltip","Set the tissue block width, height and depth (dimensions)",1,"header"],[1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"size-inputs"],["floatLabel","always",1,"field"],[1,"text","label"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block width.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block height.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block depth.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Block Dimensions (mm)"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.refreshBlockSize()}),Te(5,"refresh"),N(),N(),F(6,"div",4),F(7,"mat-form-field",5),F(8,"mat-label",6),Te(9,"Width (X)"),N(),F(10,"input",7),ye("input",function(s){return i.updateBlockSizes(s,"x")}),N(),N(),F(11,"mat-form-field",5),F(12,"mat-label",6),Te(13,"Height (Y)"),N(),F(14,"input",8),ye("input",function(s){return i.updateBlockSizes(s,"y")}),N(),N(),F(15,"mat-form-field",5),F(16,"mat-label",6),Te(17,"Depth (Z)"),N(),F(18,"input",9),ye("input",function(s){return i.updateBlockSizes(s,"z")}),N(),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("value",i.blockSize.x),Y(4),ie("value",i.blockSize.y),Y(4),ie("value",i.blockSize.z))},directives:[cc,Rs,Qo,tm,Bf,Hb],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;height:1.5rem;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const Vq={thickness:NaN,numSlices:NaN};let fPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-slices-input",this.slicesConfig=Vq,this.slicesConfigChange=new Pe}get hasThicknessValue(){return!isNaN(this.slicesConfig.thickness)}updateSlicesData(t,i){const{value:r}=t.target;this.slicesConfig=Object.assign(Object.assign({},this.slicesConfig),{[i]:""!==r?+r:NaN}),this.ga.event("slice_config_update","slice_input",i,this.slicesConfig[i]),this.slicesConfigChange.emit(this.slicesConfig)}refreshSlices(){this.slicesConfig=Vq,this.ga.event("slice_config_reset","slice_input"),this.slicesConfigChange.emit(this.slicesConfig)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-slices-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{slicesConfig:"slicesConfig"},outputs:{slicesConfigChange:"slicesConfigChange"},decls:17,vars:6,consts:[[1,"header"],["matTooltip","\u201cAdd thickness of tissue sections and the total number of sections",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slices-inputs"],[1,"field"],[1,"text","label"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter thickness of tissue sections",1,"input",3,"value","input"],["matSuffix","",1,"suffix"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter total number of sections",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Sections"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.refreshSlices()}),Te(5," refresh "),N(),N(),F(6,"div",4),F(7,"mat-form-field",5),F(8,"mat-label",6),Te(9,"Thickness"),N(),F(10,"input",7),ye("input",function(s){return i.updateSlicesData(s,"thickness")}),N(),F(11,"div",8),Te(12,"\u03bcm"),N(),N(),F(13,"mat-form-field",5),F(14,"mat-label",6),Te(15,"# Sections"),N(),F(16,"input",9),ye("input",function(s){return i.updateSlicesData(s,"numSlices")}),N(),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("value",i.slicesConfig.thickness),Y(1),at("show",i.hasThicknessValue),Y(5),ie("value",i.slicesConfig.numSlices))},directives:[cc,Rs,Qo,tm,Bf,Hb,oOe,SO],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field.mat-focused[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%], [_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix.show[_ngcontent-%COMP%]{display:initial}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const jq={x:0,y:0,z:0};let pPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-rotation-slider",this.rotation=jq,this.rotationChange=new Pe}changeRotation(t,i){this.rotation=Object.assign(Object.assign({},this.rotation),{[i]:+t}),this.ga.event("rotation_update","rotation_slider",i,+t),this.rotationChange.emit(this.rotation)}resetRotation(){this.rotation=jq,this.ga.event("rotation_reset","rotation_slider"),this.rotationChange.emit(this.rotation)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-rotation-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{rotation:"rotation"},outputs:{rotationChange:"rotationChange"},decls:27,vars:23,consts:[[1,"header"],["matTooltip","Use sliders below to rotate tissue block for registration",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slider-box","red"],[1,"text","label"],[1,"slider-container"],[1,"slider",3,"max","min","step","thumbLabel","tickInterval","value","input"],[1,"text","value"],[1,"slider-box","green"],[1,"slider-box","blue"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Block Rotation"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.resetRotation()}),Te(5,"refresh"),N(),N(),F(6,"div",4),F(7,"span",5),Te(8,"X"),N(),F(9,"div",6),F(10,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"x")}),N(),N(),F(11,"span",8),Te(12),N(),N(),F(13,"div",9),F(14,"span",5),Te(15,"Y"),N(),F(16,"div",6),F(17,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"y")}),N(),N(),F(18,"span",8),Te(19),N(),N(),F(20,"div",10),F(21,"span",5),Te(22,"Z"),N(),F(23,"div",6),F(24,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"z")}),N(),N(),F(25,"span",8),Te(26),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.x),Y(2),Ai(i.rotation.x),Y(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.y),Y(2),Ai(i.rotation.y),Y(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.z),Y(2),Ai(i.rotation.z))},directives:[cc,Rs,Qo,wk],styles:["[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;height:4rem;padding-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:1rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{width:2.75rem;text-align:center}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{width:100%;padding:1rem 2rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:not(.cdk-focused) .mat-slider-thumb{width:1.25rem;height:1.25rem;transform:none}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper{right:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper:after{margin-top:-.25rem;height:.625rem!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container{margin-top:-.25rem;height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container .mat-slider-ticks{height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function mPe(n){const{subscriber:e,counter:t,period:i}=n;e.next(t),this.schedule({subscriber:e,counter:t+1,period:i},i)}const _Pe=["input"],yPe=function(n){return{enterDuration:n}},vPe=["*"],bPe=new _e("mat-checkbox-default-options",{providedIn:"root",factory:Uq});function Uq(){return{color:"accent",clickAction:"check-indeterminate"}}let CPe=0;const zq=Uq(),wPe={provide:Ao,useExisting:T(()=>Hq),multi:!0};class EPe{}const SPe=Nf(kf(Ff(em(class{constructor(n){this._elementRef=n}}))));let Hq=(()=>{class n extends SPe{constructor(t,i,r,s,o,a,l){super(t),this._changeDetectorRef=i,this._focusMonitor=r,this._ngZone=s,this._animationMode=a,this._options=l,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++CPe,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Pe,this.indeterminateChange=new Pe,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||zq,this.color=this.defaultColor=this._options.color||zq.color,this.tabIndex=parseInt(o)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=Dt(t)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t||Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}),this._syncIndeterminate(this._indeterminate)}ngAfterViewChecked(){}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}get checked(){return this._checked}set checked(t){t!=this.checked&&(this._checked=t,this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){const i=Dt(t);i!==this.disabled&&(this._disabled=i,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const i=t!=this._indeterminate;this._indeterminate=Dt(t),i&&(this._transitionCheckState(this._indeterminate?3:this.checked?1:2),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(t){this.checked=!!t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_getAriaChecked(){return this.checked?"true":this.indeterminate?"mixed":"false"}_transitionCheckState(t){let i=this._currentCheckState,r=this._elementRef.nativeElement;if(i!==t&&(this._currentAnimationClass.length>0&&r.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){r.classList.add(this._currentAnimationClass);const s=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{r.classList.remove(s)},1e3)})}}_emitChangeEvent(){const t=new EPe;t.source=this,t.checked=this.checked,this._controlValueAccessorChangeFn(this.checked),this.change.emit(t),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked}_onInputClick(t){var i;const r=null===(i=this._options)||void 0===i?void 0:i.clickAction;t.stopPropagation(),this.disabled||"noop"===r?!this.disabled&&"noop"===r&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==r&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,i){t?this._focusMonitor.focusVia(this._inputElement,t,i):this._inputElement.nativeElement.focus(i)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,i){if("NoopAnimations"===this._animationMode)return"";let r="";switch(t){case 0:if(1===i)r="unchecked-checked";else{if(3!=i)return"";r="unchecked-indeterminate"}break;case 2:r=1===i?"unchecked-checked":"unchecked-indeterminate";break;case 1:r=2===i?"checked-unchecked":"checked-indeterminate";break;case 3:r=1===i?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${r}`}_syncIndeterminate(t){const i=this._inputElement;i&&(i.nativeElement.indeterminate=t)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(hl),E(lt),fs("tabindex"),E(Zo,8),E(bPe,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-checkbox"]],viewQuery:function(t,i){if(1&t&&(ni(_Pe,5),ni(Qo,5)),2&t){let r;Mt(r=xt())&&(i._inputElement=r.first),Mt(r=xt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,i){2&t&&(sl("id",i.id),en("tabindex",null),at("mat-checkbox-indeterminate",i.indeterminate)("mat-checkbox-checked",i.checked)("mat-checkbox-disabled",i.disabled)("mat-checkbox-label-before","before"==i.labelPosition)("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],id:"id",labelPosition:"labelPosition",name:"name",required:"required",checked:"checked",disabled:"disabled",indeterminate:"indeterminate",ariaDescribedby:["aria-describedby","ariaDescribedby"],value:"value"},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[At([wPe]),ht],ngContentSelectors:vPe,decls:17,vars:21,consts:[[1,"mat-checkbox-layout"],["label",""],[1,"mat-checkbox-inner-container"],["type","checkbox",1,"mat-checkbox-input","cdk-visually-hidden",3,"id","required","checked","disabled","tabIndex","change","click"],["input",""],["matRipple","",1,"mat-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleRadius","matRippleCentered","matRippleAnimation"],[1,"mat-ripple-element","mat-checkbox-persistent-ripple"],[1,"mat-checkbox-frame"],[1,"mat-checkbox-background"],["version","1.1","focusable","false","viewBox","0 0 24 24",0,"xml","space","preserve","aria-hidden","true",1,"mat-checkbox-checkmark"],["fill","none","stroke","white","d","M4.1,12.7 9,17.6 20.3,6.3",1,"mat-checkbox-checkmark-path"],[1,"mat-checkbox-mixedmark"],[1,"mat-checkbox-label",3,"cdkObserveContent"],["checkboxLabel",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"span",2),F(3,"input",3,4),ye("change",function(s){return i._onInteractionEvent(s)})("click",function(s){return i._onInputClick(s)}),N(),F(5,"span",5),et(6,"span",6),N(),et(7,"span",7),F(8,"span",8),Ut.lFrame.currentNamespace=Bn,F(9,"svg",9),et(10,"path",10),N(),Ut.lFrame.currentNamespace=null,et(11,"span",11),N(),N(),F(12,"span",12,13),ye("cdkObserveContent",function(){return i._onLabelTextChange()}),F(14,"span",14),Te(15,"\xa0"),N(),In(16),N(),N()),2&t){const r=Ys(1),s=Ys(13);en("for",i.inputId),Y(2),at("mat-checkbox-inner-container-no-side-margin",!s.textContent||!s.textContent.trim()),Y(1),ie("id",i.inputId)("required",i.required)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex),en("value",i.value)("name",i.name)("aria-label",i.ariaLabel||null)("aria-labelledby",i.ariaLabelledby)("aria-checked",i._getAriaChecked())("aria-describedby",i.ariaDescribedby),Y(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Fg(19,yPe,"NoopAnimations"===i._animationMode?0:150))}},directives:[Qo,kD],styles:["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"],encapsulation:2,changeDetection:0}),n})(),$q=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),TPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn,_E,$q],Nn,$q]}),n})();const APe=["closeSearch"];function DPe(n,e){if(1&n){const t=Lr();F(0,"div",12),F(1,"mat-checkbox",13),ye("ngModelChange",function(r){const o=Vn(t).$implicit;return bt(2).checkedResults[o.id]=r}),Te(2),N(),N()}if(2&n){const t=e.$implicit,i=bt(2);Y(1),ie("ngModel",i.checkedResults[t.id]),Y(1),Os(" ",t.label," ")}}function OPe(n,e){if(1&n&&(F(0,"div",9),Ct(1,DPe,3,2,"div",10),F(2,"div",11),Te(3),yn(4,"i18nPlural"),N(),N()),2&n){const t=bt();Y(1),ie("ngForOf",t.searchResults.results)("ngForTrackBy",t.tagId),Y(2),Os(" ",QL(4,3,t.searchResults.totalCount,t.countMapping)," ")}}const Gq=5,d1={totalCount:0,results:[]};class gp{constructor(e,t,i){this.el=e,this.ga=t,this.clsName="ccf-tag-search",this.placeholder="Add Anatomical Structures ...",this.added=new Pe,this.countMapping={"=1":"1 result",other:"# results"},this.searchControl=new vh,this.searchResults=d1,this.checkedResults={},this.resultsVisible=!1,this.destroy$=new we,this.searchControl.valueChanges.pipe(zn(this.destroy$),function(n,e=_G){return t=>t.lift(new zMe(n,!!e.leading,!!e.trailing))}(()=>{var r;return function(n=0,e=Tf){return(!IO(n)||n<0)&&(n=0),(!e||"function"!=typeof e.schedule)&&(e=Tf),new oe(t=>(t.add(e.schedule(mPe,n,{subscriber:t,counter:0,period:n})),t))}(null!==(r=this.searchThrottle)&&void 0!==r?r:100)},{leading:!0,trailing:!0}),Ir(this.executeSearch)).subscribe(r=>{this.searchResults=r,this.checkedResults=this.getUpdatedCheckedResults(r),i.markForCheck()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}tagId(e,t){return t.id}hasCheckedTags(){return Object.values(this.checkedResults).some(e=>e)}addTags(){const{searchControl:e,searchResults:t,checkedResults:i}=this,r=t.results.filter(s=>i[s.id]);r.length>0&&(e.reset(),this.searchResults=d1,this.checkedResults={},this.ga.event("tags_added","tag_search",r.map(s=>s.label).join(",")),this.added.emit(r))}openResults(){this.resultsVisible||(this.resultsVisible=!0)}closeResults(e){const{closeSearch:t}=this;this.resultsVisible&&e.target instanceof Node&&(!this.el.nativeElement.contains(e.target)||t.nativeElement.contains(e.target))&&(this.resultsVisible=!1)}executeSearch(e){const{search:t,searchLimit:i=Gq}=this;return e&&t?li(t(e,i)).pipe(Sa(()=>[d1]),be(this.truncateResults)):[d1]}truncateResults(e){const{searchLimit:t=Gq}=this,i=e.results;return i.length>t?Object.assign(Object.assign({},e),{results:i.slice(0,t)}):e}getUpdatedCheckedResults(e){const t=this.checkedResults;return e.results.reduce((i,{id:r})=>{var s;return i[r]=null!==(s=t[r])&&void 0!==s&&s,i},{})}}function PPe(n,e){if(1&n&&(F(0,"div",11),F(1,"div",12),Te(2),N(),F(3,"div",13),Te(4),N(),N()),2&n){const t=e.$implicit;Y(2),Ai(t.label),Y(2),Ai(t.value)}}gp.\u0275fac=function(e){return new(e||gp)(E(nt),E(io),E(Un))},gp.\u0275cmp=Le({type:gp,selectors:[["ccf-tag-search"]],viewQuery:function(e,t){if(1&e&&ni(APe,5,nt),2&e){let i;Mt(i=xt())&&(t.closeSearch=i.first)}},hostVars:2,hostBindings:function(e,t){1&e&&ye("click",function(){return t.openResults()})("focusin",function(){return t.openResults()})("click",function(r){return t.closeResults(r)},!1,ny)("focusin",function(r){return t.closeResults(r)},!1,ny),2&e&&Fn(t.clsName)},inputs:{placeholder:"placeholder",search:"search",searchLimit:"searchLimit",searchThrottle:"searchThrottle"},outputs:{added:"added"},decls:10,vars:8,consts:[[1,"spacer"],["appearance","outline",1,"overlay"],[1,"search-box"],["matInput","","type","search",3,"placeholder","formControl"],["search",""],["matSuffix","",1,"add-button",3,"disabled","click"],["closeSearch",""],[1,"icon"],["class","results",4,"ngIf"],[1,"results"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"count"],[1,"item"],["labelPosition","after",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e){const i=Lr();et(0,"div",0),F(1,"mat-form-field",1),F(2,"div",2),et(3,"input",3,4),F(5,"button",5,6),ye("click",function(){Vn(i);const s=Ys(4);return t.addTags(),s.focus()}),F(7,"mat-icon",7),Te(8,"add"),N(),N(),N(),Ct(9,OPe,5,6,"div",8),N()}2&e&&(Y(1),at("expanded",t.resultsVisible),Y(2),ie("placeholder",t.placeholder)("formControl",t.searchControl),Y(2),at("active",t.hasCheckedTags()),ie("disabled",!t.hasCheckedTags()),Y(4),ie("ngIf",t.resultsVisible))},directives:[tm,Hb,Lb,ek,kM,SO,Rs,Is,Xl,Hq,dk],pipes:[x3],styles:["[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] .spacer[_ngcontent-%COMP%]{height:3.25rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;z-index:10}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;height:3rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .add-button[_ngcontent-%COMP%]{border-radius:.25rem;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;height:100%}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-top:.5rem;font-size:.75rem;text-align:end}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:0;border-radius:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex{padding-right:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline{opacity:1!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline-thick{opacity:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-infix{padding:.313rem .063rem .063rem;border:0}[_nghost-%COMP%] .overlay.expanded[_ngcontent-%COMP%] .mat-form-field-wrapper{box-shadow:0 0 .3rem .1rem #9e9e9e5e}"],changeDetection:0}),De([su.ak],gp.prototype,"executeSearch",null),De([su.ak],gp.prototype,"truncateResults",null);let RPe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.clsName="ccf-review-modal",this.metaData=i.metaData,this.registrationCallbackSet=i.registrationCallbackSet}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return n.\u0275fac=function(t){return new(t||n)(E(Gm),E(xk))},n.\u0275cmp=Le({type:n,selectors:[["ccf-review-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:14,vars:2,consts:[[1,"ccf-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography"],[1,"display-fields"],["class","field",4,"ngFor","ngForOf"],[1,"footer"],["mat-button","",1,"download-button",3,"click"],[1,"field"],[1,"label"],[1,"data"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),F(3,"mat-icon",3),ye("click",function(){return i.close()}),Te(4,"clear"),N(),N(),F(5,"div",4),F(6,"h2",5),Te(7,"Registration Review"),N(),F(8,"mat-dialog-content",6),F(9,"div",7),Ct(10,PPe,5,2,"div",8),N(),N(),F(11,"div",9),F(12,"button",10),ye("click",function(){return i.dialogRef.close(!0)}),Te(13),N(),N(),N(),N(),N()),2&t&&(Y(10),ie("ngForOf",i.metaData),Y(3),Ai(i.registrationCallbackSet?"REGISTER":"DOWNLOAD REGISTRATION DATA"))},directives:[Rs,xG,TG,Xl,$f],styles:[".mat-dialog-container{padding:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;background-color:#fff}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{text-align:center;font-size:1.5rem;margin-bottom:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%]{justify-content:space-around;display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%]{margin-top:2rem;margin-bottom:2rem;width:100%}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:50%;text-align:right;padding-right:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .data[_ngcontent-%COMP%]{width:50%;text-align:left;padding-left:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;margin-top:1rem;margin-right:1rem;cursor:pointer}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{padding-top:1.5rem;display:flex;justify-content:space-around}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .review-button[_ngcontent-%COMP%]{height:3rem}"]}),n})(),kPe=(()=>{class n{constructor(t,i){this.dialog=t,this.ga=i,this.clsName="ccf-review-button",this.registrationCallbackSet=!0,this.metaData=[],this.displayErrors=!0,this.registrationIsValid=!1,this.registerData=new Pe,this.enterErrorMode=new Pe}ngOnChanges(){this.registrationIsValid=this.metaData.length>=3&&this.metaData.slice(0,3).every(t=>t.value)}get disabled(){return!this.registrationIsValid}registerButtonClick(t){return t&&t.preventDefault(),this.enterErrorMode.emit(),this.registrationIsValid&&(this.ga.event("review_start","review_button"),this.launchReviewModal()),!1}launchReviewModal(){this.dialog.open(RPe,{panelClass:"modal-animated",width:"60rem",data:{registrationCallbackSet:this.registrationCallbackSet,metaData:this.metaData}}).afterClosed().subscribe(i=>{i&&(this.ga.event("register","review_button"),this.registerData.emit())})}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-review-button"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{registrationCallbackSet:"registrationCallbackSet",metaData:"metaData",displayErrors:"displayErrors",registrationIsValid:"registrationIsValid"},outputs:{registerData:"registerData",enterErrorMode:"enterErrorMode"},features:[qn],decls:2,vars:4,consts:[["mat-button","",1,"review-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(F(0,"button",0),ye("click",function(s){return i.registerButtonClick(s)}),Te(1),N()),2&t&&(at("disabled",i.disabled),ie("matTooltip",i.disabled?"Required: Select an organ and position tissue block inside organ.":"Review registration and submit/download."),Y(1),Os(" ",i.registrationCallbackSet?"REVIEW AND REGISTER":"REVIEW AND DOWNLOAD","\n"))},directives:[$f,cc],styles:[".review-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;font-weight:500}.review-button.disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]}),n})();function FPe(n,e){if(1&n){const t=Lr();F(0,"mat-chip",2),ye("removed",function(){const s=Vn(t).$implicit;return bt().removeTag(s)}),Te(1),F(2,"mat-icon",3),Te(3,"cancel"),N(),N()}if(2&n){const t=e.$implicit;Fn(bt().tagClasses(t)),Y(1),Os(" ",t.label," ")}}let NPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-tag-list",this.tagRemoved=new Pe,this.tagsChange=new Pe}tagId(t,i){return i.id}tagClasses(t){return"added"===t.type?["added"]:["assigned"]}removeTag(t){this.tags=this.tags.filter(i=>i!==t),this.ga.event("tag_removed","tag_list",t.label),this.tagRemoved.emit(t),this.tagsChange.emit(this.tags)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-tag-list"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{tags:"tags"},outputs:{tagRemoved:"tagRemoved",tagsChange:"tagsChange"},decls:2,vars:2,consts:[["selectable","false"],["removable","","disableRipple","",3,"class","removed",4,"ngFor","ngForOf","ngForTrackBy"],["removable","","disableRipple","",3,"removed"],["matChipRemove","",1,"icon","remove"]],template:function(t,i){1&t&&(F(0,"mat-chip-list",0),Ct(1,FPe,4,3,"mat-chip",1),N()),2&t&&(Y(1),ie("ngForOf",i.tags)("ngForTrackBy",i.tagId))},directives:[Oq,Xl,u0,Rs,Aq],styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto}[_nghost-%COMP%] .mat-chip-list-wrapper{margin:0}"],changeDetection:0}),n})();function LPe(n,e){if(1&n){const t=Lr();F(0,"ccf-tag-list",20),ye("tagRemoved",function(r){return Vn(t),bt().astags.removeTag(r)}),yn(1,"async"),N()}2&n&&ie("tags",wn(1,1,bt().astags.tags$))}function BPe(n,e){}const VPe=function(){return[]};let jPe=(()=>{class n{constructor(t,i,r,s){this.model=t,this.registration=i,this.page=r,this.astags=s,this.clsName="ccf-right-sidebar",this.modalClosed=!1}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(wr),E(Ui),E(Io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-right-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{modalClosed:"modalClosed"},decls:34,vars:28,consts:[[1,"scroll-wrapper"],[1,"container"],[1,"info-button-container"],["videoID","gY3_-LIoKaU","infoTitle","HuBMAP CCF Registration User Interface"],[3,"blockSize","blockSizeChange"],[3,"slicesConfig","slicesConfigChange"],[3,"rotation","rotationChange"],[1,"tags-container",3,"expanded"],[1,"header"],["matTooltip","Review tags generated via collision detection. Add or delete tags as needed."],[3,"search","added"],["class","tag-list",3,"tags","tagRemoved",4,"ngIf","ngIfElse"],["tagListPlaceholder",""],[1,"legend"],[1,"dot","assigned"],[1,"text","assigned"],[1,"dot","added"],[1,"text","added"],[1,"filler"],[3,"registrationCallbackSet","displayErrors","registrationIsValid","metaData","registerData","enterErrorMode"],[1,"tag-list",3,"tags","tagRemoved"]],template:function(t,i){if(1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),et(3,"ccf-info-button",3),N(),F(4,"ccf-block-size-input",4),ye("blockSizeChange",function(s){return i.model.setBlockSize(s)}),yn(5,"async"),N(),F(6,"ccf-slices-input",5),ye("slicesConfigChange",function(s){return i.model.setSlicesConfig(s)}),yn(7,"async"),N(),F(8,"ccf-rotation-slider",6),ye("rotationChange",function(s){return i.model.setRotation(s)}),yn(9,"async"),N(),et(10,"mat-divider"),F(11,"mat-expansion-panel",7),F(12,"mat-expansion-panel-header",8),F(13,"mat-panel-title",9),Te(14,"Anatomical Structure Tags"),N(),N(),F(15,"ccf-tag-search",10),ye("added",function(s){return i.astags.addTags(s)}),N(),Ct(16,LPe,2,3,"ccf-tag-list",11),yn(17,"async"),Ct(18,BPe,0,0,"ng-template",null,12,Rw),F(20,"div",13),et(21,"span",14),F(22,"span",15),Te(23,"Assigned"),N(),et(24,"span",16),F(25,"span",17),Te(26,"Added"),N(),N(),N(),et(27,"mat-divider"),et(28,"div",18),F(29,"ccf-review-button",19),ye("registerData",function(){return i.registration.register()})("enterErrorMode",function(){return i.registration.setDisplayErrors(!i.registration.isValid)}),yn(30,"async"),yn(31,"async"),yn(32,"async"),yn(33,"async"),N(),N(),N()),2&t){const r=Ys(19);let s,o;Y(4),ie("blockSize",wn(5,11,i.model.blockSize$)),Y(2),ie("slicesConfig",wn(7,13,i.model.slicesConfig$)),Y(2),ie("rotation",wn(9,15,i.model.rotation$)),Y(3),ie("expanded",i.modalClosed),Y(4),ie("search",i.astags.searchExternal),Y(1),ie("ngIf",null==(s=wn(17,17,i.model.organ$))?null:s.name)("ngIfElse",r),Y(13),ie("registrationCallbackSet",wn(30,19,i.page.registrationCallbackSet$))("displayErrors",wn(31,21,i.registration.displayErrors$))("registrationIsValid",wn(32,23,i.registration.valid$))("metaData",null!==(o=wn(33,25,i.registration.metadata$))&&void 0!==o?o:lv(27,VPe))}},directives:[rOe,hPe,fPe,pPe,Sq,NM,LM,PG,cc,gp,Is,kPe,NPe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100%;margin-left:1.5rem;margin-right:.375rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .info-button-container[_ngcontent-%COMP%]{height:3.75rem;display:flex;justify-content:flex-end}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 .5rem 0 0;font-weight:bold;-webkit-user-select:none;-moz-user-select:none;font-size:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%]{overflow:visible}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding-left:0;padding-right:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{margin-top:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%] .icon.add[_ngcontent-%COMP%]{position:absolute;width:3.625rem;height:3.625rem;font-size:3.625rem;top:-1.9375rem;right:-1.1875rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list[_ngcontent-%COMP%]{max-height:32rem;margin-left:-1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list-placeholder[_ngcontent-%COMP%]{display:flex;height:4rem;align-items:center;justify-content:center;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{display:flex;width:100%;margin-top:1.5rem;align-items:center;font-size:.9rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{display:inline-block;width:1rem;height:1rem;border-radius:50%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.assigned[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.added[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function Wq(n,e){return Xo((t,i)=>e?e(t[n],i[n]):t[n]===i[n])}const UPe=["input"],zPe=function(n){return{enterDuration:n}},HPe=["*"],$Pe=new _e("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let qq=0;const WPe={provide:Ao,useExisting:T(()=>Zq),multi:!0};class Yq{constructor(e,t){this.source=e,this.value=t}}const Xq=new _e("MatRadioGroup");let Kq=(()=>{class n{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+qq++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new Pe}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=Dt(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(i=>{i.checked=this.value===i.value,i.checked&&(this._selected=i)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new Yq(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return n.\u0275fac=function(t){return new(t||n)(E(Un))},n.\u0275dir=he({type:n,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),n})(),Zq=(()=>{class n extends Kq{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,selectors:[["mat-radio-group"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,Qq,5),2&t){let s;Mt(s=xt())&&(i._radios=s)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[At([WPe,{provide:Xq,useExisting:n}]),ht]}),n})();class qPe{constructor(e){this._elementRef=e}}const YPe=Ff(Nf(qPe));let XPe=(()=>{class n extends YPe{constructor(t,i,r,s,o,a,l,c){super(i),this._changeDetector=r,this._focusMonitor=s,this._radioDispatcher=o,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++qq,this.id=this._uniqueId,this.change=new Pe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===a,c&&(this.tabIndex=So(c,0)),this._removeUniqueSelectionListener=o.listen((d,f)=>{d!==this.id&&f===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const i=Dt(t);this._checked!==i&&(this._checked=i,i&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!i&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),i&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(Dt(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=Dt(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new Yq(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const i=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),i&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(Kq),E(nt),E(Un),E(hl),E(tS),E(String),E(void 0),E(String))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&ni(UPe,5),2&t){let r;Mt(r=xt())&&(i._inputElement=r.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[ht]}),n})(),Qq=(()=>{class n extends XPe{constructor(t,i,r,s,o,a,l,c){super(t,i,r,s,o,a,l,c)}}return n.\u0275fac=function(t){return new(t||n)(E(Xq,8),E(nt),E(Un),E(hl),E(tS),E(Zo,8),E($Pe,8),fs("tabindex"))},n.\u0275cmp=Le({type:n,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._inputElement.nativeElement.focus()}),2&t&&(en("tabindex",null)("id",i.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),at("mat-radio-checked",i.checked)("mat-radio-disabled",i.disabled)("_mat-animation-noopable",i._noopAnimations)("mat-primary","primary"===i.color)("mat-accent","accent"===i.color)("mat-warn","warn"===i.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[ht],ngContentSelectors:HPe,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"span",2),et(3,"span",3),et(4,"span",4),F(5,"input",5,6),ye("change",function(s){return i._onInputInteraction(s)})("click",function(s){return i._onInputClick(s)}),N(),F(7,"span",7),et(8,"span",8),N(),N(),F(9,"span",9),F(10,"span",10),Te(11,"\xa0"),N(),In(12),N(),N()),2&t){const r=Ys(1);en("for",i.inputId),Y(5),ie("id",i.inputId)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex)("required",i.required),en("name",i.name)("value",i.value)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),Y(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Fg(18,zPe,i._noopAnimations?0:150)),Y(2),at("mat-radio-label-before","before"==i.labelPosition)}},directives:[Qo],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),n})(),KPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn],Nn]}),n})();const ZPe=["label"],QPe=["options"],JPe=function(){return["Register","3D\xa0Preview"]};let eRe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-stage-nav",this.side="anterior",this.view3D=!1,this.sideChange=new Pe,this.view3DChange=new Pe,this.isDropdownActive=!1,this.isDropdownHidden=!0}set useDropdownMenu(t){this.isDropdownActive=t,this.isDropdownHidden=!0}get labelEl(){return this.labelRef.nativeElement}get optionsEl(){return this.optionsRef.nativeElement}handleClick(t){const{isDropdownHidden:i,labelEl:r,optionsEl:s}=this;r.contains(t)?this.isDropdownHidden=!i:s.contains(t)||(this.isDropdownHidden=!0)}updateSide(t){this.ga.event("side_update","stage_nav",t),"3D"===t?this.updateView(!0):(this.updateView(!1),this.side=t,this.sideChange.emit(this.side))}updateView(t){this.view3D=t,this.ga.event("view_update","stage_nav",t?"3D":"Register"),this.view3DChange.emit(this.view3D)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-stage-nav"]],viewQuery:function(t,i){if(1&t&&(ni(ZPe,7),ni(QPe,7)),2&t){let r;Mt(r=xt())&&(i.labelRef=r.first),Mt(r=xt())&&(i.optionsRef=r.first)}},hostVars:2,hostBindings:function(t,i){1&t&&ye("click",function(s){return i.handleClick(s.target)},!1,Qp),2&t&&Fn(i.clsName)},inputs:{useDropdownMenu:"useDropdownMenu",side:"side",view3D:"view3D"},outputs:{sideChange:"sideChange",view3DChange:"view3DChange"},decls:18,vars:10,consts:[[1,"dropdown-label"],["label",""],[1,"stage-options"],["options",""],[1,"input-group",3,"value","change"],["value","left",1,"nav-input"],["value","right",1,"nav-input"],["value","anterior","checked","",1,"nav-input"],["value","posterior",1,"nav-input"],["matTooltip","Change view.",1,"view-slider",3,"labels","value","valueChange"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"mat-label"),Te(3,"Options"),N(),F(4,"mat-icon"),Te(5,"arrow_drop_down"),N(),N(),F(6,"div",2,3),F(8,"mat-radio-group",4),ye("change",function(s){return i.updateSide(s.value)}),F(9,"mat-radio-button",5),Te(10,"Left"),N(),F(11,"mat-radio-button",6),Te(12,"Right"),N(),F(13,"mat-radio-button",7),Te(14,"Anterior"),N(),F(15,"mat-radio-button",8),Te(16,"Posterior"),N(),N(),F(17,"ccf-labeled-slide-toggle",9),ye("valueChange",function(s){return i.updateView("Register"!==s)}),N(),N()),2&t&&(at("dropdown",i.isDropdownActive),Y(6),at("dropdowncontainer",i.isDropdownActive)("hidden",i.isDropdownActive&&i.isDropdownHidden),Y(2),ie("value",i.side),Y(9),ie("labels",lv(9,JPe))("value",i.view3D?"3D\xa0Preview":"Register"))},directives:[Bf,Rs,Zq,Qq,vF,cc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%]{display:none;align-items:center}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-label[_ngcontent-%COMP%], [_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{line-height:1.5rem}[_nghost-%COMP%] .dropdown-label.dropdown[_ngcontent-%COMP%]{display:flex;cursor:pointer;align-items:start}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{margin-right:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{margin-left:-1rem;margin-bottom:1.5rem;white-space:nowrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-radius:.25rem;width:16.5rem;position:absolute;top:3.5rem;z-index:1;transition:opacity .25s}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{margin-left:1.5rem;margin-right:0;display:flex;flex-wrap:wrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{display:flex;margin:0 1.5rem 0 0;height:2.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{display:flex;align-items:center;height:3rem;margin:0 .5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:visible;border-top:2px solid}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%]{visibility:hidden;opacity:0;transition:visibility .25s,opacity .25s}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:hidden}"],changeDetection:0}),n})();function tRe(n,e){if(1&n){const t=Lr();F(0,"ccf-body-ui",16),ye("rotationChange",function(r){Vn(t),bt();const s=Ys(24);return s.rotation=r[0],s.rotationX=r[1]}),yn(1,"async"),yn(2,"async"),yn(3,"async"),N()}if(2&n){const t=bt();ie("scene",wn(1,5,t.scene.nodes$))("rotation",wn(2,7,t.scene.rotation$))("bounds",wn(3,9,t.bounds$))("zoom",11.5)("interactive",!0)}}function nRe(n,e){if(1&n){const t=Lr();F(0,"ccf-body-ui",17),ye("nodeDrag",function(r){return Vn(t),bt().handleNodeDrag(r)}),yn(1,"async"),yn(2,"async"),N()}if(2&n){const t=bt();ie("scene",wn(1,4,t.scene.rotatedNodes$))("interactive",!1)("bounds",wn(2,6,t.bounds$))("zoom",11.5)}}function iRe(n,e){1&n&&et(0,"ccf-store-debug",18)}function rRe(n,e){if(1&n){const t=Lr();F(0,"div",19),F(1,"button",20),ye("click",function(){Vn(t);const r=bt();return r.debugMode=!r.debugMode}),Te(2,"State"),N(),F(3,"button",21),ye("click",function(){return Vn(t),bt().registration.setUseRegistrationCallback(!0)}),Te(4,"Use callback"),N(),F(5,"button",21),ye("click",function(){return Vn(t),bt().registration.setUseRegistrationCallback(!1)}),Te(6,"Use download"),N(),N()}}let sRe=(()=>{class n{constructor(t,i,r,s,o,a){this.model=t,this.page=i,this.registration=r,this.scene=s,this.rootRef=o,this.cdr=a,this.clsName="ccf-content",this.position$=this.model.position$.pipe(be(l=>({x:Math.floor(l.x),y:Math.floor(l.y),z:Math.floor(l.z)}))),this.is3DView$=this.model.viewType$.pipe(be(l=>"3d"===l)),this.bounds$=this.model.organDimensions$.pipe(be(l=>({x:Math.max(l.x,this.model.defaultPosition.x+40)/1e3,y:Math.max(l.y,this.model.defaultPosition.y+40)/1e3,z:Math.max(l.z,this.model.defaultPosition.z+40)/1e3})),Wq("x"),Wq("y")),this.isNarrowView=!1,this.debugMode=!1,this.showDebugButtons=!Sh.production}ngOnInit(){this.sensor=new vG.ResizeSensor(this.rootRef.nativeElement,({width:t})=>{const i=t<440;this.isNarrowView!==i&&(this.isNarrowView=i,this.cdr.markForCheck())})}ngOnDestroy(){this.sensor.detach()}setViewType(t){this.model.setViewType(t?"3d":"register")}resetStage(){this.model.setPosition(this.model.defaultPosition),this.model.setViewSide("anterior"),this.model.setViewType("register")}handleNodeDrag(t){if("#DraftPlacement"===t.node["@id"]&&t.info.coordinate){const[i,r]=t.info.coordinate.map(d=>1e3*d),{position:s,viewSide:o,organDimensions:a}=this.model.snapshot,l=[a.x,a.y,a.z].map(d=>d/2);let c=s;switch(o){case"anterior":c={x:i+l[0],y:r+l[1],z:s.z};break;case"posterior":c={x:-i+l[0],y:r+l[1],z:s.z};break;case"left":c={x:s.x,y:r+l[1],z:-i+l[2]};break;case"right":c={x:s.x,y:r+l[1],z:i+l[2]}}this.model.setPosition(c)}}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(Ui),E(wr),E(ss),E(nt),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:29,vars:34,consts:[[1,"top-bar"],[3,"useDropdownMenu","view3D","side","view3DChange","sideChange"],["matRipple","","matRippleColor","rgba(204, 204, 204, 0.25)",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"main-content"],["class","body-ui","camera","perspective",3,"scene","rotation","bounds","zoom","interactive","rotationChange",4,"ngIf"],["class","body-ui","camera","orthographic",3,"scene","interactive","bounds","zoom","nodeDrag",4,"ngIf"],[1,"gizmo-area"],[1,"position-display"],[1,"position"],[1,"x"],[1,"y"],[1,"z"],[1,"gizmo",3,"scene","rotation","interactive","zoom"],["gizmo",""],["class","debug",4,"ngIf"],["style","position: absolute; bottom: 1rem; display: flex; flex-direction: row; justify-content: space-between; width: 7rem;",4,"ngIf"],["camera","perspective",1,"body-ui",3,"scene","rotation","bounds","zoom","interactive","rotationChange"],["camera","orthographic",1,"body-ui",3,"scene","interactive","bounds","zoom","nodeDrag"],[1,"debug"],[2,"position","absolute","bottom","1rem","display","flex","flex-direction","row","justify-content","space-between","width","7rem"],[2,"width","3rem","font-size",".7rem",3,"click"],[3,"click"]],template:function(t,i){if(1&t&&(F(0,"div",0),F(1,"ccf-stage-nav",1),ye("view3DChange",function(s){return i.setViewType(s)})("sideChange",function(s){return i.model.setViewSide(s)}),yn(2,"async"),yn(3,"async"),N(),F(4,"mat-icon",2),ye("click",function(){return i.resetStage()}),Te(5,"refresh"),N(),N(),F(6,"div",3),Ct(7,tRe,4,11,"ccf-body-ui",4),yn(8,"async"),Ct(9,nRe,3,8,"ccf-body-ui",5),yn(10,"async"),F(11,"div",6),F(12,"div",7),F(13,"div",8),F(14,"div",9),Te(15),yn(16,"async"),N(),F(17,"div",10),Te(18),yn(19,"async"),N(),F(20,"div",11),Te(21),yn(22,"async"),N(),N(),N(),et(23,"ccf-body-ui",12,13),yn(25,"async"),yn(26,"async"),N(),N(),Ct(27,iRe,1,0,"ccf-store-debug",14),Ct(28,rRe,7,0,"div",15)),2&t){let r,s,o;Y(1),ie("useDropdownMenu",i.isNarrowView)("view3D",wn(2,16,i.is3DView$))("side",wn(3,18,i.model.viewSide$)),Y(3),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(3),ie("ngIf","3d"===wn(8,20,i.model.viewType$)),Y(2),ie("ngIf","register"===wn(10,22,i.model.viewType$)),Y(6),Os("X: ",null==(r=wn(16,24,i.position$))?null:r.x,""),Y(3),Os("Y: ",null==(s=wn(19,26,i.position$))?null:s.y,""),Y(3),Os("Z: ",null==(o=wn(22,28,i.position$))?null:o.z,""),Y(2),ie("scene",wn(25,30,i.scene.gizmo$))("rotation",wn(26,32,i.scene.rotation$))("interactive",!1)("zoom",9.5),Y(4),ie("ngIf",i.showDebugButtons&&i.debugMode),Y(1),ie("ngIf",i.showDebugButtons)}},directives:[eRe,Rs,Qo,Is,IDe,VDe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;padding:1.5rem;overflow:hidden}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%]{display:flex;height:calc(100% - 1rem)}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .body-ui[_ngcontent-%COMP%]{flex:auto;transition:opacity 1s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%]{width:4rem;margin-top:1.5rem;margin-left:1.5rem;z-index:10}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .position-display[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:1.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%]{height:5.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{opacity:0;z-index:0}[_nghost-%COMP%] .ccf-store-debug[_ngcontent-%COMP%]{color:#fff;position:absolute;top:.5rem;max-width:55rem}"],changeDetection:0}),n})();const oRe=function(n){return[n]};let aRe=(()=>{class n{constructor(t,i,r,s,o,a,l,c){this.model=t,this.page=i,this.consentService=r,this.snackbar=s,this.theming=o,this.globalConfig=c,this.organList=_F,this.open=!0,this.registrationStarted=!1,this.disablePositionChange=!1,this.subscriptions=new Ie,o.initialize(a,l),this.subscriptions.add(i.registrationCallbackSet$.subscribe(d=>{this.open=!d})),this.subscriptions.add(i.registrationStarted$.subscribe(d=>{this.registrationStarted=d}))}ngOnInit(){const t=this.snackbar.openFromComponent(pOe,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3})}handleKey(t){const i=this.model.snapshot.position;if(this.disablePositionChange||!this.registrationStarted)return;t.preventDefault();const r=t.repeat?1:.5;let s=i;switch(t.key){case"q":s=Object.assign(Object.assign({},i),{z:i.z+r});break;case"e":s=Object.assign(Object.assign({},i),{z:i.z-r});break;case"w":s=Object.assign(Object.assign({},i),{y:i.y+r});break;case"s":s=Object.assign(Object.assign({},i),{y:i.y-r});break;case"a":s=Object.assign(Object.assign({},i),{x:i.x-r});break;case"d":s=Object.assign(Object.assign({},i),{x:i.x+r})}this.model.setPosition(s)}handleClick(t){this.disablePositionChange="INPUT"===t.nodeName}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(Ui),E(o0),E(Woe),E(yF),E(nt),E(Tt),E(Eh))},n.\u0275cmp=Le({type:n,selectors:[["ccf-root"]],hostBindings:function(t,i){1&t&&ye("keydown",function(s){return i.handleKey(s)},!1,Qp)("click",function(s){return i.handleClick(s.target)},!1,Qp)},decls:18,vars:16,consts:[["opened",""],[3,"modalClosed","disableSlider"],["position","end","opened",""],[3,"modalClosed"],[1,"selector-drawer"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],[1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",3,"click"],[1,"stage-content"]],template:function(t,i){if(1&t&&(et(0,"ccf-registration-modal"),et(1,"ccf-header"),F(2,"ccf-drawer-container"),F(3,"ccf-drawer",0),et(4,"ccf-left-sidebar",1),et(5,"ccf-drawer-toggle-button"),N(),F(6,"ccf-drawer",2),et(7,"ccf-right-sidebar",3),et(8,"ccf-drawer-toggle-button"),N(),F(9,"ccf-drawer-content"),F(10,"div",4),F(11,"ccf-organ-selector",5,6),ye("organsChanged",function(s){return i.model.setOrgan(s[0])}),yn(13,"async"),N(),F(14,"div",7),F(15,"mat-icon",8),ye("click",function(){return i.open=!i.open}),Te(16),N(),N(),N(),et(17,"ccf-content",9),N(),N()),2&t){const r=Ys(12);Y(4),ie("modalClosed",i.registrationStarted)("disableSlider",!(null!=r.selectedOrgans[0]&&r.selectedOrgans[0].hasSex)),Y(3),ie("modalClosed",i.registrationStarted),Y(3),at("closed",!i.open),Y(1),at("closed",!i.open),ie("organList",i.organList)("selectedOrgans",Fg(14,oRe,wn(13,12,i.model.organ$))),Y(5),Os(" ",i.open?"arrow_drop_up":"arrow_drop_down"," "),Y(1),at("expanded-stage",!i.open)}},directives:[ZOe,tIe,cIe,CF,uPe,dPe,jPe,l1,oq,Rs,sRe],pipes:[zu],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;color:#000}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:25.5rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{position:relative;z-index:1}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-organ-selector[_ngcontent-%COMP%]{height:100%;padding-top:.5rem;transition:all .5s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-organ-selector.closed[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;justify-content:center;height:5.688rem;transition:all .5s ease-in-out}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{width:3rem;height:1.2rem;position:absolute;bottom:0;right:calc(50% - 1.5rem);margin-bottom:-1.2rem;z-index:99;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:#fff;border-bottom-left-radius:.2rem;border-bottom-right-radius:.2rem;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]:hover{background-color:#ececec}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:3rem;top:-2.9rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{border-radius:.5rem!important;height:calc(100% - 2.688rem - 3rem - 1.5rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 1.5rem);padding-bottom:1rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-content[_ngcontent-%COMP%]{position:absolute;transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:all;bottom:1.5rem;z-index:1}"],changeDetection:0}),n})();function lRe(n,e){1&n&&et(0,"ccf-root")}let cRe=(()=>{class n extends wOe{constructor(t,i){var r;super(t,i,{initialDelay:500,initialConfig:null!==(r=globalThis.ruiConfig)&&void 0!==r?r:{},parse:{useDownload:EOe.boolean,user:EOe.json,organ:EOe.json,editRegistration:EOe.json,register:EOe.function,cancelRegistration:EOe.function,fetchPreviousRegistrations:EOe.function,skipUnsavedChangesConfirmation:EOe.boolean}})}}return n.\u0275fac=function(t){return new(t||n)(E(Eh),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-root-wc"]],inputs:{baseHref:"baseHref",useDownload:"useDownload",user:"user",organ:"organ",editRegistration:"editRegistration",register:"register",cancelRegistration:"cancelRegistration",fetchPreviousRegistrations:"fetchPreviousRegistrations",skipUnsavedChangesConfirmation:"skipUnsavedChangesConfirmation"},features:[ht],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&Ct(0,lRe,1,0,"ccf-root",0),2&t&&ie("ngIf",i.initialized)},directives:[Is,aRe],encapsulation:2,changeDetection:0}),n})();const uRe=new _e("Global configuration object");function dRe(n){return n.get("ruiConfig",{user:{firstName:"",lastName:""}})}let hRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:uRe,useFactory:dRe,deps:[cq]}]}),n})(),fRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:pv,useValue:yF.initialize,multi:!0},yF]}),n})(),pRe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[kr,Ra,KG,...t]}}}return n.\u0275fac=function(t){return new(t||n)(I(kr,2),I(Ra,2))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const h1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class _Re{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=ap(this.action),i=function(n){return h1(n.getHours(),2)+":"+h1(n.getMinutes(),2)+":"+h1(n.getSeconds(),2)+"."+h1(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class yRe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const Jq=new _e("NGXS_LOGGER_PLUGIN_OPTIONS");let vRe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new yRe(this._options),this._store=this._store||this._injector.get(ph);const s=new _Re(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Di(o=>{s.completed(o)}),Sa(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(I(Jq),I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const e9=new _e("LOGGER_USER_OPTIONS");function bRe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let CRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:jR,useClass:vRe,multi:!0},{provide:e9,useValue:t},{provide:Jq,useFactory:bRe,deps:[e9]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const SF=new _e("NGXS_STORAGE_PLUGIN_OPTION"),t9=new _e("STORAGE_ENGINE"),MF="@@STATE",n9="NGXS_OPTIONS_META";function wRe(n){return Array.isArray(n)||(n=[n]),n.map(e=>(e.hasOwnProperty(n9)&&(e=e[n9].name),e instanceof class{constructor(e){this.name=e,(function(n){return n.hasOwnProperty(UR)||Object.defineProperty(n,UR,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),qR(n)}(this)).makeRootSelector=i=>i.getStateGetter(this.name)}getName(){return this.name}toString(){return`StateToken[${this.name}]`}}?e.getName():e))}function ERe(n){return void 0!==n&&n.key&&(n.key=wRe(n.key)),Object.assign({key:[MF],storage:0,serialize:JSON.stringify,deserialize:JSON.parse,beforeSerialize:e=>e,afterDeserialize:e=>e},n)}function SRe(n,e){return wD(e)?null:0===n.storage?localStorage:1===n.storage?sessionStorage:null}let MRe=(()=>{class n{constructor(t,i,r){this._options=t,this._engine=i,this._platformId=r}handle(t,i,r){if(wD(this._platformId)&&null===this._engine)return r(t,i);const s=this._options.key,o=function(n){const e=ap(n);return function(t){return e===ap(t)}}(i),a=o(c$)||o(u$);let l=!1;if(a)for(const c of s){const d=c===MF;let f=this._engine.getItem(c);if("undefined"!==f&&null!=f){try{const p=this._options.deserialize(f);f=this._options.afterDeserialize(p,c)}catch(p){console.error("Error ocurred while deserializing the store value, falling back to empty object."),f={}}this._options.migrations&&this._options.migrations.forEach(p=>{p.version===Vm(f,p.versionKey||"version")&&(!p.key&&d||p.key===c)&&(f=p.migrate(f),l=!0)}),t=d?Object.assign({},t,f):zR(t,c,f)}}return r(t,i).pipe(Di(c=>{if(!a||a&&l)for(const d of s){let f=c;d!==MF&&(f=Vm(c,d));try{const p=this._options.beforeSerialize(f,d);this._engine.setItem(d,this._options.serialize(p))}catch(p){console.error("Error ocurred while serializing the store value, value not updated.")}}}))}}return n.\u0275fac=function(t){return new(t||n)(I(SF),I(t9),I(cl))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const i9=new _e("USER_OPTIONS");let xRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:jR,useClass:MRe,multi:!0},{provide:i9,useValue:t},{provide:SF,useFactory:ERe,deps:[i9]},{provide:t9,useFactory:SRe,deps:[SF,cl]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const r9=[{name:"logo",namespace:"app",url:"assets/icons/logo-rui.svg"},{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.svg"},{name:"bone-marrow",namespace:"app",url:"assets/icons/organs/ico-organs-bone-marrow.svg"},{name:"brain",namespace:"app",url:"assets/icons/organs/ico-organs-brain.svg"},{name:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.svg"},{name:"heart",namespace:"app",url:"assets/icons/organs/ico-organs-heart.svg"},{name:"kidney-left",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-left.svg"},{name:"kidney-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.svg"},{name:"large-intestine",namespace:"app",url:"assets/icons/organs/ico-organs-large-intestine.svg"},{name:"liver",namespace:"app",url:"assets/icons/organs/ico-organs-liver.svg"},{name:"lung-left",namespace:"app",url:"assets/icons/organs/ico-organs-lung-left.svg"},{name:"lung-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.svg"},{name:"skin",namespace:"app",url:"assets/icons/organs/ico-organs-skin.svg"},{name:"small-intestine",namespace:"app",url:"assets/icons/organs/ico-organs-small intestine.svg"},{name:"spleen",namespace:"app",url:"assets/icons/organs/ico-organs-spleen.svg"},{name:"stomach",namespace:"app",url:"assets/icons/organs/ico-organs-stomach.svg"},{name:"thymus",namespace:"app",url:"assets/icons/organs/ico-organs-thymus.svg"},{name:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.svg"},{name:"opacity",namespace:"app",url:"assets/icons/opacity-24px.svg"},{name:"visibility_on",namespace:"app",url:"assets/icons/visibility-on-24px.svg"},{name:"visibility_off",namespace:"app",url:"assets/icons/visibility-off-24px.svg"},{name:"visibility_off_cube",namespace:"app",url:"assets/icons/ico-cube.svg"}];let ld=class extends rTe{constructor(e,t,i){super(),this.registry=e,this.sanitizer=t,this.globalConfig=i}ngxsOnInit(){var e;r9.filter(t=>void 0!==t.html).map(t=>Object.assign(Object.assign({},t),{html:this.sanitizer.bypassSecurityTrustHtml(t.html)})).forEach(t=>this.registerIconImpl(t)),null===(e=this.registry)||void 0===e||e.addSvgIconResolver((t,i)=>{var r;const s=r9.find(a=>{var l,c;return(null!==(l=a.name)&&void 0!==l?l:"")===t&&(null!==(c=a.namespace)&&void 0!==c?c:"")===i});if(void 0===s||void 0===s.url)return null;const o=null!==(r=this.globalConfig.snapshot.baseHref)&&void 0!==r?r:"";return this.sanitizer.bypassSecurityTrustResourceUrl(o+s.url)})}registerIcon(e){return this.registerIconImpl(e)}registerIconImpl(e){if(!this.registry||!e.url&&!e.html)return!1;const t=this.registry,r=t[this.getMethodName(e)],s=this.getArguments(e);if(!r)return!1;try{return r.apply(t,s),!0}catch(o){return!1}}getMethodName({name:e,namespace:t,url:i}){const r=["addSvgIcon"];return e||r.push("Set"),i||r.push("Literal"),t&&r.push("InNamespace"),r.join("")}getArguments({name:e,namespace:t,url:i,html:r}){return[t,e,null!=i?i:r].filter(o=>!!o)}};ld.\u0275fac=function(e){return new(e||ld)(I(jv,8),I(Kd),I(Eh))},ld.\u0275prov=ae({token:ld,factory:ld.\u0275fac}),De([Xt()],ld.prototype,"registerIcon",null),ld=De([Ch(),gh({name:"iconRegistry"})],ld);const TRe=[Eh,ld,Ui,si,Io,dc,wr,ss];let ARe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[pRe.forRoot(),ia.forRoot(TRe,{developmentMode:!Sh.production}),xRe.forRoot({key:["registration.registrations"]}),CRe.forRoot({disabled:Sh.production})]]}),n})(),DRe=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[nU,DDe.forRoot({gaToken:Sh.googleAnalyticsToken,appName:"rui"}),dOe,hRe,ARe,fRe]]}),n})(),xF=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,vq]]}),n})(),ORe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,KPe,Lq,Pr,EF,xF,uc]]}),n})(),IRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr]]}),n})(),PRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,ORe,Pr,jDe,IRe,ec,PDe]]}),n})(),RRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,uc]]}),n})(),kRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})(),FRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Lq]]}),n})(),s9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,vq,$b,yk,vk,uc]]}),n})(),NRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,ec,lq]]}),n})(),o9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,Iq]]}),n})(),LRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf]]}),n})(),BRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Ok,Pr,uc,EF,kRe,xF,s9,o9,FRe,lq,NRe,o9,LRe]]}),n})(),VRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf,uc,s9,xF,aq]]}),n})(),jRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,VRe]]}),n})(),URe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,$b,Pr,ec,uc]]}),n})(),zRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,SG,ec,uc]]}),n})(),HRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,$b,Pr,ec,uc,aOe]]}),n})(),$Re=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Iq,Pr]]}),n})(),GRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,yk,vk,Gf,TPe,Lv,Pr,$b]]}),n})(),WRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,Gf]]}),n})(),qRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,WRe,Gf,uc]]}),n})(),YRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Ok,EF,Pr,bO,uc,URe,qRe,zRe,HRe,$Re,GRe,sOe]]}),n})(),XRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:Cq,useValue:bq}],imports:[[dE,bO,Pr]]}),n})(),KRe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ol).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new Ote(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends Pte{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(cRe,{injector:this.injector});customElements.define("ccf-rui",t)}}return n.\u0275fac=function(t){return new(t||n)(I(Tt))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:mq,useValue:"light-theme"},{provide:zj,useValue:{appearance:"standard",floatLabel:!1,hideRequiredMarker:!0}}],imports:[[dE,bO,DRe,Pr,XRe,RRe,PRe,BRe,YRe,aq,jRe,gOe,UU]]}),n})();Sh.production&&function(){if(DB)throw new Error("Cannot enable prod mode after platform setup.");AB=!1}(),Jee().bootstrapModule(KRe).catch(n=>console.error(n))},948:pt=>{pt.exports=function(Ve){return Ve&&Ve.__esModule?Ve:{default:Ve}},pt.exports.default=pt.exports,pt.exports.__esModule=!0},321:pt=>{function We(Ve){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(pt.exports=We=function(k){return typeof k},pt.exports.default=pt.exports,pt.exports.__esModule=!0):(pt.exports=We=function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},pt.exports.default=pt.exports,pt.exports.__esModule=!0),We(Ve)}pt.exports=We,pt.exports.default=pt.exports,pt.exports.__esModule=!0},833:pt=>{function We(Ve){return Promise.resolve().then(()=>{var _t=new Error("Cannot find module '"+Ve+"'");throw _t.code="MODULE_NOT_FOUND",_t})}We.keys=()=>[],We.resolve=We,We.id=833,pt.exports=We},521:()=>{},125:()=>{},307:()=>{}},pt=>{pt(pt.s=473)}]); \ No newline at end of file +var ZRe=Object.defineProperty,QRe=Object.defineProperties,JRe=Object.getOwnPropertyDescriptors,l9=Object.getOwnPropertySymbols,eke=Object.prototype.hasOwnProperty,tke=Object.prototype.propertyIsEnumerable,zi=Math.pow,c9=(pt,We,Ve)=>We in pt?ZRe(pt,We,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):pt[We]=Ve,J=(pt,We)=>{for(var Ve in We||(We={}))eke.call(We,Ve)&&c9(pt,Ve,We[Ve]);if(l9)for(var Ve of l9(We))tke.call(We,Ve)&&c9(pt,Ve,We[Ve]);return pt},an=(pt,We)=>QRe(pt,JRe(We));(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{517:(pt,We)=>{"use strict";var _t=(()=>{return(It=_t||(_t={})).typeOfFunction="function",It.boolTrue=!0,_t;var It})();function k(It,Pt,ft){if(!ft||typeof ft.value!==_t.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+Pt+"> is not a method!");return{configurable:_t.boolTrue,get:function(){var qt=ft.value.bind(this);return Object.defineProperty(this,Pt,{value:qt,configurable:_t.boolTrue,writable:_t.boolTrue}),qt}}}We.ak=k,We.ZP=k},266:(pt,We,Ve)=>{pt.exports={ResizeSensor:Ve(835),ElementQueries:Ve(845)}},845:function(pt,We,Ve){"use strict";var _t,k,It;"undefined"!=typeof window&&window,k=[Ve(835)],void 0!==(It="function"==typeof(_t=function(Pt){var ft=function(){var yt,dn={},En=[];function Fe(Ae){Ae||(Ae=document.documentElement);var oe=window.getComputedStyle(Ae,null).fontSize;return parseFloat(oe)||16}function $t(Ae,oe){var kt=oe.split(/\d/),Bt=kt[kt.length-1];switch(oe=parseFloat(oe),Bt){case"px":return oe;case"em":return oe*Fe(Ae);case"rem":return oe*Fe();case"vw":return oe*document.documentElement.clientWidth/100;case"vh":return oe*document.documentElement.clientHeight/100;case"vmin":case"vmax":var Gt=document.documentElement.clientWidth/100,oi=document.documentElement.clientHeight/100;return oe*(0,Math["vmin"===Bt?"min":"max"])(Gt,oi);default:return oe}}function Ne(Ae,oe){this.element=Ae;var kt,Bt,Gt,oi,Oi,we,rn,Ln,be=["min-width","min-height","max-width","max-height"];this.call=function(){for(kt in Gt=function(Ae){if(!Ae.getBoundingClientRect)return{width:Ae.offsetWidth,height:Ae.offsetHeight};var oe=Ae.getBoundingClientRect();return{width:Math.round(oe.width),height:Math.round(oe.height)}}(this.element),we={},dn[oe])!dn[oe].hasOwnProperty(kt)||(oi=$t(this.element,(Bt=dn[oe][kt]).value),Oi="width"===Bt.property?Gt.width:Gt.height,rn="","min"===Bt.mode&&Oi>=oi&&(rn+=Bt.value),"max"===Bt.mode&&Oi<=oi&&(rn+=Bt.value),we[Ln=Bt.mode+"-"+Bt.property]||(we[Ln]=""),rn&&-1===(" "+we[Ln]+" ").indexOf(" "+rn+" ")&&(we[Ln]+=" "+rn));for(var Ii in be)!be.hasOwnProperty(Ii)||(we[be[Ii]]?this.element.setAttribute(be[Ii],we[be[Ii]].substr(1)):this.element.removeAttribute(be[Ii]))}}function Ie(Ae,oe){Ae.elementQueriesSetupInformation||(Ae.elementQueriesSetupInformation=new Ne(Ae,oe)),Ae.elementQueriesSensor||(Ae.elementQueriesSensor=new Pt(Ae,function(){Ae.elementQueriesSetupInformation.call()}))}function pi(Ae,oe,kt,Bt){if(void 0===dn[Ae]){dn[Ae]=[];var Gt=En.length;yt.innerHTML+="\n"+Ae+" {animation: 0.1s element-queries;}",yt.innerHTML+="\n"+Ae+" > .resize-sensor {min-width: "+Gt+"px;}",En.push(Ae)}dn[Ae].push({mode:oe,property:kt,value:Bt})}function qe(Ae){var oe;if(document.querySelectorAll&&(oe=Ae?Ae.querySelectorAll.bind(Ae):document.querySelectorAll.bind(document)),!oe&&"undefined"!=typeof $$&&(oe=$$),!oe&&"undefined"!=typeof jQuery&&(oe=jQuery),!oe)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return oe}function Rt(Ae){var oe=[],kt=[],Bt=[],Gt=0,oi=-1,Oi=[];for(var we in Ae.children)if(Ae.children.hasOwnProperty(we)&&Ae.children[we].tagName&&"img"===Ae.children[we].tagName.toLowerCase()){oe.push(Ae.children[we]);var rn=Ae.children[we].getAttribute("min-width")||Ae.children[we].getAttribute("data-min-width"),Ln=Ae.children[we].getAttribute("data-src")||Ae.children[we].getAttribute("url");Bt.push(Ln),kt.push({minWidth:rn}),rn?Ae.children[we].style.display="none":(Gt=oe.length-1,Ae.children[we].style.display="block")}function Ii(){var Sr,Ft=!1;for(Sr in oe)!oe.hasOwnProperty(Sr)||kt[Sr].minWidth&&Ae.offsetWidth>kt[Sr].minWidth&&(Ft=Sr);if(Ft||(Ft=Gt),oi!==Ft)if(Oi[Ft])oe[oi].style.display="none",oe[Ft].style.display="block",oi=Ft;else{var os=new Image;os.onload=function(){oe[Ft].src=Bt[Ft],oe[oi].style.display="none",oe[Ft].style.display="block",Oi[Ft]=!0,oi=Ft},os.src=Bt[Ft]}else oe[Ft].src=Bt[Ft]}oi=Gt,Ae.resizeSensorInstance=new Pt(Ae,Ii),Ii()}var $n=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,Ci=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function yi(Ae){var oe,kt,Bt,Gt;for(Ae=Ae.replace(/'/g,'"');null!==(oe=$n.exec(Ae));)for(kt=oe[1]+oe[3],Bt=oe[2];null!==(Gt=Ci.exec(Bt));)pi(kt,Gt[1],Gt[2],Gt[3])}function vi(Ae){var oe="";if(Ae)if("string"==typeof Ae)(-1!==(Ae=Ae.toLowerCase()).indexOf("min-width")||-1!==Ae.indexOf("max-width"))&&yi(Ae);else for(var kt=0,Bt=Ae.length;kt img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",yt.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(yt),Er=!0);for(var oe=0,kt=document.styleSheets.length;oe=je.status}function qt(Fe){try{Fe.dispatchEvent(new MouseEvent("click"))}catch($t){var je=document.createEvent("MouseEvents");je.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),Fe.dispatchEvent(je)}}var yt="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,dn=yt.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),En=yt.saveAs||("object"!=typeof window||window!==yt?function(){}:"download"in HTMLAnchorElement.prototype&&!dn?function(Fe,je,$t){var Ne=yt.URL||yt.webkitURL,Ie=document.createElement("a");Ie.download=je=je||Fe.name||"download",Ie.rel="noopener","string"==typeof Fe?(Ie.href=Fe,Ie.origin===location.origin?qt(Ie):ft(Ie.href)?Pt(Fe,je,$t):qt(Ie,Ie.target="_blank")):(Ie.href=Ne.createObjectURL(Fe),setTimeout(function(){Ne.revokeObjectURL(Ie.href)},4e4),setTimeout(function(){qt(Ie)},0))}:"msSaveOrOpenBlob"in navigator?function(Fe,je,$t){if(je=je||Fe.name||"download","string"!=typeof Fe)navigator.msSaveOrOpenBlob(function(Fe,je){return void 0===je?je={autoBom:!1}:"object"!=typeof je&&(console.warn("Deprecated: Expected third argument to be a object"),je={autoBom:!je}),je.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(Fe.type)?new Blob(["\ufeff",Fe],{type:Fe.type}):Fe}(Fe,$t),je);else if(ft(Fe))Pt(Fe,je,$t);else{var Ne=document.createElement("a");Ne.href=Fe,Ne.target="_blank",setTimeout(function(){qt(Ne)})}}:function(Fe,je,$t,Ne){if((Ne=Ne||open("","_blank"))&&(Ne.document.title=Ne.document.body.innerText="downloading..."),"string"==typeof Fe)return Pt(Fe,je,$t);var Ie="application/octet-stream"===Fe.type,pi=/constructor/i.test(yt.HTMLElement)||yt.safari,qe=/CriOS\/[\d]+/.test(navigator.userAgent);if((qe||Ie&&pi||dn)&&"undefined"!=typeof FileReader){var Jn=new FileReader;Jn.onloadend=function(){var $n=Jn.result;$n=qe?$n:$n.replace(/^data:[^;]*;/,"data:attachment/file;"),Ne?Ne.location.href=$n:location=$n,Ne=null},Jn.readAsDataURL(Fe)}else{var Rt=yt.URL||yt.webkitURL,nn=Rt.createObjectURL(Fe);Ne?Ne.location=nn:location.href=nn,Ne=null,setTimeout(function(){Rt.revokeObjectURL(nn)},4e4)}});yt.saveAs=En.saveAs=En,pt.exports=En})?Ve.apply(We,[]):Ve)&&(pt.exports=k)},524:(pt,We,Ve)=>{var _t;!function(k,It,Pt,ft){"use strict";var qe,qt=["","webkit","Moz","MS","ms","o"],yt=It.createElement("div"),En=Math.round,Fe=Math.abs,je=Date.now;function $t(A,R,j){return setTimeout($n(A,j),R)}function Ne(A,R,j){return!!Array.isArray(A)&&(Ie(A,j[R],j),!0)}function Ie(A,R,j){var te;if(A)if(A.forEach)A.forEach(R,j);else if(A.length!==ft)for(te=0;te\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",hn=k.console&&(k.console.warn||k.console.log);return hn&&hn.call(k.console,te,Re),A.apply(this,arguments)}}qe="function"!=typeof Object.assign?function(R){if(R===ft||null===R)throw new TypeError("Cannot convert undefined or null to object");for(var j=Object(R),te=1;te-1}function kt(A){return A.trim().split(/\s+/g)}function Bt(A,R,j){if(A.indexOf&&!j)return A.indexOf(R);for(var te=0;teGr[R]}):te.sort()),te}function Oi(A,R){for(var j,te,Me=R[0].toUpperCase()+R.slice(1),Re=0;Re1&&!j.firstMultiple?j.firstMultiple=La(R):1===Me&&(j.firstMultiple=!1);var Re=j.firstInput,hn=j.firstMultiple,cr=hn?hn.center:Re.center,mr=R.center=ao(te);R.timeStamp=je(),R.deltaTime=R.timeStamp-Re.timeStamp,R.angle=lo(cr,mr),R.distance=ls(cr,mr),function(A,R){var j=R.center,te=A.offsetDelta||{},Me=A.prevDelta||{},Re=A.prevInput||{};(1===R.eventType||4===Re.eventType)&&(Me=A.prevDelta={x:Re.deltaX||0,y:Re.deltaY||0},te=A.offsetDelta={x:j.x,y:j.y}),R.deltaX=Me.x+(j.x-te.x),R.deltaY=Me.y+(j.y-te.y)}(j,R),R.offsetDirection=ki(R.deltaX,R.deltaY);var Gr=Ba(R.deltaTime,R.deltaX,R.deltaY);R.overallVelocityX=Gr.x,R.overallVelocityY=Gr.y,R.overallVelocity=Fe(Gr.x)>Fe(Gr.y)?Gr.x:Gr.y,R.scale=hn?function(A,R){return ls(R[0],R[1],Fr)/ls(A[0],A[1],Fr)}(hn.pointers,te):1,R.rotation=hn?function(A,R){return lo(R[1],R[0],Fr)+lo(A[1],A[0],Fr)}(hn.pointers,te):0,R.maxPointers=j.prevInput?R.pointers.length>j.prevInput.maxPointers?R.pointers.length:j.prevInput.maxPointers:R.pointers.length,function(A,R){var Me,Re,hn,cr,j=A.lastInterval||R,te=R.timeStamp-j.timeStamp;if(8!=R.eventType&&(te>25||j.velocity===ft)){var mr=R.deltaX-j.deltaX,Gr=R.deltaY-j.deltaY,cn=Ba(te,mr,Gr);Re=cn.x,hn=cn.y,Me=Fe(cn.x)>Fe(cn.y)?cn.x:cn.y,cr=ki(mr,Gr),A.lastInterval=R}else Me=j.velocity,Re=j.velocityX,hn=j.velocityY,cr=j.direction;R.velocity=Me,R.velocityX=Re,R.velocityY=hn,R.direction=cr}(j,R);var cn=A.element;Ae(R.srcEvent.target,cn)&&(cn=R.srcEvent.target),R.target=cn}(A,j),A.emit("hammer.input",j),A.recognize(j),A.session.prevInput=j}function La(A){for(var R=[],j=0;j=Fe(R)?A<0?2:4:R<0?8:16}function ls(A,R,j){j||(j=$r);var te=R[j[0]]-A[j[0]],Me=R[j[1]]-A[j[1]];return Math.sqrt(te*te+Me*Me)}function lo(A,R,j){return j||(j=$r),180*Math.atan2(R[j[1]]-A[j[1]],R[j[0]]-A[j[0]])/Math.PI}ei.prototype={handler:function(){},init:function(){this.evEl&&vi(this.element,this.evEl,this.domHandler),this.evTarget&&vi(this.target,this.evTarget,this.domHandler),this.evWin&&vi(Ln(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Er(this.element,this.evEl,this.domHandler),this.evTarget&&Er(this.target,this.evTarget,this.domHandler),this.evWin&&Er(Ln(this.element),this.evWin,this.domHandler)}};var lu={mousedown:1,mousemove:2,mouseup:4},cu="mousedown",uu="mousemove mouseup";function wl(){this.evEl=cu,this.evWin=uu,this.pressed=!1,ei.apply(this,arguments)}nn(wl,ei,{handler:function(R){var j=lu[R.type];1&j&&0===R.button&&(this.pressed=!0),2&j&&1!==R.which&&(j=4),this.pressed&&(4&j&&(this.pressed=!1),this.callback(this.manager,j,{pointers:[R],changedPointers:[R],pointerType:as,srcEvent:R}))}});var pc={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ud={2:os,3:"pen",4:as,5:"kinect"},du="pointerdown",Vs="pointermove pointerup pointercancel";function Ye(){this.evEl=du,this.evWin=Vs,ei.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}k.MSPointerEvent&&!k.PointerEvent&&(du="MSPointerDown",Vs="MSPointerMove MSPointerUp MSPointerCancel"),nn(Ye,ei,{handler:function(R){var j=this.store,te=!1,Me=R.type.toLowerCase().replace("ms",""),Re=pc[Me],hn=ud[R.pointerType]||R.pointerType,cr=hn==os,mr=Bt(j,R.pointerId,"pointerId");1&Re&&(0===R.button||cr)?mr<0&&(j.push(R),mr=j.length-1):12&Re&&(te=!0),!(mr<0)&&(j[mr]=R,this.callback(this.manager,Re,{pointers:j,changedPointers:[R],pointerType:hn,srcEvent:R}),te&&j.splice(mr,1))}});var hu={touchstart:1,touchmove:2,touchend:4,touchcancel:8},G="touchstart",q="touchstart touchmove touchend touchcancel";function Z(){this.evTarget=G,this.evWin=q,this.started=!1,ei.apply(this,arguments)}function T(A,R){var j=Gt(A.touches),te=Gt(A.changedTouches);return 12&R&&(j=oi(j.concat(te),"identifier",!0)),[j,te]}nn(Z,ei,{handler:function(R){var j=hu[R.type];if(1===j&&(this.started=!0),this.started){var te=T.call(this,R,j);12&j&&te[0].length-te[1].length==0&&(this.started=!1),this.callback(this.manager,j,{pointers:te[0],changedPointers:te[1],pointerType:os,srcEvent:R})}}});var D={touchstart:1,touchmove:2,touchend:4,touchcancel:8},B="touchstart touchmove touchend touchcancel";function K(){this.evTarget=B,this.targetIds={},ei.apply(this,arguments)}function H(A,R){var j=Gt(A.touches),te=this.targetIds;if(3&R&&1===j.length)return te[j[0].identifier]=!0,[j,j];var Me,Re,hn=Gt(A.changedTouches),cr=[],mr=this.target;if(Re=j.filter(function(Gr){return Ae(Gr.target,mr)}),1===R)for(Me=0;Me-1&&te.splice(Re,1)},2500)}}function Cn(A){for(var R=A.srcEvent.clientX,j=A.srcEvent.clientY,te=0;te-1&&this.requireFail.splice(R,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(A){return!!this.simultaneous[A.id]},emit:function(A){var R=this,j=this.state;function te(Me){R.manager.emit(Me,A)}j<8&&te(R.options.event+ae(j)),te(R.options.event),A.additionalEvent&&te(A.additionalEvent),j>=8&&te(R.options.event+ae(j))},tryEmit:function(A){if(this.canEmit())return this.emit(A);this.state=32},canEmit:function(){for(var A=0;AR.threshold&&Me&R.direction},attrTest:function(A){return ir.prototype.attrTest.call(this,A)&&(2&this.state||!(2&this.state)&&this.directionTest(A))},emit:function(A){this.pX=A.deltaX,this.pY=A.deltaY;var R=r_(A.direction);R&&(A.additionalEvent=this.options.event+R),this._super.emit.call(this,A)}}),nn(gu,ir,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||2&this.state)},emit:function(A){1!==A.scale&&(A.additionalEvent=this.options.event+(A.scale<1?"in":"out")),this._super.emit.call(this,A)}}),nn(Th,Va,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(A){var R=this.options,j=A.pointers.length===R.pointers,te=A.distanceR.time;if(this._input=A,!te||!j||12&A.eventType&&!Me)this.reset();else if(1&A.eventType)this.reset(),this._timer=$t(function(){this.state=8,this.tryEmit()},R.time,this);else if(4&A.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(A){8===this.state&&(A&&4&A.eventType?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=je(),this.manager.emit(this.options.event,this._input)))}}),nn(mu,ir,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||2&this.state)}}),nn(la,ir,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _c.prototype.getTouchAction.call(this)},attrTest:function(A){var j,R=this.options.direction;return 30&R?j=A.overallVelocity:6&R?j=A.overallVelocityX:24&R&&(j=A.overallVelocityY),this._super.attrTest.call(this,A)&&R&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers==this.options.pointers&&Fe(j)>this.options.velocity&&4&A.eventType},emit:function(A){var R=r_(A.offsetDirection);R&&this.manager.emit(this.options.event+R,A),this.manager.emit(this.options.event,A)}}),nn(Sl,Va,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Hi]},process:function(A){var R=this.options,j=A.pointers.length===R.pointers,te=A.distance"']/g,Vs=RegExp(ud.source),Ye=RegExp(du.source),hu=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,D=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,K=RegExp(B.source),H=/^\s+/,se=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,de=/\{\n\/\* \[wrapped with (.+)\] \*/,Be=/,? & /,Kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cn=/[()=,{}\[\]\/\s]/,jt=/\\(\\)?/g,gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zt=/\w*$/,ti=/^[-+]0x[0-9a-f]+$/i,Hi=/^0b[01]+$/i,$i=/^\[object .+?Constructor\]$/,ln=/^0o[0-7]+$/i,bi=/^(?:0|[1-9]\d*)$/,gc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,co=/($^)/,dd=/['\n\r\u2028\u2029\\]/g,El="\\ud800-\\udfff",Gi="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xn="\\u2700-\\u27bf",pu="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",ir="\\ufe0e\\ufe0f",_c="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Th="["+El+"]",mu="["+_c+"]",la="["+Gi+"]",Sl="\\d+",ja="["+xn+"]",mp="["+pu+"]",vt="[^"+El+_c+Sl+xn+pu+Ee+"]",Ml="\\ud83c[\\udffb-\\udfff]",ca="[^"+El+"]",hd="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",R="["+Ee+"]",j="\\u200d",te="(?:"+mp+"|"+vt+")",Me="(?:"+R+"|"+vt+")",Re="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",hn="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",cr="(?:"+la+"|"+Ml+")?",mr="["+ir+"]?",f1=mr+cr+"(?:"+j+"(?:"+[ca,hd,A].join("|")+")"+mr+cr+")*",fd="(?:"+[ja,hd,A].join("|")+")"+f1,gi="(?:"+[ca+la+"?",la,hd,A,Th].join("|")+")",yp=RegExp("['\u2019]","g"),s_=RegExp(la,"g"),Ah=RegExp(Ml+"(?="+Ml+")|"+gi+f1,"g"),h0=RegExp([R+"?"+mp+"+"+Re+"(?="+[mu,R,"$"].join("|")+")",Me+"+"+hn+"(?="+[mu,R+te,"$"].join("|")+")",R+"?"+te+"+"+Re,R+"+"+hn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sl,fd].join("|"),"g"),p1=RegExp("["+j+El+Gi+ir+"]"),xl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Dh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],g1=-1,Le={};Le[ao]=Le[Ba]=Le[ki]=Le[ls]=Le[lo]=Le[fc]=Le[Cl]=Le[lu]=Le[cu]=!0,Le[as]=Le[sa]=Le[bl]=Le[ai]=Le[La]=Le[ot]=Le[Pi]=Le[oa]=Le[Ri]=Le[Hr]=Le[nr]=Le[$r]=Le[Fr]=Le[ei]=Le[ci]=!1;var wi={};wi[as]=wi[sa]=wi[bl]=wi[La]=wi[ai]=wi[ot]=wi[ao]=wi[Ba]=wi[ki]=wi[ls]=wi[lo]=wi[Ri]=wi[Hr]=wi[nr]=wi[$r]=wi[Fr]=wi[ei]=wi[hc]=wi[fc]=wi[Cl]=wi[lu]=wi[cu]=!0,wi[Pi]=wi[oa]=wi[ci]=!1;var xe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},m1=parseFloat,m0=parseInt,he="object"==typeof global&&global&&global.Object===Object&&global,cs="object"==typeof self&&self&&self.Object===Object&&self,Wn=he||cs||Function("return this")(),Tl=We&&!We.nodeType&&We,ua=Tl&&pt&&!pt.nodeType&&pt,uo=ua&&ua.exports===Tl,o_=uo&&he.process,Wi=function(){try{return ua&&ua.require&&ua.require("util").types||o_&&o_.binding&&o_.binding("util")}catch(ue){}}(),Ze=Wi&&Wi.isArrayBuffer,fn=Wi&&Wi.isDate,xi=Wi&&Wi.isMap,Us=Wi&&Wi.isRegExp,yc=Wi&&Wi.isSet,Mr=Wi&&Wi.isTypedArray;function xr(W,ue,ne){switch(ne.length){case 0:return W.call(ue);case 1:return W.call(ue,ne[0]);case 2:return W.call(ue,ne[0],ne[1]);case 3:return W.call(ue,ne[0],ne[1],ne[2])}return W.apply(ue,ne)}function ur(W,ue,ne,it){for(var Et=-1,Bn=null==W?0:W.length;++Et-1}function Oh(W,ue,ne){for(var it=-1,Et=null==W?0:W.length;++it-1;);return ne}function b1(W,ue){for(var ne=W.length;ne--&&Ua(ue,W[ne],0)>-1;);return ne}function AF(W,ue){for(var ne=W.length,it=0;ne--;)W[ne]===ue&&++it;return it}var DF=Po({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),OF=Po({"&":"&","<":"<",">":">",'"':""","'":"'"});function IF(W){return"\\"+xe[W]}function Rh(W){return p1.test(W)}function y0(W){var ue=-1,ne=Array(W.size);return W.forEach(function(it,Et){ne[++ue]=[Et,it]}),ne}function C1(W,ue){return function(ne){return W(ue(ne))}}function yu(W,ue){for(var ne=-1,it=W.length,Et=0,Bn=[];++ne",""":'"',"'":"'"}),Fh=function W(ue){var u,ne=(ue=null==ue?Wn:Fh.defaults(Wn.Object(),ue,Fh.pick(Wn,Dh))).Array,it=ue.Date,Et=ue.Error,Bn=ue.Function,_r=ue.Math,di=ue.Object,f_=ue.RegExp,p_=ue.String,fa=ue.TypeError,Ti=ne.prototype,vu=di.prototype,bp=ue["__core-js_shared__"],qi=Bn.prototype.toString,hi=vu.hasOwnProperty,LF=0,Nh=(u=/[^.]+$/.exec(bp&&bp.keys&&bp.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ss=vu.toString,S1=qi.call(di),g_=Wn._,vd=f_("^"+qi.call(hi).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ds=uo?ue.Buffer:k,Dl=ue.Symbol,bd=ue.Uint8Array,C0=ds?ds.allocUnsafe:k,pa=C1(di.getPrototypeOf,di),m_=di.create,Cp=vu.propertyIsEnumerable,Ut=Ti.splice,M1=Dl?Dl.isConcatSpreadable:k,Lh=Dl?Dl.iterator:k,bu=Dl?Dl.toStringTag:k,wp=function(){try{var u=Oc(di,"defineProperty");return u({},"",{}),u}catch(h){}}(),w0=ue.clearTimeout!==Wn.clearTimeout&&ue.clearTimeout,x1=it&&it.now!==Wn.Date.now&&it.now,T1=ue.setTimeout!==Wn.setTimeout&&ue.setTimeout,Ce=_r.ceil,Sn=_r.floor,Vn=di.getOwnPropertySymbols,Tr=ds?ds.isBuffer:k,__=ue.isFinite,Bh=Ti.join,Ha=C1(di.keys,di),hr=_r.max,Nr=_r.min,BF=it.now,A1=ue.parseInt,Vh=_r.random,Ep=Ti.reverse,qr=Oc(ue,"DataView"),zs=Oc(ue,"Map"),Sp=Oc(ue,"Promise"),ga=Oc(ue,"Set"),fo=Oc(ue,"WeakMap"),jh=Oc(di,"create"),Uh=fo&&new fo,Cd={},D1=Pu(qr),y_=Pu(zs),v_=Pu(Sp),E0=Pu(ga),b_=Pu(fo),Mp=Dl?Dl.prototype:k,wd=Mp?Mp.valueOf:k,zh=Mp?Mp.toString:k;function O(u){if(Ki(u)&&!Ot(u)&&!(u instanceof pn)){if(u instanceof po)return u;if(hi.call(u,"__wrapped__"))return Xp(u)}return new po(u)}var Cu=function(){function u(){}return function(h){if(!Xi(h))return{};if(m_)return m_(h);u.prototype=h;var m=new u;return u.prototype=k,m}}();function Hh(){}function po(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=k}function pn(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ft,this.__views__=[]}function Hs(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function hs(u,h,m,b,M,P){var V,z=1&h,X=2&h,ge=4&h;if(m&&(V=M?m(u,b,M,P):m(u)),V!==k)return V;if(!Xi(u))return u;var me=Ot(u);if(me){if(V=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&hi.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!z)return xs(u,V)}else{var Se=gs(u),Ke=Se==oa||Se==Fa;if(el(u))return Bp(u,z);if(Se==nr||Se==as||Ke&&!M){if(V=X||Ke?{}:K0(u),!z)return X?function(u,h){return va(u,q0(u),h)}(u,function(u,h){return u&&va(h,As(h),u)}(V,u)):function(u,h){return va(u,z_(u),h)}(u,V1(V,u))}else{if(!wi[Se])return M?u:{};V=function(u,h,m){var b=u.constructor;switch(h){case bl:return Au(u);case ai:case ot:return new b(+u);case La:return function(u,h){var m=h?Au(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case ao:case Ba:case ki:case ls:case lo:case fc:case Cl:case lu:case cu:return L_(u,m);case Ri:return new b;case Hr:case ei:return new b(u);case $r:return function(u){var h=new u.constructor(u.source,Zt.exec(u));return h.lastIndex=u.lastIndex,h}(u);case Fr:return new b;case hc:return function(u){return wd?di(wd.call(u)):{}}(u)}}(u,Se,z)}}P||(P=new _a);var mt=P.get(u);if(mt)return mt;P.set(u,V),iT(u)?u.forEach(function(zt){V.add(hs(zt,h,m,zt,u,P))}):Jx(u)&&u.forEach(function(zt,_n){V.set(_n,hs(zt,h,m,_n,u,P))});var mn=me?k:(ge?X?j_:Fl:X?As:Qr)(u);return us(mn||u,function(zt,_n){mn&&(zt=u[_n=zt]),Ga(V,_n,hs(zt,h,m,_n,u,P))}),V}function Ip(u,h,m){var b=m.length;if(null==u)return!b;for(u=di(u);b--;){var M=m[b],V=u[M];if(V===k&&!(M in u)||!(0,h[M])(V))return!1}return!0}function Wh(u,h,m){if("function"!=typeof u)throw new fa(qt);return Jh(function(){u.apply(k,m)},h)}function wc(u,h,m,b){var M=-1,P=Al,V=!0,z=u.length,X=[],ge=h.length;if(!z)return X;m&&(h=ui(h,ko(m))),b?(P=Oh,V=!1):h.length>=200&&(P=Ph,V=!1,h=new ma(h));e:for(;++M-1},Ol.prototype.set=function(u,h){var m=this.__data__,b=Sd(m,u);return b<0?(++this.size,m.push([u,h])):m[b][1]=h,this},$a.prototype.clear=function(){this.size=0,this.__data__={hash:new Hs,map:new(zs||Ol),string:new Hs}},$a.prototype.delete=function(u){var h=ps(this,u).delete(u);return this.size-=h?1:0,h},$a.prototype.get=function(u){return ps(this,u).get(u)},$a.prototype.has=function(u){return ps(this,u).has(u)},$a.prototype.set=function(u,h){var m=ps(this,u),b=m.size;return m.set(u,h),this.size+=m.size==b?0:1,this},ma.prototype.add=ma.prototype.push=function(u){return this.__data__.set(u,dn),this},ma.prototype.has=function(u){return this.__data__.has(u)},_a.prototype.clear=function(){this.__data__=new Ol,this.size=0},_a.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},_a.prototype.get=function(u){return this.__data__.get(u)},_a.prototype.has=function(u){return this.__data__.has(u)},_a.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Ol){var b=m.__data__;if(!zs||b.length<199)return b.push([u,h]),this.size=++m.size,this;m=this.__data__=new $a(b)}return m.set(u,h),this.size=m.size,this};var Ec=Xa(qa),A_=Xa(Pp,!0);function D0(u,h){var m=!0;return Ec(u,function(b,M,P){return m=!!h(b,M,P)}),m}function qh(u,h,m){for(var b=-1,M=u.length;++b0&&m(z)?h>1?Yr(z,h-1,m,b,M):dr(M,z):b||(M[M.length]=z)}return M}var Md=B0(),xd=B0(!0);function qa(u,h){return u&&Md(u,h,Qr)}function Pp(u,h){return u&&xd(u,h,Qr)}function Yh(u,h){return da(h,function(m){return Ho(u[m])})}function Fo(u,h){for(var m=0,b=(h=Tc(h,u)).length;null!=u&&mh}function Td(u,h){return null!=u&&hi.call(u,h)}function Ad(u,h){return null!=u&&h in di(u)}function Eu(u,h,m){for(var b=m?Oh:Al,M=u[0].length,P=u.length,V=P,z=ne(P),X=1/0,ge=[];V--;){var me=u[V];V&&h&&(me=ui(me,ko(h))),X=Nr(me.length,X),z[V]=!m&&(h||M>=120&&me.length>=120)?new ma(V&&me):k}me=u[0];var Se=-1,Ke=z[0];e:for(;++Se=z?X:X*("desc"==m[b]?-1:1)}return u.index-h.index}(P,V,m)});ne--;)W[ne]=W[ne].value;return W}($1(u,function(P,V,z){return{criteria:ui(h,function(ge){return ge(P)}),index:++b,value:P}}))}function k0(u,h,m){for(var b=-1,M=h.length,P={};++b-1;)z!==u&&Ut.call(z,X,1),Ut.call(u,X,1);return u}function Kh(u,h){for(var m=u?h.length:0,b=m-1;m--;){var M=h[m];if(m==b||M!==P){var P=M;_o(M)?Ut.call(u,M,1):Mu(u,M)}}return u}function Il(u,h){return u+Sn(Vh()*(h-u+1))}function kp(u,h){var m="";if(!u||h<1||h>Ln)return m;do{h%2&&(m+=u),(h=Sn(h/2))&&(u+=u)}while(h);return m}function gn(u,h){return Yp(ox(u,h,Ds),u+"")}function W1(u){return S_(Wd(u))}function qF(u,h){var m=Wd(u);return Ld(m,wu(h,0,m.length))}function Fp(u,h,m,b){if(!Xi(u))return u;for(var M=-1,P=(h=Tc(h,u)).length,V=P-1,z=u;null!=z&&++MM?0:M+h),(m=m>M?M:m)<0&&(m+=M),M=h>m?0:m-h>>>0,h>>>=0;for(var P=ne(M);++b>>1,V=u[P];null!==V&&!$o(V)&&(m?V<=h:V=200){var ge=h?null:V_(u);if(ge)return u_(ge);V=!1,M=Ph,X=new ma}else X=h?[]:z;e:for(;++b=b?u:Kr(u,h,m)}var X1=w0||function(u){return Wn.clearTimeout(u)};function Bp(u,h){if(h)return u.slice();var m=u.length,b=C0?C0(m):new u.constructor(m);return u.copy(b),b}function Au(u){var h=new u.constructor(u.byteLength);return new bd(h).set(new bd(u)),h}function L_(u,h){var m=h?Au(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function Ac(u,h){if(u!==h){var m=u!==k,b=null===u,M=u==u,P=$o(u),V=h!==k,z=null===h,X=h==h,ge=$o(h);if(!z&&!ge&&!P&&u>h||P&&V&&X&&!z&&!ge||b&&V&&X||!m&&X||!M)return 1;if(!b&&!P&&!ge&&u1?m[M-1]:k,V=M>2?m[2]:k;for(P=u.length>3&&"function"==typeof P?(M--,P):k,V&&ms(m[0],m[1],V)&&(P=M<3?k:P,M=1),h=di(h);++b-1?M[P?h[V]:V]:k}}function Ou(u){return Ka(function(h){var m=h.length,b=m,M=po.prototype.thru;for(u&&h.reverse();b--;){var P=h[b];if("function"!=typeof P)throw new fa(qt);if(M&&!V&&"wrapper"==Gp(P))var V=new po([],!0)}for(b=V?b:m;++b1&&On.reverse(),me&&X<_n&&(On.length=X),this&&this!==Wn&&this instanceof zt&&(kc=mn||kd(kc)),kc.apply(il,On)}}function U0(u,h){return function(m,b){return function(u,h,m,b){return qa(u,function(M,P,V){h(b,m(M),P,V)}),b}(m,u,h(b),{})}}function B_(u,h){return function(m,b){var M;if(m===k&&b===k)return h;if(m!==k&&(M=m),b!==k){if(M===k)return b;"string"==typeof m||"string"==typeof b?(m=mo(m),b=mo(b)):(m=N0(m),b=N0(b)),M=u(m,b)}return M}}function jp(u){return Ka(function(h){return h=ui(h,ko(Nt())),gn(function(m){var b=this;return u(h,function(M){return xr(M,b,m)})})})}function Up(u,h){var m=(h=h===k?" ":mo(h)).length;if(m<2)return m?kp(h,u):h;var b=kp(h,Ce(u/kh(h)));return Rh(h)?Ya(za(b),0,u).join(""):b.slice(0,u)}function z0(u){return function(h,m,b){return b&&"number"!=typeof b&&ms(h,m,b)&&(m=b=k),h=tl(h),m===k?(m=h,h=0):m=tl(m),function(u,h,m,b){for(var M=-1,P=hr(Ce((h-u)/(m||1)),0),V=ne(P);P--;)V[b?P:++M]=u,u+=m;return V}(h,m,b=b===k?hz))return!1;var ge=P.get(u),me=P.get(h);if(ge&&me)return ge==h&&me==u;var Se=-1,Ke=!0,mt=2&m?new ma:k;for(P.set(u,h),P.set(h,u);++Se-1&&u%1==0&&u1?"& ":"")+h[b],h=h.join(m>2?", ":" "),u.replace(ce,"{\n/* [wrapped with "+h+"] */\n")}(b,function(u,h){return us(Mh,function(m){var b="_."+m[0];h&m[1]&&!Al(u,b)&&u.push(b)}),u.sort()}(function(u){var h=u.match(de);return h?h[1].split(Be):[]}(b),m)))}function Y_(u){var h=0,m=0;return function(){var b=BF(),M=16-(b-m);if(m=b,M>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(k,arguments)}}function Ld(u,h){var m=-1,b=u.length,M=b-1;for(h=h===k?b:h;++m1?u[h-1]:k;return m="function"==typeof m?(u.pop(),m):k,Dx(u,m)});function sy(u){var h=O(u);return h.__chain__=!0,h}function Vd(u,h){return h(u)}var oy=Ka(function(u){var h=u.length,m=h?u[0]:0,b=this.__wrapped__,M=function(P){return x_(P,u)};return!(h>1||this.__actions__.length)&&b instanceof pn&&_o(m)?((b=b.slice(m,+m+(h?1:0))).__actions__.push({func:Vd,args:[M],thisArg:k}),new po(b,this.__chain__).thru(function(P){return h&&!P.length&&P.push(k),P})):this.thru(M)}),Px=yr(function(u,h,m){hi.call(u,m)?++u[m]:Wa(u,m,1)}),Fx=j0(K_),Nx=j0(Z_);function uy(u,h){return(Ot(u)?us:Ec)(u,Nt(h,3))}function Jp(u,h){return(Ot(u)?pd:A_)(u,Nt(h,3))}var Bx=yr(function(u,h,m){hi.call(u,m)?u[m].push(h):Wa(u,m,[h])}),yC=gn(function(u,h,m){var b=-1,M="function"==typeof h,P=$s(u)?ne(u.length):[];return Ec(u,function(V){P[++b]=M?xr(h,V,m):ya(V,h,m)}),P}),vC=yr(function(u,h,m){Wa(u,m,h)});function Qa(u,h){return(Ot(u)?ui:$1)(u,Nt(h,3))}var CC=yr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),tg=gn(function(u,h){if(null==u)return[];var m=h.length;return m>1&&ms(u,h[0],h[1])?h=[]:m>2&&ms(h[0],h[1],h[2])&&(h=[h[0]]),Xh(u,Yr(h,1),[])}),Ru=x1||function(){return Wn.Date.now()};function ng(u,h,m){return h=m?k:h,kl(u,128,k,k,k,k,h=u&&null==h?u.length:h)}function hy(u,h){var m;if("function"!=typeof h)throw new fa(qt);return u=Jt(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=k),m}}var sf=gn(function(u,h,m){var b=1;if(m.length){var M=yu(m,Nd(sf));b|=32}return kl(u,b,h,m,M)}),Ud=gn(function(u,h,m){var b=3;if(m.length){var M=yu(m,Nd(Ud));b|=32}return kl(h,b,u,m,M)});function AC(u,h,m){var b,M,P,V,z,X,ge=0,me=!1,Se=!1,Ke=!0;if("function"!=typeof u)throw new fa(qt);function mt(Xn){var il=b,kc=M;return b=M=k,ge=Xn,V=u.apply(kc,il)}function Vt(Xn){return ge=Xn,z=Jh(_n,h),me?mt(Xn):V}function zt(Xn){var il=Xn-X;return X===k||il>=h||il<0||Se&&Xn-ge>=P}function _n(){var Xn=Ru();if(zt(Xn))return On(Xn);z=Jh(_n,function(Xn){var WT=h-(Xn-X);return Se?Nr(WT,P-(Xn-ge)):WT}(Xn))}function On(Xn){return z=k,Ke&&b?mt(Xn):(b=M=k,V)}function Go(){var Xn=Ru(),il=zt(Xn);if(b=arguments,M=this,X=Xn,il){if(z===k)return Vt(X);if(Se)return X1(z),z=Jh(_n,h),mt(X)}return z===k&&(z=Jh(_n,h)),V}return h=Gs(h)||0,Xi(m)&&(me=!!m.leading,P=(Se="maxWait"in m)?hr(Gs(m.maxWait)||0,h):P,Ke="trailing"in m?!!m.trailing:Ke),Go.cancel=function(){z!==k&&X1(z),ge=0,b=X=M=z=k},Go.flush=function(){return z===k?V:On(Ru())},Go}var zx=gn(function(u,h){return Wh(u,1,h)}),DC=gn(function(u,h,m){return Wh(u,Gs(h)||0,m)});function of(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new fa(qt);var m=function(){var b=arguments,M=h?h.apply(this,b):b[0],P=m.cache;if(P.has(M))return P.get(M);var V=u.apply(this,b);return m.cache=P.set(M,V)||P,V};return m.cache=new(of.Cache||$a),m}function gy(u){if("function"!=typeof u)throw new fa(qt);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}of.Cache=$a;var Hx=Y1(function(u,h){var m=(h=1==h.length&&Ot(h[0])?ui(h[0],ko(Nt())):ui(Yr(h,1),ko(Nt()))).length;return gn(function(b){for(var M=-1,P=Nr(b.length,m);++M=h}),Ja=j1(function(){return arguments}())?j1:function(u){return Ki(u)&&hi.call(u,"callee")&&!Cp.call(u,"callee")},Ot=ne.isArray,FC=Ze?ko(Ze):function(u){return Ki(u)&&Xr(u)==bl};function $s(u){return null!=u&&_y(u.length)&&!Ho(u)}function Yi(u){return Ki(u)&&$s(u)}var el=Tr||jy,NC=fn?ko(fn):function(u){return Ki(u)&&Xr(u)==ot};function Ca(u){if(!Ki(u))return!1;var h=Xr(u);return h==Pi||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!og(u)}function Ho(u){if(!Xi(u))return!1;var h=Xr(u);return h==oa||h==Fa||"[object AsyncFunction]"==h||"[object Proxy]"==h}function sg(u){return"number"==typeof u&&u==Jt(u)}function _y(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Ln}function Xi(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Ki(u){return null!=u&&"object"==typeof u}var Jx=xi?ko(xi):function(u){return Ki(u)&&gs(u)==Ri};function nT(u){return"number"==typeof u||Ki(u)&&Xr(u)==Hr}function og(u){if(!Ki(u)||Xr(u)!=nr)return!1;var h=pa(u);if(null===h)return!0;var m=hi.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&qi.call(m)==S1}var jC=Us?ko(Us):function(u){return Ki(u)&&Xr(u)==$r},iT=yc?ko(yc):function(u){return Ki(u)&&gs(u)==Fr};function vy(u){return"string"==typeof u||!Ot(u)&&Ki(u)&&Xr(u)==ei}function $o(u){return"symbol"==typeof u||Ki(u)&&Xr(u)==hc}var af=Mr?ko(Mr):function(u){return Ki(u)&&_y(u.length)&&!!Le[Xr(u)]},Ic=zp(R0),by=zp(function(u,h){return u<=h});function UC(u){if(!u)return[];if($s(u))return vy(u)?za(u):xs(u);if(Lh&&u[Lh])return function(W){for(var ue,ne=[];!(ue=W.next()).done;)ne.push(ue.value);return ne}(u[Lh]());var h=gs(u);return(h==Ri?y0:h==Fr?u_:Wd)(u)}function tl(u){return u?(u=Gs(u))===rn||u===-rn?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Jt(u){var h=tl(u),m=h%1;return h==h?m?h-m:h:0}function Cy(u){return u?wu(Jt(u),0,Ft):0}function Gs(u){if("number"==typeof u)return u;if($o(u))return NaN;if(Xi(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=Xi(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=_0(u);var m=Hi.test(u);return m||ln.test(u)?m0(u.slice(2),m?2:8):ti.test(u)?NaN:+u}function zC(u){return va(u,As(u))}function Yn(u){return null==u?"":mo(u)}var rT=Pl(function(u,h){if(qp(h)||$s(h))va(h,Qr(h),u);else for(var m in h)hi.call(h,m)&&Ga(u,m,h[m])}),sT=Pl(function(u,h){va(h,As(h),u)}),zd=Pl(function(u,h,m,b){va(h,As(h),u,b)}),oT=Pl(function(u,h,m,b){va(h,Qr(h),u,b)}),HC=Ka(x_),lT=gn(function(u,h){u=di(u);var m=-1,b=h.length,M=b>2?h[2]:k;for(M&&ms(h[0],h[1],M)&&(b=1);++m1),P}),va(u,j_(u),m),b&&(m=hs(m,7,Hp));for(var M=h.length;M--;)Mu(m,h[M]);return m}),fT=Ka(function(u,h){return null==u?{}:function(u,h){return k0(u,h,function(m,b){return ag(u,b)})}(u,h)});function KC(u,h){if(null==u)return{};var m=ui(j_(u),function(b){return[b]});return h=Nt(h),k0(u,m,function(b,M){return h(b,M[0])})}var pT=Iu(Qr),QC=Iu(As);function Wd(u){return null==u?[]:c_(u,Qr(u))}var vT=Rl(function(u,h,m){return h=h.toLowerCase(),u+(m?My(h):h)});function My(u){return ug(Yn(u).toLowerCase())}function xy(u){return(u=Yn(u))&&u.replace(gc,DF).replace(s_,"")}var CT=Rl(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),wT=Rl(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),pN=Vp("toLowerCase"),TT=Rl(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),Dy=Rl(function(u,h,m){return u+(m?" ":"")+ug(h)}),rw=Rl(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),ug=Vp("toUpperCase");function Ry(u,h,m){return u=Yn(u),(h=m?k:h)===k?function(W){return xl.test(W)}(u)?function(W){return W.match(h0)||[]}(u):function(W){return W.match(Kt)||[]}(u):u.match(h)||[]}var ky=gn(function(u,h){try{return xr(u,k,h)}catch(m){return Ca(m)?m:new Et(m)}}),sw=Ka(function(u,h){return us(h,function(m){m=on(m),Wa(u,m,sf(u[m],u))}),u});function Fy(u){return function(){return u}}var mN=Ou(),ku=Ou(!0);function Ds(u){return u}function Fu(u){return H1("function"==typeof u?u:hs(u,1))}var Ny=gn(function(u,h){return function(m){return ya(m,u,h)}}),ow=gn(function(u,h){return function(m){return ya(u,m,h)}});function Ly(u,h,m){var b=Qr(h),M=Yh(h,b);null==m&&(!Xi(h)||!M.length&&b.length)&&(m=h,h=u,u=this,M=Yh(h,Qr(h)));var P=!(Xi(m)&&"chain"in m&&!m.chain),V=Ho(u);return us(M,function(z){var X=h[z];u[z]=X,V&&(u.prototype[z]=function(){var ge=this.__chain__;if(P||ge){var me=u(this.__wrapped__),Se=me.__actions__=xs(this.__actions__);return Se.push({func:X,args:arguments,thisArg:u}),me.__chain__=ge,me}return X.apply(u,dr([this.value()],arguments))})}),u}function By(){}var kT=jp(ui),FT=jp(sn),lw=jp(ho);function Nu(u){return Vo(u)?a_(on(u)):function(u){return function(h){return Fo(h,u)}}(u)}var NT=z0(),LT=z0(!0);function Rc(){return[]}function jy(){return!1}var Tt=B_(function(u,h){return u+h},0),Uy=Fd("ceil"),yN=B_(function(u,h){return u/h},1),Bl=Fd("floor"),hw=B_(function(u,h){return u*h},1),fw=Fd("round"),pw=B_(function(u,h){return u-h},0);return O.after=function(u,h){if("function"!=typeof h)throw new fa(qt);return u=Jt(u),function(){if(--u<1)return h.apply(this,arguments)}},O.ary=ng,O.assign=rT,O.assignIn=sT,O.assignInWith=zd,O.assignWith=oT,O.at=HC,O.before=hy,O.bind=sf,O.bindAll=sw,O.bindKey=Ud,O.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Ot(u)?u:[u]},O.chain=sy,O.chunk=function(u,h,m){h=(m?ms(u,h,m):h===k)?1:hr(Jt(h),0);var b=null==u?0:u.length;if(!b||h<1)return[];for(var M=0,P=0,V=ne(Ce(b/h));MM?0:M+m),(b=b===k||b>M?M:Jt(b))<0&&(b+=M),b=m>b?0:Cy(b);m>>0)?(u=Yn(u))&&("string"==typeof h||null!=h&&!jC(h))&&!(h=mo(h))&&Rh(u)?Ya(za(u),0,m):u.split(h,m):[]},O.spread=function(u,h){if("function"!=typeof u)throw new fa(qt);return h=null==h?0:hr(Jt(h),0),gn(function(m){var b=m[h],M=Ya(m,0,h);return b&&dr(M,b),xr(u,this,M)})},O.tail=function(u){var h=null==u?0:u.length;return h?Kr(u,1,h):[]},O.take=function(u,h,m){return u&&u.length?Kr(u,0,(h=m||h===k?1:Jt(h))<0?0:h):[]},O.takeRight=function(u,h,m){var b=null==u?0:u.length;return b?Kr(u,(h=b-(h=m||h===k?1:Jt(h)))<0?0:h,b):[]},O.takeRightWhile=function(u,h){return u&&u.length?xu(u,Nt(h,3),!1,!0):[]},O.takeWhile=function(u,h){return u&&u.length?xu(u,Nt(h,3)):[]},O.tap=function(u,h){return h(u),u},O.throttle=function(u,h,m){var b=!0,M=!0;if("function"!=typeof u)throw new fa(qt);return Xi(m)&&(b="leading"in m?!!m.leading:b,M="trailing"in m?!!m.trailing:M),AC(u,h,{leading:b,maxWait:h,trailing:M})},O.thru=Vd,O.toArray=UC,O.toPairs=pT,O.toPairsIn=QC,O.toPath=function(u){return Ot(u)?ui(u,on):$o(u)?[u]:xs(eC(Yn(u)))},O.toPlainObject=zC,O.transform=function(u,h,m){var b=Ot(u),M=b||el(u)||af(u);if(h=Nt(h,4),null==m){var P=u&&u.constructor;m=M?b?new P:[]:Xi(u)&&Ho(P)?Cu(pa(u)):{}}return(M?us:qa)(u,function(V,z,X){return h(m,V,z,X)}),m},O.unary=function(u){return ng(u,1)},O.union=uC,O.unionBy=ny,O.unionWith=Qp,O.uniq=function(u){return u&&u.length?Mc(u):[]},O.uniqBy=function(u,h){return u&&u.length?Mc(u,Nt(h,2)):[]},O.uniqWith=function(u,h){return h="function"==typeof h?h:k,u&&u.length?Mc(u,k,h):[]},O.unset=function(u,h){return null==u||Mu(u,h)},O.unzip=dC,O.unzipWith=Dx,O.update=function(u,h,m){return null==u?u:Np(u,h,N_(m))},O.updateWith=function(u,h,m,b){return b="function"==typeof b?b:k,null==u?u:Np(u,h,N_(m),b)},O.values=Wd,O.valuesIn=function(u){return null==u?[]:c_(u,As(u))},O.without=hC,O.words=Ry,O.wrap=function(u,h){return ig(N_(h),u)},O.xor=iN,O.xorBy=yo,O.xorWith=iy,O.zip=ry,O.zipObject=function(u,h){return Lp(u||[],h||[],Ga)},O.zipObjectDeep=function(u,h){return Lp(u||[],h||[],Fp)},O.zipWith=rf,O.entries=pT,O.entriesIn=QC,O.extend=sT,O.extendWith=zd,Ly(O,O),O.add=Tt,O.attempt=ky,O.camelCase=vT,O.capitalize=My,O.ceil=Uy,O.clamp=function(u,h,m){return m===k&&(m=h,h=k),m!==k&&(m=(m=Gs(m))==m?m:0),h!==k&&(h=(h=Gs(h))==h?h:0),wu(Gs(u),h,m)},O.clone=function(u){return hs(u,4)},O.cloneDeep=function(u){return hs(u,5)},O.cloneDeepWith=function(u,h){return hs(u,5,h="function"==typeof h?h:k)},O.cloneWith=function(u,h){return hs(u,4,h="function"==typeof h?h:k)},O.conformsTo=function(u,h){return null==h||Ip(u,h,Qr(h))},O.deburr=xy,O.defaultTo=function(u,h){return null==u||u!=u?h:u},O.divide=yN,O.endsWith=function(u,h,m){u=Yn(u),h=mo(h);var b=u.length,M=m=m===k?b:wu(Jt(m),0,b);return(m-=h.length)>=0&&u.slice(m,M)==h},O.eq=St,O.escape=function(u){return(u=Yn(u))&&Ye.test(u)?u.replace(du,OF):u},O.escapeRegExp=function(u){return(u=Yn(u))&&K.test(u)?u.replace(B,"\\$&"):u},O.every=function(u,h,m){var b=Ot(u)?sn:D0;return m&&ms(u,h,m)&&(h=k),b(u,Nt(h,3))},O.find=Fx,O.findIndex=K_,O.findKey=function(u,h){return Ih(u,Nt(h,3),qa)},O.findLast=Nx,O.findLastIndex=Z_,O.findLastKey=function(u,h){return Ih(u,Nt(h,3),Pp)},O.floor=Bl,O.forEach=uy,O.forEachRight=Jp,O.forIn=function(u,h){return null==u?u:Md(u,Nt(h,3),As)},O.forInRight=function(u,h){return null==u?u:xd(u,Nt(h,3),As)},O.forOwn=function(u,h){return u&&qa(u,Nt(h,3))},O.forOwnRight=function(u,h){return u&&Pp(u,Nt(h,3))},O.get=uf,O.gt=Y,O.gte=kC,O.has=function(u,h){return null!=u&&X0(u,h,Td)},O.hasIn=ag,O.head=nC,O.identity=Ds,O.includes=function(u,h,m,b){u=$s(u)?u:Wd(u),m=m&&!b?Jt(m):0;var M=u.length;return m<0&&(m=hr(M+m,0)),vy(u)?m<=M&&u.indexOf(h,m)>-1:!!M&&Ua(u,h,m)>-1},O.indexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=null==m?0:Jt(m);return M<0&&(M=hr(b+M,0)),Ua(u,h,M)},O.inRange=function(u,h,m){return h=tl(h),m===k?(m=h,h=0):m=tl(m),function(u,h,m){return u>=Nr(h,m)&&u=-Ln&&u<=Ln},O.isSet=iT,O.isString=vy,O.isSymbol=$o,O.isTypedArray=af,O.isUndefined=function(u){return u===k},O.isWeakMap=function(u){return Ki(u)&&gs(u)==ci},O.isWeakSet=function(u){return Ki(u)&&"[object WeakSet]"==Xr(u)},O.join=function(u,h){return null==u?"":Bh.call(u,h)},O.kebabCase=CT,O.last=jo,O.lastIndexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=b;return m!==k&&(M=(M=Jt(m))<0?hr(b+M,0):Nr(M,b-1)),h==h?function(W,ue,ne){for(var it=ne+1;it--;)if(W[it]===ue)return it;return it}(u,h,M):md(u,vc,M,!0)},O.lowerCase=wT,O.lowerFirst=pN,O.lt=Ic,O.lte=by,O.max=function(u){return u&&u.length?qh(u,Ds,fs):k},O.maxBy=function(u,h){return u&&u.length?qh(u,Nt(h,2),fs):k},O.mean=function(u){return Wr(u,Ds)},O.meanBy=function(u,h){return Wr(u,Nt(h,2))},O.min=function(u){return u&&u.length?qh(u,Ds,R0):k},O.minBy=function(u,h){return u&&u.length?qh(u,Nt(h,2),R0):k},O.stubArray=Rc,O.stubFalse=jy,O.stubObject=function(){return{}},O.stubString=function(){return""},O.stubTrue=function(){return!0},O.multiply=hw,O.nth=function(u,h){return u&&u.length?Su(u,Jt(h)):k},O.noConflict=function(){return Wn._===this&&(Wn._=g_),this},O.noop=By,O.now=Ru,O.pad=function(u,h,m){u=Yn(u);var b=(h=Jt(h))?kh(u):0;if(!h||b>=h)return u;var M=(h-b)/2;return Up(Sn(M),m)+u+Up(Ce(M),m)},O.padEnd=function(u,h,m){u=Yn(u);var b=(h=Jt(h))?kh(u):0;return h&&bh){var b=u;u=h,h=b}if(m||u%1||h%1){var M=Vh();return Nr(u+M*(h-u+m1("1e-"+((M+"").length-1))),h)}return Il(u,h)},O.reduce=function(u,h,m){var b=Ot(u)?_u:Ro,M=arguments.length<3;return b(u,Nt(h,4),m,M,Ec)},O.reduceRight=function(u,h,m){var b=Ot(u)?gd:Ro,M=arguments.length<3;return b(u,Nt(h,4),m,M,A_)},O.repeat=function(u,h,m){return h=(m?ms(u,h,m):h===k)?1:Jt(h),kp(Yn(u),h)},O.replace=function(){var u=arguments,h=Yn(u[0]);return u.length<3?h:h.replace(u[1],u[2])},O.result=function(u,h,m){var b=-1,M=(h=Tc(h,u)).length;for(M||(M=1,u=k);++bLn)return[];var m=Ft,b=Nr(u,Ft);h=Nt(h),u-=Ft;for(var M=yd(b,h);++m=P)return u;var z=m-kh(b);if(z<1)return b;var X=V?Ya(V,0,z).join(""):u.slice(0,z);if(M===k)return X+b;if(V&&(z+=X.length-z),jC(M)){if(u.slice(z).search(M)){var ge,me=X;for(M.global||(M=f_(M.source,Yn(Zt.exec(M))+"g")),M.lastIndex=0;ge=M.exec(me);)var Se=ge.index;X=X.slice(0,Se===k?z:Se)}}else if(u.indexOf(mo(M),z)!=z){var Ke=X.lastIndexOf(M);Ke>-1&&(X=X.slice(0,Ke))}return X+b},O.unescape=function(u){return(u=Yn(u))&&Vs.test(u)?u.replace(ud,h_):u},O.uniqueId=function(u){var h=++LF;return Yn(u)+h},O.upperCase=rw,O.upperFirst=ug,O.each=uy,O.eachRight=Jp,O.first=nC,Ly(O,function(){var u={};return qa(O,function(h,m){hi.call(O.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),O.VERSION="4.17.21",us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){O[u].placeholder=O}),us(["drop","take"],function(u,h){pn.prototype[u]=function(m){m=m===k?1:hr(Jt(m),0);var b=this.__filtered__&&!h?new pn(this):this.clone();return b.__filtered__?b.__takeCount__=Nr(m,b.__takeCount__):b.__views__.push({size:Nr(m,Ft),type:u+(b.__dir__<0?"Right":"")}),b},pn.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),us(["filter","map","takeWhile"],function(u,h){var m=h+1,b=1==m||3==m;pn.prototype[u]=function(M){var P=this.clone();return P.__iteratees__.push({iteratee:Nt(M,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),us(["head","last"],function(u,h){var m="take"+(h?"Right":"");pn.prototype[u]=function(){return this[m](1).value()[0]}}),us(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");pn.prototype[u]=function(){return this.__filtered__?new pn(this):this[m](1)}}),pn.prototype.compact=function(){return this.filter(Ds)},pn.prototype.find=function(u){return this.filter(u).head()},pn.prototype.findLast=function(u){return this.reverse().find(u)},pn.prototype.invokeMap=gn(function(u,h){return"function"==typeof u?new pn(this):this.map(function(m){return ya(m,u,h)})}),pn.prototype.reject=function(u){return this.filter(gy(Nt(u)))},pn.prototype.slice=function(u,h){u=Jt(u);var m=this;return m.__filtered__&&(u>0||h<0)?new pn(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==k&&(m=(h=Jt(h))<0?m.dropRight(-h):m.take(h-u)),m)},pn.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},pn.prototype.toArray=function(){return this.take(Ft)},qa(pn.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),b=/^(?:head|last)$/.test(h),M=O[b?"take"+("last"==h?"Right":""):h],P=b||/^find/.test(h);!M||(O.prototype[h]=function(){var V=this.__wrapped__,z=b?[1]:arguments,X=V instanceof pn,ge=z[0],me=X||Ot(V),Se=function(_n){var On=M.apply(O,dr([_n],z));return b&&Ke?On[0]:On};me&&m&&"function"==typeof ge&&1!=ge.length&&(X=me=!1);var Ke=this.__chain__,mt=!!this.__actions__.length,Vt=P&&!Ke,mn=X&&!mt;if(!P&&me){V=mn?V:new pn(this);var zt=u.apply(V,z);return zt.__actions__.push({func:Vd,args:[Se],thisArg:k}),new po(zt,Ke)}return Vt&&mn?u.apply(this,z):(zt=this.thru(Se),Vt?b?zt.value()[0]:zt.value():zt)})}),us(["pop","push","shift","sort","splice","unshift"],function(u){var h=Ti[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",b=/^(?:pop|shift)$/.test(u);O.prototype[u]=function(){var M=arguments;if(b&&!this.__chain__){var P=this.value();return h.apply(Ot(P)?P:[],M)}return this[m](function(V){return h.apply(Ot(V)?V:[],M)})}}),qa(pn.prototype,function(u,h){var m=O[h];if(m){var b=m.name+"";hi.call(Cd,b)||(Cd[b]=[]),Cd[b].push({name:h,func:m})}}),Cd[Dc(k,2).name]=[{name:"wrapper",func:k}],pn.prototype.clone=function(){var u=new pn(this.__wrapped__);return u.__actions__=xs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=xs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=xs(this.__views__),u},pn.prototype.reverse=function(){if(this.__filtered__){var u=new pn(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},pn.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Ot(u),b=h<0,M=m?u.length:0,P=function(u,h,m){for(var b=-1,M=m.length;++b=this.__values__.length;return{done:u,value:u?k:this.__values__[this.__index__++]}},O.prototype.plant=function(u){for(var h,m=this;m instanceof Hh;){var b=Xp(m);b.__index__=0,b.__values__=k,h?M.__wrapped__=b:h=b;var M=b;m=m.__wrapped__}return M.__wrapped__=u,h},O.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof pn){var h=u;return this.__actions__.length&&(h=new pn(this)),(h=h.reverse()).__actions__.push({func:Vd,args:[ty],thisArg:k}),new po(h,this.__chain__)}return this.thru(ty)},O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=function(){return q1(this.__wrapped__,this.__actions__)},O.prototype.first=O.prototype.head,Lh&&(O.prototype[Lh]=function(){return this}),O}();Wn._=Fh,(_t=function(){return Fh}.call(We,Ve,We,pt))!==k&&(pt.exports=_t)}.call(this)},478:function(pt){pt.exports=function(){"use strict";function We(G,q){for(var Z=0;ZG.length)&&(q=G.length);for(var Z=0,T=new Array(q);Z=G.length?{done:!0}:{done:!1,value:G[T++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Pt={exports:{}};function ft(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Pt.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:ft,changeDefaults:function(G){Pt.exports.defaults=G}};var yt=/[&<>"']/,dn=/[&<>"']/g,En=/[<>"']|&(?!#?\w+;)/,Fe=/[<>"']|&(?!#?\w+;)/g,je={"&":"&","<":"<",">":">",'"':""","'":"'"},$t=function(q){return je[q]};var Ie=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function pi(G){return G.replace(Ie,function(q,Z){return"colon"===(Z=Z.toLowerCase())?":":"#"===Z.charAt(0)?"x"===Z.charAt(1)?String.fromCharCode(parseInt(Z.substring(2),16)):String.fromCharCode(+Z.substring(1)):""})}var qe=/(^|[^\[])\^/g;var Rt=/[^\w:]/g,nn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var Ci={},yi=/^[^:]+:\/*[^/]*$/,vi=/^([^:]+:)[\s\S]*$/,Er=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ae(G,q){Ci[" "+G]||(Ci[" "+G]=yi.test(G)?G+"/":Gt(G,"/",!0));var Z=-1===(G=Ci[" "+G]).indexOf(":");return"//"===q.substring(0,2)?Z?q:G.replace(vi,"$1")+q:"/"===q.charAt(0)?Z?q:G.replace(Er,"$1")+q:G+q}function Gt(G,q,Z){var T=G.length;if(0===T)return"";for(var D=0;D1;)1&q&&(Z+=G),q>>=1,G+=G;return Z+G},Ln=Pt.exports.defaults,be=Gt,Ii=function(G,q){var T=G.replace(/\|/g,function(B,K,H){for(var se=!1,ce=K;--ce>=0&&"\\"===H[ce];)se=!se;return se?"|":" |"}).split(/ \|/),D=0;if(T.length>q)T.splice(q);else for(;T.length1?{type:"space",raw:D[0]}:{raw:"\n"}},q.code=function(T){var D=this.rules.block.code.exec(T);if(D){var B=D[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:D[0],codeBlockStyle:"indented",text:this.options.pedantic?B:be(B,"\n")}}},q.fences=function(T){var D=this.rules.block.fences.exec(T);if(D){var B=D[0],K=function(G,q){var Z=G.match(/^(\s+)(?:```)/);if(null===Z)return q;var T=Z[1];return q.split("\n").map(function(D){var B=D.match(/^\s+/);return null===B?D:B[0].length>=T.length?D.slice(T.length):D}).join("\n")}(B,D[3]||"");return{type:"code",raw:B,lang:D[2]?D[2].trim():D[2],text:K}}},q.heading=function(T){var D=this.rules.block.heading.exec(T);if(D){var B=D[2].trim();if(/#$/.test(B)){var K=be(B,"#");(this.options.pedantic||!K||/ $/.test(K))&&(B=K.trim())}return{type:"heading",raw:D[0],depth:D[1].length,text:B}}},q.nptable=function(T){var D=this.rules.block.nptable.exec(T);if(D){var B={type:"table",header:Ii(D[1].replace(/^ *| *\| *$/g,"")),align:D[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:D[3]?D[3].replace(/\n$/,"").split("\n"):[],raw:D[0]};if(B.header.length===B.align.length){var H,K=B.align.length;for(H=0;H ?/gm,"");return{type:"blockquote",raw:D[0],text:B}}},q.list=function(T){var D=this.rules.block.list.exec(T);if(D){var Be,Kt,Cn,jt,gt,Zt,ti,Hi,$i,B=D[0],K=D[2],H=K.length>1,se={type:"list",raw:B,ordered:H,start:H?+K.slice(0,-1):"",loose:!1,items:[]},ce=D[0].match(this.rules.block.item),de=!1,ln=ce.length;Cn=this.rules.block.listItemStart.exec(ce[0]);for(var bi=0;biCn[1].length:jt[1].length>=Cn[0].length||jt[1].length>3){ce.splice(bi,2,ce[bi]+(!this.options.pedantic&&jt[1].length/i.test(K[0])&&(D=!1),!B&&/^<(pre|code|kbd|script)(\s|>)/i.test(K[0])?B=!0:B&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(K[0])&&(B=!1),{type:this.options.sanitize?"text":"html",raw:K[0],inLink:D,inRawBlock:B,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):Ft(K[0]):K[0]}},q.link=function(T){var D=this.rules.inline.link.exec(T);if(D){var B=D[2].trim();if(!this.options.pedantic&&/^$/.test(B))return;var K=be(B.slice(0,-1),"\\");if((B.length-K.length)%2==0)return}else{var H=Sr(D[2],"()");if(H>-1){var ce=(0===D[0].indexOf("!")?5:4)+D[1].length+H;D[2]=D[2].substring(0,H),D[0]=D[0].substring(0,ce).trim(),D[3]=""}}var de=D[2],Be="";if(this.options.pedantic){var Kt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(de);Kt&&(de=Kt[1],Be=Kt[3])}else Be=D[3]?D[3].slice(1,-1):"";return de=de.trim(),/^$/.test(B)?de.slice(1):de.slice(1,-1)),os(D,{href:de&&de.replace(this.rules.inline._escapes,"$1"),title:Be&&Be.replace(this.rules.inline._escapes,"$1")},D[0])}},q.reflink=function(T,D){var B;if((B=this.rules.inline.reflink.exec(T))||(B=this.rules.inline.nolink.exec(T))){var K=(B[2]||B[1]).replace(/\s+/g," ");if(!(K=D[K.toLowerCase()])||!K.href){var H=B[0].charAt(0);return{type:"text",raw:H,text:H}}return os(B,K,B[0])}},q.emStrong=function(T,D,B){void 0===B&&(B="");var K=this.rules.inline.emStrong.lDelim.exec(T);if(K&&(!K[3]||!B.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var H=K[1]||K[2]||"";if(!H||H&&(""===B||this.rules.inline.punctuation.exec(B))){var ce,de,se=K[0].length-1,Be=se,Kt=0,Cn="*"===K[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Cn.lastIndex=0,D=D.slice(-1*T.length+se);null!=(K=Cn.exec(D));)if(ce=K[1]||K[2]||K[3]||K[4]||K[5]||K[6]){if(de=ce.length,K[3]||K[4]){Be+=de;continue}if((K[5]||K[6])&&se%3&&!((se+de)%3)){Kt+=de;continue}if(!((Be-=de)>0))return de=Math.min(de,de+Be+Kt),Math.min(se,de)%2?{type:"em",raw:T.slice(0,se+K.index+de+1),text:T.slice(1,se+K.index+de)}:{type:"strong",raw:T.slice(0,se+K.index+de+1),text:T.slice(2,se+K.index+de-1)}}}}},q.codespan=function(T){var D=this.rules.inline.code.exec(T);if(D){var B=D[2].replace(/\n/g," "),K=/[^ ]/.test(B),H=/^ /.test(B)&&/ $/.test(B);return K&&H&&(B=B.substring(1,B.length-1)),B=Ft(B,!0),{type:"codespan",raw:D[0],text:B}}},q.br=function(T){var D=this.rules.inline.br.exec(T);if(D)return{type:"br",raw:D[0]}},q.del=function(T){var D=this.rules.inline.del.exec(T);if(D)return{type:"del",raw:D[0],text:D[2]}},q.autolink=function(T,D){var K,H,B=this.rules.inline.autolink.exec(T);if(B)return H="@"===B[2]?"mailto:"+(K=Ft(this.options.mangle?D(B[1]):B[1])):K=Ft(B[1]),{type:"link",raw:B[0],text:K,href:H,tokens:[{type:"text",raw:K,text:K}]}},q.url=function(T,D){var B;if(B=this.rules.inline.url.exec(T)){var K,H;if("@"===B[2])H="mailto:"+(K=Ft(this.options.mangle?D(B[0]):B[0]));else{var se;do{se=B[0],B[0]=this.rules.inline._backpedal.exec(B[0])[0]}while(se!==B[0]);K=Ft(B[0]),H="www."===B[1]?"http://"+K:K}return{type:"link",raw:B[0],text:K,href:H,tokens:[{type:"text",raw:K,text:K}]}}},q.inlineText=function(T,D,B){var H,K=this.rules.inline.text.exec(T);if(K)return H=D?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):Ft(K[0]):K[0]:Ft(this.options.smartypants?B(K[0]):K[0]),{type:"text",raw:K[0],text:H}},G}(),sa=rn_noopTest,Gn=rn_edit,ai=rn_merge,ot={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:sa,table:sa,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};ot.def=Gn(ot.def).replace("label",ot._label).replace("title",ot._title).getRegex(),ot.bullet=/(?:[*+-]|\d{1,9}[.)])/,ot.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ot.item=Gn(ot.item,"gm").replace(/bull/g,ot.bullet).getRegex(),ot.listItemStart=Gn(/^( *)(bull) */).replace("bull",ot.bullet).getRegex(),ot.list=Gn(ot.list).replace(/bull/g,ot.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ot.def.source+")").getRegex(),ot._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ot._comment=/|$)/,ot.html=Gn(ot.html,"i").replace("comment",ot._comment).replace("tag",ot._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ot.paragraph=Gn(ot._paragraph).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.blockquote=Gn(ot.blockquote).replace("paragraph",ot.paragraph).getRegex(),ot.normal=ai({},ot),ot.gfm=ai({},ot.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ot.gfm.nptable=Gn(ot.gfm.nptable).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.gfm.table=Gn(ot.gfm.table).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.pedantic=ai({},ot.normal,{html:Gn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ot._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:sa,paragraph:Gn(ot.normal._paragraph).replace("hr",ot.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ot.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var He={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:sa,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:sa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};He.punctuation=Gn(He.punctuation).replace(/punctuation/g,He._punctuation).getRegex(),He.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,He.escapedEmSt=/\\\*|\\_/g,He._comment=Gn(ot._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),He.emStrong.lDelim=Gn(He.emStrong.lDelim).replace(/punct/g,He._punctuation).getRegex(),He.emStrong.rDelimAst=Gn(He.emStrong.rDelimAst,"g").replace(/punct/g,He._punctuation).getRegex(),He.emStrong.rDelimUnd=Gn(He.emStrong.rDelimUnd,"g").replace(/punct/g,He._punctuation).getRegex(),He._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,He._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,He._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,He.autolink=Gn(He.autolink).replace("scheme",He._scheme).replace("email",He._email).getRegex(),He._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,He.tag=Gn(He.tag).replace("comment",He._comment).replace("attribute",He._attribute).getRegex(),He._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,He._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,He._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,He.link=Gn(He.link).replace("label",He._label).replace("href",He._href).replace("title",He._title).getRegex(),He.reflink=Gn(He.reflink).replace("label",He._label).getRegex(),He.reflinkSearch=Gn(He.reflinkSearch,"g").replace("reflink",He.reflink).replace("nolink",He.nolink).getRegex(),He.normal=ai({},He),He.pedantic=ai({},He.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Gn(/^!?\[(label)\]\((.*?)\)/).replace("label",He._label).getRegex(),reflink:Gn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",He._label).getRegex()}),He.gfm=ai({},He.normal,{escape:Gn(He.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(T="x"+T.toString(16)),q+="&#"+T+";";return q}var li=function(){function G(Z){this.tokens=[],this.tokens.links=Object.create(null),this.options=Z||Fa,this.options.tokenizer=this.options.tokenizer||new oa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var T={block:Ri.normal,inline:Hr.normal};this.options.pedantic?(T.block=Ri.pedantic,T.inline=Hr.pedantic):this.options.gfm&&(T.block=Ri.gfm,T.inline=this.options.breaks?Hr.breaks:Hr.gfm),this.tokenizer.rules=T}G.lex=function(T,D){return new G(D).lex(T)},G.lexInline=function(T,D){return new G(D).inlineTokens(T)};var q=G.prototype;return q.lex=function(T){return T=T.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(T,this.tokens,!0),this.inline(this.tokens),this.tokens},q.blockTokens=function(T,D,B){var H,se,ce,de,Be,Kt,K=this;for(void 0===D&&(D=[]),void 0===B&&(B=!0),this.options.pedantic&&(T=T.replace(/^ +$/gm,""));T;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(jt){return!!(H=jt.call(K,T,D))&&(T=T.substring(H.raw.length),D.push(H),!0)}))){if(H=this.tokenizer.space(T)){T=T.substring(H.raw.length),H.type&&D.push(H);continue}if(H=this.tokenizer.code(T)){T=T.substring(H.raw.length),(de=D[D.length-1])&&"paragraph"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H);continue}if(H=this.tokenizer.fences(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.heading(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.nptable(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.hr(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.blockquote(T)){T=T.substring(H.raw.length),H.tokens=this.blockTokens(H.text,[],B),D.push(H);continue}if(H=this.tokenizer.list(T)){for(T=T.substring(H.raw.length),ce=H.items.length,se=0;se=0&&(jt=Math.min(jt,Zt))}),jt<1/0&&jt>=0&&(Be=T.substring(0,jt+1))}(),B&&(H=this.tokenizer.paragraph(Be))){de=D[D.length-1],Kt&&"paragraph"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H),Kt=Be.length!==T.length,T=T.substring(H.raw.length);continue}if(H=this.tokenizer.text(T)){T=T.substring(H.raw.length),(de=D[D.length-1])&&"text"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H);continue}if(T){var Cn="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(Cn);break}throw new Error(Cn)}}return D},q.inline=function(T){var D,B,K,H,se,ce,de=T.length;for(D=0;D0)for(;null!=(Kt=this.tokenizer.rules.inline.reflinkSearch.exec(Be));)gt.includes(Kt[0].slice(Kt[0].lastIndexOf("[")+1,-1))&&(Be=Be.slice(0,Kt.index)+"["+Na("a",Kt[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(Kt=this.tokenizer.rules.inline.blockSkip.exec(Be));)Be=Be.slice(0,Kt.index)+"["+Na("a",Kt[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(Kt=this.tokenizer.rules.inline.escapedEmSt.exec(Be));)Be=Be.slice(0,Kt.index)+"++"+Be.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;T;)if(Cn||(jt=""),Cn=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ti){return!!(se=ti.call(H,T,D))&&(T=T.substring(se.raw.length),D.push(se),!0)}))){if(se=this.tokenizer.escape(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.tag(T,B,K)){T=T.substring(se.raw.length),B=se.inLink,K=se.inRawBlock,(ce=D[D.length-1])&&"text"===se.type&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(se=this.tokenizer.link(T)){T=T.substring(se.raw.length),"link"===se.type&&(se.tokens=this.inlineTokens(se.text,[],!0,K)),D.push(se);continue}if(se=this.tokenizer.reflink(T,this.tokens.links)){T=T.substring(se.raw.length),ce=D[D.length-1],"link"===se.type?(se.tokens=this.inlineTokens(se.text,[],!0,K),D.push(se)):ce&&"text"===se.type&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(se=this.tokenizer.emStrong(T,Be,jt)){T=T.substring(se.raw.length),se.tokens=this.inlineTokens(se.text,[],B,K),D.push(se);continue}if(se=this.tokenizer.codespan(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.br(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.del(T)){T=T.substring(se.raw.length),se.tokens=this.inlineTokens(se.text,[],B,K),D.push(se);continue}if(se=this.tokenizer.autolink(T,so)){T=T.substring(se.raw.length),D.push(se);continue}if(!B&&(se=this.tokenizer.url(T,so))){T=T.substring(se.raw.length),D.push(se);continue}if(de=T,this.options.extensions&&this.options.extensions.startInline&&function(){var ti=1/0,Hi=T.slice(1),$i=void 0;H.options.extensions.startInline.forEach(function(ln){"number"==typeof($i=ln.call(this,Hi))&&$i>=0&&(ti=Math.min(ti,$i))}),ti<1/0&&ti>=0&&(de=T.substring(0,ti+1))}(),se=this.tokenizer.inlineText(de,K,nr)){T=T.substring(se.raw.length),"_"!==se.raw.slice(-1)&&(jt=se.raw.slice(-1)),Cn=!0,(ce=D[D.length-1])&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(T){var Zt="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(Zt);break}throw new Error(Zt)}}return D},function(G,q,Z){q&&We(G.prototype,q),Z&&We(G,Z)}(G,null,[{key:"rules",get:function(){return{block:Ri,inline:Hr}}}]),G}(),$r=Pt.exports.defaults,Fr=rn_cleanUrl,ei=rn_escape,hc=function(){function G(Z){this.options=Z||$r}var q=G.prototype;return q.code=function(T,D,B){var K=(D||"").match(/\S*/)[0];if(this.options.highlight){var H=this.options.highlight(T,K);null!=H&&H!==T&&(B=!0,T=H)}return T=T.replace(/\n$/,"")+"\n",K?'
    '+(B?T:ei(T,!0))+"
    \n":"
    "+(B?T:ei(T,!0))+"
    \n"},q.blockquote=function(T){return"
    \n"+T+"
    \n"},q.html=function(T){return T},q.heading=function(T,D,B,K){return this.options.headerIds?"'+T+"\n":""+T+"\n"},q.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},q.list=function(T,D,B){var K=D?"ol":"ul";return"<"+K+(D&&1!==B?' start="'+B+'"':"")+">\n"+T+"\n"},q.listitem=function(T){return"
  • "+T+"
  • \n"},q.checkbox=function(T){return" "},q.paragraph=function(T){return"

    "+T+"

    \n"},q.table=function(T,D){return D&&(D=""+D+""),"\n\n"+T+"\n"+D+"
    \n"},q.tablerow=function(T){return"\n"+T+"\n"},q.tablecell=function(T,D){var B=D.header?"th":"td";return(D.align?"<"+B+' align="'+D.align+'">':"<"+B+">")+T+"\n"},q.strong=function(T){return""+T+""},q.em=function(T){return""+T+""},q.codespan=function(T){return""+T+""},q.br=function(){return this.options.xhtml?"
    ":"
    "},q.del=function(T){return""+T+""},q.link=function(T,D,B){if(null===(T=Fr(this.options.sanitize,this.options.baseUrl,T)))return B;var K='"+B+""},q.image=function(T,D,B){if(null===(T=Fr(this.options.sanitize,this.options.baseUrl,T)))return B;var K=''+B+'":">")},q.text=function(T){return T},G}(),oo=function(){function G(){}var q=G.prototype;return q.strong=function(T){return T},q.em=function(T){return T},q.codespan=function(T){return T},q.del=function(T){return T},q.html=function(T){return T},q.text=function(T){return T},q.link=function(T,D,B){return""+B},q.image=function(T,D,B){return""+B},q.br=function(){return""},G}(),ci=function(){function G(){this.seen={}}var q=G.prototype;return q.serialize=function(T){return T.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},q.getNextSafeSlug=function(T,D){var B=T,K=0;if(this.seen.hasOwnProperty(B)){K=this.seen[T];do{B=T+"-"+ ++K}while(this.seen.hasOwnProperty(B))}return D||(this.seen[T]=K,this.seen[B]=0),B},q.slug=function(T,D){void 0===D&&(D={});var B=this.serialize(T);return this.getNextSafeSlug(B,D.dryrun)},G}(),xh=hc,bl=oo,La=ci,ao=Pt.exports.defaults,Ba=rn_unescape,ls=li,lo=function(){function G(Z){this.options=Z||ao,this.options.renderer=this.options.renderer||new xh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new bl,this.slugger=new La}G.parse=function(T,D){return new G(D).parse(T)},G.parseInline=function(T,D){return new G(D).parseInline(T)};var q=G.prototype;return q.parse=function(T,D){void 0===D&&(D=!0);var K,H,se,ce,de,Be,Kt,Cn,jt,gt,Zt,ti,Hi,$i,ln,bi,gc,co,dd,B="",El=T.length;for(K=0;K0&&"text"===ln.tokens[0].type?(ln.tokens[0].text=co+" "+ln.tokens[0].text,ln.tokens[0].tokens&&ln.tokens[0].tokens.length>0&&"text"===ln.tokens[0].tokens[0].type&&(ln.tokens[0].tokens[0].text=co+" "+ln.tokens[0].tokens[0].text)):ln.tokens.unshift({type:"text",text:co}):$i+=co),$i+=this.parse(ln.tokens,Hi),jt+=this.renderer.listitem($i,gc,bi);B+=this.renderer.list(jt,Zt,ti);continue;case"html":B+=this.renderer.html(gt.text);continue;case"paragraph":B+=this.renderer.paragraph(this.parseInline(gt.tokens));continue;case"text":for(jt=gt.tokens?this.parseInline(gt.tokens):gt.text;K+1An error occurred:

    "+pc(se.message+"",!0)+"
    ";throw se}}return Ye.options=Ye.setOptions=function(G){return uu(Ye.defaults,G),du(Ye.defaults),Ye},Ye.getDefaults=ud,Ye.defaults=Vs,Ye.use=function(){for(var G=this,q=arguments.length,Z=new Array(q),T=0;TAn error occurred:

    "+pc(T.message+"",!0)+"
    ";throw T}},Ye.Parser=lo,Ye.parser=lo.parse,Ye.Renderer=Cl,Ye.TextRenderer=lu,Ye.Lexer=ls,Ye.lexer=ls.lex,Ye.Tokenizer=fc,Ye.Slugger=cu,Ye.parse=Ye,Ye}()},310:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.isMobile=function(){return void 0!==k.window.orientation},We.default=function(yt){if(!yt&&!(0,It.default)())return"Node";if((0,Pt.default)(yt))return"Electron";var dn="undefined"!=typeof navigator?navigator:{},En=yt||dn.userAgent||"";if(En.indexOf("Edge")>-1)return"Edge";var Fe=-1!==En.indexOf("MSIE "),je=-1!==En.indexOf("Trident/");return Fe||je?"IE":k.window.chrome?"Chrome":k.window.safari?"Safari":k.window.mozInnerScreenX?"Firefox":"Unknown"};var k=Ve(151),It=_t(Ve(602)),Pt=_t(Ve(344))},151:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.console=We.process=We.document=We.global=We.window=We.self=void 0;var k=_t(Ve(321)),It={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,k.default)(process))&&process};We.self=It.self||It.window||It.global,We.window=It.window||It.self||It.global,We.global=It.global||It.self||It.window,We.document=It.document||{},We.process=It.process||{};var En=console;We.console=En},761:(pt,We,Ve)=>{"use strict";var k=Ve(948),It=Ve(321);Object.defineProperty(We,"CO",{enumerable:!0,get:function(){return Pt.global}}),Object.defineProperty(We,"jU",{enumerable:!0,get:function(){return ft.default}}),Object.defineProperty(We,"qs",{enumerable:!0,get:function(){return qt.default}});var Pt=Ve(151),ft=En(Ve(602)),qt=En(Ve(310));k(Ve(344));function dn(Fe){if("function"!=typeof WeakMap)return null;var je=new WeakMap,$t=new WeakMap;return(dn=function(Ie){return Ie?$t:je})(Fe)}function En(Fe,je){if(!je&&Fe&&Fe.__esModule)return Fe;if(null===Fe||"object"!==It(Fe)&&"function"!=typeof Fe)return{default:Fe};var $t=dn(je);if($t&&$t.has(Fe))return $t.get(Fe);var Ne={},Ie=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var pi in Fe)if("default"!==pi&&Object.prototype.hasOwnProperty.call(Fe,pi)){var qe=Ie?Object.getOwnPropertyDescriptor(Fe,pi):null;qe&&(qe.get||qe.set)?Object.defineProperty(Ne,pi,qe):Ne[pi]=Fe[pi]}return Ne.default=Fe,$t&&$t.set(Fe,Ne),Ne}},602:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=Pt,We.isBrowserMainThread=function(){return Pt()&&"undefined"!=typeof document};var k=_t(Ve(321)),It=_t(Ve(344));function Pt(){return!("object"===("undefined"==typeof process?"undefined":(0,k.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,It.default)()}},344:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=function(Pt){if("undefined"!=typeof window&&"object"===(0,k.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,k.default)(process.versions)&&Boolean(process.versions.electron))return!0;var ft="object"===("undefined"==typeof navigator?"undefined":(0,k.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,qt=Pt||ft;return!!(qt&&qt.indexOf("Electron")>=0)};var k=_t(Ve(321))},473:(pt,We,Ve)=>{"use strict";var _t={};Ve.r(_t),Ve.d(_t,{decode:()=>$ve,encode:()=>Gve});var k={};Ve.r(k),Ve.d(k,{decode:()=>Kve,encode:()=>Zve});var It={};Ve.r(It),Ve.d(It,{decode:()=>Qve,encode:()=>Jve});var Pt={};function ft(n){return"function"==typeof n}Ve.r(Pt),Ve.d(Pt,{decode:()=>ebe,encode:()=>tbe});let qt=!1;const yt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else qt&&console.log("RxJS: Back to a better error behavior. Thank you. <3");qt=n},get useDeprecatedSynchronousErrorHandling(){return qt}};function dn(n){setTimeout(()=>{throw n},0)}const En={closed:!0,next(n){},error(n){if(yt.useDeprecatedSynchronousErrorHandling)throw n;dn(n)},complete(){}},Fe=Array.isArray||(n=>n&&"number"==typeof n.length);function je(n){return null!==n&&"object"==typeof n}const Ne=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class Ie{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof Ie)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof Ne?t.errors:t),[])}Ie.EMPTY=((n=new Ie).closed=!0,n);const qe="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class Rt extends Ie{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=En;break;case 1:if(!e){this.destination=En;break}if("object"==typeof e){e instanceof Rt?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new nn(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new nn(this,e,t,i)}}[qe](){return this}static create(e,t,i){const r=new Rt(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class nn extends Rt{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;ft(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==En&&(o=Object.create(t),ft(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;yt.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=yt;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):dn(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;dn(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);yt.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),yt.useDeprecatedSynchronousErrorHandling)throw i;dn(i)}}__tryOrSetError(e,t,i){if(!yt.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return yt.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(dn(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const yi="function"==typeof Symbol&&Symbol.observable||"@@observable";function vi(n){return n}function Er(...n){return Ae(n)}function Ae(n){return 0===n.length?vi:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let oe=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof Rt)return n;if(n[qe])return n[qe]()}return n||e||t?new Rt(n,e,t):new Rt(En)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||yt.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),yt.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){yt.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof Rt?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=kt(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[yi](){return this}pipe(...t){return 0===t.length?this:Ae(t)(this)}toPromise(t){return new(t=kt(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function kt(n){if(n||(n=yt.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const Gt=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class oi extends Ie{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class Oi extends Rt{constructor(e){super(e),this.destination=e}}let we=(()=>{class n extends oe{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[qe](){return new Oi(this)}lift(t){const i=new rn(this,this);return i.operator=t,i}next(t){if(this.closed)throw new Gt;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew rn(e,t),n})();class rn extends we{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):Ie.EMPTY}}function Ln(n){return n&&"function"==typeof n.schedule}function be(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new Ii(n,e))}}class Ii{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new Ft(e,this.project,this.thisArg))}}class Ft extends Rt{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const Sr=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function He(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Pi=n=>{if(n&&"function"==typeof n[yi])return(n=>e=>{const t=n[yi]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(ot(n))return Sr(n);if(He(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,dn),e))(n);if(n&&"function"==typeof n[as])return(n=>e=>{const t=n[as]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${je(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Ri(n,e){return new oe(t=>{const i=new Ie;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function li(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[yi]}(n))return function(n,e){return new oe(t=>{const i=new Ie;return i.add(e.schedule(()=>{const r=n[yi]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(He(n))return function(n,e){return new oe(t=>{const i=new Ie;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(ot(n))return Ri(n,e);if(function(n){return n&&"function"==typeof n[as]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new oe(t=>{const i=new Ie;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[as](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof oe?n:new oe(Pi(n))}class $r extends Rt{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class ei extends Rt{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function oo(n,e){if(e.closed)return;if(n instanceof oe)return n.subscribe(e);let t;try{t=Pi(n)(e)}catch(i){e.error(i)}return t}function ci(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(ci((r,s)=>li(n(r,s)).pipe(be((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new xh(n,t)))}class xh{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new bl(e,this.project,this.concurrent))}}class bl extends ei{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function ao(n=Number.POSITIVE_INFINITY){return ci(vi,n)}function Ba(n,e){return e?Ri(n,e):new oe(Sr(n))}function ki(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Ln(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof oe?n[0]:ao(e)(Ba(n,t))}function ls(){return function(e){return e.lift(new lo(e))}}class lo{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new fc(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class fc extends Rt{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Cl extends oe{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new Ie,e.add(this.source.subscribe(new cu(this.getSubject(),this))),e.closed&&(this._connection=null,e=Ie.EMPTY)),e}refCount(){return ls()(this)}}const lu=(()=>{const n=Cl.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class cu extends Oi{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}function pc(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new ud(r,e));const s=Object.create(i,lu);return s.source=i,s.subjectFactory=r,s}}class ud{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function du(){return new we}function Vs(){return n=>ls()(pc(du)(n))}function Ye(n){for(let e in n)if(n[e]===Ye)return e;throw Error("Could not find renamed property on target object.")}function hu(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function G(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(G).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function q(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const Z=Ye({__forward_ref__:Ye});function T(n){return n.__forward_ref__=T,n.toString=function(){return G(this())},n}function D(n){return B(n)?n():n}function B(n){return"function"==typeof n&&n.hasOwnProperty(Z)&&n.__forward_ref__===T}class H extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function de(n){return"string"==typeof n?n:null==n?"":String(n)}function Be(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():de(n)}function gt(n,e){const t=e?` in ${e}`:"";throw new H("201",`No provider for ${Be(n)} found${t}`)}function Gi(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function ae(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Ee(n){return{providers:n.providers||[],imports:n.imports||[]}}function ir(n){return _c(n,la)||_c(n,ja)}function _c(n,e){return n.hasOwnProperty(e)?n[e]:null}function mu(n){return n&&(n.hasOwnProperty(Sl)||n.hasOwnProperty(mp))?n[Sl]:null}const la=Ye({\u0275prov:Ye}),Sl=Ye({\u0275inj:Ye}),ja=Ye({ngInjectableDef:Ye}),mp=Ye({ngInjectorDef:Ye});var vt=(()=>((vt=vt||{})[vt.Default=0]="Default",vt[vt.Host=1]="Host",vt[vt.Self=2]="Self",vt[vt.SkipSelf=4]="SkipSelf",vt[vt.Optional=8]="Optional",vt))();let Ml;function ca(n){const e=Ml;return Ml=n,e}function hd(n,e,t){const i=ir(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&vt.Optional?null:void 0!==e?e:void gt(G(n),"Injector")}function R(n){return{toString:n}.toString()}var j=(()=>((j=j||{})[j.OnPush=0]="OnPush",j[j.Default=1]="Default",j))(),Re=(()=>((Re=Re||{})[Re.Emulated=0]="Emulated",Re[Re.None=2]="None",Re[Re.ShadowDom=3]="ShadowDom",Re))();const hn="undefined"!=typeof globalThis&&globalThis,cr="undefined"!=typeof window&&window,mr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Gr="undefined"!=typeof global&&global,cn=hn||Gr||cr||mr,fd={},gi=[],yp=Ye({\u0275cmp:Ye}),s_=Ye({\u0275dir:Ye}),Ah=Ye({\u0275pipe:Ye}),h0=Ye({\u0275mod:Ye}),p1=Ye({\u0275loc:Ye}),xl=Ye({\u0275fac:Ye}),Dh=Ye({__NG_ELEMENT_ID__:Ye});let g1=0;function Le(n){return R(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===j.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||gi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Re.Emulated,id:"c",styles:n.styles||gi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=g1++,i.inputs=m0(n.inputs,t),i.outputs=m0(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(f0):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(p0):null,i})}function f0(n){return Wn(n)||function(n){return n[s_]||null}(n)}function p0(n){return function(n){return n[Ah]||null}(n)}const g0={};function xe(n){return R(()=>{const e={type:n.type,bootstrap:n.bootstrap||gi,declarations:n.declarations||gi,imports:n.imports||gi,exports:n.exports||gi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(g0[n.id]=n.type),e})}function m0(n,e){if(null==n)return fd;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const he=Le;function cs(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Wn(n){return n[yp]||null}function uo(n,e){const t=n[h0]||null;if(!t&&!0===e)throw new Error(`Type ${G(n)} does not have '\u0275mod' property.`);return t}function Po(n){return Array.isArray(n)&&"object"==typeof n[1]}function Ro(n){return Array.isArray(n)&&!0===n[1]}function l_(n){return 0!=(8&n.flags)}function _d(n){return 2==(2&n.flags)}function yd(n){return 1==(1&n.flags)}function ha(n){return null!==n.template}function _0(n){return 0!=(512&n[2])}function bc(n,e){return n.hasOwnProperty(xl)?n[xl]:null}class h_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function qn(){return b0}function b0(n){return n.type.prototype.ngOnChanges&&(n.setInput=E1),w1}function w1(){const n=W(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===fd)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function E1(n,e,t,i){const r=W(n)||function(n,e){return n[Fh]=e}(n,{previous:fd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new h_(l&&l.currentValue,e,o===fd),n[i]=e}qn.ngInherit=!0;const Fh="__ngSimpleChanges__";function W(n){return n[Fh]||null}const Bn="http://www.w3.org/2000/svg";let di;function Ti(n){return!!n.listen}const vu={createRenderer:(n,e)=>void 0!==di?di:"undefined"!=typeof document?document:void 0};function qi(n){for(;Array.isArray(n);)n=n[0];return n}function Nh(n,e){return qi(e[n])}function Ss(n,e){return qi(e[n.index])}function g_(n,e){return n.data[e]}function vd(n,e){return n[e]}function ds(n,e){const t=e[n];return Po(t)?t:t[0]}function Dl(n){return 4==(4&n[2])}function bd(n){return 128==(128&n[2])}function pa(n,e){return null==e?null:n[e]}function m_(n){n[18]=0}function Cp(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Ut={lFrame:Cu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function w0(){return Ut.bindingsEnabled}function Ce(){return Ut.lFrame.lView}function Sn(){return Ut.lFrame.tView}function Vn(n){return Ut.lFrame.contextLView=n,n[8]}function Tr(){let n=__();for(;null!==n&&64===n.type;)n=n.parent;return n}function __(){return Ut.lFrame.currentTNode}function Ha(n,e){const t=Ut.lFrame;t.currentTNode=n,t.isParent=e}function hr(){return Ut.lFrame.isParent}function Nr(){Ut.lFrame.isParent=!1}function Vh(){return Ut.isInCheckNoChangesMode}function Ep(n){Ut.isInCheckNoChangesMode=n}function qr(){const n=Ut.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function zs(){return Ut.lFrame.bindingIndex}function ga(){return Ut.lFrame.bindingIndex++}function fo(n){const e=Ut.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Cd(n,e){const t=Ut.lFrame;t.bindingIndex=t.bindingRootIndex=n,y_(e)}function y_(n){Ut.lFrame.currentDirectiveIndex=n}function v_(n){const e=Ut.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function E0(){return Ut.lFrame.currentQueryIndex}function b_(n){Ut.lFrame.currentQueryIndex=n}function Mp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function wd(n,e,t){if(t&vt.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&vt.Host||(r=Mp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ut.lFrame=O();return i.currentTNode=e,i.lView=n,!0}function zh(n){const e=O(),t=n[1];Ut.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function O(){const n=Ut.lFrame,e=null===n?null:n.child;return null===e?Cu(n):e}function Cu(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Hh(){const n=Ut.lFrame;return Ut.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const po=Hh;function pn(){const n=Hh();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Ms(){return Ut.lFrame.selectedIndex}function Hs(n){Ut.lFrame.selectedIndex=n}function rr(){const n=Ut.lFrame;return g_(n.tView,n.selectedIndex)}function xp(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class $h{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Dp(n,e,t){const i=Ti(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let Sd=!0;function Op(n){const e=Sd;return Sd=n,e}let x_=0;function hs(n,e){const t=Ip(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,T_(i.data,n),T_(e,null),T_(i.blueprint,null));const r=Wh(n,e),s=n.injectorIndex;if(T0(r)){const o=Ed(r),a=Ga(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function T_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Ip(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Wh(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function wc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Dh)&&(i=t[Dh]),null==i&&(i=t[Dh]=x_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:I0:e}(t);if("function"==typeof s){if(!wd(e,n,i))return i&vt.Host?A_(r,t,i):D0(e,t,i,r);try{const o=s(i);if(null!=o||i&vt.Optional)return o;gt(t)}finally{po()}}else if("number"==typeof s){let o=null,a=Ip(n,e),l=-1,c=i&vt.Host?e[16][6]:null;for((-1===a||i&vt.SkipSelf)&&(l=-1===a?Wh(n,e):e[a+8],-1!==l&&Yh(i,!1)?(o=e[1],a=Ed(l),e=Ga(l,e)):a=-1);-1!==a;){const d=e[1];if(Pp(s,a,d.data)){const f=Yr(a,e,t,o,i,c);if(f!==O0)return f}l=e[a+8],-1!==l&&Yh(i,e[1].data[a+8]===c)&&Pp(s,a,e)?(o=d,a=Ed(l),e=Ga(l,e)):a=-1}}}return D0(e,t,i,r)}const O0={};function I0(){return new Fo(Tr(),Ce())}function Yr(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=Md(a,o,t,null==i?_d(a)&&Sd:i!=o&&0!=(3&a.type),r&vt.Host&&s===a);return null!==d?xd(e,o,d,a):O0}function Md(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&ha(g)&&g.type===t)return l}return null}function xd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof $h}(r)){const o=r;o.resolving&&function(n,e){throw new H("200",`Circular dependency in DI detected for ${n}`)}(Be(s[t]));const a=Op(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ca(o.injectImpl):null;wd(n,i,vt.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=b0(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ca(l),Op(a),o.resolving=!1,po()}}return r}function Pp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[xl]||Xr(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[xl]||Xr(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Xr(n){return B(n)?()=>{const e=Xr(D(n));return e&&e()}:bc(n)}function fs(n){return function(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const i=t.length;let r=0;for(;r{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(Ad)?l[Ad]:Object.defineProperty(l,Ad,{value:[]})[Ad];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class _e{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=ae({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const Su=Function;function No(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Lo(t,e):e(t))}function Kh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Il(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Sc(n,e){const t=[];for(let i=0;i=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function k_(n,e){const t=Kr(n,e);if(t>=0)return n[1|t]}function Kr(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):G(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Tc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[xc]=null,n}const Rd=Pd(ya("Inject",n=>({token:n})),-1),yr=Pd(ya("Optional"),8),Xa=Pd(ya("SkipSelf"),4);let Fd;function Iu(n){var e;return(null===(e=function(){if(void 0===Fd&&(Fd=null,cn.trustedTypes))try{Fd=cn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Fd}())||void 0===e?void 0:e.createHTML(n))||n}class Fl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class j_ extends Fl{getTypeName(){return"HTML"}}class U_ extends Fl{getTypeName(){return"Style"}}class Gp extends Fl{getTypeName(){return"Script"}}class Nd extends Fl{getTypeName(){return"URL"}}class Nt extends Fl{getTypeName(){return"ResourceURL"}}function ps(n){return n instanceof Fl?n.changingThisBreaksApplicationSecurity:n}function Bo(n,e){const t=Oc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Oc(n){return n instanceof Fl&&n.getTypeName()||null}class X0{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Iu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class tx{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Iu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Iu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0_o(e.trim())).join(", ")}function Vo(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Qh(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Wp=Vo("area,br,col,hr,img,wbr"),Z0=Vo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Q0=Vo("rp,rt"),H_=Qh(Wp,Qh(Z0,Vo("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Qh(Q0,Vo("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Qh(Q0,Z0)),$_=Vo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),G_=Vo("srcset"),W_=Qh($_,G_,Vo("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Vo("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),ax=Vo("script,style,template");class q_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!H_.hasOwnProperty(t))return this.sanitizedSomething=!0,!ax.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();H_.hasOwnProperty(t)&&!Wp.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Yp(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return t}}const J0=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Jh=/([^\#-~ |!])/g;function Yp(n){return n.replace(/&/g,"&").replace(J0,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Jh,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let ef;function Y_(n,e){let t=null;try{ef=ef||function(n){const e=new tx(n);return function(){try{return!!(new window.DOMParser).parseFromString(Iu(""),"text/html")}catch(n){return!1}}()?new X0(e):e}(n);let i=e?String(e):"";t=ef.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=t.innerHTML,t=ef.getInertBodyElement(i)}while(i!==s);return Iu((new q_).sanitizeChildren(Ld(t)||t))}finally{if(t){const i=Ld(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Ld(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var on=(()=>((on=on||{})[on.NONE=0]="NONE",on[on.HTML=1]="HTML",on[on.STYLE=2]="STYLE",on[on.SCRIPT=3]="SCRIPT",on[on.URL=4]="URL",on[on.RESOURCE_URL=5]="RESOURCE_URL",on))();const Z_="__ngContext__";function Zr(n,e){n[Z_]=e}function Q_(n){const e=function(n){return n[Z_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Kp(n){return n.ngOriginalError}function bx(n,...e){n.error(...e)}class Uo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||bx}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(Kp(e)):null}_findOriginalError(e){let t=e&&Kp(e);for(;t&&Kp(t);)t=Kp(t);return t||null}}const uC=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(cn))();function ny(n){return n.ownerDocument.defaultView}function Qp(n){return n.ownerDocument}function Za(n){return n instanceof Function?n():n}var yo=(()=>((yo=yo||{})[yo.Important=1]="Important",yo[yo.DashCase=2]="DashCase",yo))();function ry(n,e){return undefined(n,e)}function rf(n){const e=n[3];return Ro(e)?e[3]:e}function Vd(n){return gC(n[13])}function oy(n){return gC(n[4])}function gC(n){for(;null!==n&&!Ro(n);)n=n[4];return n}function jd(n,e,t,i,r){if(null!=i){let s,o=!1;Ro(i)?s=i:Po(i)&&(o=!0,i=i[0]);const a=qi(i);0===n&&null!==t?null==r?bC(e,t,a):Qa(e,t,a,r||null,!0):1===n&&null!==t?Qa(e,t,a,r||null,!0):2===n?function(n,e,t){const i=eg(n,e);i&&function(n,e,t,i){Ti(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==qi(t)&&jd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Il(n,10+e);!function(n,e){Ud(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function uy(n,e){if(!(256&e[2])){const t=e[11];Ti(t)&&t.destroyNode&&Ud(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Jp(n[1],n);for(;e;){let t=null;if(Po(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Po(e)&&Jp(e[1],e),e=e[3];null===e&&(e=n),Po(e)&&Jp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Jp(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==of(g,c,0)||2&i&&c!==p){if(ba(i))return!1;o=!0}}}}else{if(!o&&!ba(i)&&!ba(l))return!1;if(o&&ba(l))continue;o=!1,i=l|1&i}}return ba(i)||o}function ba(n){return 0==(1&n)}function Gx(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!ba(o)&&(e+=RC(s,r),r=""),i=o,s=s||!ba(i);t++}return""!==r&&(e+=RC(s,r)),e}const St={};function Y(n){kC(Sn(),Ce(),Ms()+n,Vh())}function kC(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Tp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Ap(e,s,0,t)}Hs(t)}function Ja(n,e){return n<<17|e<<2}function Ot(n){return n>>17&32767}function Yi(n){return 2|n}function Nl(n){return(131068&n)>>2}function el(n,e){return-131069&n|e<<2}function my(n){return 1|n}function HC(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&kC(n,e,20,Vh()),t(i,r)}finally{Hs(s)}}function GC(n,e,t){if(l_(e)){const r=e.directiveEnd;for(let s=e.directiveStart;s0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function ew(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function tw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function vT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&Ay(t)}}function Ay(n){for(let i=Vd(n);null!==i;i=oy(i))for(let r=10;r0&&Ay(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&Ay(r)}}function xT(n,e){const t=ds(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function rw(n){return n[7]||(n[7]=[])}function ug(n){return n.cleanup||(n.cleanup=[])}function Ry(n,e,t){return(null===n||ha(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function ky(n,e){const t=n[9],i=t?t.get(Uo,null):null;i&&i.handleError(e)}function sw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Lo([e],a=>this.processInjectorType(a,[],s)),this.records.set(ku,Nu(void 0,this));const o=this.records.get(Fu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:G(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=Tu,i=vt.Default){this.assertNotDestroyed();const r=Id(this),s=ca(void 0);try{if(!(i&vt.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof _e}(e)&&ir(e);a=l&&this.injectableDefInScope(l)?Nu(Vy(e),df):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&vt.Self?ow():this.parent).get(e,t=i&vt.Optional&&t===Tu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[xc]=o[xc]||[]).unshift(G(e)),r)throw o;return xs(o,e,"R3InjectorError",this.source)}throw o}finally{ca(s),Id(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(G(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=D(e)))return!1;let r=mu(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=mu(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Lo(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||gi))}}this.injectorDefTypes.add(o);const l=bc(o)||(()=>new o);this.records.set(o,Nu(l,df));const c=r.providers;if(null!=c&&!a){const d=e;Lo(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Rc(e=D(e))?e:D(e&&e.provide);const s=function(n,e,t){return cw(n)?Nu(void 0,n.useValue):Nu(lw(n),df)}(e);if(Rc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Nu(void 0,df,!0),o.factory=()=>Du(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===df&&(t.value=RT,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=D(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Vy(n){const e=ir(n),t=null!==e?e.factory:bc(n);if(null!==t)return t;if(n instanceof _e)throw new Error(`Token ${G(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=Sc(e,"?");throw new Error(`Can't resolve all parameters for ${G(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[la]||n[ja]);if(e){const t=function(n){if(n.hasOwnProperty("name"))return n.name;const e=(""+n).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${t}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${t}" class.`),e}return null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new Error("unreachable")}function lw(n,e,t){let i;if(Rc(n)){const r=D(n);return bc(r)||Vy(r)}if(cw(n))i=()=>D(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Du(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>I(D(n.useExisting));else{const r=D(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return bc(r)||Vy(r);i=()=>new r(...Du(n.deps))}return i}function Nu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function cw(n){return null!==n&&"object"==typeof n&&Bp in n}function Rc(n){return"function"==typeof n}const uw=function(n,e,t){return function(n,e=null,t=null,i){const r=aw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Tt{static create(e,t){return Array.isArray(e)?uw(e,t,""):uw(e.providers,e.parent,e.name||"")}}function u9(n,e){xp(Q_(n)[1],Tr())}function ht(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(ha(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=qT(n.inputs),o.declaredInputs=qT(n.declaredInputs),o.outputs=qT(n.outputs);const a=r.hostBindings;a&&p9(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&h9(n,l),c&&f9(n,c),hu(n.inputs,r.inputs),hu(n.declaredInputs,r.declaredInputs),hu(n.outputs,r.outputs),ha(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Gh(r.hostAttrs,t=Gh(t,r.hostAttrs))}}(i)}function qT(n){return n===fd?{}:n===gi?[]:n}function h9(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function f9(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function p9(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Tt.THROW_IF_NOT_FOUND=Tu,Tt.NULL=new Ds,Tt.\u0275prov=ae({token:Tt,providedIn:"any",factory:()=>I(ku)}),Tt.__NG_ELEMENT_ID__=-1;let gw=null;function hg(){if(!gw){const n=cn.Symbol;if(n&&n.iterator)gw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(qi(L[i.index])):i.index;if(Ti(t)){let L=null;if(!a&&l&&(L=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==L)(L.__ngLastListenerFn__||L).__ngNextListenerFn__=s,L.__ngLastListenerFn__=s,g=!1;else{s=tA(i,e,f,s,!1);const U=t.listen(w,r,s);p.push(s,U),d&&d.push(r,x,C,C+1)}}else s=tA(i,e,f,s,!0),w.addEventListener(r,s,o),p.push(s),d&&d.push(r,x,C,o)}else s=tA(i,e,f,s,!1);const _=i.outputs;let y;if(g&&null!==_&&(y=_[r])){const v=y.length;if(v)for(let w=0;w0;)e=e[15],n--;return e}(n,Ut.lFrame.contextLView))[8]}(n)}function q9(n,e){let t=null;const i=function(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(n);for(let r=0;r=0}const Jr={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function o2(n){return n.substring(Jr.key,Jr.keyEnd)}function a2(n,e){const t=Jr.textEnd;return t===e?-1:(e=Jr.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Jr.key=e,t),Eg(n,e,t))}function Eg(n,e,t){for(;e=0;t=a2(e,t))go(n,o2(e),!0)}function Ul(n,e,t,i){const r=Ce(),s=Sn(),o=fo(2);s.firstUpdatePass&&f2(s,n,o,i),e!==St&&qs(r,o,e)&&g2(s,s.data[Ms()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=G(ps(n)))),n}(e,t),i,o)}function zl(n,e,t,i){const r=Sn(),s=fo(2);r.firstUpdatePass&&f2(r,null,s,i);const o=Ce();if(t!==St&&qs(o,s,t)){const a=r.data[Ms()];if(_2(a,i)&&!h2(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=q(l,t||"")),eA(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===St&&(r=gi);let l=0,c=0,d=0=n.expandoStartIndex}function f2(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Ms()],o=h2(n,t);_2(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=v_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Xy(t=iA(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=iA(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Nl(i))return n[Ot(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=iA(null,n,e,l[1],i),l=Xy(l,e.attrs,i),function(n,e,t,i){n[Ot(t?e.classBindings:e.styleBindings)]=i}(n,e,i,l))}else s=function(n,e,t){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Ot(n[a+1]);n[i+1]=Ja(p,a),0!==p&&(n[p+1]=el(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=Ja(a,0),0!==a&&(n[a+1]=el(n[a+1],i)),a=i;else n[i+1]=Ja(l,0),0===a?a=i:n[l+1]=el(n[l+1],i),l=i;c&&(n[i+1]=Yi(n[i+1])),s2(n,d,i,!0),s2(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Kr(s,e)>=0&&(t[i+1]=my(t[i+1]))}(e,d,n,i,s),o=Ja(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function iA(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===St&&(p=f?gi:void 0);let g=f?k_(p,i):d===i?p:void 0;if(c&&!vw(g)&&(g=k_(l,i)),vw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Ot(_):Nl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=k_(l,i))}return a}function vw(n){return void 0!==n}function _2(n,e){return 0!=(n.flags&(e?16:32))}function Te(n,e=""){const t=Ce(),i=Sn(),r=n+20,s=i.firstCreatePass?Hd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return Ti(n)?n.createText(e):n.createTextNode(e)}(t[11],e);tg(i,t,o,s),Ha(s,!1)}function Ai(n){return Os("",n,""),Ai}function Os(n,e,t){const i=Ce(),r=pg(i,n,e,t);return r!==St&&Ll(i,Ms(),r),Os}function bw(n,e,t,i,r){const s=Ce(),o=function(n,e,t,i,r,s){const a=hf(n,zs(),t,r);return fo(2),a?e+de(t)+i+de(r)+s:St}(s,n,e,t,i,r);return o!==St&&Ll(s,Ms(),o),bw}function sl(n,e,t){const i=Ce();return qs(i,ga(),e)&&vo(Sn(),rr(),i,n,e,i[11],t,!0),sl}function Sg(n,e,t){const i=Ce();if(qs(i,ga(),e)){const s=Sn(),o=rr();vo(s,o,i,n,e,Ry(v_(s.data),o,i),t,!0)}return Sg}const mf=void 0;var D7=["en",[["a","p"],["AM","PM"],mf],[["AM","PM"],mf,mf],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],mf,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],mf,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",mf,"{1} 'at' {0}",mf],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Mg={};function N2(n){return n in Mg||(Mg[n]=cn.ng&&cn.ng.common&&cn.ng.common.locales&&cn.ng.common.locales[n]),Mg[n]}var tt=(()=>((tt=tt||{})[tt.LocaleId=0]="LocaleId",tt[tt.DayPeriodsFormat=1]="DayPeriodsFormat",tt[tt.DayPeriodsStandalone=2]="DayPeriodsStandalone",tt[tt.DaysFormat=3]="DaysFormat",tt[tt.DaysStandalone=4]="DaysStandalone",tt[tt.MonthsFormat=5]="MonthsFormat",tt[tt.MonthsStandalone=6]="MonthsStandalone",tt[tt.Eras=7]="Eras",tt[tt.FirstDayOfWeek=8]="FirstDayOfWeek",tt[tt.WeekendRange=9]="WeekendRange",tt[tt.DateFormat=10]="DateFormat",tt[tt.TimeFormat=11]="TimeFormat",tt[tt.DateTimeFormat=12]="DateTimeFormat",tt[tt.NumberSymbols=13]="NumberSymbols",tt[tt.NumberFormats=14]="NumberFormats",tt[tt.CurrencyCode=15]="CurrencyCode",tt[tt.CurrencySymbol=16]="CurrencySymbol",tt[tt.CurrencyName=17]="CurrencyName",tt[tt.Currencies=18]="Currencies",tt[tt.Directionality=19]="Directionality",tt[tt.PluralCase=20]="PluralCase",tt[tt.ExtraData=21]="ExtraData",tt))();const Cw="en-US";let L2=Cw;function rA(n){Gi(n,"Expected localeId to be defined"),"string"==typeof n&&(L2=n.toLowerCase().replace(/_/g,"-"))}function aA(n,e,t,i,r){if(n=D(n),Array.isArray(n))for(let s=0;s>20;if(Rc(n)||!n.multi){const g=new $h(l,r,E),_=cA(a,e,r?d:d+p,f);-1===_?(wc(hs(c,o),s,a),lA(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[_]=g,o[_]=g)}else{const g=cA(a,e,d+p,f),_=cA(a,e,d,d+p),y=g>=0&&t[g],v=_>=0&&t[_];if(r&&!v||!r&&!y){wc(hs(c,o),s,a);const w=function(n,e,t,i,r){const s=new $h(n,t,E);return s.multi=[],s.index=e,s.componentProviders=0,aL(s,r,i&&!t),s}(r?xY:MY,t.length,r,i,l);!r&&v&&(t[_].providerFactory=w),lA(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(w),o.push(w)}else lA(s,n,g>-1?g:_,aL(t[r?_:g],l,!r&&i));!r&&i&&v&&t[_].componentProviders++}}}function lA(n,e,t,i){const r=Rc(e);if(r||function(n){return!!n.useClass}(e)){const o=(e.useClass||e).prototype.ngOnDestroy;if(o){const a=n.destroyHooks||(n.destroyHooks=[]);if(!r&&e.multi){const l=a.indexOf(t);-1===l?a.push(t,[i,o]):a[l+1].push(i,o)}else a.push(t,o)}}}function aL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function cA(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Sn();if(i.firstCreatePass){const r=ha(n);aA(t,i.data,i.blueprint,r,!0),aA(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class lL{}const uL="ngComponent";class DY{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${G(n)}. Did you add it to @NgModule.entryComponents?`);return e[uL]=n,e}(e)}}class ol{}function xw(...n){}function Tg(n,e){return new nt(Ss(n,e))}ol.NULL=new DY;const PY=function(){return Tg(Tr(),Ce())};let nt=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=PY,n})();function dL(n){return n instanceof nt?n.nativeElement:n}class _f{}let Lc=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>kY(),n})();const kY=function(){const n=Ce(),t=ds(Tr().index,n);return function(n){return n[11]}(Po(t)?t:n)};let hA=(()=>{class n{}return n.\u0275prov=ae({token:n,providedIn:"root",factory:()=>null}),n})();class Lu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const hL=new Lu("12.2.5");class fL{constructor(){}supports(e){return $y(e)}create(e){return new BY(e)}}const LY=(n,e)=>e;class BY{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||LY}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new VY(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new pL),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new pL),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class VY{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class jY{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class pL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new jY,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function gL(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new zY(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class zY{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function _L(){return new Ag([new fL])}let Ag=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||_L()),deps:[[n,new Xa,new yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=ae({token:n,providedIn:"root",factory:_L}),n})();function yL(){return new Dg([new mL])}let Dg=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||yL()),deps:[[n,new Xa,new yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=ae({token:n,providedIn:"root",factory:yL}),n})();function Tw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(qi(s)),Ro(s))for(let a=10;a-1&&(cy(e,i),Il(t,i))}this._attachedToViewContainer=!1}uy(this._lView[1],this._lView)}onDestroy(e){qC(this._lView[1],this._lView,null,e)}markForCheck(){Dy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Iy(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Ep(!0);try{Iy(n,e,t)}finally{Ep(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Ud(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class $Y extends ev{constructor(e){super(e),this._view=e}detectChanges(){iw(this._view)}checkNoChanges(){!function(n){Ep(!0);try{iw(n)}finally{Ep(!1)}}(this._view)}get context(){return null}}const WY=function(n){return function(n,e,t){if(_d(n)&&!t){const i=ds(n.index,e);return new ev(i,i)}return 47&n.type?new ev(e[16],e):null}(Tr(),Ce(),16==(16&n))};let Un=(()=>{class n{}return n.__NG_ELEMENT_ID__=WY,n})();const XY=[new mL],ZY=new Ag([new fL]),QY=new Dg(XY),eX=function(){return Aw(Tr(),Ce())};let Xs=(()=>{class n{}return n.__NG_ELEMENT_ID__=eX,n})();const tX=Xs,nX=class extends tX{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=lf(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),cf(t,i,e),new ev(i)}};function Aw(n,e){return 4&n.type?new nX(e,n,Tg(n,e)):null}class Bc{}const sX=function(){return wL(Tr(),Ce())};let es=(()=>{class n{}return n.__NG_ELEMENT_ID__=sX,n})();const aX=es,bL=class extends aX{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return Tg(this._hostTNode,this._hostLView)}get injector(){return new Fo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Wh(this._hostTNode,this._hostLView);if(T0(e)){const t=Ga(e,this._hostLView),i=Ed(e);return new Fo(t[1].data[i+8],t)}return new Fo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=CL(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Bc,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Ro(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new bL(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),iuC});class $L extends lL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(Kx).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return HL(this.componentDef.inputs)}get outputs(){return HL(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,Rg,r);return s!==Rg||i===Rg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(_f,vu),a=s.get(hA,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(Ti(n))return n.selectRootElement(e,t===Re.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ly(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?Bn:"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||uC,clean:IT,playerHandler:e||null,flags:0}}(),g=lg(0,null,null,1,0,null,null,null,null,null),_=lf(null,g,p,f,null,null,o,l,a,s);let y,v;zh(_);try{const w=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Hd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(dg(l,c,!0),null!==n&&(Dp(r,n,c),null!==l.classes&&py(r,n,l.classes),null!==l.styles&&DC(r,n,l.styles)));const d=i.createRenderer(n,e),f=lf(t,ag(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(wc(hs(l,t),o,e.type),tw(o,l),My(l,t.length,1)),cg(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)Dp(l,d,["ng-version",hL.full]);else{const{attrs:C,classes:x}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&py(l,d,x.join(" "))}if(v=g_(g,20),void 0!==t){const C=v.projection=[];for(let x=0;xl(o,e)),e.contentQueries){const l=Tr();e.contentQueries(1,o,l.directiveStart)}const a=Tr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(Hs(a.index),JC(t[1],a,0,a.directiveStart,a.directiveEnd,e),ew(e,o)),o}(w,this.componentDef,_,p,[u9]),cf(g,_,null)}finally{pn()}return new oK(this.componentType,y,Tg(v,_),_,v)}}class oK extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new $Y(r),this.componentType=e}get injector(){return new Fo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const kg=new Map;class cK extends Bc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new zL(this);const i=uo(e),r=function(n){return n[p1]||null}(e);r&&rA(r),this._bootstrapComponents=Za(i.bootstrap),this._r3Injector=aw(e,t,[{provide:Bc,useValue:this},{provide:ol,useValue:this.componentFactoryResolver}],G(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Tt.THROW_IF_NOT_FOUND,i=vt.Default){return e===Tt||e===Bc||e===ku?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class xA extends class{}{constructor(e){super(),this.moduleType=e,null!==uo(e)&&function(n){const e=new Set;!function t(i){const r=uo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${G(e)} vs ${G(e.name)}`)}(s,kg.get(s),i),kg.set(s,i));const o=Za(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new cK(this.moduleType,e)}}function lv(n,e,t){const i=qr()+n,r=Ce();return r[i]===St?Fc(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function Fg(n,e,t,i){return qL(Ce(),qr(),n,e,t,i)}function cv(n,e){const t=n[e];return t===St?void 0:t}function qL(n,e,t,i,r,s){const o=e+t;return qs(n,o,r)?Fc(n,o+1,s?i.call(s,r):i(r)):cv(n,o+1)}function yn(n,e){const t=Sn();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new H("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=bc(i.type)),o=ca(E);try{const a=Op(!1),l=s();return Op(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Ce(),r,l),l}finally{ca(o)}}function wn(n,e,t){const i=n+20,r=Ce(),s=vd(r,i);return dv(r,uv(r,i)?qL(r,qr(),e,s.transform,t,s):s.transform(t))}function QL(n,e,t,i){const r=n+20,s=Ce(),o=vd(s,r);return dv(s,uv(s,r)?function(n,e,t,i,r,s,o){const a=e+t;return hf(n,a,r,s)?Fc(n,a+2,o?i.call(o,r,s):i(r,s)):cv(n,a+2)}(s,qr(),e,o.transform,t,i,o):o.transform(t,i))}function uv(n,e){return n[1].data[e].pure}function dv(n,e){return Vl.isWrapped(e)&&(e=Vl.unwrap(e),n[zs()]=St),e}function TA(n){return e=>{setTimeout(n,void 0,e)}}const Pe=class extends we{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=TA(l),a&&(a=TA(a)),c&&(c=TA(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof Ie&&e.add(d),d}};function EK(){return this._results[hg()]()}class bf{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=hg(),i=bf.prototype;i[t]||(i[t]=EK)}get changes(){return this._changes||(this._changes=new Pe)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=No(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=xw,this.reject=xw,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(I(Cf,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const fv=new _e("AppId"),rZ={provide:fv,useFactory:function(){return`${BA()}${BA()}${BA()}`},deps:[]};function BA(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const CB=new _e("Platform Initializer"),cl=new _e("Platform ID"),pv=new _e("appBootstrapListener");let Nw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Bu=new _e("LocaleId"),wB=new _e("DefaultCurrencyCode");class oZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const VA=function(n){return new xA(n)},aZ=VA,lZ=function(n){return Promise.resolve(VA(n))},EB=function(n){const e=VA(n),i=Za(uo(n).declarations).reduce((r,s)=>{const o=Wn(s);return o&&r.push(new $L(o)),r},[]);return new oZ(e,i)},cZ=EB,uZ=function(n){return Promise.resolve(EB(n))};let wf=(()=>{class n{constructor(){this.compileModuleSync=aZ,this.compileModuleAsync=lZ,this.compileModuleAndAllComponentsSync=cZ,this.compileModuleAndAllComponentsAsync=uZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const SB=new _e("compilerOptions"),hZ=(()=>Promise.resolve(0))();function jA(n){"undefined"==typeof Zone?hZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class lt{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Pe(!1),this.onMicrotaskEmpty=new Pe(!1),this.onStable=new Pe(!1),this.onError=new Pe(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=cn.requestAnimationFrame,e=cn.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(cn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,zA(n),n.isCheckStableRunning=!0,UA(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),zA(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return MB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),xB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return MB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),xB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,zA(n),UA(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!lt.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(lt.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,pZ,xw,xw);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const pZ={};function UA(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function zA(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function MB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function xB(n){n._nesting--,UA(n)}class _Z{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Pe,this.onMicrotaskEmpty=new Pe,this.onStable=new Pe,this.onError=new Pe}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let HA=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{lt.assertNotInAngularZone(),jA(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())jA(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(I(lt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),TB=(()=>{class n{constructor(){this._applications=new Map,$A.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return $A.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class yZ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let $A=new yZ,AB=!0,DB=!1;function wo(){return DB=!0,AB}let Gl;const OB=new _e("AllowMultipleToken");function IB(n,e,t=[]){const i=`Platform: ${e}`,r=new _e(i);return(s=[])=>{let o=WA();if(!o||o.injector.get(OB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Fu,useValue:"platform"});!function(n){if(Gl&&!Gl.destroyed&&!Gl.injector.get(OB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Gl=n.get(PB);const e=n.get(CB,null);e&&e.forEach(t=>t())}(Tt.create({providers:a,name:i}))}return function(n){const e=WA();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function WA(){return Gl&&!Gl.destroyed?Gl:null}let PB=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new _Z:("zone.js"===n?void 0:n)||new lt({enableLongStackTrace:wo(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:lt,useValue:a}];return a.run(()=>{const c=Tt.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Uo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{qA(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return Wy(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(Lg);return p.runInitializers(),p.donePromise.then(()=>(rA(d.injector.get(Bu,Cw)||Cw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=RB({},i);return function(n,e,t){const i=new xA(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(Yd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${G(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function RB(n,e){return Array.isArray(e)?e.reduce(RB,n):Object.assign(Object.assign({},n),e)}let Yd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new oe(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new oe(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{lt.assertNotInAngularZone(),jA(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{lt.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=ki(a,l.pipe(Vs()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof lL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Bc),a=r.create(Tt.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(HA,null),d=c&&a.injector.get(TB);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),qA(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;qA(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(pv,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(Tt),I(Uo),I(ol),I(Lg))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function qA(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const GZ=IB(null,"core",[{provide:cl,useValue:"unknown"},{provide:PB,deps:[Tt]},{provide:TB,deps:[]},{provide:Nw,deps:[]}]),KZ=[{provide:Yd,useClass:Yd,deps:[lt,Tt,Uo,ol,Lg]},{provide:iK,deps:[lt],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Lg,useClass:Lg,deps:[[new yr,Cf]]},{provide:wf,useClass:wf,deps:[]},rZ,{provide:Ag,useFactory:function(){return ZY},deps:[]},{provide:Dg,useFactory:function(){return QY},deps:[]},{provide:Bu,useFactory:function(n){return rA(n=n||"undefined"!=typeof $localize&&$localize.locale||Cw),n},deps:[[new Rd(Bu),new yr,new Xa]]},{provide:wB,useValue:"USD"}];let QZ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(I(Yd))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:KZ}),n})(),Yw=null;function Vc(){return Yw}const rt=new _e("DocumentToken");let Mf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:ZQ,token:n,providedIn:"platform"}),n})();function ZQ(){return I(a3)}let a3=(()=>{class n extends Mf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Vc().getBaseHref(this._doc)}onPopState(t){const i=Vc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Vc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){l3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){l3()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:JQ,token:n,providedIn:"platform"}),n})();function l3(){return!!window.history.pushState}function JQ(){return new a3(I(rt))}function lD(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}function c3(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function ju(n){return n&&"?"!==n[0]?"?"+n:n}let jg=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:eJ,token:n,providedIn:"root"}),n})();function eJ(n){const e=I(rt).location;return new u3(I(Mf),e&&e.origin||"")}const cD=new _e("appBaseHref");let u3=(()=>{class n extends jg{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return lD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+ju(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+ju(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+ju(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(I(Mf),I(cD,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Ug=(()=>{class n{constructor(t,i){this._subject=new Pe,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=c3(d3(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+ju(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,d3(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ju(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ju(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(I(jg),I(Mf))},n.normalizeQueryParams=ju,n.joinWithSlash=lD,n.stripTrailingSlash=c3,n.\u0275prov=ae({factory:nJ,token:n,providedIn:"root"}),n})();function nJ(){return new Ug(I(jg),I(Mf))}function d3(n){return n.replace(/\/index.html$/,"")}var Br=(()=>((Br=Br||{})[Br.Zero=0]="Zero",Br[Br.One=1]="One",Br[Br.Two=2]="Two",Br[Br.Few=3]="Few",Br[Br.Many=4]="Many",Br[Br.Other=5]="Other",Br))();const uJ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=N2(e);if(t)return t;const i=e.split("-")[0];if(t=N2(i),t)return t;if("en"===i)return D7;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[tt.PluralCase]};class rE{}let VJ=(()=>{class n extends rE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(uJ(i||this.locale)(t)){case Br.Zero:return"zero";case Br.One:return"one";case Br.Two:return"two";case Br.Few:return"few";case Br.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(I(Bu))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function b3(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}let sE=(()=>{class n{constructor(t,i,r,s){this._iterableDiffers=t,this._keyValueDiffers=i,this._ngEl=r,this._renderer=s,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(t){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&($y(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachChangedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachRemovedItem(i=>{i.previousValue&&this._toggleClass(i.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(i=>{if("string"!=typeof i.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${G(i.item)}`);this._toggleClass(i.item,!0)}),t.forEachRemovedItem(i=>this._toggleClass(i.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!0)):Object.keys(t).forEach(i=>this._toggleClass(i,!!t[i])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!1)):Object.keys(t).forEach(i=>this._toggleClass(i,!1)))}_toggleClass(t,i){(t=t.trim())&&t.split(/\s+/g).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ag),E(Dg),E(nt),E(Lc))},n.\u0275dir=he({type:n,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),n})();class UJ{constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Xl=(()=>{class n{constructor(t,i,r){this._viewContainer=t,this._template=i,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(i){throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const i=[];t.forEachOperation((r,s,o)=>{if(null==r.previousIndex){const a=this._viewContainer.createEmbeddedView(this._template,new UJ(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new C3(r,a);i.push(l)}else if(null==o)this._viewContainer.remove(null===s?void 0:s);else if(null!==s){const a=this._viewContainer.get(s);this._viewContainer.move(a,o);const l=new C3(r,a);i.push(l)}});for(let r=0;r{this._viewContainer.get(r.currentIndex).context.$implicit=r.item})}_perViewChange(t,i){t.context.$implicit=i.item}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Ag))},n.\u0275dir=he({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class C3{constructor(e,t){this.record=e,this.view=t}}let Is=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new HJ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){w3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){w3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs))},n.\u0275dir=he({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class HJ{constructor(){this.$implicit=null,this.ngIf=null}}function w3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${G(e)}'.`)}class yD{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Cv=(()=>{class n{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const i=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||i,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),i}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let i=0;i{class n{constructor(t,i,r){this.ngSwitch=r,r._addCase(),this._view=new yD(t,i)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Cv,9))},n.\u0275dir=he({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),n})(),E3=(()=>{class n{constructor(t,i,r){r._addDefault(new yD(t,i))}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Cv,9))},n.\u0275dir=he({type:n,selectors:[["","ngSwitchDefault",""]]}),n})(),M3=(()=>{class n{constructor(t,i,r){this._ngEl=t,this._differs=i,this._renderer=r,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,i){const[r,s]=t.split(".");null!=(i=null!=i&&s?`${i}${s}`:i)?this._renderer.setStyle(this._ngEl.nativeElement,r,i):this._renderer.removeStyle(this._ngEl.nativeElement,r)}_applyChanges(t){t.forEachRemovedItem(i=>this._setStyle(i.key,null)),t.forEachAddedItem(i=>this._setStyle(i.key,i.currentValue)),t.forEachChangedItem(i=>this._setStyle(i.key,i.currentValue))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Dg),E(Lc))},n.\u0275dir=he({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),n})();function Kl(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${G(n)}'`)}class WJ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class qJ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const YJ=new qJ,XJ=new WJ;let zu=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(Wy(t))return YJ;if(qN(t))return XJ;throw Kl(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(Un,16))},n.\u0275pipe=cs({name:"async",type:n,pure:!1}),n})();const tee=/#/g;let x3=(()=>{class n{constructor(t){this._localization=t}transform(t,i,r){if(null==t)return"";if("object"!=typeof i||null===i)throw Kl(n,i);return i[function(n,e,t,i){let r=`=${n}`;if(e.indexOf(r)>-1||(r=t.getPluralCategory(n,i),e.indexOf(r)>-1))return r;if(e.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${n}"`)}(t,Object.keys(i),this._localization,r)].replace(tee,t.toString())}}return n.\u0275fac=function(t){return new(t||n)(E(rE,16))},n.\u0275pipe=cs({name:"i18nPlural",type:n,pure:!0}),n})(),T3=(()=>{class n{transform(t){return JSON.stringify(t,null,2)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=cs({name:"json",type:n,pure:!1}),n})(),bn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:rE,useClass:VJ}]}),n})();const D3="browser";function xf(n){return n===D3}function wD(n){return"server"===n}class P3{}class ED extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){Yw||(Yw=n)}(new ED)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(wv=wv||document.querySelector("base"),wv?wv.getAttribute("href"):null);return null==t?null:function(n){oE=oE||document.createElement("a"),oE.setAttribute("href",n);const e=oE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){wv=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return b3(document.cookie,e)}}let oE,wv=null;const R3=new _e("TRANSITION_ID"),yee=[{provide:Cf,useFactory:function(n,e,t){return()=>{t.get(Lg).donePromise.then(()=>{const i=Vc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},cn.getAllAngularTestabilities=()=>e.getAllTestabilities(),cn.getAllAngularRootElements=()=>e.getAllRootElements(),cn.frameworkStabilizers||(cn.frameworkStabilizers=[]),cn.frameworkStabilizers.push(i=>{const r=cn.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Vc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let vee=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Ev=new _e("EventManagerPlugins");let lE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Sv=(()=>{class n extends F3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(N3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(N3))}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function N3(n){Vc().remove(n)}const xD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},TD=/%COMP%/g;function cE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let uE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new AD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Re.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new kee(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Re.ShadowDom:return new Fee(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=cE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(I(lE),I(Sv),I(fv))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class AD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(xD[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=xD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=xD[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(yo.DashCase|yo.Important)?e.style.setProperty(t,i,r&yo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&yo.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,V3(i)):this.eventManager.addEventListener(e,t,V3(i))}}class kee extends AD{constructor(e,t,i,r){super(e),this.component=i;const s=cE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(TD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(TD,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class Fee extends AD{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=cE(r.id,r.styles,[]);for(let o=0;o{class n extends MD{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const z3=["alt","control","meta","shift"],Hee={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},H3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},$ee={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Gee=(()=>{class n extends MD{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Vc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(z3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&H3.hasOwnProperty(e)&&(e=H3[e]))}return Hee[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),z3.forEach(s=>{s!=r&&$ee[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Kd=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return I(OD)},token:n,providedIn:"root"}),n})(),OD=(()=>{class n extends Kd{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case on.NONE:return i;case on.HTML:return Bo(i,"HTML")?ps(i):Y_(this._doc,String(i)).toString();case on.STYLE:return Bo(i,"Style")?ps(i):i;case on.SCRIPT:if(Bo(i,"Script"))return ps(i);throw new Error("unsafe value used in a script context");case on.URL:return Oc(i),Bo(i,"URL")?ps(i):_o(String(i));case on.RESOURCE_URL:if(Bo(i,"ResourceURL"))return ps(i);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return function(n){return new j_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new U_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Gp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new Nd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Nt(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return function(n){return new OD(n.get(rt))}(I(ku))},token:n,providedIn:"root"}),n})();const Jee=IB(GZ,"browser",[{provide:cl,useValue:D3},{provide:CB,useValue:function(){ED.makeCurrent(),SD.init()},multi:!0},{provide:rt,useFactory:function(){return function(n){di=n}(document),document},deps:[]}]),ete=[[],{provide:Fu,useValue:"root"},{provide:Uo,useFactory:function(){return new Uo},deps:[]},{provide:Ev,useClass:Nee,multi:!0,deps:[rt,lt,cl]},{provide:Ev,useClass:Gee,multi:!0,deps:[rt]},[],{provide:uE,useClass:uE,deps:[lE,Sv,fv]},{provide:_f,useExisting:uE},{provide:F3,useExisting:Sv},{provide:Sv,useClass:Sv,deps:[rt]},{provide:HA,useClass:HA,deps:[lt]},{provide:lE,useClass:lE,deps:[Ev,lt]},{provide:P3,useClass:vee,deps:[]},[]];let dE=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:fv,useValue:t.appId},{provide:R3,useExisting:fv},yee]}}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:ete,imports:[bn,QZ]}),n})();"undefined"!=typeof window&&window;class lte extends Ie{constructor(e,t){super()}schedule(e,t=0){return this}}class hE extends lte{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let G3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Zl extends G3{constructor(e,t=G3.now){super(e,()=>Zl.delegate&&Zl.delegate!==this?Zl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Zl.delegate&&Zl.delegate!==this?Zl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const dte=new class extends Zl{}(class extends hE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Ql=new oe(n=>n.complete());function fE(n){return n?function(n){return new oe(e=>n.schedule(()=>e.complete()))}(n):Ql}function st(...n){let e=n[n.length-1];return Ln(e)?(n.pop(),Ri(n,e)):Ba(n)}function zg(n,e){return new oe(e?t=>e.schedule(fte,0,{error:n,subscriber:t}):t=>t.error(n))}function fte({error:n,subscriber:e}){e.error(n)}class qo{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return st(this.value);case"E":return zg(this.error);case"C":return fE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new qo("N",e):qo.undefinedValueNotification}static createError(e){return new qo("E",void 0,e)}static createComplete(){return qo.completeNotification}}qo.completeNotification=new qo("C"),qo.undefinedValueNotification=new qo("N",void 0);class pE extends Rt{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(pE.dispatch,this.delay,new gte(e,this.destination)))}_next(e){this.scheduleMessage(qo.createNext(e))}_error(e){this.scheduleMessage(qo.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(qo.createComplete()),this.unsubscribe()}}class gte{constructor(e,t){this.notification=e,this.destination=t}}class Hg extends we{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new mte(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new Gt;if(this.isStopped||this.hasError?o=Ie.EMPTY:(this.observers.push(e),o=new oi(this,e)),r&&e.add(e=new pE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class mte{constructor(e,t){this.time=e,this.value=t}}function Ir(n,e){return"function"==typeof e?t=>t.pipe(Ir((i,r)=>li(n(i,r)).pipe(be((s,o)=>e(i,s,r,o))))):t=>t.lift(new _te(n))}class _te{constructor(e){this.project=e}call(e,t){return t.subscribe(new yte(e,this.project))}}class yte extends ei{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new $r(this),r=this.destination;r.add(i),this.innerSubscription=oo(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const gE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return gE.schedule(n,0);if(void 0===window.requestAnimationFrame)return gE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let PD;function Ate(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!PD){const t=Element.prototype;PD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&PD.call(n,e)}(n,r)||(i=s,0))),i}class Ote{constructor(e,t){this.componentFactory=t.get(ol).resolveComponentFactory(e)}create(e){return new Ite(this.componentFactory,e)}}class Ite{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new Hg(1),this.events=this.eventEmitters.pipe(Ir(i=>ki(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(lt),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=gE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=Tt.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(be(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=gE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new h_(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class Pte extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Dt(n){return null!=n&&"false"!=`${n}`}function So(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function mE(n){return Array.isArray(n)?n:[n]}function jr(n){return null==n?"":"string"==typeof n?n:`${n}px`}function Hu(n){return n instanceof nt?n.nativeElement:n}const Tf=new Zl(hE);function $g(n,e=Tf){return t=>t.lift(new Nte(n,e))}class Nte{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Lte(e,this.dueTime,this.scheduler))}}class Lte extends Rt{constructor(e,t,i){super(e),this.dueTime=t,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Bte,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function Bte(n){n.debouncedNext()}let RD=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})(),W3=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Hu(t);return new oe(r=>{const o=this._observeElement(i).subscribe(r);return()=>{o.unsubscribe(),this._unobserveElement(i)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const i=new we,r=this._mutationObserverFactory.create(s=>i.next(s));r&&r.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:r,stream:i,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:i,stream:r}=this._observedElements.get(t);i&&i.disconnect(),r.complete(),this._observedElements.delete(t)}}}return n.\u0275fac=function(t){return new(t||n)(I(RD))},n.\u0275prov=ae({factory:function(){return new n(I(RD))},token:n,providedIn:"root"}),n})(),kD=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new Pe,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=So(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe($g(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(W3),E(nt),E(lt))},n.\u0275dir=he({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),_E=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[RD]}),n})();class sr extends we{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Gt;return this._value}next(e){super.next(this._value=e)}}function Yo(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}function Qd(){}function Di(n,e,t){return function(r){return r.lift(new Kte(n,e,t))}}class Kte{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Zte(e,this.nextOrObserver,this.error,this.complete))}}class Zte extends Rt{constructor(e,t,i,r){super(e),this._tapNext=Qd,this._tapError=Qd,this._tapComplete=Qd,this._tapError=i||Qd,this._tapComplete=r||Qd,ft(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||Qd,this._tapError=t.error||Qd,this._tapComplete=t.complete||Qd)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}function Tn(n,e){return function(i){return i.lift(new Qte(n,e))}}class Qte{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new Jte(e,this.predicate,this.thisArg))}}class Jte extends Rt{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}const K3=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function _i(n){return e=>0===n?fE():e.lift(new ene(n))}class ene{constructor(e){if(this.total=e,this.total<0)throw new K3}call(e,t){return t.subscribe(new tne(e,this.total))}}class tne extends Rt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function VD(n){return e=>e.lift(new nne(n))}class nne{constructor(e){this.total=e}call(e,t){return t.subscribe(new ine(e,this.total))}}class ine extends Rt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function Xo(n,e){return t=>t.lift(new rne(n,e))}class rne{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new sne(e,this.compare,this.keySelector))}}class sne extends Rt{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}function zn(n){return e=>e.lift(new one(n))}class one{constructor(e){this.notifier=e}call(e,t){const i=new ane(e),r=oo(this.notifier,new $r(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class ane extends ei{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}let jD;try{jD="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){jD=!1}let qg,ii=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?xf(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!jD)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(I(cl))},n.\u0275prov=ae({factory:function(){return new n(I(cl))},token:n,providedIn:"root"}),n})(),Av=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const Z3=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function Q3(){if(qg)return qg;if("object"!=typeof document||!document)return qg=new Set(Z3),qg;let n=document.createElement("input");return qg=new Set(Z3.filter(e=>(n.setAttribute("type",e),n.type===e))),qg}let Dv,Af,UD;function Yg(n){return function(){if(null==Dv&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Dv=!0}))}finally{Dv=Dv||!1}return Dv}()?n:!!n.capture}function J3(){if(null==Af){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Af=!1,Af;if("scrollBehavior"in document.documentElement.style)Af=!0;else{const n=Element.prototype.scrollTo;Af=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Af}function vE(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Df(n){return n.composedPath?n.composedPath()[0]:n.target}function bE(n,e){return(n.getAttribute(e)||"").match(/\S+/g)||[]}const tV="cdk-describedby-message-container",nV="cdk-describedby-message",CE="cdk-describedby-host";let fne=0;const jc=new Map;let Ps=null,iV=(()=>{class n{constructor(t){this._document=t}describe(t,i,r){if(!this._canBeDescribed(t,i))return;const s=zD(i,r);"string"!=typeof i?(rV(i),jc.set(s,{messageElement:i,referenceCount:0})):jc.has(s)||this._createMessageElement(i,r),this._isElementDescribedByMessage(t,s)||this._addMessageReference(t,s)}removeDescription(t,i,r){if(!i||!this._isElementNode(t))return;const s=zD(i,r);if(this._isElementDescribedByMessage(t,s)&&this._removeMessageReference(t,s),"string"==typeof i){const o=jc.get(s);o&&0===o.referenceCount&&this._deleteMessageElement(s)}Ps&&0===Ps.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${CE}]`);for(let i=0;i0!=r.indexOf(nV));t.setAttribute("aria-describedby",i.join(" "))}_addMessageReference(t,i){const r=jc.get(i);(function(n,e,t){const i=bE(n,e);i.some(r=>r.trim()==t.trim())||(i.push(t.trim()),n.setAttribute(e,i.join(" ")))})(t,"aria-describedby",r.messageElement.id),t.setAttribute(CE,""),r.referenceCount++}_removeMessageReference(t,i){const r=jc.get(i);r.referenceCount--,function(n,e,t){const r=bE(n,e).filter(s=>s!=t.trim());r.length?n.setAttribute(e,r.join(" ")):n.removeAttribute(e)}(t,"aria-describedby",r.messageElement.id),t.removeAttribute(CE)}_isElementDescribedByMessage(t,i){const r=bE(t,"aria-describedby"),s=jc.get(i),o=s&&s.messageElement.id;return!!o&&-1!=r.indexOf(o)}_canBeDescribed(t,i){if(!this._isElementNode(t))return!1;if(i&&"object"==typeof i)return!0;const r=null==i?"":`${i}`.trim(),s=t.getAttribute("aria-label");return!(!r||s&&s.trim()===r)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})();function zD(n,e){return"string"==typeof n?`${e||""}/${n}`:n}function rV(n){n.id||(n.id=`${nV}-${fne++}`)}class sV{constructor(e){this._items=e,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new we,this._typeaheadSubscription=Ie.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new we,this.change=new we,e instanceof bf&&e.changes.subscribe(t=>{if(this._activeItem){const r=t.toArray().indexOf(this._activeItem);r>-1&&r!==this._activeItemIndex&&(this._activeItemIndex=r)}})}skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(Di(t=>this._pressedLetters.push(t)),$g(e),Tn(()=>this._pressedLetters.length>0),be(()=>this._pressedLetters.join(""))).subscribe(t=>{const i=this._getItemsArray();for(let r=1;r!e[s]||this._allowedModifierKeys.indexOf(s)>-1);switch(t){case 9:return void this.tabOut.next();case 40:if(this._vertical&&r){this.setNextItemActive();break}return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&r){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&r){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}return;default:return void((r||Yo(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))))}this._pressedLetters=[],e.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem}isTyping(){return this._pressedLetters.length>0}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._items.length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(e){const t=this._getItemsArray(),i="number"==typeof e?e:t.indexOf(e),r=t[i];this._activeItem=null==r?null:r,this._activeItemIndex=i}_setActiveItemByDelta(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}_setActiveInWrapMode(e){const t=this._getItemsArray();for(let i=1;i<=t.length;i++){const r=(this._activeItemIndex+e*i+t.length)%t.length;if(!this._skipPredicateFn(t[r]))return void this.setActiveItem(r)}}_setActiveInDefaultMode(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}_setActiveItemByIndex(e,t){const i=this._getItemsArray();if(i[e]){for(;this._skipPredicateFn(i[e]);)if(!i[e+=t])return;this.setActiveItem(e)}}_getItemsArray(){return this._items instanceof bf?this._items.toArray():this._items}}class oV extends sV{setActiveItem(e){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(e),this.activeItem&&this.activeItem.setActiveStyles()}}class aV extends sV{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}}let lV=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===uV(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=uV(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||cV(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(ii))},token:n,providedIn:"root"}),n})();function cV(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function uV(n){if(!cV(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class Sne{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const e=this._startAnchor,t=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),t&&(t.removeEventListener("focus",this.endAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(_i(1)).subscribe(e)}}let dV=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new Sne(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(I(lV),I(lt),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(lV),I(lt),I(rt))},token:n,providedIn:"root"}),n})();function hV(n){return 0===n.offsetX&&0===n.offsetY}function fV(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const pV=new _e("cdk-input-modality-detector-options"),Dne={ignoreKeys:[18,17,224,91,16]},Xg=Yg({passive:!0,capture:!0});let mV=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new sr(null),this._lastTouchMs=0,this._onKeydown=o=>{var a,l;(null===(l=null===(a=this._options)||void 0===a?void 0:a.ignoreKeys)||void 0===l?void 0:l.some(c=>c===o.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Df(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(hV(o)?"keyboard":"mouse"),this._mostRecentTarget=Df(o))},this._onTouchstart=o=>{fV(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Df(o))},this._options=Object.assign(Object.assign({},Dne),s),this.modalityDetected=this._modality.pipe(VD(1)),this.modalityChanged=this.modalityDetected.pipe(Xo()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,Xg),r.addEventListener("mousedown",this._onMousedown,Xg),r.addEventListener("touchstart",this._onTouchstart,Xg)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Xg),document.removeEventListener("mousedown",this._onMousedown,Xg),document.removeEventListener("touchstart",this._onTouchstart,Xg))}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt),I(rt),I(pV,8))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt),I(rt),I(pV,8))},token:n,providedIn:"root"}),n})();const _V=new _e("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),yV=new _e("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let wE=(()=>{class n{constructor(t,i,r,s){this._ngZone=i,this._defaultOptions=s,this._document=r,this._liveElement=t||this._createLiveElement()}announce(t,...i){const r=this._defaultOptions;let s,o;return 1===i.length&&"number"==typeof i[0]?o=i[0]:[s,o]=i,this.clear(),clearTimeout(this._previousTimeout),s||(s=r&&r.politeness?r.politeness:"polite"),null==o&&r&&(o=r.duration),this._liveElement.setAttribute("aria-live",s),this._ngZone.runOutsideAngular(()=>new Promise(a=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,a(),"number"==typeof o&&(this._previousTimeout=setTimeout(()=>this.clear(),o))},100)}))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement&&this._liveElement.parentNode&&(this._liveElement.parentNode.removeChild(this._liveElement),this._liveElement=null)}_createLiveElement(){const t="cdk-live-announcer-element",i=this._document.getElementsByClassName(t),r=this._document.createElement("div");for(let s=0;s{class n{constructor(t,i,r,s,o){this._ngZone=t,this._platform=i,this._inputModalityDetector=r,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new we,this._rootNodeFocusAndBlurListener=a=>{const l=Df(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let d=l;d;d=d.parentElement)c.call(this,a,d)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=Hu(t);if(!this._platform.isBrowser||1!==r.nodeType)return st(null);const s=function(n){if(function(){if(null==UD){const n="undefined"!=typeof document?document.head:null;UD=!(!n||!n.createShadowRoot&&!n.attachShadow)}return UD}()){const e=n.getRootNode?n.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}(r)||this._getDocument(),o=this._elementInfo.get(r);if(o)return i&&(o.checkChildren=!0),o.subject;const a={checkChildren:i,subject:new we,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Hu(t),r=this._elementInfo.get(i);r&&(r.subject.complete(),this._setClasses(i),this._elementInfo.delete(i),this._removeGlobalListeners(r))}focusVia(t,i,r){const s=Hu(t);s===this._getDocument().activeElement?this._getClosestElementsInfo(s).forEach(([a,l])=>this._originChanged(a,i,l)):(this._setOrigin(i),"function"==typeof s.focus&&s.focus(r))}ngOnDestroy(){this._elementInfo.forEach((t,i)=>this.stopMonitoring(i))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,i,r){r?t.classList.add(i):t.classList.remove(i)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,i){this._toggleClass(t,"cdk-focused",!!i),this._toggleClass(t,"cdk-touch-focused","touch"===i),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===i),this._toggleClass(t,"cdk-mouse-focused","mouse"===i),this._toggleClass(t,"cdk-program-focused","program"===i)}_setOrigin(t,i=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&i,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,i){const r=this._elementInfo.get(i),s=Df(t);!r||!r.checkChildren&&i!==s||this._originChanged(i,this._getFocusOrigin(s),r)}_onBlur(t,i){const r=this._elementInfo.get(i);!r||r.checkChildren&&t.relatedTarget instanceof Node&&i.contains(t.relatedTarget)||(this._setClasses(i),this._emitOrigin(r.subject,null))}_emitOrigin(t,i){this._ngZone.run(()=>t.next(i))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const i=t.rootNode,r=this._rootNodeFocusListenerCount.get(i)||0;r||this._ngZone.runOutsideAngular(()=>{i.addEventListener("focus",this._rootNodeFocusAndBlurListener,EE),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,EE)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(zn(this._stopInputModalityDetector)).subscribe(s=>{this._setOrigin(s,!0)}))}_removeGlobalListeners(t){const i=t.rootNode;if(this._rootNodeFocusListenerCount.has(i)){const r=this._rootNodeFocusListenerCount.get(i);r>1?this._rootNodeFocusListenerCount.set(i,r-1):(i.removeEventListener("focus",this._rootNodeFocusAndBlurListener,EE),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,EE),this._rootNodeFocusListenerCount.delete(i))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,i,r){this._setClasses(t,i),this._emitOrigin(r.subject,i),this._lastFocusOrigin=i}_getClosestElementsInfo(t){const i=[];return this._elementInfo.forEach((r,s)=>{(s===t||r.checkChildren&&s.contains(t))&&i.push([s,r])}),i}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(ii),I(mV),I(rt,8),I(vV,8))},n.\u0275prov=ae({factory:function(){return new n(I(lt),I(ii),I(mV),I(rt,8),I(vV,8))},token:n,providedIn:"root"}),n})();const bV="cdk-high-contrast-black-on-white",CV="cdk-high-contrast-white-on-black",HD="cdk-high-contrast-active";let wV=(()=>{class n{constructor(t,i){this._platform=t,this._document=i}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const i=this._document.defaultView||window,r=i&&i.getComputedStyle?i.getComputedStyle(t):null,s=(r&&r.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),s){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(HD),t.remove(bV),t.remove(CV),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(HD),t.add(bV)):2===i&&(t.add(HD),t.add(CV))}}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(rt))},token:n,providedIn:"root"}),n})(),Ine=(()=>{class n{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return n.\u0275fac=function(t){return new(t||n)(I(wV))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Av,_E]]}),n})();const EV=new _e("cdk-dir-doc",{providedIn:"root",factory:function(){return Ac(rt)}});let Ko=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new Pe,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(I(EV,8))},n.\u0275prov=ae({factory:function(){return new n(I(EV,8))},token:n,providedIn:"root"}),n})(),Iv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const SV=new Lu("12.2.5");class MV{}const $u="*";function Jl(n,e){return{type:7,name:n,definitions:e,options:{}}}function Mo(n,e=null){return{type:4,styles:e,timings:n}}function xV(n,e=null){return{type:2,steps:n,options:e}}function Kn(n){return{type:6,styles:n,offset:null}}function br(n,e,t){return{type:0,name:n,styles:e,options:t}}function kne(n){return{type:5,steps:n}}function Qs(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function Fne(n=null){return{type:9,options:n}}function Nne(n,e,t=null){return{type:11,selector:n,animation:e,options:t}}function TV(n){Promise.resolve(null).then(n)}class Kg{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){TV(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class AV{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,i=0,r=0;const s=this.players.length;0==s?TV(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++i==s&&this._onDestroy()}),o.onStart(()=>{++r==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(i=>{const r=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(r)})}getPosition(){const e=this.players.reduce((t,i)=>null===t||i.totalTime>t.totalTime?i:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function DV(){return"undefined"!=typeof window&&void 0!==window.document}function GD(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Jd(n){switch(n.length){case 0:return new Kg;case 1:return n[0];default:return new AV(n)}}function OV(n,e,t,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(d=>{const f=d.offset,p=f==l,g=p&&c||{};Object.keys(d).forEach(_=>{let y=_,v=d[_];if("offset"!==_)switch(y=e.normalizePropertyName(y,o),v){case"!":v=r[_];break;case $u:v=s[_];break;default:v=e.normalizeStyleValue(_,y,v,o)}g[y]=v}),p||a.push(g),c=g,l=f}),o.length){const d="\n - ";throw new Error(`Unable to animate due to the following errors:${d}${o.join(d)}`)}return a}function WD(n,e,t,i){switch(e){case"start":n.onStart(()=>i(t&&qD(t,"start",n)));break;case"done":n.onDone(()=>i(t&&qD(t,"done",n)));break;case"destroy":n.onDestroy(()=>i(t&&qD(t,"destroy",n)))}}function qD(n,e,t){const i=t.totalTime,s=YD(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,null==i?n.totalTime:i,!!t.disabled),o=n._data;return null!=o&&(s._data=o),s}function YD(n,e,t,i,r="",s=0,o){return{element:n,triggerName:e,fromState:t,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function wa(n,e,t){let i;return n instanceof Map?(i=n.get(e),i||n.set(e,i=t)):(i=n[e],i||(i=n[e]=t)),i}function IV(n){const e=n.indexOf(":");return[n.substring(1,e),n.substr(e+1)]}let XD=(n,e)=>!1,KD=(n,e)=>!1,PV=(n,e,t)=>[];const RV=GD();(RV||"undefined"!=typeof Element)&&(XD=DV()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),KD=(()=>{if(RV||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):KD}})(),PV=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{const i=t.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=n[t]}),e}let NV=(()=>{class n{validateStyleProperty(t){return ZD(t)}matchesElement(t,i){return QD(t,i)}containsElement(t,i){return JD(t,i)}query(t,i,r){return eO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new Kg(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class SE{}SE.NOOP=new NV;const tO="ng-enter",ME="ng-leave",xE="ng-trigger",TE=".ng-trigger",BV="ng-animating",nO=".ng-animating";function If(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:iO(parseFloat(e[1]),e[2])}function iO(n,e){switch(e){case"s":return 1e3*n;default:return n}}function AE(n,e,t){return n.hasOwnProperty("duration")?n:function(n,e,t){let r,s=0,o="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return e.push(`The provided timing value "${n}" is invalid.`),{duration:0,delay:0,easing:""};r=iO(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(s=iO(parseFloat(l),a[4]));const c=a[5];c&&(o=c)}else r=n;if(!t){let a=!1,l=e.length;r<0&&(e.push("Duration values below 0 are not allowed for this animation step."),a=!0),s<0&&(e.push("Delay values below 0 are not allowed for this animation step."),a=!0),a&&e.splice(l,0,`The provided timing value "${n}" is invalid.`)}return{duration:r,delay:s,easing:o}}(n,e,t)}function Zg(n,e={}){return Object.keys(n).forEach(t=>{e[t]=n[t]}),e}function eh(n,e,t={}){if(e)for(let i in n)t[i]=n[i];else Zg(n,t);return t}function jV(n,e,t){return t?e+":"+t+";":""}function UV(n){let e="";for(let t=0;t{const r=sO(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),GD()&&UV(n))}function Pf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=sO(t);n.style[i]=""}),GD()&&UV(n))}function Pv(n){return Array.isArray(n)?1==n.length?n[0]:xV(n):n}const rO=new RegExp("{{\\s*(.+?)\\s*}}","g");function zV(n){let e=[];if("string"==typeof n){let t;for(;t=rO.exec(n);)e.push(t[1]);rO.lastIndex=0}return e}function DE(n,e,t){const i=n.toString(),r=i.replace(rO,(s,o)=>{let a=e[o];return e.hasOwnProperty(o)||(t.push(`Please provide a value for the animation param ${o}`),a=""),a.toString()});return r==i?n:r}function OE(n){const e=[];let t=n.next();for(;!t.done;)e.push(t.value),t=n.next();return e}const Hne=/-+([a-z0-9])/g;function sO(n){return n.replace(Hne,(...e)=>e[1].toUpperCase())}function $ne(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function HV(n,e){return 0===n||0===e}function $V(n,e,t){const i=Object.keys(t);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(a=>{s.hasOwnProperty(a)||o.push(a),s[a]=t[a]}),o.length)for(var r=1;rfunction(n,e,t){if(":"==n[0]){const l=function(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i) *"}}(n,t);if("function"==typeof l)return void e.push(l);n=l}const i=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return t.push(`The provided transition expression "${n}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(GV(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(GV(o,r))}(i,t,e)):t.push(n),t}const PE=new Set(["true","1"]),RE=new Set(["false","0"]);function GV(n,e){const t=PE.has(n)||RE.has(n),i=PE.has(e)||RE.has(e);return(r,s)=>{let o="*"==n||n==r,a="*"==e||e==s;return!o&&t&&"boolean"==typeof r&&(o=r?PE.has(n):RE.has(n)),!a&&i&&"boolean"==typeof s&&(a=s?PE.has(e):RE.has(e)),o&&a}}const Yne=new RegExp("s*:selfs*,?","g");function aO(n,e,t){return new Xne(n).build(e,t)}class Xne{constructor(e){this._driver=e}build(e,t){const i=new Qne(t);return this._resetContextStyleTimingState(i),Ea(this,Pv(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,r=t.depCount=0;const s=[],o=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),0==a.type){const l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,s.push(this.visitState(l,t))}),l.name=c}else if(1==a.type){const l=this.visitTransition(a,t);i+=l.queryCount,r+=l.depCount,o.push(l)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:s,transitions:o,queryCount:i,depCount:r,options:null}}visitState(e,t){const i=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(i.containsDynamicStyles){const s=new Set,o=r||{};if(i.styles.forEach(a=>{if(kE(a)){const l=a;Object.keys(l).forEach(c=>{zV(l[c]).forEach(d=>{o.hasOwnProperty(d)||s.add(d)})})}}),s.size){const a=OE(s.values());t.errors.push(`state("${e.name}", ...) must define default values for all the following style substitutions: ${a.join(", ")}`)}}return{type:0,name:e.name,style:i,options:r?{params:r}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const i=Ea(this,Pv(e.animation),t);return{type:1,matchers:Gne(e.expr,t.errors),animation:i,queryCount:t.queryCount,depCount:t.depCount,options:Rf(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(i=>Ea(this,i,t)),options:Rf(e.options)}}visitGroup(e,t){const i=t.currentTime;let r=0;const s=e.steps.map(o=>{t.currentTime=i;const a=Ea(this,o,t);return r=Math.max(r,t.currentTime),a});return t.currentTime=r,{type:3,steps:s,options:Rf(e.options)}}visitAnimate(e,t){const i=function(n,e){let t=null;if(n.hasOwnProperty("duration"))t=n;else if("number"==typeof n)return lO(AE(n,e).duration,0,"");const i=n;if(i.split(/\s+/).some(s=>"{"==s.charAt(0)&&"{"==s.charAt(1))){const s=lO(0,0,"");return s.dynamic=!0,s.strValue=i,s}return t=t||AE(i,e),lO(t.duration,t.delay,t.easing)}(e.timings,t.errors);t.currentAnimateTimings=i;let r,s=e.styles?e.styles:Kn({});if(5==s.type)r=this.visitKeyframes(s,t);else{let o=e.styles,a=!1;if(!o){a=!0;const c={};i.easing&&(c.easing=i.easing),o=Kn(c)}t.currentTime+=i.duration+i.delay;const l=this.visitStyle(o,t);l.isEmptyStep=a,r=l}return t.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}}visitStyle(e,t){const i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){const i=[];Array.isArray(e.styles)?e.styles.forEach(o=>{"string"==typeof o?o==$u?i.push(o):t.errors.push(`The provided style string value ${o} is not allowed.`):i.push(o)}):i.push(e.styles);let r=!1,s=null;return i.forEach(o=>{if(kE(o)){const a=o,l=a.easing;if(l&&(s=l,delete a.easing),!r)for(let c in a)if(a[c].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:i,easing:s,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){const i=t.currentAnimateTimings;let r=t.currentTime,s=t.currentTime;i&&s>0&&(s-=i.duration+i.delay),e.styles.forEach(o=>{"string"!=typeof o&&Object.keys(o).forEach(a=>{if(!this._driver.validateStyleProperty(a))return void t.errors.push(`The provided animation property "${a}" is not a supported CSS property for animations`);const l=t.collectedStyles[t.currentQuerySelector],c=l[a];let d=!0;c&&(s!=r&&s>=c.startTime&&r<=c.endTime&&(t.errors.push(`The CSS property "${a}" that exists between the times of "${c.startTime}ms" and "${c.endTime}ms" is also being animated in a parallel animation between the times of "${s}ms" and "${r}ms"`),d=!1),s=c.startTime),d&&(l[a]={startTime:s,endTime:r}),t.options&&function(n,e,t){const i=e.params||{},r=zV(n);r.length&&r.forEach(s=>{i.hasOwnProperty(s)||t.push(`Unable to resolve the local animation param ${s} in the given list of values`)})}(o[a],t.options,t.errors)})})}visitKeyframes(e,t){const i={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),i;let s=0;const o=[];let a=!1,l=!1,c=0;const d=e.steps.map(w=>{const C=this._makeStyleAst(w,t);let x=null!=C.offset?C.offset:function(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(kE(t)&&t.hasOwnProperty("offset")){const i=t;e=parseFloat(i.offset),delete i.offset}});else if(kE(n)&&n.hasOwnProperty("offset")){const t=n;e=parseFloat(t.offset),delete t.offset}return e}(C.styles),L=0;return null!=x&&(s++,L=C.offset=x),l=l||L<0||L>1,a=a||L0&&s{const x=p>0?C==g?1:p*C:o[C],L=x*v;t.currentTime=_+y.delay+L,y.duration=L,this._validateStyleAst(w,t),w.offset=x,i.styles.push(w)}),i}visitReference(e,t){return{type:8,animation:Ea(this,Pv(e.animation),t),options:Rf(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:Rf(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:Rf(e.options)}}visitQuery(e,t){const i=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;const[s,o]=function(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(Yne,"")),[n=n.replace(/@\*/g,TE).replace(/@\w+/g,t=>TE+"-"+t.substr(1)).replace(/:animating/g,nO),e]}(e.selector);t.currentQuerySelector=i.length?i+" "+s:s,wa(t.collectedStyles,t.currentQuerySelector,{});const a=Ea(this,Pv(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:11,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:Rf(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");const i="full"===e.timings?{duration:0,delay:0,easing:"full"}:AE(e.timings,t.errors,!0);return{type:12,animation:Ea(this,Pv(e.animation),t),timings:i,options:null}}}class Qne{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function kE(n){return!Array.isArray(n)&&"object"==typeof n}function Rf(n){return n?(n=Zg(n)).params&&(n.params=function(n){return n?Zg(n):null}(n.params)):n={},n}function lO(n,e,t){return{duration:n,delay:e,easing:t}}function cO(n,e,t,i,r,s,o=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class FE{constructor(){this._map=new Map}consume(e){let t=this._map.get(e);return t?this._map.delete(e):t=[],t}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const iie=new RegExp(":enter","g"),sie=new RegExp(":leave","g");function uO(n,e,t,i,r,s={},o={},a,l,c=[]){return(new oie).buildKeyframes(n,e,t,i,r,s,o,a,l,c)}class oie{buildKeyframes(e,t,i,r,s,o,a,l,c,d=[]){c=c||new FE;const f=new dO(e,t,c,r,s,d,[]);f.options=l,f.currentTimeline.setStyles([o],null,f.errors,l),Ea(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&Object.keys(a).length){const g=p[p.length-1];g.allowOnlyTimelineStyles()||g.setStyles([a],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[cO(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const i=t.subInstructions.consume(t.element);if(i){const r=t.createSubContext(e.options),s=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,r,r.options);s!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){const i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,i){let s=t.currentTimeline.currentTime;const o=null!=i.duration?If(i.duration):null,a=null!=i.delay?If(i.delay):null;return 0!==o&&e.forEach(l=>{const c=t.appendInstructionToTimeline(l,o,a);s=Math.max(s,c.duration+c.delay)}),s}visitReference(e,t){t.updateOptions(e.options,!0),Ea(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const i=t.subContextCount;let r=t;const s=e.options;if(s&&(s.params||s.delay)&&(r=t.createSubContext(s),r.transformIntoNewTimeline(),null!=s.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=NE);const o=If(s.delay);r.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>Ea(this,o,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const i=[];let r=t.currentTimeline.currentTime;const s=e.options&&e.options.delay?If(e.options.delay):0;e.steps.forEach(o=>{const a=t.createSubContext(e.options);s&&a.delayNextStep(s),Ea(this,o,a),r=Math.max(r,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(r),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const i=e.strValue;return AE(t.params?DE(i,t.params,t.errors):i,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const i=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),r.snapshotCurrentStyles());const s=e.style;5==s.type?this.visitKeyframes(s,t):(t.incrementTime(i.duration),this.visitStyle(s,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const i=t.currentTimeline,r=t.currentAnimateTimings;!r&&i.getCurrentStyleProperties().length&&i.forwardFrame();const s=r&&r.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(s):i.setStyles(e.styles,s,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const i=t.currentAnimateTimings,r=t.currentTimeline.duration,s=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{a.forwardTime((l.offset||0)*s),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(r+s),t.previousNode=e}visitQuery(e,t){const i=t.currentTimeline.currentTime,r=e.options||{},s=r.delay?If(r.delay):0;s&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=NE);let o=i;const a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,d)=>{t.currentQueryIndex=d;const f=t.createSubContext(e.options,c);s&&f.delayNextStep(s),c===t.element&&(l=f.currentTimeline),Ea(this,e.animation,f),f.currentTimeline.applyStylesToKeyframe(),o=Math.max(o,f.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const i=t.parentContext,r=t.currentTimeline,s=e.timings,o=Math.abs(s.duration),a=o*(t.currentQueryTotal-1);let l=o*t.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime}const d=t.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;Ea(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=r.currentTime-f+(r.startTime-i.currentTimeline.startTime)}}const NE={};class dO{constructor(e,t,i,r,s,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=s,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=NE,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new LE(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const i=e;let r=this.options;null!=i.duration&&(r.duration=If(i.duration)),null!=i.delay&&(r.delay=If(i.delay));const s=i.params;if(s){let o=r.params;o||(o=this.options.params={}),Object.keys(s).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=DE(s[a],o,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const i=e.params={};Object.keys(t).forEach(r=>{i[r]=t[r]})}}return e}createSubContext(e=null,t,i){const r=t||this.element,s=new dO(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(e),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(e){return this.previousNode=NE,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){const r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=i?i:0)+e.delay,easing:""},s=new aie(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,r,s,o){let a=[];if(r&&a.push(this.element),e.length>0){e=(e=e.replace(iie,"."+this._enterClassName)).replace(sie,"."+this._leaveClassName);let c=this._driver.query(this.element,e,1!=i);0!==i&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!s&&0==a.length&&o.push(`\`query("${t}")\` returned zero elements. (Use \`query("${t}", { optional: true })\` if you wish to allow this.)`),a}}class LE{constructor(e,t,i,r){this._driver=e,this.element=t,this.startTime=i,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new LE(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||$u,this._currentKeyframe[t]=$u}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,r){t&&(this._previousKeyframe.easing=t);const s=r&&r.params||{},o=function(n,e){const t={};let i;return n.forEach(r=>{"*"===r?(i=i||Object.keys(e),i.forEach(s=>{t[s]=$u})):eh(r,!1,t)}),t}(e,this._globalTimelineStyles);Object.keys(o).forEach(a=>{const l=DE(o[a],s,i);this._pendingStyles[a]=l,this._localTimelineStyles.hasOwnProperty(a)||(this._backFill[a]=this._globalTimelineStyles.hasOwnProperty(a)?this._globalTimelineStyles[a]:$u),this._updateStyle(a,l)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(i=>{this._currentKeyframe[i]=e[i]}),Object.keys(this._localTimelineStyles).forEach(i=>{this._currentKeyframe.hasOwnProperty(i)||(this._currentKeyframe[i]=this._localTimelineStyles[i])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const i=this._styleSummary[t],r=e._styleSummary[t];(!i||r.time>i.time)&&this._updateStyle(t,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,i=1===this._keyframes.size&&0===this.duration;let r=[];this._keyframes.forEach((a,l)=>{const c=eh(a,!0);Object.keys(c).forEach(d=>{const f=c[d];"!"==f?e.add(d):f==$u&&t.add(d)}),i||(c.offset=l/this.duration),r.push(c)});const s=e.size?OE(e.values()):[],o=t.size?OE(t.values()):[];if(i){const a=r[0],l=Zg(a);a.offset=0,l.offset=1,r=[a,l]}return cO(this.element,r,s,o,this.duration,this.startTime,this.easing,!1)}}class aie extends LE{constructor(e,t,i,r,s,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:r}=this.timings;if(this._stretchStartingKeyframe&&t){const s=[],o=i+t,a=t/o,l=eh(e[0],!1);l.offset=0,s.push(l);const c=eh(e[0],!1);c.offset=YV(a),s.push(c);const d=e.length-1;for(let f=1;f<=d;f++){let p=eh(e[f],!1);p.offset=YV((t+p.offset*i)/o),s.push(p)}i=o,t=0,r="",e=s}return cO(this.element,e,this.preStyleProps,this.postStyleProps,i,t,r,!0)}}function YV(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}class hO{}class cie extends hO{normalizePropertyName(e,t){return sO(e)}normalizeStyleValue(e,t,i,r){let s="";const o=i.toString().trim();if(uie[t]&&0!==i&&"0"!==i)if("number"==typeof i)s="px";else{const a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&r.push(`Please provide a CSS unit value for ${e}:${i}`)}return o+s}}const uie=(()=>function(n){const e={};return n.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function XV(n,e,t,i,r,s,o,a,l,c,d,f,p){return{type:0,element:n,triggerName:e,isRemovalTransition:r,fromState:t,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:d,totalTime:f,errors:p}}const fO={};class KV{constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,r){return function(n,e,t,i,r){return n.some(s=>s(e,t,i,r))}(this.ast.matchers,e,t,i,r)}buildStyles(e,t,i){const r=this._stateStyles["*"],s=this._stateStyles[e],o=r?r.buildStyles(t,i):{};return s?s.buildStyles(t,i):o}build(e,t,i,r,s,o,a,l,c,d){const f=[],p=this.ast.options&&this.ast.options.params||fO,_=this.buildStyles(i,a&&a.params||fO,f),y=l&&l.params||fO,v=this.buildStyles(r,y,f),w=new Set,C=new Map,x=new Map,L="void"===r,U={params:Object.assign(Object.assign({},p),y)},$=d?[]:uO(e,t,this.ast.animation,s,o,_,v,U,c,f);let ee=0;if($.forEach(pe=>{ee=Math.max(pe.duration+pe.delay,ee)}),f.length)return XV(t,this._triggerName,i,r,L,_,v,[],[],C,x,ee,f);$.forEach(pe=>{const ve=pe.element,$e=wa(C,ve,{});pe.preStyleProps.forEach(re=>$e[re]=!0);const Xe=wa(x,ve,{});pe.postStyleProps.forEach(re=>Xe[re]=!0),ve!==t&&w.add(ve)});const fe=OE(w.values());return XV(t,this._triggerName,i,r,L,_,v,$,fe,C,x,ee)}}class fie{constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){const i={},r=Zg(this.defaultParams);return Object.keys(e).forEach(s=>{const o=e[s];null!=o&&(r[s]=o)}),this.styles.styles.forEach(s=>{if("string"!=typeof s){const o=s;Object.keys(o).forEach(a=>{let l=o[a];l.length>1&&(l=DE(l,r,t));const c=this.normalizer.normalizePropertyName(a,t);l=this.normalizer.normalizeStyleValue(a,c,l,t),i[c]=l})}}),i}}class gie{constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,this.transitionFactories=[],this.states={},t.states.forEach(r=>{this.states[r.name]=new fie(r.style,r.options&&r.options.params||{},i)}),ZV(this.states,"true","1"),ZV(this.states,"false","0"),t.transitions.forEach(r=>{this.transitionFactories.push(new KV(e,r,this.states))}),this.fallbackTransition=function(n,e,t){return new KV(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(o,a)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,r){return this.transitionFactories.find(o=>o.match(e,t,i,r))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}}function ZV(n,e,t){n.hasOwnProperty(e)?n.hasOwnProperty(t)||(n[t]=n[e]):n.hasOwnProperty(t)&&(n[e]=n[t])}const _ie=new FE;class yie{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}register(e,t){const i=[],r=aO(this._driver,t,i);if(i.length)throw new Error(`Unable to build the animation due to the following errors: ${i.join("\n")}`);this._animations[e]=r}_buildPlayer(e,t,i){const r=e.element,s=OV(0,this._normalizer,0,e.keyframes,t,i);return this._driver.animate(r,s,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){const r=[],s=this._animations[e];let o;const a=new Map;if(s?(o=uO(this._driver,t,s,tO,ME,{},{},i,_ie,r),o.forEach(d=>{const f=wa(a,d.element,{});d.postStyleProps.forEach(p=>f[p]=null)})):(r.push("The requested animation doesn't exist or has already been destroyed"),o=[]),r.length)throw new Error(`Unable to create the animation due to the following errors: ${r.join("\n")}`);a.forEach((d,f)=>{Object.keys(d).forEach(p=>{d[p]=this._driver.computeStyle(f,p,$u)})});const c=Jd(o.map(d=>{const f=a.get(d.element);return this._buildPlayer(d,{},f)}));return this._playersById[e]=c,c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw new Error(`Unable to find the timeline player referenced by ${e}`);return t}listen(e,t,i,r){const s=YD(t,"","","");return WD(this._getPlayer(e),i,s,r),()=>{}}command(e,t,i,r){if("register"==i)return void this.register(e,r[0]);if("create"==i)return void this.create(e,t,r[0]||{});const s=this._getPlayer(e);switch(i){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}}const QV="ng-animate-queued",JV="ng-animate-disabled",ej=".ng-animate-disabled",wie=[],tj={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Eie={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},fl="__ng_removed";class pO{constructor(e,t=""){this.namespaceId=t;const i=e&&e.hasOwnProperty("value");if(this.value=function(n){return null!=n?n:null}(i?e.value:e),i){const s=Zg(e);delete s.value,this.options=s}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const i=this.options.params;Object.keys(t).forEach(r=>{null==i[r]&&(i[r]=t[r])})}}}const Rv="void",gO=new pO(Rv);class Sie{constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,pl(t,this._hostClassName)}listen(e,t,i,r){if(!this._triggers.hasOwnProperty(t))throw new Error(`Unable to listen on the animation trigger event "${i}" because the animation trigger "${t}" doesn't exist!`);if(null==i||0==i.length)throw new Error(`Unable to listen on the animation trigger "${t}" because the provided event is undefined!`);if(!function(n){return"start"==n||"done"==n}(i))throw new Error(`The provided animation trigger event "${i}" for the animation trigger "${t}" is not supported!`);const s=wa(this._elementListeners,e,[]),o={name:t,phase:i,callback:r};s.push(o);const a=wa(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(pl(e,xE),pl(e,xE+"-"+t),a[t]=gO),()=>{this._engine.afterFlush(()=>{const l=s.indexOf(o);l>=0&&s.splice(l,1),this._triggers[t]||delete a[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw new Error(`The provided animation trigger "${e}" has not been registered!`);return t}trigger(e,t,i,r=!0){const s=this._getTrigger(t),o=new mO(this.id,t,e);let a=this._engine.statesByElement.get(e);a||(pl(e,xE),pl(e,xE+"-"+t),this._engine.statesByElement.set(e,a={}));let l=a[t];const c=new pO(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a[t]=c,l||(l=gO),c.value!==Rv&&l.value===c.value){if(!function(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let r=0;r{Pf(e,v),Uc(e,w)})}return}const p=wa(this._engine.playersByElement,e,[]);p.forEach(y=>{y.namespaceId==this.id&&y.triggerName==t&&y.queued&&y.destroy()});let g=s.matchTransition(l.value,c.value,e,c.params),_=!1;if(!g){if(!r)return;g=s.fallbackTransition,_=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:g,fromState:l,toState:c,player:o,isFallbackTransition:_}),_||(pl(e,QV),o.onStart(()=>{Qg(e,QV)})),o.onDone(()=>{let y=this.players.indexOf(o);y>=0&&this.players.splice(y,1);const v=this._engine.playersByElement.get(e);if(v){let w=v.indexOf(o);w>=0&&v.splice(w,1)}}),this.players.push(o),p.push(o),o}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,i)=>{delete t[e]}),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(r=>r.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const i=this._engine.driver.query(e,TE,!0);i.forEach(r=>{if(r[fl])return;const s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(o=>o.triggerLeaveAnimation(r,t,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(e,t,i,r){const s=this._engine.statesByElement.get(e);if(s){const o=[];if(Object.keys(s).forEach(a=>{if(this._triggers[a]){const l=this.trigger(e,a,Rv,r);l&&o.push(l)}}),o.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),i&&Jd(o).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){const r=new Set;t.forEach(s=>{const o=s.name;if(r.has(o))return;r.add(o);const l=this._triggers[o].fallbackTransition,c=i[o]||gO,d=new pO(Rv),f=new mO(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(e,t){const i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let r=!1;if(i.totalAnimations){const s=i.players.length?i.playersByQueriedElement.get(e):[];if(s&&s.length)r=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(e),r)i.markElementAsRemoved(this.id,e,!1,t);else{const s=e[fl];(!s||s===tj)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){pl(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(i=>{const r=i.player;if(r.destroyed)return;const s=i.element,o=this._elementListeners.get(s);o&&o.forEach(a=>{if(a.name==i.triggerName){const l=YD(s,i.triggerName,i.fromState.value,i.toState.value);l._data=e,WD(i.player,a.phase,l,a.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):t.push(i)}),this._queue=[],t.sort((i,r)=>{const s=i.transition.ast.depCount,o=r.transition.ast.depCount;return 0==s||0==o?s-o:this._engine.driver.containsElement(i.element,r.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(i=>i.element===e)||t,t}}class Mie{constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(r,s)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){const i=new Sie(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){const i=this._namespaceList.length-1;if(i>=0){let r=!1;for(let s=i;s>=0;s--)if(this.driver.containsElement(this._namespaceList[s].hostElement,t)){this._namespaceList.splice(s+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let r=this._namespaceLookup[e];r&&r.register(t,i)&&this.totalAnimations++}destroy(e,t){if(!e)return;const i=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(i.hostElement),delete this._namespaceLookup[e];const r=this._namespaceList.indexOf(i);r>=0&&this._namespaceList.splice(r,1)}),this.afterFlushAnimationsDone(()=>i.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,i=this.statesByElement.get(e);if(i){const r=Object.keys(i);for(let s=0;s=0&&this.collectedLeaveElements.splice(o,1)}if(e){const o=this._fetchNamespace(e);o&&o.insertNode(t,i)}r&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),pl(e,JV)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Qg(e,JV))}removeNode(e,t,i,r){if(BE(t)){const s=e?this._fetchNamespace(e):null;if(s?s.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r),i){const o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,r)}}else this._onRemovalComplete(t,r)}markElementAsRemoved(e,t,i,r){this.collectedLeaveElements.push(t),t[fl]={namespaceId:e,setForRemoval:r,hasAnimation:i,removedBeforeQueried:!1}}listen(e,t,i,r,s){return BE(t)?this._fetchNamespace(e).listen(t,i,r,s):()=>{}}_buildInstruction(e,t,i,r,s){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,r,e.fromState.options,e.toState.options,t,s)}destroyInnerAnimations(e){let t=this.driver.query(e,TE,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,nO,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Jd(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e[fl];if(t&&t.setForRemoval){if(e[fl]=tj,t.namespaceId){this.destroyInnerAnimations(e);const i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}this.driver.matchesElement(e,ej)&&this.markElementAsDisabled(e,!1),this.driver.query(e,ej,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,r)=>this._balanceNamespaceList(i,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],t.length?Jd(t).onDone(()=>{i.forEach(r=>r())}):i.forEach(r=>r())}}reportError(e){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${e.join("\n")}`)}_flushAnimations(e,t){const i=new FE,r=[],s=new Map,o=[],a=new Map,l=new Map,c=new Map,d=new Set;this.disabledNodes.forEach(Q=>{d.add(Q);const Ue=this.driver.query(Q,".ng-animate-queued",!0);for(let ke=0;ke{const ke=tO+y++;_.set(Ue,ke),Q.forEach(ze=>pl(ze,ke))});const v=[],w=new Set,C=new Set;for(let Q=0;Qw.add(ze)):C.add(Ue))}const x=new Map,L=rj(p,Array.from(w));L.forEach((Q,Ue)=>{const ke=ME+y++;x.set(Ue,ke),Q.forEach(ze=>pl(ze,ke))}),e.push(()=>{g.forEach((Q,Ue)=>{const ke=_.get(Ue);Q.forEach(ze=>Qg(ze,ke))}),L.forEach((Q,Ue)=>{const ke=x.get(Ue);Q.forEach(ze=>Qg(ze,ke))}),v.forEach(Q=>{this.processLeaveNode(Q)})});const U=[],$=[];for(let Q=this._namespaceList.length-1;Q>=0;Q--)this._namespaceList[Q].drainQueuedTransitions(t).forEach(ke=>{const ze=ke.player,wt=ke.element;if(U.push(ze),this.collectedEnterElements.length){const fi=wt[fl];if(fi&&fi.setForMove)return void ze.destroy()}const kn=!f||!this.driver.containsElement(f,wt),Je=x.get(wt),tr=_.get(wt),Dn=this._buildInstruction(ke,i,tr,Je,kn);if(Dn.errors&&Dn.errors.length)$.push(Dn);else{if(kn)return ze.onStart(()=>Pf(wt,Dn.fromStyles)),ze.onDestroy(()=>Uc(wt,Dn.toStyles)),void r.push(ze);if(ke.isFallbackTransition)return ze.onStart(()=>Pf(wt,Dn.fromStyles)),ze.onDestroy(()=>Uc(wt,Dn.toStyles)),void r.push(ze);Dn.timelines.forEach(fi=>fi.stretchStartingKeyframe=!0),i.append(wt,Dn.timelines),o.push({instruction:Dn,player:ze,element:wt}),Dn.queriedElements.forEach(fi=>wa(a,fi,[]).push(ze)),Dn.preStyleProps.forEach((fi,gr)=>{const ra=Object.keys(fi);if(ra.length){let Bs=l.get(gr);Bs||l.set(gr,Bs=new Set),ra.forEach(ka=>Bs.add(ka))}}),Dn.postStyleProps.forEach((fi,gr)=>{const ra=Object.keys(fi);let Bs=c.get(gr);Bs||c.set(gr,Bs=new Set),ra.forEach(ka=>Bs.add(ka))})}});if($.length){const Q=[];$.forEach(Ue=>{Q.push(`@${Ue.triggerName} has failed due to:\n`),Ue.errors.forEach(ke=>Q.push(`- ${ke}\n`))}),U.forEach(Ue=>Ue.destroy()),this.reportError(Q)}const ee=new Map,fe=new Map;o.forEach(Q=>{const Ue=Q.element;i.has(Ue)&&(fe.set(Ue,Ue),this._beforeAnimationBuild(Q.player.namespaceId,Q.instruction,ee))}),r.forEach(Q=>{const Ue=Q.element;this._getPreviousPlayers(Ue,!1,Q.namespaceId,Q.triggerName,null).forEach(ze=>{wa(ee,Ue,[]).push(ze),ze.destroy()})});const pe=v.filter(Q=>oj(Q,l,c)),ve=new Map;ij(ve,this.driver,C,c,$u).forEach(Q=>{oj(Q,l,c)&&pe.push(Q)});const Xe=new Map;g.forEach((Q,Ue)=>{ij(Xe,this.driver,new Set(Q),l,"!")}),pe.forEach(Q=>{const Ue=ve.get(Q),ke=Xe.get(Q);ve.set(Q,Object.assign(Object.assign({},Ue),ke))});const re=[],le=[],Oe={};o.forEach(Q=>{const{element:Ue,player:ke,instruction:ze}=Q;if(i.has(Ue)){if(d.has(Ue))return ke.onDestroy(()=>Uc(Ue,ze.toStyles)),ke.disabled=!0,ke.overrideTotalTime(ze.totalTime),void r.push(ke);let wt=Oe;if(fe.size>1){let Je=Ue;const tr=[];for(;Je=Je.parentNode;){const Dn=fe.get(Je);if(Dn){wt=Dn;break}tr.push(Je)}tr.forEach(Dn=>fe.set(Dn,wt))}const kn=this._buildAnimation(ke.namespaceId,ze,ee,s,Xe,ve);if(ke.setRealPlayer(kn),wt===Oe)re.push(ke);else{const Je=this.playersByElement.get(wt);Je&&Je.length&&(ke.parentPlayer=Jd(Je)),r.push(ke)}}else Pf(Ue,ze.fromStyles),ke.onDestroy(()=>Uc(Ue,ze.toStyles)),le.push(ke),d.has(Ue)&&r.push(ke)}),le.forEach(Q=>{const Ue=s.get(Q.element);if(Ue&&Ue.length){const ke=Jd(Ue);Q.setRealPlayer(ke)}}),r.forEach(Q=>{Q.parentPlayer?Q.syncPlayerEvents(Q.parentPlayer):Q.destroy()});for(let Q=0;Q!kn.destroyed);wt.length?Die(this,Ue,wt):this.processLeaveNode(Ue)}return v.length=0,re.forEach(Q=>{this.players.push(Q),Q.onDone(()=>{Q.destroy();const Ue=this.players.indexOf(Q);this.players.splice(Ue,1)}),Q.play()}),re}elementContainsData(e,t){let i=!1;const r=t[fl];return r&&r.setForRemoval&&(i=!0),this.playersByElement.has(t)&&(i=!0),this.playersByQueriedElement.has(t)&&(i=!0),this.statesByElement.has(t)&&(i=!0),this._fetchNamespace(e).elementContainsData(t)||i}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,r,s){let o=[];if(t){const a=this.playersByQueriedElement.get(e);a&&(o=a)}else{const a=this.playersByElement.get(e);if(a){const l=!s||s==Rv;a.forEach(c=>{c.queued||!l&&c.triggerName!=r||o.push(c)})}}return(i||r)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||r&&r!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){const s=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:t.triggerName;for(const l of t.timelines){const c=l.element,d=c!==s,f=wa(i,c,[]);this._getPreviousPlayers(c,d,o,a,t.toState).forEach(g=>{const _=g.getRealPlayer();_.beforeDestroy&&_.beforeDestroy(),g.destroy(),f.push(g)})}Pf(s,t.fromStyles)}_buildAnimation(e,t,i,r,s,o){const a=t.triggerName,l=t.element,c=[],d=new Set,f=new Set,p=t.timelines.map(_=>{const y=_.element;d.add(y);const v=y[fl];if(v&&v.removedBeforeQueried)return new Kg(_.duration,_.delay);const w=y!==l,C=function(n){const e=[];return sj(n,e),e}((i.get(y)||wie).map(ee=>ee.getRealPlayer())).filter(ee=>!!ee.element&&ee.element===y),x=s.get(y),L=o.get(y),U=OV(0,this._normalizer,0,_.keyframes,x,L),$=this._buildPlayer(_,U,C);if(_.subTimeline&&r&&f.add(y),w){const ee=new mO(e,a,y);ee.setRealPlayer($),c.push(ee)}return $});c.forEach(_=>{wa(this.playersByQueriedElement,_.element,[]).push(_),_.onDone(()=>function(n,e,t){let i;if(n instanceof Map){if(i=n.get(e),i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&n.delete(e)}}else if(i=n[e],i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&delete n[e]}return i}(this.playersByQueriedElement,_.element,_))}),d.forEach(_=>pl(_,BV));const g=Jd(p);return g.onDestroy(()=>{d.forEach(_=>Qg(_,BV)),Uc(l,t.toStyles)}),f.forEach(_=>{wa(r,_,[]).push(g)}),g}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new Kg(e.duration,e.delay)}}class mO{constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i,this._player=new Kg,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(i=>WD(e,t,void 0,i))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){wa(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function BE(n){return n&&1===n.nodeType}function nj(n,e){const t=n.style.display;return n.style.display=null!=e?e:"none",t}function ij(n,e,t,i,r){const s=[];t.forEach(l=>s.push(nj(l)));const o=[];i.forEach((l,c)=>{const d={};l.forEach(f=>{const p=d[f]=e.computeStyle(c,f,r);(!p||0==p.length)&&(c[fl]=Eie,o.push(c))}),n.set(c,d)});let a=0;return t.forEach(l=>nj(l,s[a++])),o}function rj(n,e){const t=new Map;if(n.forEach(a=>t.set(a,[])),0==e.length)return t;const r=new Set(e),s=new Map;function o(a){if(!a)return 1;let l=s.get(a);if(l)return l;const c=a.parentNode;return l=t.has(c)?c:r.has(c)?1:o(c),s.set(a,l),l}return e.forEach(a=>{const l=o(a);1!==l&&t.get(l).push(a)}),t}const VE="$$classes";function pl(n,e){if(n.classList)n.classList.add(e);else{let t=n[VE];t||(t=n[VE]={}),t[e]=!0}}function Qg(n,e){if(n.classList)n.classList.remove(e);else{let t=n[VE];t&&delete t[e]}}function Die(n,e,t){Jd(t).onDone(()=>n.processLeaveNode(e))}function sj(n,e){for(let t=0;tr.add(s)):e.set(n,i),t.delete(n),!0}class jE{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(r,s)=>{},this._transitionEngine=new Mie(e,t,i),this._timelineEngine=new yie(e,t,i),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(e,t,i,r,s){const o=e+"-"+r;let a=this._triggerCache[o];if(!a){const l=[],c=aO(this._driver,s,l);if(l.length)throw new Error(`The animation trigger "${r}" has failed to build due to the following errors:\n - ${l.join("\n - ")}`);a=function(n,e,t){return new gie(n,e,t)}(r,c,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,r,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,r){this._transitionEngine.insertNode(e,t,i,r)}onRemove(e,t,i,r){this._transitionEngine.removeNode(e,t,r||!1,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,r){if("@"==i.charAt(0)){const[s,o]=IV(i);this._timelineEngine.command(s,t,o,r)}else this._transitionEngine.trigger(e,t,i,r)}listen(e,t,i,r,s){if("@"==i.charAt(0)){const[o,a]=IV(i);return this._timelineEngine.listen(o,t,a,s)}return this._transitionEngine.listen(e,t,i,r,s)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function aj(n,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=_O(e[0]),e.length>1&&(i=_O(e[e.length-1]))):e&&(t=_O(e)),t||i?new Jg(n,t,i):null}class Jg{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Jg.initialStylesByElement.get(e);r||Jg.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Uc(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Uc(this._element,this._initialStyles),this._endStyles&&(Uc(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Jg.initialStylesByElement.delete(this._element),this._startStyles&&(Pf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Pf(this._element,this._endStyles),this._endStyles=null),Uc(this._element,this._initialStyles),this._state=3)}}function _O(n){let e=null;const t=Object.keys(n);for(let i=0;ithis._handleCallback(l)}apply(){(function(n,e){const t=vO(n,"").trim();let i=0;t.length&&(function(n,e){let t=0;for(let i=0;i=this._delay&&i>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),hj(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(n,e){const i=vO(n,"").split(","),r=yO(i,e);r>=0&&(i.splice(r,1),UE(n,"",i.join(",")))}(this._element,this._name))}}function uj(n,e,t){UE(n,"PlayState",t,dj(n,e))}function dj(n,e){const t=vO(n,"");return t.indexOf(",")>0?yO(t.split(","),e):yO([t],e)}function yO(n,e){for(let t=0;t=0)return t;return-1}function hj(n,e,t){t?n.removeEventListener(cj,e):n.addEventListener(cj,e)}function UE(n,e,t,i){const r=lj+e;if(null!=i){const s=n.style[r];if(s.length){const o=s.split(",");o[i]=t,t=o.join(",")}}n.style[r]=t}function vO(n,e){return n.style[lj+e]||""}class fj{constructor(e,t,i,r,s,o,a,l){this.element=e,this.keyframes=t,this.animationName=i,this._duration=r,this._delay=s,this._finalStyles=a,this._specialStyles=l,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=o||"linear",this.totalTime=r+s,this._buildStyler()}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(e=>e()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(e){this._styler.setPosition(e)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new Fie(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}beforeDestroy(){this.init();const e={};if(this.hasStarted()){const t=this._state>=3;Object.keys(this._finalStyles).forEach(i=>{"offset"!=i&&(e[i]=t?this._finalStyles[i]:oO(this.element,i))})}this.currentSnapshot=e}}class Uie extends Kg{constructor(e,t){super(),this.element=e,this._startingStyles={},this.__initialized=!1,this._styles=FV(t)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(e=>{this._startingStyles[e]=this.element.style[e]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(e=>this.element.style.setProperty(e,this._styles[e])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(e=>{const t=this._startingStyles[e];t?this.element.style.setProperty(e,t):this.element.style.removeProperty(e)}),this._startingStyles=null,super.destroy())}}class gj{constructor(){this._count=0}validateStyleProperty(e){return ZD(e)}matchesElement(e,t){return QD(e,t)}containsElement(e,t){return JD(e,t)}query(e,t,i){return eO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}buildKeyframeElement(e,t,i){i=i.map(a=>FV(a));let r=`@keyframes ${t} {\n`,s="";i.forEach(a=>{s=" ";const l=parseFloat(a.offset);r+=`${s}${100*l}% {\n`,s+=" ",Object.keys(a).forEach(c=>{const d=a[c];switch(c){case"offset":return;case"easing":return void(d&&(r+=`${s}animation-timing-function: ${d};\n`));default:return void(r+=`${s}${c}: ${d};\n`)}}),r+=`${s}}\n`}),r+="}\n";const o=document.createElement("style");return o.textContent=r,o}animate(e,t,i,r,s,o=[],a){const l=o.filter(v=>v instanceof fj),c={};HV(i,r)&&l.forEach(v=>{let w=v.currentSnapshot;Object.keys(w).forEach(C=>c[C]=w[C])});const d=function(n){let e={};return n&&(Array.isArray(n)?n:[n]).forEach(i=>{Object.keys(i).forEach(r=>{"offset"==r||"easing"==r||(e[r]=i[r])})}),e}(t=$V(e,t,c));if(0==i)return new Uie(e,d);const f="gen_css_kf_"+this._count++,p=this.buildKeyframeElement(e,f,t);(function(n){var e;const t=null===(e=n.getRootNode)||void 0===e?void 0:e.call(n);return"undefined"!=typeof ShadowRoot&&t instanceof ShadowRoot?t:document.head})(e).appendChild(p);const _=aj(e,t),y=new fj(e,t,f,i,r,s,d,_);return y.onDestroy(()=>function(n){n.parentNode.removeChild(n)}(p)),y}}class _j{constructor(e,t,i,r){this.element=e,this.keyframes=t,this.options=i,this._specialStyles=r,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,i){return e.animate(t,i)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(t=>{"offset"!=t&&(e[t]=this._finished?this._finalKeyframe[t]:oO(this.element,t))}),this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class Wie{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(yj().toString()),this._cssKeyframesDriver=new gj}validateStyleProperty(e){return ZD(e)}matchesElement(e,t){return QD(e,t)}containsElement(e,t){return JD(e,t)}query(e,t,i){return eO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}overrideWebAnimationsSupport(e){this._isNativeImpl=e}animate(e,t,i,r,s,o=[],a){if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,i,r,s,o);const d={duration:i,delay:r,fill:0==r?"both":"forwards"};s&&(d.easing=s);const f={},p=o.filter(_=>_ instanceof _j);HV(i,r)&&p.forEach(_=>{let y=_.currentSnapshot;Object.keys(y).forEach(v=>f[v]=y[v])});const g=aj(e,t=$V(e,t=t.map(_=>eh(_,!1)),f));return new _j(e,t,d,g)}}function yj(){return DV()&&Element.prototype.animate||{}}let Yie=(()=>{class n extends MV{constructor(t,i){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(i.body,{id:"0",encapsulation:Re.None,styles:[],data:{animation:[]}})}build(t){const i=this._nextAnimationId.toString();this._nextAnimationId++;const r=Array.isArray(t)?xV(t):t;return vj(this._renderer,null,i,"register",[r]),new Xie(i,this._renderer)}}return n.\u0275fac=function(t){return new(t||n)(I(_f),I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Xie extends class{}{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new Kie(this._id,e,t||{},this._renderer)}}class Kie{constructor(e,t,i,r){this.id=e,this.element=t,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return vj(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function vj(n,e,t,i,r){return n.setProperty(e,`@@${t}:${i}`,r)}const bj="@.disabled";let Zie=(()=>{class n{constructor(t,i,r){this.delegate=t,this.engine=i,this._zone=r,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),i.onRemovalComplete=(s,o)=>{o&&o.parentNode(s)&&o.removeChild(s.parentNode,s)}}createRenderer(t,i){const s=this.delegate.createRenderer(t,i);if(!(t&&i&&i.data&&i.data.animation)){let d=this._rendererCache.get(s);return d||(d=new Cj("",s,this.engine),this._rendererCache.set(s,d)),d}const o=i.id,a=i.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const l=d=>{Array.isArray(d)?d.forEach(l):this.engine.registerTrigger(o,a,t,d.name,d)};return i.data.animation.forEach(l),new Qie(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,i,r){t>=0&&ti(r)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(s=>{const[o,a]=s;o(a)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([i,r]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return n.\u0275fac=function(t){return new(t||n)(I(_f),I(jE),I(lt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Cj{constructor(e,t,i){this.namespaceId=e,this.delegate=t,this.engine=i,this.destroyNode=this.delegate.destroyNode?r=>t.destroyNode(r):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,r=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,r)}removeChild(e,t,i){this.engine.onRemove(this.namespaceId,t,this.delegate,i)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,r){this.delegate.setAttribute(e,t,i,r)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,r){this.delegate.setStyle(e,t,i,r)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){"@"==t.charAt(0)&&t==bj?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i){return this.delegate.listen(e,t,i)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class Qie extends Cj{constructor(e,t,i,r){super(t,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){"@"==t.charAt(0)?"."==t.charAt(1)&&t==bj?this.disableAnimations(e,i=void 0===i||!!i):this.engine.process(this.namespaceId,e,t.substr(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i){if("@"==t.charAt(0)){const r=function(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let s=t.substr(1),o="";return"@"!=s.charAt(0)&&([s,o]=function(n){const e=n.indexOf(".");return[n.substring(0,e),n.substr(e+1)]}(s)),this.engine.listen(this.namespaceId,r,s,o,a=>{this.factory.scheduleListenerCallback(a._data||-1,i,a)})}return this.delegate.listen(e,t,i)}}let tre=(()=>{class n extends jE{constructor(t,i,r){super(t.body,i,r)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(SE),I(hO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Zo=new _e("AnimationModuleType"),wj=[{provide:MV,useClass:Yie},{provide:hO,useFactory:function(){return new cie}},{provide:jE,useClass:tre},{provide:_f,useFactory:function(n,e,t){return new Zie(n,e,t)},deps:[uE,jE,lt]}],Ej=[{provide:SE,useFactory:function(){return"function"==typeof yj()?new Wie:new gj}},{provide:Zo,useValue:"BrowserAnimations"},...wj],Sj=[{provide:SE,useClass:NV},{provide:Zo,useValue:"NoopAnimations"},...wj];let bO=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?Sj:Ej}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:Ej,imports:[dE]}),n})();function are(n,e){if(1&n&&et(0,"mat-pseudo-checkbox",4),2&n){const t=bt();ie("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function lre(n,e){if(1&n&&(F(0,"span",5),Te(1),N()),2&n){const t=bt();Y(1),Os("(",t.group.label,")")}}const cre=["*"],Mj=new Lu("12.2.5"),dre=new _e("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let Lf,Nn=(()=>{class n{constructor(t,i,r){this._hasDoneGlobalChecks=!1,this._document=r,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=i,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!wo()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const i=getComputedStyle(t);i&&"none"!==i.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&Mj.full!==SV.full&&console.warn("The Angular Material version ("+Mj.full+") does not match the Angular CDK version ("+SV.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(I(wV),I(dre,8),I(rt))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Iv],Iv]}),n})();function em(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=Dt(e)}}}function kf(n,e){return class extends n{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const i=t||this.defaultColor;i!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),i&&this._elementRef.nativeElement.classList.add(`mat-${i}`),this._color=i)}}}function Ff(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=Dt(e)}}}function Nf(n,e=0){return class extends n{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?So(t):this.defaultTabIndex}}}function CO(n){return class extends n{constructor(...e){super(...e),this.stateChanges=new we,this.errorState=!1}updateErrorState(){const e=this.errorState,s=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);s!==e&&(this.errorState=s,this.stateChanges.next())}}}try{Lf="undefined"!=typeof Intl}catch(n){Lf=!1}let kv=(()=>{class n{isErrorState(t,i){return!!(t&&t.invalid&&(t.touched||i&&i.submitted))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})();class Ere{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const Tj={enterDuration:225,exitDuration:150},wO=Yg({passive:!0}),Aj=["mousedown","touchstart"],Dj=["mouseup","mouseleave","touchend","touchcancel"];class Oj{constructor(e,t,i,r){this._target=e,this._ngZone=t,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=Hu(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},Tj),i.animation);i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);const o=i.radius||function(n,e,t){const i=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),r=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),a=e-r.left,l=t-r.top,c=s.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=a-o+"px",d.style.top=l-o+"px",d.style.height=2*o+"px",d.style.width=2*o+"px",null!=i.color&&(d.style.backgroundColor=i.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(d),d.style.transform="scale(1)";const f=new Ere(this,d,i);return f.state=0,this._activeRipples.add(f),i.persistent||(this._mostRecentTransientRipple=f),this._runTimeoutOutsideZone(()=>{const p=f===this._mostRecentTransientRipple;f.state=1,!i.persistent&&(!p||!this._isPointerDown)&&f.fadeOut()},c),f}fadeOutRipple(e){const t=this._activeRipples.delete(e);if(e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!t)return;const i=e.element,r=Object.assign(Object.assign({},Tj),e.config.animation);i.style.transitionDuration=`${r.exitDuration}ms`,i.style.opacity="0",e.state=2,this._runTimeoutOutsideZone(()=>{e.state=3,i.parentNode.removeChild(i)},r.exitDuration)}fadeOutAll(){this._activeRipples.forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Hu(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(Aj))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(Dj),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=hV(e),i=this._lastTouchStartEvent&&Date.now(){!e.config.persistent&&(1===e.state||e.config.terminateOnPointerUp&&0===e.state)&&e.fadeOut()}))}_runTimeoutOutsideZone(e,t=0){this._ngZone.runOutsideAngular(()=>setTimeout(e,t))}_registerEvents(e){this._ngZone.runOutsideAngular(()=>{e.forEach(t=>{this._triggerElement.addEventListener(t,this,wO)})})}_removeTriggerEvents(){this._triggerElement&&(Aj.forEach(e=>{this._triggerElement.removeEventListener(e,this,wO)}),this._pointerUpEventsRegistered&&Dj.forEach(e=>{this._triggerElement.removeEventListener(e,this,wO)}))}}const Ij=new _e("mat-ripple-global-options");let Qo=(()=>{class n{constructor(t,i,r,s,o){this._elementRef=t,this._animationMode=o,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=s||{},this._rippleRenderer=new Oj(this,i,t,r)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,i=0,r){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,i,Object.assign(Object.assign({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(lt),E(ii),E(Ij,8),E(Zo,8))},n.\u0275dir=he({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&at("mat-ripple-unbounded",i.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),n})(),ec=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn,Av],Nn]}),n})(),Tre=(()=>{class n{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return n.\u0275fac=function(t){return new(t||n)(E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,i){2&t&&at("mat-pseudo-checkbox-indeterminate","indeterminate"===i.state)("mat-pseudo-checkbox-checked","checked"===i.state)("mat-pseudo-checkbox-disabled",i.disabled)("_mat-animation-noopable","NoopAnimations"===i._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,i){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),n})(),Are=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn]]}),n})();const $E=new _e("MAT_OPTION_PARENT_COMPONENT"),Dre=em(class{});let Ore=0,Pj=(()=>{class n extends Dre{constructor(t){var i;super(),this._labelId="mat-optgroup-label-"+Ore++,this._inert=null!==(i=null==t?void 0:t.inertGroups)&&void 0!==i&&i}}return n.\u0275fac=function(t){return new(t||n)(E($E,8))},n.\u0275dir=he({type:n,inputs:{label:"label"},features:[ht]}),n})();const GE=new _e("MatOptgroup");let Ire=0;class Rj{constructor(e,t=!1){this.source=e,this.isUserInput=t}}let Pre=(()=>{class n{constructor(t,i,r,s){this._element=t,this._changeDetectorRef=i,this._parent=r,this.group=s,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+Ire++,this.onSelectionChange=new Pe,this._stateChanges=new we}get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(t){this._disabled=Dt(t)}get disableRipple(){return this._parent&&this._parent.disableRipple}get active(){return this._active}get viewValue(){return(this._getHostElement().textContent||"").trim()}select(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}deselect(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}focus(t,i){const r=this._getHostElement();"function"==typeof r.focus&&r.focus(i)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!Yo(t)&&(this._selectViaInteraction(),t.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getAriaSelected(){return this.selected||!this.multiple&&null}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){const t=this.viewValue;t!==this._mostRecentViewValue&&(this._mostRecentViewValue=t,this._stateChanges.next())}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(t=!1){this.onSelectionChange.emit(new Rj(this,t))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(void 0),E(Pj))},n.\u0275dir=he({type:n,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),n})(),WE=(()=>{class n extends Pre{constructor(t,i,r,s){super(t,i,r,s)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E($E,8),E(GE,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,i){1&t&&ye("click",function(){return i._selectViaInteraction()})("keydown",function(s){return i._handleKeydown(s)}),2&t&&(sl("id",i.id),en("tabindex",i._getTabIndex())("aria-selected",i._getAriaSelected())("aria-disabled",i.disabled.toString()),at("mat-selected",i.selected)("mat-option-multiple",i.multiple)("mat-active",i.active)("mat-option-disabled",i.disabled))},exportAs:["matOption"],features:[ht],ngContentSelectors:cre,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(t,i){1&t&&(Dr(),Ct(0,are,1,2,"mat-pseudo-checkbox",0),F(1,"span",1),In(2),N(),Ct(3,lre,2,1,"span",2),et(4,"div",3)),2&t&&(ie("ngIf",i.multiple),Y(3),ie("ngIf",i.group&&i.group._inert),Y(1),ie("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},directives:[Is,Qo,Tre],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),n})();function EO(n,e,t){if(t.length){let i=e.toArray(),r=t.toArray(),s=0;for(let o=0;o{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,bn,Nn,Are]]}),n})();function zc(n,e,t,i){return ft(t)&&(i=t,t=void 0),i?zc(n,e,t).pipe(be(r=>Fe(r)?i(...r):i(r))):new oe(r=>{Fj(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function Fj(n,e,t,i,r){let s;if(function(n){return n&&"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener}(n)){const o=n;n.addEventListener(e,t,r),s=()=>o.removeEventListener(e,t,r)}else if(function(n){return n&&"function"==typeof n.on&&"function"==typeof n.off}(n)){const o=n;n.on(e,t),s=()=>o.off(e,t)}else if(function(n){return n&&"function"==typeof n.addListener&&"function"==typeof n.removeListener}(n)){const o=n;n.addListener(e,t),s=()=>o.removeListener(e,t)}else{if(!n||!n.length)throw new TypeError("Invalid event target");for(let o=0,a=n.length;oYE(n,t,e)):t=>YE(n,t)}const Lre=["underline"],Bre=["connectionContainer"],Vre=["inputContainer"],jre=["label"];function Ure(n,e){1&n&&(ff(0),F(1,"div",14),et(2,"div",15),et(3,"div",16),et(4,"div",17),N(),F(5,"div",18),et(6,"div",15),et(7,"div",16),et(8,"div",17),N(),pf())}function zre(n,e){1&n&&(F(0,"div",19),In(1,1),N())}function Hre(n,e){if(1&n&&(ff(0),In(1,2),F(2,"span"),Te(3),N(),pf()),2&n){const t=bt(2);Y(3),Ai(t._control.placeholder)}}function $re(n,e){1&n&&In(0,3,["*ngSwitchCase","true"])}function Gre(n,e){1&n&&(F(0,"span",23),Te(1," *"),N())}function Wre(n,e){if(1&n){const t=Lr();F(0,"label",20,21),ye("cdkObserveContent",function(){return Vn(t),bt().updateOutlineGap()}),Ct(2,Hre,4,1,"ng-container",12),Ct(3,$re,1,0,"ng-content",12),Ct(4,Gre,2,0,"span",22),N()}if(2&n){const t=bt();at("mat-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-form-field-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-accent","accent"==t.color)("mat-warn","warn"==t.color),ie("cdkObserveContentDisabled","outline"!=t.appearance)("id",t._labelId)("ngSwitch",t._hasLabel()),en("for",t._control.id)("aria-owns",t._control.id),Y(2),ie("ngSwitchCase",!1),Y(1),ie("ngSwitchCase",!0),Y(1),ie("ngIf",!t.hideRequiredMarker&&t._control.required&&!t._control.disabled)}}function qre(n,e){1&n&&(F(0,"div",24),In(1,4),N())}function Yre(n,e){if(1&n&&(F(0,"div",25,26),et(2,"span",27),N()),2&n){const t=bt();Y(2),at("mat-accent","accent"==t.color)("mat-warn","warn"==t.color)}}function Xre(n,e){1&n&&(F(0,"div"),In(1,5),N()),2&n&&ie("@transitionMessages",bt()._subscriptAnimationState)}function Kre(n,e){if(1&n&&(F(0,"div",31),Te(1),N()),2&n){const t=bt(2);ie("id",t._hintLabelId),Y(1),Ai(t.hintLabel)}}function Zre(n,e){if(1&n&&(F(0,"div",28),Ct(1,Kre,2,2,"div",29),In(2,6),et(3,"div",30),In(4,7),N()),2&n){const t=bt();ie("@transitionMessages",t._subscriptAnimationState),Y(1),ie("ngIf",t.hintLabel)}}const Qre=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Jre=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],Nj=new _e("MatError"),tse={transitionMessages:Jl("transitionMessages",[br("enter",Kn({opacity:1,transform:"translateY(0%)"})),Qs("void => enter",[Kn({opacity:0,transform:"translateY(-5px)"}),Mo("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let Nv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n}),n})();const Lj=new _e("MatHint");let Bf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-label"]]}),n})(),ise=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-placeholder"]]}),n})();const Bj=new _e("MatPrefix"),Vj=new _e("MatSuffix");let SO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["","matSuffix",""]],features:[At([{provide:Vj,useExisting:n}])]}),n})(),jj=0;const ose=kf(class{constructor(n){this._elementRef=n}},"primary"),zj=new _e("MAT_FORM_FIELD_DEFAULT_OPTIONS"),XE=new _e("MatFormField");let tm=(()=>{class n extends ose{constructor(t,i,r,s,o,a,l,c){super(t),this._changeDetectorRef=i,this._dir=s,this._defaults=o,this._platform=a,this._ngZone=l,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new we,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+jj++,this._labelId="mat-form-field-label-"+jj++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==c,this.appearance=o&&o.appearance?o.appearance:"legacy",this._hideRequiredMarker=!(!o||null==o.hideRequiredMarker)&&o.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const i=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&i!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Dt(t)}_shouldAlwaysFloat(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}_canLabelFloat(){return"never"!==this.floatLabel}get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}get floatLabel(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}get _control(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic}set _control(t){this._explicitFormFieldControl=t}getLabelId(){return this._hasFloatingLabel()?this._labelId:null}getConnectedOverlayOrigin(){return this._connectionContainerRef||this._elementRef}ngAfterContentInit(){this._validateControlChild();const t=this._control;t.controlType&&this._elementRef.nativeElement.classList.add(`mat-form-field-type-${t.controlType}`),t.stateChanges.pipe(ns(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(zn(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(zn(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),ki(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(ns(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(ns(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(zn(this._destroyed)).subscribe(()=>{"function"==typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this.updateOutlineGap())}):this.updateOutlineGap()})}ngAfterContentChecked(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}ngAfterViewInit(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_shouldForward(t){const i=this._control?this._control.ngControl:null;return i&&i[t]}_hasPlaceholder(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}_hasLabel(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}_shouldLabelFloat(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_hideControlPlaceholder(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}_hasFloatingLabel(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_animateAndLockLabel(){this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,zc(this._label.nativeElement,"transitionend").pipe(_i(1)).subscribe(()=>{this._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}_validatePlaceholders(){}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_getDefaultFloatLabelState(){return this._defaults&&this._defaults.floatLabel||"auto"}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&t.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const i=this._hintChildren?this._hintChildren.find(s=>"start"===s.align):null,r=this._hintChildren?this._hintChildren.find(s=>"end"===s.align):null;i?t.push(i.id):this._hintLabel&&t.push(this._hintLabelId),r&&t.push(r.id)}else this._errorChildren&&t.push(...this._errorChildren.map(i=>i.id));this._control.setDescribedByIds(t)}}_validateControlChild(){}updateOutlineGap(){const t=this._label?this._label.nativeElement:null;if(!("outline"===this.appearance&&t&&t.children.length&&t.textContent.trim()&&this._platform.isBrowser))return;if(!this._isAttachedToDOM())return void(this._outlineGapCalculationNeededImmediately=!0);let i=0,r=0;const s=this._connectionContainerRef.nativeElement,o=s.querySelectorAll(".mat-form-field-outline-start"),a=s.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const l=s.getBoundingClientRect();if(0===l.width&&0===l.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const c=this._getStartEnd(l),d=t.children,f=this._getStartEnd(d[0].getBoundingClientRect());let p=0;for(let g=0;g0?.75*p+10:0}for(let l=0;l{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn,_E],Nn]}),n})();function Bv(...n){if(1===n.length){const e=n[0];if(Fe(e))return KE(e,null);if(je(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return KE(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return KE(n=1===n.length&&Fe(n[0])?n[0]:n,null).pipe(be(t=>e(...t)))}return KE(n,null)}function KE(n,e){return new oe(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function Sa(n){return function(t){const i=new ase(n),r=t.lift(i);return i.caught=r}}class ase{constructor(e){this.selector=e}call(e,t){return t.subscribe(new lse(e,this.selector,this.caught))}}class lse extends ei{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new $r(this);this.add(i);const r=oo(t,i);r!==i&&this.add(r)}}}class cse{constructor(e){this.callback=e}call(e,t){return t.subscribe(new use(e,this.callback))}}class use extends Rt{constructor(e,t){super(e),this.add(new Ie(t))}}class $j{}class Gj{}class Gu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof Gu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new Gu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof Gu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class dse{encodeKey(e){return Wj(e)}encodeValue(e){return Wj(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const fse=/%(\d[a-f0-9])/gi,pse={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Wj(n){return encodeURIComponent(n).replace(fse,(e,t)=>{var i;return null!==(i=pse[t])&&void 0!==i?i:e})}function qj(n){return`${n}`}class th{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new dse,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new th({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(qj(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(qj(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class gse{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function Yj(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function Xj(n){return"undefined"!=typeof Blob&&n instanceof Blob}function Kj(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Vv{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==i?i:null,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new Gu),this.context||(this.context=new gse),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(d=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),d)),new Vv(i,r,o,{params:d,headers:c,context:f,reportProgress:l,responseType:s,withCredentials:a})}}var Ur=(()=>((Ur=Ur||{})[Ur.Sent=0]="Sent",Ur[Ur.UploadProgress=1]="UploadProgress",Ur[Ur.ResponseHeader=2]="ResponseHeader",Ur[Ur.DownloadProgress=3]="DownloadProgress",Ur[Ur.Response=4]="Response",Ur[Ur.User=5]="User",Ur))();class MO{constructor(e,t=200,i="OK"){this.headers=e.headers||new Gu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class xO extends MO{constructor(e={}){super(e),this.type=Ur.ResponseHeader}clone(e={}){return new xO({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class ZE extends MO{constructor(e={}){super(e),this.type=Ur.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new ZE({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class Zj extends MO{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function TO(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let im=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Vv)s=t;else{let l,c;l=r.headers instanceof Gu?r.headers:new Gu(r.headers),r.params&&(c=r.params instanceof th?r.params:new th({fromObject:r.params})),s=new Vv(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=st(s).pipe(function(n,e){return ci(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Vv||"events"===r.observe)return o;const a=o.pipe(Tn(l=>l instanceof ZE));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(be(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(be(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(be(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(be(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new th).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,TO(r,i))}post(t,i,r={}){return this.request("POST",t,TO(r,i))}put(t,i,r={}){return this.request("PUT",t,TO(r,i))}}return n.\u0275fac=function(t){return new(t||n)(I($j))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Qj{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const Jj=new _e("HTTP_INTERCEPTORS");let yse=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const vse=/^\)\]\}',?\n/;let eU=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new oe(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,_)=>r.setRequestHeader(g,_.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,_=r.statusText||"OK",y=new Gu(r.getAllResponseHeaders()),v=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new xO({headers:y,status:g,statusText:_,url:v}),o},l=()=>{let{headers:g,status:_,statusText:y,url:v}=a(),w=null;204!==_&&(w=void 0===r.response?r.responseText:r.response),0===_&&(_=w?200:0);let C=_>=200&&_<300;if("json"===t.responseType&&"string"==typeof w){const x=w;w=w.replace(vse,"");try{w=""!==w?JSON.parse(w):null}catch(L){w=x,C&&(C=!1,w={error:L,text:w})}}C?(i.next(new ZE({body:w,headers:g,status:_,statusText:y,url:v||void 0})),i.complete()):i.error(new Zj({error:w,headers:g,status:_,statusText:y,url:v||void 0}))},c=g=>{const{url:_}=a(),y=new Zj({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:_||void 0});i.error(y)};let d=!1;const f=g=>{d||(i.next(a()),d=!0);let _={type:Ur.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),"text"===t.responseType&&!!r.responseText&&(_.partialText=r.responseText),i.next(_)},p=g=>{let _={type:Ur.UploadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),i.next(_)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",f),null!==s&&r.upload&&r.upload.addEventListener("progress",p)),r.send(s),i.next({type:Ur.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",f),null!==s&&r.upload&&r.upload.removeEventListener("progress",p)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(I(P3))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const AO=new _e("XSRF_COOKIE_NAME"),DO=new _e("XSRF_HEADER_NAME");class tU{}let Cse=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=b3(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(cl),I(AO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),OO=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(tU),I(DO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),wse=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(Jj,[]);this.chain=i.reduceRight((r,s)=>new Qj(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Gj),I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Ese=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:OO,useClass:yse}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:AO,useValue:t.cookieName}:[],t.headerName?{provide:DO,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[OO,{provide:Jj,useExisting:OO,multi:!0},{provide:tU,useClass:Cse},{provide:AO,useValue:"XSRF-TOKEN"},{provide:DO,useValue:"X-XSRF-TOKEN"}]}),n})(),nU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[im,{provide:$j,useClass:wse},eU,{provide:Gj,useExisting:eU}],imports:[[Ese.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const Sse=["*"];function iU(n){return Error(`Unable to find icon with the name "${n}"`)}function rU(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function sU(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class Vf{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let jv=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new Vf(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(on.HTML,r);if(!o)throw sU(r);return this._addSvgIconConfig(t,i,new Vf("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new Vf(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(on.HTML,i);if(!s)throw sU(i);return this._addSvgIconSetConfig(t,new Vf("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(on.RESOURCE_URL,t);if(!i)throw rU(t);const r=this._cachedIconsByUrl.get(i);return r?st(QE(r)):this._loadSvgIconFromConfig(new Vf(t,null)).pipe(Di(s=>this._cachedIconsByUrl.set(i,s)),be(s=>QE(s)))}getNamedSvgIcon(t,i=""){const r=oU(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):zg(iU(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?st(QE(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(be(i=>QE(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?st(r):Bv(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(Sa(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(on.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),st(null)})))).pipe(be(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw iU(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Di(i=>t.svgText=i),be(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?st(null):this._fetchIcon(t).pipe(Di(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new cse(n))}(()=>this._inProgressUrlFetches.delete(a)),Vs());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(oU(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),aU=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Pse=aU.map(n=>`[${n}]`).join(", "),Rse=/^url\(['"]?#(.*?)['"]?\)$/;let Rs=(()=>{class n extends Ase{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=Ie.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=Dt(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){const i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(Pse),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(Rse):null;if(c){let d=r.get(a);d||(d=[],r.set(a,d)),d.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(_i(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(jv),fs("aria-hidden"),E(Dse),E(Uo))},n.\u0275cmp=Le({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(en("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),at("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[ht],ngContentSelectors:Sse,decls:1,vars:0,template:function(t,i){1&t&&(Dr(),In(0))},styles:[".mat-icon{background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],encapsulation:2,changeDetection:0}),n})(),Pr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn],Nn]}),n})();new class extends Zl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let Lse=1;const Bse=Promise.resolve(),JE={};function lU(n){return n in JE&&(delete JE[n],!0)}const cU={setImmediate(n){const e=Lse++;return JE[e]=!0,Bse.then(()=>lU(e)&&n()),e},clearImmediate(n){lU(n)}};new class extends Zl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=cU.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cU.clearImmediate(t),e.scheduled=void 0)}});function Uv(n){return!!n&&(n instanceof oe||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class Hse{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new $se(e,this.durationSelector))}}class $se extends ei{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=oo(t,new $r(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function IO(n){return!Fe(n)&&n-parseFloat(n)+1>=0}function Wse(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function eS(n,e=Tf){return function(n){return function(t){return t.lift(new Hse(n))}}(()=>function(n=0,e,t){let i=-1;return IO(e)?i=Number(e)<1?1:Number(e):Ln(e)&&(t=e),Ln(t)||(t=Tf),new oe(r=>{const s=IO(n)?n:+n-t.now();return t.schedule(Wse,s,{index:0,period:i,subscriber:r})})}(n,e))}function Hc(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new Hg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}class uU{constructor(e=!1,t,i=!0){this._multiple=e,this._emitChanges=i,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new we,t&&t.length&&(e?t.forEach(r=>this._markSelected(r)):this._markSelected(t[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...e){this._verifyValueAssignment(e),e.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...e){this._verifyValueAssignment(e),e.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(e){this.isSelected(e)?this.deselect(e):this.select(e)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(e){return this._selection.has(e)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(e){this._multiple&&this.selected&&this._selected.sort(e)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(e){this.isSelected(e)||(this._multiple||this._unmarkAll(),this._selection.add(e),this._emitChanges&&this._selectedToEmit.push(e))}_unmarkSelected(e){this.isSelected(e)&&(this._selection.delete(e),this._emitChanges&&this._deselectedToEmit.push(e))}_unmarkAll(){this.isEmpty()||this._selection.forEach(e=>this._unmarkSelected(e))}_verifyValueAssignment(e){}}let tS=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})(),rm=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new we,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new oe(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(eS(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):st()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Tn(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=Hu(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>zc(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(ii),I(rt,8))},n.\u0275prov=ae({factory:function(){return new n(I(lt),I(ii),I(rt,8))},token:n,providedIn:"root"}),n})(),jf=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new we,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){const t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){const t=this.getViewportScrollPosition(),{width:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(eS(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt),I(rt,8))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt),I(rt,8))},token:n,providedIn:"root"}),n})(),zv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),gU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Iv,Av,zv],Iv,zv]}),n})();class PO{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class sm extends PO{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Uf extends PO{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class uoe extends PO{constructor(e){super(),this.element=e instanceof nt?e.nativeElement:e}}class nS{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof sm?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Uf?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof uoe?(this._attachedPortal=e,this.attachDomPortal(e)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class doe extends nS{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let zf=(()=>{class n extends nS{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new Pe,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedPortal=null,this._attachedRef=null}attachComponentPortal(t){t.setAttachedHost(this);const i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(E(ol),E(es),E(rt))},n.\u0275dir=he({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ht]}),n})(),iS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function _U(n,e=!1){return t=>t.lift(new hoe(n,e))}class hoe{constructor(e,t){this.predicate=e,this.inclusive=t}call(e,t){return t.subscribe(new foe(e,this.predicate,this.inclusive))}}class foe extends Rt{constructor(e,t,i){super(e),this.predicate=t,this.inclusive=i,this.index=0}_next(e){const t=this.destination;let i;try{i=this.predicate(e,this.index++)}catch(r){return void t.error(r)}this.nextOrComplete(e,i)}nextOrComplete(e,t){const i=this.destination;Boolean(t)?i.next(e):(this.inclusive&&i.next(e),i.complete())}}const yU=J3();class poe{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=jr(-this._previousScrollPosition.left),e.style.top=jr(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),yU&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),yU&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class goe{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class vU{enable(){}disable(){}attach(){}}function RO(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function bU(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class moe{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:r}=this._viewportRuler.getViewportSize();RO(t,[{width:i,height:r,bottom:r,right:i,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let _oe=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new vU,this.close=o=>new goe(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new poe(this._viewportRuler,this._document),this.reposition=o=>new moe(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(I(rm),I(jf),I(lt),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rm),I(jf),I(lt),I(rt))},token:n,providedIn:"root"}),n})();class Hv{constructor(e){if(this.scrollStrategy=new vU,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class yoe{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class voe{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let CU=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})(),boe=(()=>{class n extends CU{constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);break}}}add(t){super.add(t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})(),Coe=(()=>{class n extends CU{constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Df(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(rt),I(ii))},token:n,providedIn:"root"}),n})();const nh="undefined"!=typeof window?window:{},wU=void 0!==nh.__karma__&&!!nh.__karma__||void 0!==nh.jasmine&&!!nh.jasmine||void 0!==nh.jest&&!!nh.jest||void 0!==nh.Mocha&&!!nh.Mocha;let om=(()=>{class n{constructor(t,i){this._platform=i,this._document=t}ngOnDestroy(){const t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||wU){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(d),this._keydownEvents=new we,this._outsidePointerEvents=new we,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this.hasAttached()&&this.updatePosition()}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,e&&this._detachments.next(),this._detachments.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=jr(this._config.width),e.height=jr(this._config.height),e.minWidth=jr(this._config.minWidth),e.minHeight=jr(this._config.minHeight),e.maxWidth=jr(this._config.maxWidth),e.maxHeight=jr(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;mE(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(zn(ki(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._previousHostParent.removeChild(this._host)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const EU="cdk-overlay-connected-position-bounding-box",Eoe=/([A-Za-z%]+)$/;class SU{constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new we,this._resizeSubscription=Ie.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(EU),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();const e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Hf(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(EU),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();const e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=xU(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,_=this._subtractOverflows(s.width,0-o,o+s.width-i.width),y=this._subtractOverflows(s.height,p,g),v=_*y;return{visibleArea:v,isCompletelyWithinViewport:s.width*s.height===v,fitsInViewportVertically:y===s.height,fitsInViewportHorizontally:_==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=MU(this._overlayRef.getConfig().minHeight),a=MU(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=xU(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let d=0,f=0;return d=r.width<=s.width?c||-o:e.x_&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-_/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,d=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)f=e.x,d=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),_=this._lastBoundingBoxSize.width;d=2*g,f=e.x-g,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(f=e.x-_/2)}return{top:o,left:f,bottom:a,right:p,width:d,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=jr(i.height),r.top=jr(i.top),r.bottom=jr(i.bottom),r.width=jr(i.width),r.left=jr(i.left),r.right=jr(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=jr(s)),o&&(r.maxWidth=jr(o))}this._lastBoundingBoxSize=i,Hf(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Hf(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Hf(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const d=this._viewportRuler.getViewportScrollPosition();Hf(i,this._getExactOverlayY(t,e,d)),Hf(i,this._getExactOverlayX(t,e,d))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=jr(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=jr(o.maxWidth):s&&(i.maxWidth="")),Hf(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=jr(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=jr(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:bU(e,i),isOriginOutsideView:RO(e,i),isOverlayClipped:bU(t,i),isOverlayOutsideView:RO(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&mE(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof nt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function Hf(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function MU(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(Eoe);return t&&"px"!==t?null:parseFloat(e)}return n||null}function xU(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class Soe{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new SU(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new yoe(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const TU="cdk-global-overlay-wrapper";class Moe{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(TU),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?t.justifyContent="flex-start":"center"===this._justifyContent?t.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?t.justifyContent="flex-end":"flex-end"===this._justifyContent&&(t.justifyContent="flex-start"):t.justifyContent=this._justifyContent,t.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(TU),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let xoe=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new Moe}connectedTo(t,i,r){return new Soe(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new SU(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(I(jf),I(rt),I(ii),I(om))},n.\u0275prov=ae({factory:function(){return new n(I(jf),I(rt),I(ii),I(om))},token:n,providedIn:"root"}),n})(),Toe=0,Jo=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=d,this._location=f,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new Hv(t);return o.direction=o.direction||this._directionality.value,new woe(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+Toe++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Yd)),new doe(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(I(_oe),I(om),I(ol),I(xoe),I(boe),I(Tt),I(lt),I(rt),I(Ko),I(Ug),I(Coe))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Aoe=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],AU=new _e("cdk-connected-overlay-scroll-strategy");let Doe=(()=>{class n{constructor(t){this.elementRef=t}}return n.\u0275fac=function(t){return new(t||n)(E(nt))},n.\u0275dir=he({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),n})(),DU=(()=>{class n{constructor(t,i,r,s,o){this._overlay=t,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=Ie.EMPTY,this._attachSubscription=Ie.EMPTY,this._detachSubscription=Ie.EMPTY,this._positionSubscription=Ie.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Pe,this.positionChange=new Pe,this.attach=new Pe,this.detach=new Pe,this.overlayKeydown=new Pe,this.overlayOutsideClick=new Pe,this._templatePortal=new Uf(i,r),this._scrollStrategyFactory=s,this.scrollStrategy=this._scrollStrategyFactory()}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}get hasBackdrop(){return this._hasBackdrop}set hasBackdrop(t){this._hasBackdrop=Dt(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=Dt(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=Dt(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=Dt(t)}get push(){return this._push}set push(t){this._push=Dt(t)}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this._attachOverlay():this._detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Aoe);const t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=t.detachments().subscribe(()=>this.detach.emit()),t.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),27===i.keyCode&&!this.disableClose&&!Yo(i)&&(i.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{this.overlayOutsideClick.next(i)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),i=new Hv({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(i.width=this.width),(this.height||0===this.height)&&(i.height=this.height),(this.minWidth||0===this.minWidth)&&(i.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(t){const i=this.positions.map(r=>({originX:r.originX,originY:r.originY,overlayX:r.overlayX,overlayY:r.overlayY,offsetX:r.offsetX||this.offsetX,offsetY:r.offsetY||this.offsetY,panelClass:r.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const t=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(t),t}_attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(t=>{this.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(_U(()=>this.positionChange.observers.length>0)).subscribe(t=>{this.positionChange.emit(t),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()}))}_detachOverlay(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Xs),E(es),E(AU),E(Ko,8))},n.\u0275dir=he({type:n,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[qn]}),n})();const Ioe={provide:AU,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};let $v=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[Jo,Ioe],imports:[[Iv,iS,gU],gU]}),n})();const OU=["mat-button",""],IU=["*"],Roe=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],koe=kf(em(Ff(class{constructor(n){this._elementRef=n}})));let $f=(()=>{class n extends koe{constructor(t,i,r){super(t),this._focusMonitor=i,this._animationMode=r,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const s of Roe)this._hasHostAttributes(s)&&this._getHostElement().classList.add(s);t.nativeElement.classList.add("mat-button-base"),this.isRoundButton&&(this.color="accent")}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}focus(t,i){t?this._focusMonitor.focusVia(this._getHostElement(),t,i):this._getHostElement().focus(i)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(i=>this._getHostElement().hasAttribute(i))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-icon-button",""],["button","mat-fab",""],["button","mat-mini-fab",""],["button","mat-stroked-button",""],["button","mat-flat-button",""]],viewQuery:function(t,i){if(1&t&&ni(Qo,5),2&t){let r;Mt(r=xt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,i){2&t&&(en("disabled",i.disabled||null),at("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-button-disabled",i.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[ht],attrs:OU,ngContentSelectors:IU,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,i){1&t&&(Dr(),F(0,"span",0),In(1),N(),et(2,"span",1),et(3,"span",2)),2&t&&(Y(2),at("mat-button-ripple-round",i.isRoundButton||i.isIconButton),ie("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",i.isIconButton)("matRippleTrigger",i._getHostElement()))},directives:[Qo],styles:[".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:.04}@media(hover: none){.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-icon-button,.mat-stroked-button,.mat-flat-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-button.mat-button-disabled,.mat-icon-button.mat-button-disabled,.mat-stroked-button.mat-button-disabled,.mat-flat-button.mat-button-disabled{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button.mat-button-disabled{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}._mat-animation-noopable.mat-raised-button{transition:none;animation:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-ripple.mat-ripple,.mat-stroked-button .mat-button-focus-overlay{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab.mat-button-disabled{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-fab{transition:none;animation:none}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab.mat-button-disabled{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-mini-fab{transition:none;animation:none}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button i,.mat-icon-button .mat-icon{line-height:24px}.mat-button-ripple.mat-ripple,.mat-button-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1),background-color 200ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n"],encapsulation:2,changeDetection:0}),n})(),Gf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn],Nn]}),n})();class RU extends Rt{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class Foe extends Rt{constructor(e,t,i){super(),this.parent=e,this.outerValue=t,this.outerIndex=i,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function kU(n,e,t,i,r=new Foe(n,t,i)){if(!r.closed)return e instanceof oe?e.subscribe(r):Pi(e)(r)}const FU={};function or(...n){let e,t;return Ln(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&Fe(n[0])&&(n=n[0]),Ba(n,t).lift(new NU(e))}class NU{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Noe(e,this.resultSelector))}}class Noe extends RU{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(FU),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i{class n{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):Boe}matchMedia(t){return this._platform.WEBKIT&&function(n){if(!LU.has(n))try{am||(am=document.createElement("style"),am.setAttribute("type","text/css"),document.head.appendChild(am)),am.sheet&&(am.sheet.insertRule(`@media ${n} {.fx-query-test{ }}`,0),LU.add(n))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return n.\u0275fac=function(t){return new(t||n)(I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(ii))},token:n,providedIn:"root"}),n})();function Boe(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let kO=(()=>{class n{constructor(t,i){this._mediaMatcher=t,this._zone=i,this._queries=new Map,this._destroySubject=new we}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return VU(mE(t)).some(r=>this._registerQuery(r).mql.matches)}observe(t){let s=or(VU(mE(t)).map(o=>this._registerQuery(o).observable));return s=YE(s.pipe(_i(1)),s.pipe(VD(1),$g(0))),s.pipe(be(o=>{const a={matches:!1,breakpoints:{}};return o.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const i=this._mediaMatcher.matchMedia(t),s={observable:new oe(o=>{const a=l=>this._zone.run(()=>o.next(l));return i.addListener(a),()=>{i.removeListener(a)}}).pipe(ns(i),be(({matches:o})=>({query:t,matches:o})),zn(this._destroySubject)),mql:i};return this._queries.set(t,s),s}}return n.\u0275fac=function(t){return new(t||n)(I(BU),I(lt))},n.\u0275prov=ae({factory:function(){return new n(I(BU),I(lt))},token:n,providedIn:"root"}),n})();function VU(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}function Voe(n,e){if(1&n){const t=Lr();F(0,"div",1),F(1,"button",2),ye("click",function(){return Vn(t),bt().action()}),Te(2),N(),N()}if(2&n){const t=bt();Y(2),Ai(t.data.action)}}function joe(n,e){}const FO=new _e("MatSnackBarData");class rS{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const Uoe=Math.pow(2,31)-1;class NO{constructor(e,t){this._overlayRef=t,this._afterDismissed=new we,this._afterOpened=new we,this._onAction=new we,this._dismissedByAction=!1,this.containerInstance=e,this.onAction().subscribe(()=>this.dismiss()),e._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,Uoe))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}let zoe=(()=>{class n{constructor(t,i){this.snackBarRef=t,this.data=i}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return n.\u0275fac=function(t){return new(t||n)(E(NO),E(FO))},n.\u0275cmp=Le({type:n,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-simple-snackbar"],decls:3,vars:2,consts:[["class","mat-simple-snackbar-action",4,"ngIf"],[1,"mat-simple-snackbar-action"],["mat-button","",3,"click"]],template:function(t,i){1&t&&(F(0,"span"),Te(1),N(),Ct(2,Voe,3,1,"div",0)),2&t&&(Y(1),Ai(i.data.message),Y(1),ie("ngIf",i.hasAction))},directives:[Is,$f],styles:[".mat-simple-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.mat-simple-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.mat-simple-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .mat-simple-snackbar-action{margin-left:-8px;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),n})();const Hoe={snackBarState:Jl("state",[br("void, hidden",Kn({transform:"scale(0.8)",opacity:0})),br("visible",Kn({transform:"scale(1)",opacity:1})),Qs("* => visible",Mo("150ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void, * => hidden",Mo("75ms cubic-bezier(0.4, 0.0, 1, 1)",Kn({opacity:0})))])};let $oe=(()=>{class n extends nS{constructor(t,i,r,s,o){super(),this._ngZone=t,this._elementRef=i,this._changeDetectorRef=r,this._platform=s,this.snackBarConfig=o,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new we,this._onExit=new we,this._onEnter=new we,this._animationState="void",this.attachDomPortal=a=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(a)),this._live="assertive"!==o.politeness||o.announcementMessage?"off"===o.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(t)}onAnimationEnd(t){const{fromState:i,toState:r}=t;if(("void"===r&&"void"!==i||"hidden"===r)&&this._completeExit(),"visible"===r){const s=this._onEnter;this._ngZone.run(()=>{s.next(),s.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}ngOnDestroy(){this._destroyed=!0,this._completeExit()}_completeExit(){this._ngZone.onMicrotaskEmpty.pipe(_i(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(r=>t.classList.add(r)):t.classList.add(i)),"center"===this.snackBarConfig.horizontalPosition&&t.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&t.classList.add("mat-snack-bar-top")}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),i=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&i){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(r=document.activeElement),t.removeAttribute("aria-hidden"),i.appendChild(t),null==r||r.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return n.\u0275fac=function(t){return new(t||n)(E(lt),E(nt),E(Un),E(ii),E(rS))},n.\u0275cmp=Le({type:n,selectors:[["snack-bar-container"]],viewQuery:function(t,i){if(1&t&&ni(zf,7),2&t){let r;Mt(r=xt())&&(i._portalOutlet=r.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,i){1&t&&qy("@state.done",function(s){return i.onAnimationEnd(s)}),2&t&&Sg("@state",i._animationState)},features:[ht],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,i){1&t&&(F(0,"div",0),Ct(1,joe,0,0,"ng-template",1),N(),et(2,"div")),2&t&&(Y(2),en("aria-live",i._live)("role",i._role))},directives:[zf],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[Hoe.snackBarState]}}),n})(),UU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[$v,iS,bn,Gf,Nn],Nn]}),n})();const zU=new _e("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new rS}});let Woe=(()=>{class n{constructor(t,i,r,s,o,a){this._overlay=t,this._live=i,this._injector=r,this._breakpointObserver=s,this._parentSnackBar=o,this._defaultConfig=a,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=zoe,this.snackBarContainerComponent=$oe,this.handsetCssClass="mat-snack-bar-handset"}get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}openFromComponent(t,i){return this._attach(t,i)}openFromTemplate(t,i){return this._attach(t,i)}open(t,i="",r){const s=Object.assign(Object.assign({},this._defaultConfig),r);return s.data={message:t,action:i},s.announcementMessage===t&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,i){const s=Tt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:rS,useValue:i}]}),o=new sm(this.snackBarContainerComponent,i.viewContainerRef,s),a=t.attach(o);return a.instance.snackBarConfig=i,a.instance}_attach(t,i){const r=Object.assign(Object.assign(Object.assign({},new rS),this._defaultConfig),i),s=this._createOverlay(r),o=this._attachSnackBarContainer(s,r),a=new NO(o,s);if(t instanceof Xs){const l=new Uf(t,null,{$implicit:r.data,snackBarRef:a});a.instance=o.attachTemplatePortal(l)}else{const l=this._createInjector(r,a),c=new sm(t,void 0,l),d=o.attachComponentPortal(c);a.instance=d.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(zn(s.detachments())).subscribe(l=>{const c=s.overlayElement.classList;l.matches?c.add(this.handsetCssClass):c.remove(this.handsetCssClass)}),r.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(a,r),this._openedSnackBarRef=a,this._openedSnackBarRef}_animateSnackBar(t,i){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),i.duration&&i.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(i.duration))}_createOverlay(t){const i=new Hv;i.direction=t.direction;let r=this._overlay.position().global();const s="rtl"===t.direction,o="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!s||"end"===t.horizontalPosition&&s,a=!o&&"center"!==t.horizontalPosition;return o?r.left("0"):a?r.right("0"):r.centerHorizontally(),"top"===t.verticalPosition?r.top("0"):r.bottom("0"),i.positionStrategy=r,this._overlay.create(i)}_createInjector(t,i){return Tt.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:NO,useValue:i},{provide:FO,useValue:t.data}]})}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(wE),I(Tt),I(kO),I(n,12),I(zU))},n.\u0275prov=ae({factory:function(){return new n(I(Jo),I(wE),I(ku),I(kO),I(n,12),I(zU))},token:n,providedIn:UU}),n})();function De(n,e,t,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function bs(n,e){return function(t,i){e(t,i,n)}}function Ge(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function gl(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function WU(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function BO(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||WU()}const qU="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",oS=BO();class Koe{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function VO(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const YU={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function XU(n){return"string"==typeof n?YU[n.toUpperCase()]||YU.WHITE:n}function aS(n,e){if(!n)throw new Error(e||"Assertion failed")}const tc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},Gv=tc.window||tc.self||tc.global,KU=tc.process||{};function lm(){let n;if(oS&&Gv.performance)n=Gv.performance.now();else if(KU.hrtime){const e=KU.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const cm={debug:oS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},iae={enabled:!0,level:0};function ml(){}const ZU={},QU={once:!0};function rae(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let jO=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=qU,this._startTs=lm(),this._deltaTs=lm(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Koe("__probe-".concat(this.id,"__"),iae),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((lm()-this._startTs).toPrecision(10))}getDelta(){return Number((lm()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){aS(t,i)}warn(t){return this._getLogFunction(0,t,cm.warn,arguments,QU)}error(t){return this._getLogFunction(0,t,cm.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,cm.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,cm.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,cm.debug||cm.info,arguments,QU)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||ml,r&&[r],{tag:rae(i)}):ml}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?oS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=VO(r,e,t);console.log(...s)},r.src=n,ml}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...VO(n,e,t)),ml;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...VO(r,e,t)),r.src=n.toDataURL(),ml}return ml}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=Ve(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):ml}({image:r,message:s,scale:o}):ml}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||ml)}group(t,i,r={collapsed:!1}){r=ez({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ml)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=JU(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=ez({logLevel:t,message:i,args:s,opts:o}),aS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=lm();const a=o.tag||o.message;if(o.once){if(ZU[a])return ml;ZU[a]=lm()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!oS&&"string"==typeof n&&(e&&(e=XU(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=XU(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return ml}}return n.VERSION=qU,n})();function JU(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return aS(Number.isFinite(e)&&e>=0),e}function ez(n){const{logLevel:e,message:t}=n;n.logLevel=JU(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return aS("string"===r||"object"===r),Object.assign(n,n.opts)}const Zn=new jO({id:"deck"}),Hn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Hn,"IDENTITY",{get:()=>Zn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const $c={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},tz={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},ct=new jO({id:"luma.gl"});function xo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function lS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Mn(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function cS(n){return xo(lS(n),"Invalid WebGLRenderingContext"),n}function To(n){return xo(Mn(n),"Requires WebGL2"),n}var Zi=Ve(761);const Wv={};const qv=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Zi.CO.console&&Zi.CO.console.log&&Zi.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Wf.prototype.VERTEX_ARRAY_BINDING_OES=34229,Wf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iMn(n)?void 0:0,Mae={3074:n=>Mn(n)?void 0:36064,35723:n=>Mn(n)?void 0:4352,35977:Li,32937:Li,36795:(n,e)=>{const t=Mn(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(rz);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(rz);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:Li,35071:Li,37447:Li,36063:(n,e)=>{if(!Mn(n)){const t=n.getExtension(iz);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Li,35374:Li,35377:Li,34852:n=>{if(!Mn(n)){const e=n.getExtension(iz);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(nz)?2147483647:65535,33001:n=>n.getExtension(nz)?16777216:65535,33e3:n=>16777216,37157:Li,35373:Li,35657:Li,36183:Li,37137:Li,34045:Li,35978:Li,35979:Li,35968:Li,35376:Li,35375:Li,35659:Li,37154:Li,35371:Li,35658:Li,35076:Li,35077:Li,35380:Li},sz="ANGLE_instanced_arrays",oz={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{xo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[sz]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){xo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{xo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{xo(!1)},deleteQuery:()=>{xo(!1)},beginQuery:()=>{xo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},UO={readBuffer:(n,e,t)=>{Mn(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Mn(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!Mn(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Mn(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=Mae[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function Bae(n,{extension:e,target:t,target2:i}){const r=oz[e];xo(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new Wf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&Bae(n,{extension:t,target:n.luma,target2:n})}(n,oz),function(n,{target:e,target2:t}){Object.keys(UO).forEach(i=>{if("function"==typeof UO[i]){const r=n[i]?n[i].bind(n):()=>{},s=UO[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const zO={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ih=(n,e,t)=>e?n.enable(t):n.disable(t),az=(n,e,t)=>n.hint(t,e),Ma=(n,e,t)=>n.pixelStorei(t,e);function Yv(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Uae={3042:ih,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:ih,2885:(n,e)=>n.cullFace(e),2929:ih,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:ih,35723:az,36006:(n,e)=>{const t=Mn(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:az,2849:(n,e)=>n.lineWidth(e),32823:ih,32824:"polygonOffset",10752:"polygonOffset",35977:ih,32938:"sampleCoverage",32939:"sampleCoverage",3089:ih,3088:(n,e)=>n.scissor(...e),2960:ih,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:Ma,3317:Ma,37440:Ma,37441:Ma,37443:Ma,3330:Ma,3332:Ma,3331:Ma,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Ma,32878:Ma,3316:Ma,3315:Ma,32877:Ma,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=Yv(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Yv(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=Yv(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Yv(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=Yv(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Cr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const zae={blendEquation:(n,e,t)=>n.blendEquationSeparate(Cr(32777,e,t),Cr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Cr(32969,e,t),Cr(32968,e,t),Cr(32971,e,t),Cr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Cr(32824,e,t),Cr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Cr(32938,e,t),Cr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Cr(2962,e,t),Cr(2967,e,t),Cr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Cr(34816,e,t),Cr(36003,e,t),Cr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Cr(2964,e,t),Cr(2965,e,t),Cr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Cr(34817,e,t),Cr(34818,e,t),Cr(34819,e,t))},lz={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Gc=(n,e)=>n.isEnabled(e),cz={3042:Gc,2884:Gc,2929:Gc,3024:Gc,32823:Gc,32926:Gc,32928:Gc,3089:Gc,2960:Gc,35977:Gc};function uz(n){for(const e in n)return!1;return!0}function Hae(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||zO)){const r=e,s=cz[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=cz[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},zO),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){xo(this.stateStack.length>0),Wu(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){xo(void 0!==s);const o=e[s],a=this.cache[s];Hae(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function hz(n,e={}){const{enable:t=!0,copyState:i}=e;if(xo(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new Wae(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in lz)$ae(n,o,lz[o]);dz(n,"getParameter"),dz(n,"isEnabled")}return n.state.enable=t,n}function fz(n){xo(n.state),n.state.pop()}function Wu(n,e){if(xo(lS(n),"setParameters requires a WebGL context"),uz(e))return;const t={};for(const r in e){const s=Number(r),o=Uae[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)zae[r](n,e,i)}function nc(n,e,t){if(uz(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||hz(n,{copyState:!1}),n.state.push()}(n),Wu(n,e),i)r=t(n),fz(n);else try{r=t(n)}finally{fz(n)}return r}function um(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function HO(n,e,t=!0){return function(n,e,t,i,r){const s=pz(n[0],e,t);let o=gz(n[1],e,i,r),a=pz(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=gz(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,um(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function pz(n,e,t){return Math.min(Math.round(n*e),t-1)}function gz(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const $O=(0,Zi.jU)(),Qae=$O&&"undefined"!=typeof document,mz={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function _z(n={}){xo($O,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},mz,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(Qae&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=GO(r,n),function(n){const e=Mn(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);ct.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function GO(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},mz,e);const{manageState:t,debug:i}=e;return t&&hz(n,{copyState:!1,log:(...r)=>ct.log(1,...r)()}),$O&&i&&(Zi.CO.makeDebugContext?(n=Zi.CO.makeDebugContext(n,e),ct.level=Math.max(ct.level,1)):ct.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function yz(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class vz{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=yz(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(yz()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class WO{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof vz?e:new vz(t,i)),this.stats[t]}}const Xv="8.5.7",qf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new WO({id:e})),this.stats.get(e)}};if(Zi.CO.luma&&Zi.CO.luma.VERSION!==Xv)throw new Error(`luma.gl - multiple VERSIONs detected: ${Zi.CO.luma.VERSION} vs 8.5.7`);function Qe(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function qO(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return Qe(void 0!==i,`Accessing undefined constant GL.${e}`),i}function rh(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Zi.CO.luma||((0,Zi.jU)()&&ct.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Zi.CO.luma=Zi.CO.luma||{VERSION:Xv,version:Xv,log:ct,stats:qf,globals:{modules:{},nodeIO:{}}});const YO={};function Wc(n="id"){return YO[n]=YO[n]||1,`${n}-${YO[n]++}`}function bz(n){return Qe("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function dm(n){let e=!0;for(const t in n){e=!1;break}return e}function Cz(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw ct.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const hm="Resource subclass must define virtual methods";class qu{constructor(e,t={}){cS(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||Wc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){Qe(e=qO(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Mn(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=Mn(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?rh(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=rh(this.gl,o[f]))}}return o}setParameter(e,t){Qe(e=qO(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Mn(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=qO(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return Cz(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(hm)}_deleteHandle(){throw new Error(hm)}_bindHandle(e){throw new Error(hm)}_getOptsFromHandle(){throw new Error(hm)}_getParameter(e,t){throw new Error(hm)}_setParameter(e,t){throw new Error(hm)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=qf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;qf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=qf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=qf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function XO(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Kv(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function ule({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return ea.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ea.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=KO("Accessor",e,hle)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const Ez={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},fle={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Ez},ple={removedProps:Ez};class Si extends qu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/ea.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ea.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=KO("Buffer",e,fle),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=KO("Buffer",e,ple))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ea(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;Qe(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(To(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return To(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){To(this.gl);const s=Kv(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return Qe((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(Qe(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){Qe(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=XO(e);return Qe(s),this.setAccessor(new ea(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){Qe(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/Kv(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ea(this.accessor,{type:XO(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return ct.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return ct.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return ct.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return ct.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ea(this.accessor,e),this}}const ZO={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},Sz={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},Mz={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},_le=[9729,9728],xz=Zi.CO.WebGLBuffer||function(){};class fm extends qu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=ZO[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Mn(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=ZO[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=Wc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(C=>this.initialize(Object.assign({},e,{pixels:C,data:C}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:y=!1,mipmaps:v=!0}=e;const{depth:w=0}=e;return({width:f,height:p,compressed:y,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:y,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=w,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),v&&this._isNPOT()&&(ct.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),v=!1,this._updateForNPOT(l)),this.mipmaps=v,this.setImageData({data:t,width:f,height:p,depth:w,format:s,type:_,dataFormat:g,border:o,mipmaps:v,parameters:c,compressed:y}),v&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:y}=this;y.bindTexture(this.target,this.handle);let w,v=null;return({data:c,dataType:v}=this._getDataType({data:c,compressed:_})),nc(this.gl,l,()=>{switch(v){case"null":y.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":y.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":w=To(y),w.bindBuffer(35052,c.handle||c),w.texImage2D(t,r,s,f,p,o,g,d,a),w.bindBuffer(35052,null);break;case"browser-object":Mn(y)?y.texImage2D(t,r,s,f,p,o,g,d,c):y.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[C,x]of c.entries())y.compressedTexImage2D(t,C,x.format,x.width,x.height,o,x.data);break;default:Qe(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(Sz[this.dataFormat]||4)*(Mz[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:y={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),Qe(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const v=i;i=v.data,o=v.shape[0],a=v.shape[1]}i instanceof Si&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),nc(this.gl,y,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof xz){const v=To(this.gl);v.bindBuffer(35052,i),v.texSubImage2D(e,l,r,s,o,a,f,d,g),v.bindBuffer(35052,null)}else Mn(this.gl)?To(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return ct.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof Si?{data:e.handle,dataType:"buffer"}:e instanceof xz?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=ZO[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},Qe(r,"Could not deduced texture size"),Qe(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),Qe(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Qe(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Mn(this.gl)||!this.width||!this.height||bz(this.width)&&bz(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===_le.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function yle(n,e){return Qe("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class xa extends fm{static isSupported(e,t){return fm.isSupported(e,t)}constructor(e,t={}){cS(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:yle(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Yf="EXT_color_buffer_float",Tz={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:Yf,bpp:2},33327:{gl2:Yf,bpp:4},34842:{gl2:Yf,bpp:8},33326:{gl2:Yf,bpp:4},33328:{gl2:Yf,bpp:8},34836:{gl2:Yf,bpp:16},35898:{gl2:Yf,bpp:4}};class pm extends qu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Mn(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,Tz)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return Qe(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Mn(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Tz[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const Pz="clear: bad arguments";function JO(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),Qe(0!==o,Pz),nc(n,s,()=>{n.clear(o)})}function Rz(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function un(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){Rz(s,i,r,o,a,"next",l)}function a(l){Rz(s,i,r,o,a,"throw",l)}o(void 0)})}}const eI=[34069,34070,34071,34072,34073,34074];let Mle=(()=>{class n extends fm{constructor(t,i={}){cS(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return un(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(eI.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),eI.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&ct.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((y,v)=>{t&&i?d.texImage2D(g,v,a,t,i,o,a,l,y):d.texImage2D(g,v,a,a,l,y)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=eI,n})();class xle extends fm{static isSupported(e){return Mn(e)}constructor(e,t={}){To(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),nc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof Si&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(Sz[this.dataFormat]||4)*(Mz[this.type]||1),"Texture"),this.loaded=!0,this}}function Ale(n,e){const{gl:t,width:i,height:r,id:s}=n;return new is(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function uS(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof is?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Ale(n),deleteFramebuffer:!0}}(n);Qe(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),Qe(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(Kv(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Qe(!1),0}}(t))}(o,c,r,a,l),c=c||XO(o);const y=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,y||null),f&&d.delete(),o}function tI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=uS(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=ule({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return Qe(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&ct.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){Qe(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof pm)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(is.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&JO(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){To(n),nc(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:Qe(!1,Pz)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return ct.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return ct.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return ct.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return ct.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return ct.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return ct.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=To(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=rh(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?rh(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?rh(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(tI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>ct.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=tI(this,{targetMaxHeight:100});return ct.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new xa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new pm(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new pm(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&Qe(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof pm?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:To(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:Qe(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return Mn(n)?n:null}(this.gl);t?t.readBuffer(e):Qe(36064===e||1029===e,kz),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=To(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):Qe(1===e.length&&(36064===e[0]||1029===e[0]),kz)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in Fz)void 0===n.luma.caps[e]&&(n.luma.caps[e]=Lz(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}is.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const Fz={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new xa(n,{format:6408,type:5126,dataFormat:6408}),t=new is(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function nI(n,e){return Nz(n,e)}function Nz(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>Lz(n,t))}function Lz(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=Fz[e];let i;Qe(t,e);const r=Mn(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:Qe(!1);return i}(n,e)),n.luma.caps[e]||ct.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class iI{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},jle=(Math,1/180*Math.PI),Qi={};function zle(n,{precision:e=Qi.precision||4}={}){return n=function(n){return Math.round(n/Qi.EPSILON)*Qi.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function sh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Yu(n,e,t){if(sh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*jle,void 0)}(n)}function Xf(n,e,t){return Yu(n,i=>Math.max(e,Math.min(t,i)))}function dS(n,e,t){return sh(n)?n.map((i,r)=>dS(i,e[r],t)):t*e+(1-t)*n}function eb(n,e,t){const i=Qi.EPSILON;t&&(Qi.EPSILON=t);try{if(n===e)return!0;if(sh(n)&&sh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+zle(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(Yz.length=n.length,i=Yz):i=qz,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function Kz(n){return n&&n[Symbol.asyncIterator]}function lI(n,e=(()=>!0)){return Array.isArray(n)?Zz(n,e,[]):e(n)?[n]:[]}function Zz(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function Qz(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",J(J(J({},Mce[n.type]),e),n)):null}function Jz(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function e4(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function t4(n){n.push(n.shift())}function uI(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function n4({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=uI(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const w=s;s=(C,x)=>t._normalizeConstant(w(C,x))}const _=p?(w,C)=>s(g,C):(w,C)=>s(g.subarray(w,w+a),C),y=n.getData({length:i}),v=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return cI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===gS||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=gS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wce}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==gS}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const v=f*a+l;for(let w=0;wd?c.set(x,y):(e._normalizeValue(x,w.target,0),Cce({target:c,source:w.target,start:y,count:L}));y+=L*d}else e._normalizeValue(x,c,y),y+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let hI={};function eo(n){Zn.level>0&&hI[n]&&hI[n].call(...arguments)}function Ta(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const i4="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Ace=`#version 300 es\n${i4}`;function r4(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function s4(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Ace:e>300?`#version ${e}\n${i4}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Ta(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class o4 extends qu{static isSupported(e){return Mn(e)}constructor(e,t={}){To(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,dm(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,ct.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof Si?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Pce{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof Si?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Qe(Mn(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new o4(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],Qe(i[s]instanceof Si)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new Si(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function a4(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const ib="vs",Fce={[ib]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},mS="__LUMA_INJECT_DECLARATIONS__",l4=/void\s+main\s*\([^)]*\)\s*\{\n?/,c4=/}\n?[^{}]*$/,pI=[];function u4(n,e,t,i=!1){const r=e===ib;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),pI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(c4,l=>a+l));break;case"fs:#decl":r||(n=n.replace(mS,a));break;case"fs:#main-start":r||(n=n.replace(l4,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(c4,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(mS,""),i&&(n=n.replace(/\}\s*$/,s=>s+Fce[e])),n}function gI(n){const e={};return Ta(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const Nce={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},_S="transform_uSize_",d4="transform_position";const $ce={10241:9728,10240:9728,10242:33071,10243:33071};class Wce{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${_S}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${_S}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=uS(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Ta(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new Si(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new is(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters($ce)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){Qe(n instanceof xa||n instanceof Mle||n instanceof xle);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const y=function(n,e){const t={},i=function(n){return r4(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${_S}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Ta(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(y){const{updatedLine:v,inject:w}=y;f[g]=v,c=gI([c,w]),Object.assign(a,y.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=r4(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){Qe(i);const p=`${_S}${t}`;c=gI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${d4} = transform_getPos(${p});\n gl_Position = vec4(${d4}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=gI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||s4({version:a4(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Nce].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const mI={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function Yce(n){let e=h4(n);return"object"===e?n?"type"in n?Object.assign({},n,mI[n.type]):"value"in n?(e=h4(n.value),Object.assign({type:e},n,mI[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},mI[e])}function h4(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class _I{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Ta("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=Yce(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Ta(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Ta(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Qce(n){return function(n){const e={},t={};return yI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(p4(n))}function yI({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof _I||(Ta("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ta(t.name,"shader module has no name"),(t=new _I(t)).dependencies=p4(t.dependencies)),t))}const vI={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},Kf={};function oue(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(vI).forEach(n=>{Kf[n]=n});const bI={};function g4(n,e,t={}){const i=vI[e];if(Ta(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in bI)return bI[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),bI[e]=l,l}function yS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=vI[e];Ta(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Ta(!1===r||!0===r),r}(n,t))}function mm(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const m4=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],uue=[...m4,[mm("attribute"),"in $1"],[mm("varying"),"out $1"]],due=[...m4,[mm("varying"),"in $1"]],_4=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],hue=[..._4,[mm("in"),"attribute $1"],[mm("out"),"varying $1"]],fue=[..._4,[mm("in"),"varying $1"]],CI="gl_FragColor",wI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,pue=/void\s+main\s*\([^)]*\)\s*\{\n?/;function vS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const yue=`\n\n${mS}\n\n`,y4={[ib]:"vertex",fs:"fragment"};function v4(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Ta("string"==typeof t,"shader source must be a string");const f=i===ib,p=t.split("\n");let g=100,_="",y=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],y=p.slice(1).join("\n")):_=`#version ${g}`;const v={};r.forEach($=>{Object.assign(v,$.getDefines())}),Object.assign(v,s);let w=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${y4[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${y4[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:oue(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return yS(n,Kf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),yS(n,Kf.GLSL_DERIVATIVES)&&g4(n,Kf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),yS(n,Kf.GLSL_FRAG_DATA)&&g4(n,Kf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),yS(n,Kf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(v)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const C=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),x={},L={},U={};for(const $ in a){const ee="string"==typeof a[$]?{injection:a[$],order:0}:a[$],fe=$.match(/^(v|f)s:(#)?([\w-]+)$/);if(fe){const ve=fe[3];fe[2]?"decl"===ve?L[$]=[ee]:U[$]=[ee]:x[$]=[ee]}else U[$]=[ee]}for(const $ of r){d&&$.checkDeprecations(y,d),w+=$.getModuleSource(i,g);const fe=$.injections[i];for(const pe in fe){const ve=pe.match(/^(v|f)s:#([\w-]+)$/);if(ve){const Xe="decl"===ve[2]?L:U;Xe[pe]=Xe[pe]||[],Xe[pe].push(fe[pe])}else x[pe]=x[pe]||[],x[pe].push(fe[pe])}}return w+=yue,w=u4(w,i,L),w+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(C[i],x),w+=y,w=u4(w,i,U),w=function(n,e,t){switch(e){case 300:return t?vS(n,uue):function(n){const e=(n=vS(n,due)).match(wI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${CI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(pue,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${CI}\\b`,"g"),t)}return n}(n);case 100:return t?vS(n,hue):function(n){const e=(n=vS(n,fue)).match(wI);if(e){const t=e[1];n=n.replace(wI,"").replace(new RegExp(`\\b${t}\\b`,"g"),CI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(w,l?100:g,f),w}function Cue(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Tue={5126:Ji.bind(null,"uniform1fv",Aa,1,to),35664:Ji.bind(null,"uniform2fv",Aa,2,to),35665:Ji.bind(null,"uniform3fv",Aa,3,to),35666:Ji.bind(null,"uniform4fv",Aa,4,to),5124:Ji.bind(null,"uniform1iv",oh,1,to),35667:Ji.bind(null,"uniform2iv",oh,2,to),35668:Ji.bind(null,"uniform3iv",oh,3,to),35669:Ji.bind(null,"uniform4iv",oh,4,to),35670:Ji.bind(null,"uniform1iv",oh,1,to),35671:Ji.bind(null,"uniform2iv",oh,2,to),35672:Ji.bind(null,"uniform3iv",oh,3,to),35673:Ji.bind(null,"uniform4iv",oh,4,to),35674:Ji.bind(null,"uniformMatrix2fv",Aa,4,Ku),35675:Ji.bind(null,"uniformMatrix3fv",Aa,9,Ku),35676:Ji.bind(null,"uniformMatrix4fv",Aa,16,Ku),35678:Fs,35680:Fs,5125:Ji.bind(null,"uniform1uiv",bS,1,to),36294:Ji.bind(null,"uniform2uiv",bS,2,to),36295:Ji.bind(null,"uniform3uiv",bS,3,to),36296:Ji.bind(null,"uniform4uiv",bS,4,to),35685:Ji.bind(null,"uniformMatrix2x3fv",Aa,6,Ku),35686:Ji.bind(null,"uniformMatrix2x4fv",Aa,8,Ku),35687:Ji.bind(null,"uniformMatrix3x2fv",Aa,6,Ku),35688:Ji.bind(null,"uniformMatrix3x4fv",Aa,12,Ku),35689:Ji.bind(null,"uniformMatrix4x2fv",Aa,8,Ku),35690:Ji.bind(null,"uniformMatrix4x3fv",Aa,12,Ku),35678:Fs,35680:Fs,35679:Fs,35682:Fs,36289:Fs,36292:Fs,36293:Fs,36298:Fs,36299:Fs,36300:Fs,36303:Fs,36306:Fs,36307:Fs,36308:Fs,36311:Fs},Aue={},Due={},Oue={},b4=[0];function EI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(b4[0]=n,n=b4);const r=n.length;if(r%e&&ct.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Ji(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{Qe(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return S4(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:E4(s,c),warnings:E4(o,c)}}(i,this.source,this.shaderType,this.id);throw ct.error(`GLSL compilation errors in ${r}\n${s}`)(),ct.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class SI extends rb{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class MI extends rb{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const rs=5126,sb=5124,ob=5125,xI={[rs]:[rs,1,"float"],35664:[rs,2,"vec2"],35665:[rs,3,"vec3"],35666:[rs,4,"vec4"],[sb]:[sb,1,"int"],35667:[sb,2,"ivec2"],35668:[sb,3,"ivec3"],35669:[sb,4,"ivec4"],[ob]:[ob,1,"uint"],36294:[ob,2,"uvec2"],36295:[ob,3,"uvec3"],36296:[ob,4,"uvec4"],35670:[rs,1,"bool"],35671:[rs,2,"bvec2"],35672:[rs,3,"bvec3"],35673:[rs,4,"bvec4"],35674:[rs,8,"mat2"],35685:[rs,8,"mat2x3"],35686:[rs,8,"mat2x4"],35675:[rs,12,"mat3"],35687:[rs,12,"mat3x2"],35688:[rs,12,"mat3x4"],35676:[rs,16,"mat4"],35689:[rs,16,"mat4x2"],35690:[rs,16,"mat4x3"]};function O4(n){const e=xI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function I4(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=rs}for(const t in xI){const[i,r,s]=xI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class pde{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!Mn(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=O4(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ea(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=O4(i),l={location:e,name:t,accessor:new ea({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const gde=35981,mde=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class R4 extends qu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",mde),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=gde}=e;return this.hash=t||"",this.vs="string"==typeof i?new SI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new MI(this.gl,{id:`${e.id}-fs`,source:r}):r,Qe(this.vs instanceof SI),Qe(this.fs instanceof MI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(To(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new pde(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:y,samplers:v}){if((y||v)&&(ct.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(y||{})),ct.priority>=e){const w=g?g.id:"default",C=`mode=${rh(this.gl,t)} verts=${i} instances=${c} indexType=${rh(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${w}`;ct.log(e,C)()}return Qe(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const w=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Qe(!1),0}}(t);p.begin(w)}this._bindTextures(),nc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Mn(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){ct.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Rue(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof is&&(s=s.texture),s instanceof fm)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&kue(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new SI({handle:r});break;case 35632:i.fs=new MI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=Wc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),ct.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),ct.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||ct.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(x=>this._getHash(x.name)).sort(),g=o.map(x=>this._getHash(x)),_=Object.keys(r).sort(),y=Object.keys(s).sort(),v=[],w=[];for(const x of _)v.push(this._getHash(x)),v.push(this._getHash(r[x]));for(const x of y)w.push(this._getHash(x)),w.push(this._getHash(s[x]));const C=`${d}/${f}D${v.join("/")}M${p.join("/")}I${w.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[C]){const x=function(n,e){const{vs:t,fs:i}=e,r=Qce(e.modules||[]);return{gl:n,vs:v4(n,Object.assign({},e,{source:t,type:ib,modules:r})),fs:v4(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Cue(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[C]=new R4(this.gl,{hash:C,vs:x.vs,fs:x.fs,varyings:o,bufferMode:a}),this._getUniforms[C]=x.getUniforms||(L=>{}),this._useCounts[C]=0}return this._useCounts[C]++,this._programCache[C]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":Gv.chrome?"Chrome":Gv.safari?"Safari":Gv.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Da(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Da.MAX_ATTRIBUTES=Da.MAX_ATTRIBUTES||e.getParameter(34921),Da.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Da._setConstantFloatArray(e,t,i);break;case Int32Array:Da._setConstantIntArray(e,t,i);break;case Uint32Array:Da._setConstantUintArray(e,t,i);break;default:Qe(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Da.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return Qe(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(Qe(Mn(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Da.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new Si(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!ES||ES.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Ede=/^(.+)__LOCATION_([0-9]+)$/,Sde=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Mde{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Da(e),Cz(this,"VertexArray","v6.0",Sde),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new Si(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,ct.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ea.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return Qe(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Ede.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof Si)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof Si)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof Si))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof Si){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return ct.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function lb(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=lb(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function k4(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof Si){const p=e,{data:g,changed:_}=p.getDebugData();let y;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?y=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${rh(r,s)})`:(c=!0,y=`${l} bytes`),{[i]:`${d}${lb(f,{size:o,isInteger:c})}`,"Format ":y}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${lb(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Ade(n,e){const{type:t,size:i}=e,r=I4(t,i);return r?`${n} (${r.name})`:n}function F4({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){Qe(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:lb(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function TI({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?lb(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function N4(n){const{type:e,size:t}=n.accessor,i=I4(e,t);return i?`${i.name} ${n.name}`:n.name}const Ide={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rde(n,e){const{attributeMap:t=Ide}=e||{};return t&&t[n]||n}function kde(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Qe(Number.isFinite(e.size),`attribute ${n} needs size`)}const L4=()=>{},Lde={};class SS{constructor(e,t={}){const{id:i=Wc("model")}=t;Qe(lS(e)),this.id=i,this.gl=e,this.id=t.id||Wc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||ab.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},Qe(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return Qe(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return Qe(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Rde(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=J({},o);delete c.value,i[a]=[new Si(n,l),c],kde(s,c)}}if(r){const s=r.value||r;Qe(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new Si(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(dm(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return JO(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),ct.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&ct.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:y,instanceCount:v}=this,{onBeforeRender:w=L4,onAfterRender:C=L4}=this.props;w(),this.program.setUniforms(this.uniforms);const x=this.program.draw(Object.assign(Lde,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:y,instanceCount:v,offset:f?g:0}));return C(),ct.priority>=2&&this._logDrawCallEnd(c,l,i),x}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return ct.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Qe(t instanceof R4,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new Mde(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof Si&&t.delete()}}_setAnimationProps(e){this.animated&&Qe(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(dm(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new o4(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:ct.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=k4(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Ade(s.name,a)}`),t[o]=k4(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=F4({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=F4({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&ct.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&ct.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${N4(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${N4(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);ct.table(e,s)(),ct.table(e,o)(),ct.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),ct.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class AI{static isSupported(e){return Mn(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();Qe(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new SS(t,Object.assign({},e,{fs:e.fs||s4({version:a4(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(dm(n.feedbackBuffers)&&dm(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Pce(e,t)),function(n){return!(dm(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new Wce(e,t)),Qe(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function MS(){}const jde={onStart:MS,onUpdate:MS,onInterrupt:MS,onEnd:MS};class cb{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=J(J({},jde),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const Yde={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new cb(i),this.attribute=t,this.attributeInTransition=new dI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=e4(e.size);return new AI(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new Si(e,r),new Si(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;t4(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)n4(J({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=uI(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:Jz(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new cb(i),this.attribute=t,this.attributeInTransition=new dI(e,an(J({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new xa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new is(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=e4(e.size);return new AI(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new Si(e,r),new Si(e,r),new Si(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)n4(J({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=uI(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:Jz(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),t4(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),uS(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class Xde{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=AI.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Zn.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=Yde[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Zn.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const B4="attributeManager.invalidate";class the{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new Xde(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;eo("attribute.updateStart",t),t.allocate(i)&&eo("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,eo("attribute.updateEnd",t,i))}}function j4(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function U4(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=Qz(r)))return;const o=she[r.type];if(!o)return void Zn.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(an(J({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const xS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:ahe}=xS;function uhe(n,e){if(!n.transitions)return null;const t={},i=OI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&DI(n[r],e[r],s)&&(t[r]=!0)}return t}function z4({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=DI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=DI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function DI(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function fhe(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!vhe(i[r],e[r])){t=n(i),e=i;break}return t}}function bhe(n,e){if(!e)return n;const t=J(J({},n),e);if("defines"in e&&(t.defines=J(J({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=J({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function AS(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],y=e[13],v=e[14],w=e[15],C=t*a-i*o,x=t*l-r*o,L=t*c-s*o,U=i*l-r*a,$=i*c-s*a,ee=r*c-s*l,fe=d*y-f*_,pe=d*v-p*_,ve=d*w-g*_,$e=f*v-p*y,Xe=f*w-g*y,re=p*w-g*v,le=C*re-x*Xe+L*$e+U*ve-$*pe+ee*fe;return le?(n[0]=(a*re-l*Xe+c*$e)*(le=1/le),n[1]=(r*Xe-i*re-s*$e)*le,n[2]=(y*ee-v*$+w*U)*le,n[3]=(p*$-f*ee-g*U)*le,n[4]=(l*ve-o*re-c*pe)*le,n[5]=(t*re-r*ve+s*pe)*le,n[6]=(v*L-_*ee-w*x)*le,n[7]=(d*ee-p*L+g*x)*le,n[8]=(o*Xe-a*ve+c*fe)*le,n[9]=(i*ve-t*Xe-s*fe)*le,n[10]=(_*$-y*L+w*C)*le,n[11]=(f*L-d*$-g*C)*le,n[12]=(a*pe-o*$e-l*fe)*le,n[13]=(t*$e-i*pe+r*fe)*le,n[14]=(y*x-_*U-v*C)*le,n[15]=(d*U-f*x+p*C)*le,n):null}function qc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],y=e[12],v=e[13],w=e[14],C=e[15],x=t[0],L=t[1],U=t[2],$=t[3];return n[0]=x*i+L*a+U*f+$*y,n[1]=x*r+L*l+U*p+$*v,n[2]=x*s+L*c+U*g+$*w,n[3]=x*o+L*d+U*_+$*C,n[4]=(x=t[4])*i+(L=t[5])*a+(U=t[6])*f+($=t[7])*y,n[5]=x*r+L*l+U*p+$*v,n[6]=x*s+L*c+U*g+$*w,n[7]=x*o+L*d+U*_+$*C,n[8]=(x=t[8])*i+(L=t[9])*a+(U=t[10])*f+($=t[11])*y,n[9]=x*r+L*l+U*p+$*v,n[10]=x*s+L*c+U*g+$*w,n[11]=x*o+L*d+U*_+$*C,n[12]=(x=t[12])*i+(L=t[13])*a+(U=t[14])*f+($=t[15])*y,n[13]=x*r+L*l+U*p+$*v,n[14]=x*s+L*c+U*g+$*w,n[15]=x*o+L*d+U*_+$*C,n}function ub(n,e,t){var o,a,l,c,d,f,p,g,_,y,v,w,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],y=e[9],v=e[10],w=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=y,n[10]=v,n[11]=w,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+y*s+e[13],n[14]=l*i+p*r+v*s+e[14],n[15]=c*i+g*r+w*s+e[15]),n}function db(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function $4(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function G4(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function W4(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function q4(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],y=n[13],v=n[14],w=n[15],C=e[0],x=e[1],L=e[2],U=e[3],$=e[4],ee=e[5],fe=e[6],pe=e[7],ve=e[8],$e=e[9],Xe=e[10],re=e[11],le=e[12],Oe=e[13],Q=e[14],Ue=e[15];return Math.abs(t-C)<=Vi*Math.max(1,Math.abs(t),Math.abs(C))&&Math.abs(i-x)<=Vi*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(r-L)<=Vi*Math.max(1,Math.abs(r),Math.abs(L))&&Math.abs(s-U)<=Vi*Math.max(1,Math.abs(s),Math.abs(U))&&Math.abs(o-$)<=Vi*Math.max(1,Math.abs(o),Math.abs($))&&Math.abs(a-ee)<=Vi*Math.max(1,Math.abs(a),Math.abs(ee))&&Math.abs(l-fe)<=Vi*Math.max(1,Math.abs(l),Math.abs(fe))&&Math.abs(c-pe)<=Vi*Math.max(1,Math.abs(c),Math.abs(pe))&&Math.abs(d-ve)<=Vi*Math.max(1,Math.abs(d),Math.abs(ve))&&Math.abs(f-$e)<=Vi*Math.max(1,Math.abs(f),Math.abs($e))&&Math.abs(p-Xe)<=Vi*Math.max(1,Math.abs(p),Math.abs(Xe))&&Math.abs(g-re)<=Vi*Math.max(1,Math.abs(g),Math.abs(re))&&Math.abs(_-le)<=Vi*Math.max(1,Math.abs(_),Math.abs(le))&&Math.abs(y-Oe)<=Vi*Math.max(1,Math.abs(y),Math.abs(Oe))&&Math.abs(v-Q)<=Vi*Math.max(1,Math.abs(v),Math.abs(Q))&&Math.abs(w-Ue)<=Vi*Math.max(1,Math.abs(w),Math.abs(Ue))}function Y4(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function DS(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new ta(4);ta!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const X4=[0,0,0,0],Whe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],qhe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Yhe=[0,0,0],Xhe=[0,0,0],Khe=TS(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=X4,l=X4,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=K4(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=DS([],l,o),s=i||s,o=qc([],r,s),o=qc([],o,Whe)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:Yhe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Hn.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Hn.LNGLAT:case Hn.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Hn.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function K4(n,e,t=Xhe){let r,i=t,s=!0;switch(r=e===Hn.LNGLAT_OFFSETS||e===Hn.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case $c.WEB_MERCATOR:(e===Hn.LNGLAT||e===Hn.CARTESIAN)&&(s=!1);break;case $c.WEB_MERCATOR_AUTO_OFFSET:e===Hn.LNGLAT?i=r:e===Hn.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case $c.IDENTITY:i=n.position.map(Math.fround);break;case $c.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class efe extends rI{get ELEMENTS(){return Xu(!1),0}get RANK(){return Xu(!1),0}toString(){let e="[";if(Qi.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new Lt).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return W4(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],y=n[14],v=n[15];return(e*o-t*s)*(f*v-p*y)-(e*a-i*s)*(d*v-p*_)+(e*l-r*s)*(d*y-f*_)+(t*a-i*o)*(c*v-p*g)-(t*l-r*o)*(c*y-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return AS(this,this),this.check()}multiplyLeft(e){return qc(this,e,this),this.check()}multiplyRight(e){return qc(this,this,e),this.check()}rotateX(e){return $4(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return G4(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,y,v,w,C,x,L,U,$,ee,fe,pe,ve,$e,Xe,re,le,Oe,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*sc+rc)/(2*rc),512*(rc+Math.log(Math.tan(e5+e*sc*.5)))/(2*rc)]}function ah([n,e]){const t=n/512*(2*rc)-rc,i=2*(Math.atan(Math.exp(e/512*(2*rc)-rc))-e5);return[t*RI,i*RI]}function IS({latitude:n,longitude:e,highPrecision:t=!1}){Zu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*sc),o=512/360,a=o/s,l=512/kI/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=sc*Math.tan(n*sc)/s,f=512/kI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function n5(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=IS({longitude:t,latitude:i,highPrecision:!0}),d=Sm(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=ah(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function i5({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return ub(o,o,[0,0,-i]),$4(o,o,-e*sc),G4(o,o,t*sc),db(o,o,[r/=n,r,r]),s&&ub(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function r5({width:n,height:e,fovy:t=PS(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=PS(i));const a=.5*t*sc,l=s5(t),c=r*sc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function PS(n){return 2*Math.atan(.5/n)*RI}function s5(n){return.5/Math.tan(.5*n*sc)}function FI(n,e){const[t,i,r=0]=n;return Zu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Em(e,[t,i,r,1])}function Zf(n,e,t=0){const[i,r,s]=n;if(Zu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Em(e,[i,r,s,1]);const o=Em(e,[i,r,0,1]),a=Em(e,[i,r,1,1]),l=o[2],c=a[2];return Z4([],o,a,l===c?0:((t||0)-l)/(c-l))}function o5({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Zu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new RS({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],y=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Zu(y[0]>0&&y[1]>0);const v=y[0]/_[0],w=y[1]/_[1],U=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/v,(g[1]+p[1])/2+(s.bottom-s.top)/2/w]),$=Math.min(r,f.zoom+PI(Math.abs(Math.min(v,w))));return Zu(Number.isFinite($)),{longitude:U[0],latitude:U[1],zoom:$}}const a5=Math.PI/180;function l5(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*a5:Math.atan(.5/n.altitude))>(90-n.pitch)*a5-.01?(l=c5(n,0,e),c=c5(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function c5(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Em(i,[e,0,1,1]),s=Em(i,[e,n.height,1,1]),c=ah(Z4([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class RS{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=PS(l=1.5):null===c?c=PS(l):null===l&&(l=s5(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=IS({longitude:r,latitude:i}),y=Sm([r,i]);y[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(y,y,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=r5({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return W4([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=i5({height:t,scale:g,center:y,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=y,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];qc(s,s,i),qc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];db(o,o,[e/2,-t/2,1]),ub(o,o,[1,-1,0]),qc(o,o,s);const a=AS([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof RS&&e.width===this.width&&e.height===this.height&&q4(e.projectionMatrix,this.projectionMatrix)&&q4(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=FI(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=Zf([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Sm(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=ah(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Sm(e)}unprojectFlat(e){return ah(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=Zf(t,this.pixelUnprojectionMatrix),s=Cm([],Sm(e),II([],i));return ah(Cm([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=o5(Object.assign({width:i,height:r,bounds:e},t));return new RS({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return l5(this,e.z||0)}}const hfe=Math.PI/180,ffe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],NI=[0,0,0],gfe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Mm=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?$c.WEB_MERCATOR:$c.WEB_MERCATOR_AUTO_OFFSET:$c.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&eb(t.projectionMatrix,this.projectionMatrix)&&eb(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=FI(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=Zf([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Sm(t):t}unprojectFlat(t){return this.isGeospatial?ah(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?IS({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends Mm{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:y=1.5}=t;const v=Math.pow(2,s);g=g||1,_=_||1,y=Math.max(.75,y);const{fov:w,aspect:C,focalDistance:x,near:L,far:U}=r5({width:g,height:_,pitch:o,altitude:y,nearZMultiplier:l,farZMultiplier:c});let $=i5({height:_,pitch:o,bearing:a,scale:v,altitude:y});p&&($=(new Lt).translate([512*p,0,0]).multiplyLeft($)),super(an(J({},t),{width:g,height:_,viewMatrix:$,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:w,aspect:C,focalDistance:x,near:L,far:U})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=y,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(an(J({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return n5(t,i)}panByPosition(t,i){const r=Zf(i,this.pixelUnprojectionMatrix),o=Cm([],this.projectFlat(t),II([],r)),a=Cm([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=l5(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=o5(J({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function LI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof p5){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function g5(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=DS([],[o,a,l,1],t)),i){case Hn.LNGLAT:return LI([o,a,l],e,s);case Hn.LNGLAT_OFFSETS:return LI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Hn.METER_OFFSETS:return LI(n5(r,[o,a,l]),e,s);case Hn.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const yfe={10241:9987,10240:9729,10242:33071,10243:33071},BI={},Cfe={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||pb(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>VI(n,e)},accessor:{validate(n,e){const t=kS(n);return"function"===t||t===kS(e.value)},equal:(n,e,t)=>"function"==typeof e||VI(n,e)},array:{validate:(n,e)=>e.optional&&!n||pb(n),equal:(n,e,t)=>t.compare?VI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof xa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new xa(t,an(J({},e),{parameters:J(J(J({},yfe),i),n.props.textureParameters)}));return BI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof xa)||BI[n.id]&&(n.delete(),delete BI[n.id])}(n)}}};function VI(n,e){if(n===e)return!0;if(!pb(n)||!pb(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=kfe,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Pfe]||{},i=e[Ife]||e,r=e[Rfe]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(Kz(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return un(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=UI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const v=_,{dataTransform:w}=i.component?i.component.props:{};a=w?w(v,a):a.concat(v),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(v){d=!0,f=v}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const y=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;y&&y(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:v5,ASYNC_RESOLVED:b5,ASYNC_DEFAULTS:Ffe}=xS,Nfe={};let Lfe=0,Bfe=(()=>{class n{constructor(){this.props=Sfe.apply(this,arguments),this.id=this.props.id,this.count=Lfe++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[Ffe])s in i[b5]?r[s]=i[b5][s]:s in i[v5]&&(r[s]=i[v5][s]);return new this.constructor(J(J(J({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new y5({})}}return n.componentName="Component",n.defaultProps=Nfe,n})();class Vfe extends y5{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const oc=n=>"function"==typeof n,lh=n=>null!==n&&"object"==typeof n,w5=n=>lh(n)&&n.constructor==={}.constructor,jfe=n=>n&&"function"==typeof n[Symbol.iterator],Ufe=n=>n&&"function"==typeof n[Symbol.asyncIterator],mb=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,xm=n=>"undefined"!=typeof Blob&&n instanceof Blob,E5=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||lh(n)&&oc(n.tee)&&oc(n.cancel)&&oc(n.getReader))(n)||(n=>lh(n)&&oc(n.read)&&oc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Qf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function zI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function HI(n){var e,t;let i;return Qf(n,"null loader"),Qf(zI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=an(J({},n=n[0]),{options:J(J({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Yc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},$I=Yc.global||Yc.self||Yc.window||{},qfe="object"!=typeof process||"[object process]"!==String(process)||process.browser,S5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);S5&&parseFloat(S5[1]);const WI={};function Yfe(n){for(const e in WI)n.startsWith(e)&&(n=n.replace(e,WI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const Xfe=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Kfe=/^([-\w.]+\/[-\w.+]+)/;function Zfe(n){const e=Kfe.exec(n);return e?e[1]:n}function M5(n){const e=Xfe.exec(n);return e?e[1]:""}const Qfe=/\?.*/;function BS(n){if(mb(n)){const e=qI(n.url||"");return{url:e,type:Zfe(n.headers.get("content-type")||"")||M5(e)}}return xm(n)?{url:qI(n.name||""),type:n.type||""}:"string"==typeof n?{url:qI(n),type:M5(n)}:{url:"",type:""}}function Jfe(n){return mb(n)?n.headers["content-length"]||-1:xm(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function qI(n){return n.replace(Qfe,"")}function x5(n){return YI.apply(this,arguments)}function YI(){return(YI=un(function*(n){if(mb(n))return n;const e={},t=Jfe(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=BS(n);r&&(e["content-type"]=r);const s=yield npe(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function epe(n){return XI.apply(this,arguments)}function XI(){return(XI=un(function*(n){if(!n.ok){const e=yield tpe(n);throw new Error(e)}})).apply(this,arguments)}function tpe(n){return KI.apply(this,arguments)}function KI(){return(KI=un(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function npe(n){return ZI.apply(this,arguments)}function ZI(){return(ZI=un(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${ipe(n.slice(0,5))}`:null})).apply(this,arguments)}function ipe(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const D5={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Yt(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},ope={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function JI(){$I.loaders=$I.loaders||{};const{loaders:n}=$I;return n._state=n._state||{},n._state}const eP=()=>{const n=JI();return n.globalOptions=n.globalOptions||J({},D5),n.globalOptions};function ape(n,e,t,i){return t=t||[],function(n,e){I5(n,null,D5,ope,e);for(const t of e)I5(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=J({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new rpe),R5(r,eP()),R5(r,e),r}(e,n,i)}function O5(n,e){const t=eP(),i=n||t;return"function"==typeof i.fetch?i.fetch:lh(i.fetch)?r=>T5(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:T5}function I5(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&lh(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)A5.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=cpe(a,r);A5.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function cpe(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function R5(n,e){for(const t in e)t in e&&(n[t]=w5(e[t])&&w5(n[t])?J(J({},n[t]),e[t]):e[t])}function Xc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function hpe(n,e="3.0.12"){return Xc(n,"no worker provided"),!(!e||!n.version)}const Kc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},fpe=Kc.global||Kc.self||Kc.window||{},tP="object"!=typeof process||"[object process]"!==String(process)||process.browser,nP="function"==typeof importScripts,ppe="undefined"!=typeof window&&void 0!==window.orientation,k5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),iP=(k5&&parseFloat(k5[1]),new Map);function F5(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function N5(n,e=!0,t){const i=t||new Set;if(n)if(L5(n))i.add(n);else if(L5(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)N5(n[r],e,i);return void 0===t?Array.from(i):[]}function L5(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const rP=()=>{};class B5{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Yt(this,"name",void 0),Yt(this,"source",void 0),Yt(this,"url",void 0),Yt(this,"terminated",!1),Yt(this,"worker",void 0),Yt(this,"onMessage",void 0),Yt(this,"onError",void 0),Yt(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Xc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=rP,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=rP,this.onError=rP,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||N5(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){Xc(n.source&&!n.url||!n.source&&n.url);let e=iP.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?F5(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),iP.set(n.url,e)),n.source&&(e=F5(n.source),iP.set(n.source,e))),Xc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class ype{constructor(e,t){Yt(this,"name",void 0),Yt(this,"workerThread",void 0),Yt(this,"isRunning",void 0),Yt(this,"result",void 0),Yt(this,"_resolve",void 0),Yt(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Xc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Xc(this.isRunning),this.isRunning=!1,this._reject(e)}}class vpe{constructor(e){Yt(this,"name","unnamed"),Yt(this,"source",void 0),Yt(this,"url",void 0),Yt(this,"maxConcurrency",1),Yt(this,"maxMobileConcurrency",1),Yt(this,"onDebug",()=>{}),Yt(this,"reuseWorkers",!0),Yt(this,"props",{}),Yt(this,"jobQueue",[]),Yt(this,"idleQueue",[]),Yt(this,"count",0),Yt(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=J(J({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return un(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return un(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new ype(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class Qu{static isSupported(){return B5.isSupported()}static getWorkerFarm(e={}){return Qu._workerFarm=Qu._workerFarm||new Qu({}),Qu._workerFarm.setProps(e),Qu._workerFarm}constructor(e){Yt(this,"props",void 0),Yt(this,"workerPools",new Map),this.props=J({},bpe),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=J(J({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new vpe({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function wpe(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return Xc(r),r}function Epe(n,e){return!!Qu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Spe(n,e,t,i,r){return sP.apply(this,arguments)}function sP(){return(sP=un(function*(n,e,t,i,r){const s=n.id,o=wpe(n,t),l=Qu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Mpe.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Mpe(n,e,t,i){return oP.apply(this,arguments)}function oP(){return(oP=un(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}Yt(Qu,"_workerFarm",void 0);var j5=Ve(521);function U5(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return j5.toArrayBuffer?j5.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Dpe(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function z5(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Ope(n){return lP.apply(this,arguments)}function lP(){return(lP=un(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=UI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Dpe(...e)})).apply(this,arguments)}const Rpe=262144;function H5(n){this.wrapped=n}function _b(n){return new H5(n)}function yb(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof H5;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function uP(n){return function(){return new yb(n.apply(this,arguments))}}function dP(){return(dP=uP(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(pP)}function Upe(n,e,t){return gP.apply(this,arguments)}function gP(){return(gP=un(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return jpe(n,e);if(xm(n)&&(n=yield x5(n)),mb(n)){const r=n;return yield epe(r),e.binary?yield r.arrayBuffer():yield r.text()}if(E5(n)&&(n=Vpe(n,t)),jfe(n)||Ufe(n))return Ope(n);throw new Error(pP)})).apply(this,arguments)}function Hpe(n,e,t=null){if(t)return t;const i=J({fetch:O5(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function $pe(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const G5=()=>{const n=JI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function W5(n){const e=G5();n=Array.isArray(n)?n:[n];for(const t of n){const i=HI(t);e.find(r=>i===r)||e.unshift(i)}}const Wpe=/\.([^.]+)$/;function qpe(n){return yP.apply(this,arguments)}function yP(){return(yP=un(function*(n,e=[],t,i){if(!Y5(n))return null;let r=q5(n,e,an(J({},t),{nothrow:!0}),i);if(r)return r;if(xm(n)&&(r=q5(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(X5(n));return r})).apply(this,arguments)}function q5(n,e=[],t,i){if(!Y5(n))return null;if(e&&!Array.isArray(e))return HI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...G5()),function(n){for(const e of n)HI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=BS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=vP(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&Wpe.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||vP(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Jpe(e,t))return t}else if(ArrayBuffer.isView(e)){if(K5(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&K5(e,0,t))return t;return null}(e,n),a=a||vP(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(X5(n));return s}function Y5(n){return!(n instanceof Response&&204===n.status)}function X5(n){const{url:e,type:t}=BS(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?bP(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?bP(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function vP(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Jpe(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function K5(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Zc=new Uint8ClampedArray(0);const uge={data:{type:"data",value:lge,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=an(J({},r),{fetch:an(J({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:jS(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):jS(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Hn.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let SP=(()=>{class n extends Bfe{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=g5(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=FI(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=J({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Hn.DEFAULT&&(t=i.isGeospatial?Hn.LNGLAT:Hn.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=K4(t,i,r),f=g5(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Hn.DEFAULT||t===Hn.LNGLAT||t===Hn.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){ic(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=bhe(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!cge({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Zc.length/3);if(this.internalState.usesPickingColorCache=!0,rZ5&&Zn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Zc=Qv.allocate(Zc,i,{size:3,copy:!0,maxCount:Math.max(i,Z5)});const s=Math.floor(Zc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&eo("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=z4({newProps:n,oldProps:e,propTypes:OI(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&H4(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&H4(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:fhe(n,e),transitionsChanged:uhe(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=OI(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new the(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){ic(!this.internalState&&!this.state),ic(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Vfe({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Zn.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ohe(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){eo("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=uge,n})(),hge=(()=>{class n extends SP{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:w,_subLayerProps:C}=this.props,x={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:w},L=C&&C[t.id],U=L&&L.updateTriggers,$=t.id||"sublayer";if(L){const ee=this.constructor._propTypes,fe=t.type?t.type._propTypes:{};for(const pe in L){const ve=fe[pe]||ee[pe];ve&&"accessor"===ve.type&&(L[pe]=this.getSubLayerAccessor(L[pe]))}}Object.assign(x,t,L),x.id="".concat(this.props.id,"-").concat($),x.updateTriggers=J(J({all:this.props.updateTriggers.all},t.updateTriggers),U);for(const ee of v){const fe=ee.getSubLayerProps.call(this,ee);fe&&Object.assign(x,fe,{updateTriggers:Object.assign(x.updateTriggers,fe.updateTriggers)})}return x}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=lI(t,Boolean),this.internalState.subLayers=t),eo("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const fge=/([0-9]+\.?[0-9]*)(%|px)/;function US(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(fge);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function zS(n,e){return n.relative?Math.round(n.position*e):n.position}function vb(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&vb(i,r)))return!1}return!0}class MP{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=Mm}=e;ic(!p||p instanceof Mm),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=an(J({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):vb(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=J({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:zS(this._x,e),y:zS(this._y,t),width:zS(this._width,e),height:zS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),J(J({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(J(J(J({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=US(e),this._y=US(t),this._width=US(i),this._height=US(r)}}const bb=()=>{},Q5={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:bb,onTransitionInterrupt:bb,onTransitionEnd:bb};class pge{constructor(e,t={}){this.ControllerState=e,this.props=J(J({},Q5),t),this.propsInTransition=null,this.transition=new cb(t.timeline),this.onViewStateChange=t.onViewStateChange||bb,this.onStateChange=t.onStateChange||bb,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=J(J({},Q5),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=J(J({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(J(J({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const J5=["longitude","latitude","zoom","bearing","pitch"],mge=["longitude","latitude","zoom"];class eH extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!eb(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];ic(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:J5,extract:J5,required:mge}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=dS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(J(J({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,dS(e.around,t.around,i)))}return r}}const ch={transitionDuration:0},_ge={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},$S=n=>1-(1-n)*(1-n),Tm_WHEEL=["wheel"],Tm_PAN=["panstart","panmove","panend"],Tm_PINCH=["pinchstart","pinchmove","pinchend"],Tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Tm_DOUBLE_TAP=["doubletap"],Tm_KEYBOARD=["keydown"];class xP{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new pge(e,an(J({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&an(J({},_ge),{transitionInterpolator:new eH({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(J(J({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Tm_WHEEL,d&&i),this.toggleEvents(Tm_PAN,d&&(r||s)),this.toggleEvents(Tm_PINCH,d&&(a||l)),this.toggleEvents(Tm_TRIPLE_PAN,d&&l),this.toggleEvents(Tm_DOUBLE_TAP,d&&o),this.toggleEvents(Tm_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=J(J({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,ch,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,an(J({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,ch,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,ch,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,ch,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,an(J({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?an(J({},t),{transitionInterpolator:new eH(an(J({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:ch}}class tH{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const uh_target=[0,0,0];class GS extends tH{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=uh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:w}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:w},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=J({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(an(J({},this._viewportProps),{zoom:a}));return this._getUpdatedState(J({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),Xf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new GS(J(J(J({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Xf(r,i,t),e.rotationX=Xf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class vge extends xP{constructor(e){super(GS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class bge extends xP{constructor(e){e.dragMode=e.dragMode||"pan",super(GS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Cge=(new Lt).lookAt({eye:[0,0,1]});function wge({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new Lt).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Ege extends Mm{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(an(J({},e),{longitude:null,position:a,viewMatrix:Cge.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:wge({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Cm([],e,II([],Zf(t,this.pixelUnprojectionMatrix)));return{target:Cm([],this.center,r)}}}let Sge=(()=>{class n extends MP{constructor(t){super(an(J({},t),{type:Ege}))}get controller(){return this._getControllerProps({type:bge})}}return n.displayName="OrthographicView",n})();const WS=Math.PI/180;function Mge({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*WS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new Lt).lookAt({eye:l,up:a});c.rotateX(i*WS),"Z"===t?c.rotateZ(r*WS):c.rotateY(r*WS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class xge extends Mm{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(an(J({},e),{longitude:null,viewMatrix:Mge({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=Zf([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let Tge=(()=>{class n extends MP{constructor(t={}){const{orbitAxis:i="Z"}=t;super(an(J({},t),{orbitAxis:i,type:xge}))}get controller(){return this._getControllerProps({type:vge})}}return n.displayName="OrbitView",n})();const Age=[255,255,255],Dge=1;let Oge=0;class nH{constructor(e={}){const{color:t=Age}=e,{intensity:i=Dge}=e;this.id=e.id||"ambient-".concat(Oge++),this.color=t,this.intensity=i,this.type="ambient"}}const Ige=[255,255,255],Pge=1,Rge=[0,0,-1];let kge=0;class iH{constructor(e={}){const{color:t=Ige}=e,{intensity:i=Pge}=e,{direction:r=Rge}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(kge++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Js(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class rH{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=J({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class TP extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=J({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Wu(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Wu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=sH(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dJO(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Wu(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||sH(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class Bge extends TP{constructor(e,t){super(e,t),this.shadowMap=new xa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new pm(e,{format:33189,width:1,height:1}),this.fbo=new is(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;nc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=um(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(an(J({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const jge=Object.keys(Hn).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Hn[n],";")).join(""),Uge=Object.keys($c).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat($c[n],";")).join(""),zge="".concat(jge,"\n").concat(Uge,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),Hge={},AP={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:zge,getUniforms:function(n=Hge){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Hn.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Hn.DEFAULT&&(i=n.isGeospatial?Hn.LNGLAT:Hn.CARTESIAN);const o=Khe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||qhe,o}(n):{}}},qge=TS(function({viewport:n,center:e}){return new Lt(n.viewProjectionMatrix).invert().transform(e)}),Yge=TS(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=Zf([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new Js(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new Lt).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),Xge=[0,0,0,1],Kge=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],DP={name:"shadow",dependencies:[AP],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||Xge,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=qge({viewport:n.viewport,center:e.project_uCenter}),r=[],s=Yge({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},tme={color:[255,255,255],intensity:1},oH=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],nme=[0,0,0,200/255];class OP extends rH{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=nme,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=ab.getDefaultProgramManager(e),DP&&this.programManager.addDefaultModule(DP)),this.dummyShadowMap||(this.dummyShadowMap=new xa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(DP),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new Lt).lookAt({eye:new Js(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=rme++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class sme{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=jS(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class ome{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new sme(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const ame=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},AP],lme=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function cme(n){const e=ab.getDefaultProgramManager(n);for(const t of ame)e.addDefaultModule(t);for(const t of lme)e.addShaderHook(t);return e}const hme=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class fme{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new ome({gl:e,protocol:"deck://"}),this.context=an(J({},hme),{layerManager:this,gl:e,deck:t,programManager:e&&cme(e),stats:i||new WO({id:"deck.gl"}),viewport:r||new Mm({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new aH,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){eo("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=lI(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return eo("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Zn.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Zn.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class pme{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=lI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!vb(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Zn.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(J({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=an(J(J(J({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class mme extends tH{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:w,startPitch:C,startZoom:x,normalize:L}={}){ic(Number.isFinite(s)),ic(Number.isFinite(r)),ic(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:L}),this._state={startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:w,startPitch:C,startZoom:x},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(an(J({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(an(J({},this._viewportProps),{zoom:o}));return this._getUpdatedState(J({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=J({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(J(J(J({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Xf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Xf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=J4(t+180,360)-180),(o<-180||o>180)&&(o=J4(o+180,360)-180);const a=PI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=ah([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Xf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Xf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class _me extends xP{constructor(e){e.dragMode=e.dragMode||"pan",super(mme,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(J(J({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let yme=(()=>{class n extends MP{constructor(t){super(an(J({},t),{type:p5}))}get controller(){return this._getControllerProps({type:_me})}}return n.displayName="MapView",n})();const vme=new OP;class bme{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!vb(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof OP)||this._internalEffects.push(vme)}}class Cme extends TP{}const cH={blendFunc:[1,0,32771,0],blendEquation:32774};class uH extends TP{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,nc(_,an(J({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},cH),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:an(J({},cH),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return J(J({},e.props.parameters),i)}}class Eme{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Cme(e),this.pickLayersPass=new uH(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||is.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(an(J({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,eo("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new is(this.gl),new is(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const Sme={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Mme({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let v=0;v=0){const C=v+o-t,x=C*C+y;x<=d&&(d=x,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),y=e[g];if(y){const v=y.decodePickingColor(_),w=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:y,pickedObjectIndex:v,pickedX:o+(f/4-w*l),pickedY:a+w}}Zn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Sme}function dH({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Tme(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(y=>y.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=dH(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=J({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=hH({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function hH({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Dme{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new uH(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?J(J({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new is(e),is.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new is(e),this.depthFBO.attach({36064:new xa(e,{format:Mn(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Zn.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:dH({viewports:i,x:r,y:s})};this._resizeBuffer();const f=um(this.gl),p=HO(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:y,height:v}=this.pickingFBO,w=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:y,deviceHeight:v});let C;const x=[],L={};for(let U=0;U=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Zn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:w,width:y.x+y.width-g,height:_-w},pass:"picking:".concat(l),redrawReason:l}),layers:e}),U=new Map,$=Number.isFinite(c);for(let ee=0;ee=c);ee++){const fe=L[ee];let pe={color:fe.pickedColor,layer:null,index:fe.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};pe=hH({layer:fe.pickedLayer,info:pe,mode:l}),U.has(pe.object)||U.set(pe.object,pe)}return Array.from(U.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return uS(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Ome={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Ime{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Ome),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function fH(n,e){if(!n)throw new Error(e)}const Qc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},pH=Qc.global||Qc.self||Qc.window,Rme="object"!=typeof process||"[object process]"!==String(process)||process.browser,gH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:kme}=(gH&&parseFloat(gH[1]),pH),IP="undefined"!=typeof Image,PP="undefined"!=typeof ImageBitmap,Fme=Boolean(kme),RP=!!Rme||Fme;function mH(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function _H(n){switch(mH(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const Bme=/^data:image\/svg\+xml/,Vme=/\.svg((\?|#).*)?$/;function kP(n){return n&&(Bme.test(n)||Vme.test(n))}function jme(n,e){if(kP(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return vH(n,e)}function vH(n,e){if(kP(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function bH(n,e,t){return FP.apply(this,arguments)}function FP(){return(FP=un(function*(n,e,t){const i=jme(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield Ume(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function Ume(n,e){return NP.apply(this,arguments)}function NP(){return(NP=un(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const zme={};let CH=!0;function Hme(n,e,t){return LP.apply(this,arguments)}function LP(){return(LP=un(function*(n,e,t){let i;i=kP(t)?yield bH(n,e,t):vH(n,t);const r=e&&e.imagebitmap;return yield $me(i,r)})).apply(this,arguments)}function $me(n){return BP.apply(this,arguments)}function BP(){return(BP=un(function*(n,e=null){if((Gme(e)||!CH)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),CH=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function Gme(n){for(const e in n||zme)return!1;return!0}const Jc=!1,Cb=!0;function VP(n){const e=wb(n);return function(n){const e=wb(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Jc)?{mimeType:"image/png",width:e.getUint32(16,Jc),height:e.getUint32(20,Jc)}:null}(e)||function(n){const e=wb(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Jc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Jc)?{mimeType:"image/gif",width:e.getUint16(6,Cb),height:e.getUint16(8,Cb)}:null}(e)||function(n){const e=wb(n);return e.byteLength>=14&&16973===e.getUint16(0,Jc)&&e.getUint32(2,Cb)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Cb),height:e.getUint32(22,Cb)}:null}(e)}function wb(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function Zme(n,e){const{mimeType:t}=VP(n)||{},{_parseImageNode:i}=pH;return fH(i),i(n,t,e)}function jP(){return(jP=un(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(Jme(r)){case"imagebitmap":a=yield Hme(n,e,s);break;case"image":a=yield bH(n,e,s);break;case"data":a=yield Zme(n,e);break;default:fH(!1)}return"data"===r&&(a=_H(a)),a})).apply(this,arguments)}function Jme(n){switch(n){case"auto":case"data":return function(){if(PP)return"imagebitmap";if(IP)return"image";if(RP)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return PP||IP||RP;case"imagebitmap":return PP;case"image":return IP;case"data":return RP;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const wH={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return jP.apply(this,arguments)},tests:[n=>Boolean(VP(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},t_e={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},Eb="8.5.8",qS=Zi.CO.deck&&Zi.CO.deck.VERSION;if(qS&&qS!==Eb)throw new Error("deck.gl - multiple versions detected: ".concat(qS," vs ").concat(Eb));qS||(Zn.log(1,"deck.gl ".concat(Eb))(),Zi.CO.deck=Object.assign(Zi.CO.deck||{},{VERSION:Eb,version:Eb,log:Zn,_registerLoggers:function(n){hI=n}}),W5([t_e,[wH,{imagebitmap:{premultiplyAlpha:"none"}}]]));const n_e=Zi.CO.deck;class YS extends qu{static isSupported(e,t=[]){const i=Mn(e),r=Nz(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:Qe(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return YS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const EH=(0,Zi.jU)()&&"undefined"!=typeof document;let h_e=0;class f_e{constructor(e={}){const{onCreateContext:t=(v=>_z(v)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=qf.get("animation-loop-"+h_e++)}=e;let{useDevicePixels:y=!0}=e;"useDevicePixelRatio"in e&&(ct.deprecated("useDevicePixelRatio","useDevicePixels")(),y=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:y}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return Qe("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=YS.isSupported(this.gl,["timers"])?new YS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return un(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return ct.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=EH?new Promise((e,t)=>{EH&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?GO(this.props.gl,e):this.onCreateContext(e),!lS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Wu(n,zO)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(ct.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(ct.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new is(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var p_e=Ve(524),XS=Ve.n(p_e);const g_e={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(XS().MouseInput);const v_e=XS().Manager,eu=XS(),b_e=eu?[[eu.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[eu.Rotate,{enable:!1}],[eu.Pinch,{enable:!1}],[eu.Swipe,{enable:!1}],[eu.Pan,{threshold:0,enable:!1}],[eu.Press,{enable:!1}],[eu.Tap,{event:"doubletap",taps:2,enable:!1}],[eu.Tap,{event:"anytap",enable:!1}],[eu.Tap,{enable:!1}]]:null,xH={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},C_e={doubletap:["tap"]},w_e={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},zP={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},E_e={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},TH={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},S_e="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",Am="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let AH=!1;try{const n={get passive(){return AH=!0,!0}};Am.addEventListener("test",n,n),Am.removeEventListener("test",n,n)}catch(n){}const M_e=-1!==S_e.indexOf("firefox"),{WHEEL_EVENTS:x_e}=zP,OH=4.000244140625;class D_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=x_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!AH&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;Am.WheelEvent&&(M_e&&e.deltaMode===Am.WheelEvent.DOM_DELTA_PIXEL&&(t/=Am.devicePixelRatio),e.deltaMode===Am.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%OH==0&&(t=Math.floor(t/OH)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:O_e}=zP,IH="pointermove",PH="pointerover",RH="pointerout",kH="pointerleave";class I_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=O_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===IH&&(this.enableMoveEvent=t),e===PH&&(this.enableOverEvent=t),e===RH&&(this.enableOutEvent=t),e===kH&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:PH,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:RH,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:kH,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:IH,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:P_e}=zP,FH="keydown";class R_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=P_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===FH&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:FH,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const LH="contextmenu";class k_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===LH&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:LH,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const F_e={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},BH={srcElement:"root",priority:0};class q_e{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},BH,i):BH;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&xH[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new D_e(e,this._onOtherEvent,{enable:!1}),this.moveInput=new I_e(e,this._onOtherEvent,{enable:!1}),this.keyInput=new R_e(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new k_e(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=C_e[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=TH[e]||e;let c=a.get(l);c||(c=new q_e(this),a.set(l,c),c.recognizerName=E_e[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(TH[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=w_e[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function ep(){}const VH={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:ep,onResize:ep,onViewStateChange:ep,onInteractionStateChange:ep,onBeforeRender:ep,onAfterRender:ep,onLoad:ep,onError:(n,e)=>Zn.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class ZS{constructor(e){e=J(J({},VH),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Zn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Zi.qs)()&&Zn.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new WO({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Qv.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Zn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Zn.removed("onLayerClick","onClick")(),e.initialViewState&&!vb(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](J({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),ic(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new f_e({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>_z(an(J(J({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new yme({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,GO(e,{enable:!0,copyState:!0})),this.tooltip=new Ime(this.canvas),Wu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new aH;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new X_e(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in tz)this.eventManager.on(r,this._onEvent);this.viewManager=new pme({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new fme(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new bme,this.deckRenderer=new Eme(e),this.deckPicker=new Dme(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Wu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(J({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Zn.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=an(J({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=tz[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=qf.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}ZS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(rH)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},ZS.defaultProps=VH,ZS.VERSION=n_e.VERSION;const jH={name:"project32",dependencies:[AP],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},UH="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",Q_e={lightSources:{}};function GP({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const WP={name:"lights",vs:UH,fs:UH,getUniforms:function zH(n=Q_e){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?GP(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=GP(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=GP(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return zH({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},eye={};const nye={name:"phong-lighting",dependencies:[WP],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=eye){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},rye={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},GH=J({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=rye){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),WH={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class QS{static get DRAW_MODE(){return WH}constructor(e={}){const{id:t=Wc("geometry"),drawMode:i=WH.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?J({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,Qe(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(Qe(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return Qe(Number.isFinite(i)),i}}const qP=Math.PI/180,JS=new Float32Array(16),qH=new Float32Array(12);function YH(n,e,t){const i=e[0]*qP,r=e[1]*qP,s=e[2]*qP,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function XH(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const KH={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let y;g?(JS.set(a),y=XH(JS)):(y=qH,YH(y,r,s),y.set(o,9)),n.value=new Float32Array(y)}else{let y=e*n.size;const{iterable:v,objectInfo:w}=Xz(i,e,t);for(const C of v){let x;w.index++,g?(JS.set(c?a:a(C,w)),x=XH(JS)):(x=qH,YH(x,f?r:r(C,w),d?s:s(C,w)),x.set(p?o:o(C,w),9)),_[y++]=x[0],_[y++]=x[1],_[y++]=x[2],_[y++]=x[3],_[y++]=x[4],_[y++]=x[5],_[y++]=x[6],_[y++]=x[7],_[y++]=x[8],_[y++]=x[9],_[y++]=x[10],_[y++]=x[11]}}}};function ZH(n,e){return e===Hn.CARTESIAN||e===Hn.METER_OFFSETS||e===Hn.DEFAULT&&!n.isGeospatial}function QH(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Zn.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function lye(n,e){if(n.attributes)return QH(n.attributes,e),n instanceof QS?n:new QS(n);if(n.positions||n.POSITION)return QH(n,e),new QS({attributes:n});throw Error("Invalid mesh")}const cye={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let uye=(()=>{class n extends SP{getShaders(){const t=!Mn(this.context.gl),i={};return nI(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[jH,nye,GH],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:KH}),this.setState({emptyTexture:new xa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||ZH(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new SS(this.context.gl,an(J({},this.getShaders()),{id:this.props.id,geometry:lye(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=cye,n})();const JH={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[WP]};class Dm{constructor(e={}){const{id:t}=e;this.id=t||Wc(this.constructor.name),this.display=!0,this.position=new Js,this.rotation=new Js,this.scale=new Js(1,1,1),this.matrix=new Lt,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return Qe(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return Qe(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return Qe(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){Qe(e),t=t||this.matrix;const i=new Lt(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class Sb extends Dm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;ct.assert(t.every(i=>i instanceof Dm),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new Lt}={}){const i=new Lt(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Sb?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function e8(){var n=new ta(4);return ta!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function t8(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function n8(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var r8=Y4,Mye=function(){var n=Vz(),e=jz(1,0,0),t=jz(0,1,0);return function(i,r,s){var o=Uz(r,s);return o<-.999999?(fS(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&fS(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),t8(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(fS(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();e8(),e8(),function(){var n=new ta(9);ta!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const xye=[0,0,0,1],Aye={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Dye={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function a8(n){if(!n._animation){const e=Dye[n.componentType],t=Aye[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return t8(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=ks(e)}get y(){return this[1]}set y(e){this[1]=ks(e)}get z(){return this[2]}set z(e){this[2]=ks(e)}get w(){return this[3]}set w(e){this[3]=ks(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return Mye(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Xu(!t),n8(this,this,e),this.check()}multiplyLeft(e,t){return Xu(!t),n8(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return r8(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=xye,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,y,v,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>Vi?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-i)*p)/_,v=Math.sin(i*p)/_):(y=1-i,v=i),n[0]=y*r+v*l,n[1]=y*s+v*c,n[2]=y*o+v*d,n[3]=y*a+v*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),hS(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class Nye{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:ct.warn(`Bad animation path ${s}`)()}Qe(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){YP.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:a8(e.accessors[a]),interpolation:l,output:a8(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Nye({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Bye extends Dm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof SS?(this.model=e,this._setModelNodeProps(t)):this.model=new SS(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class Vye{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},nI(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new xa(this.gl,J({id:e.name||e.id,parameters:J(J({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(ct.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function l8(n,e){return Mn(n)?`#version 300 es\n${e}`:e}const Hye={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$ye={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Gye{constructor(e,t={}){this.gl=e,this.options=Object.assign({},$ye,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Lye(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Sb({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new Sb({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new Lt).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new Sb({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){ct.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new Vye(n,e);ct.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new Bye(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[JH],defines:a.defines,parameters:a.parameters,vs:l8(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:l8(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),ct.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new Si(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ea({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Hye[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function c8(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new Om(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Om(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Om){const o=e;t=o.fields,i=f8(f8(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new Om(s,i)}}function f8(n,e){return new Map([...n||new Map,...e||new Map])}let ar,p8,g8,m8,_8,y8,v8,b8;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(ar||(ar={}));class XP{static isNull(e){return e&&e.typeId===ar.Null}static isInt(e){return e&&e.typeId===ar.Int}static isFloat(e){return e&&e.typeId===ar.Float}static isBinary(e){return e&&e.typeId===ar.Binary}static isUtf8(e){return e&&e.typeId===ar.Utf8}static isBool(e){return e&&e.typeId===ar.Bool}static isDecimal(e){return e&&e.typeId===ar.Decimal}static isDate(e){return e&&e.typeId===ar.Date}static isTime(e){return e&&e.typeId===ar.Time}static isTimestamp(e){return e&&e.typeId===ar.Timestamp}static isInterval(e){return e&&e.typeId===ar.Interval}static isList(e){return e&&e.typeId===ar.List}static isStruct(e){return e&&e.typeId===ar.Struct}static isUnion(e){return e&&e.typeId===ar.Union}static isFixedSizeBinary(e){return e&&e.typeId===ar.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===ar.FixedSizeList}static isMap(e){return e&&e.typeId===ar.Map}static isDictionary(e){return e&&e.typeId===ar.Dictionary}get typeId(){return ar.NONE}compareTo(e){return this===e}}Symbol,Symbol,p8=Symbol.toStringTag;class Im extends XP{constructor(e,t){super(),Yt(this,"isSigned",void 0),Yt(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return ar.Int}get[p8](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class tve extends Im{constructor(){super(!0,8)}}class nve extends Im{constructor(){super(!0,16)}}class ive extends Im{constructor(){super(!0,32)}}class rve extends Im{constructor(){super(!1,8)}}class sve extends Im{constructor(){super(!1,16)}}class ove extends Im{constructor(){super(!1,32)}}g8=Symbol.toStringTag;class C8 extends XP{constructor(e){super(),Yt(this,"precision",void 0),this.precision=e}get typeId(){return ar.Float}get[g8](){return"Float"}toString(){return`Float${this.precision}`}}class ave extends C8{constructor(){super(32)}}class lve extends C8{constructor(){super(64)}}Symbol,Symbol,m8=Symbol.toStringTag,_8=Symbol.toStringTag,y8=Symbol.toStringTag,v8=Symbol.toStringTag,b8=Symbol.toStringTag;class cve extends XP{constructor(e,t){super(),Yt(this,"listSize",void 0),Yt(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return ar.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[b8](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class tM{constructor(e,t,i=!1,r=new Map){Yt(this,"name",void 0),Yt(this,"type",void 0),Yt(this,"nullable",void 0),Yt(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new tM(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function w8(n,e,t){const i=t?E8(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new tve;case Uint8Array:return new rve;case Int16Array:return new nve;case Uint16Array:return new sve;case Int32Array:return new ive;case Uint32Array:return new ove;case Float32Array:return new ave;case Float64Array:return new lve;default:throw new Error("array type not supported")}}(e.value);return new tM(n,new cve(e.size,new tM("value",r)),!1,i)}function E8(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const S8={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},fve={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class gve{constructor(e){Yt(this,"draco",void 0),Yt(this,"decoder",void 0),Yt(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=E8(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=w8(o,n[o],s[o]);r.push(l)}if(t){const o=w8("indices",t);r.push(o)}return new Om(r,i)}(l.attributes,a,l.indices);return an(J({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var nM=Ve(125);const JP={};function eR(n){return tR.apply(this,arguments)}function tR(){return(tR=un(function*(n,e=null,t={}){return e&&(n=bve(n,e,t)),JP[n]=JP[n]||Cve(n),yield JP[n]})).apply(this,arguments)}function bve(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:tP?t.CDN?(Xc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):nP?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Cve(n){return nR.apply(this,arguments)}function nR(){return(nR=un(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():tP?nP?importScripts(n):wve(yield(yield fetch(n)).text(),n):nM.requireFromFile&&(yield nM.requireFromFile(n))})).apply(this,arguments)}function wve(n,e){if(!tP)return nM.requireFromString&&nM.requireFromString(n,e);if(nP)return eval.call(fpe,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Eve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Sve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Mve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Mb;function Tve(n){return iR.apply(this,arguments)}function iR(){return(iR=un(function*(n){const e=n.modules||{};return Mb=e.draco3d?Mb||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Mb||Ave(n),yield Mb})).apply(this,arguments)}function Ave(n){return sR.apply(this,arguments)}function sR(){return(sR=un(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield eR(Eve,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield eR(Sve,"draco",n),yield eR(Mve,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Dve(e,t)})).apply(this,arguments)}function Dve(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(an(J({},t),{onModuleLoaded:r=>i({draco:r})}))})}const aR=an(J({},h8),{parse:function(n,e){return lR.apply(this,arguments)}});function lR(){return(lR=un(function*(n,e){const{draco:t}=yield Tve(e),i=new gve(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Tb(n,e){return Qf(n>=0),Qf(e>0),n+(e-1)&~(e-1)}function Pve(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+Tb(i.byteLength,4)}const M8=["SCALAR","VEC2","VEC3","VEC4"],Rve=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],kve=new Map(Rve),Fve={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nve={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lve={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function x8(n){return M8[n-1]||M8[0]}function T8(n){const e=kve.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function A8(n,e){const t=Lve[n.componentType],i=Fve[n.type],s=n.count*i,o=n.count*i*Nve[n.componentType];return Oa(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const Bve={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class hh{constructor(e){Yt(this,"gltf",void 0),Yt(this,"sourceBuffers",void 0),Yt(this,"byteLength",void 0),this.gltf=e||{json:J({},Bve),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return Oa(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=A8(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return Oa(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Oa(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=VP(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Oa(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Tb(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:x8(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:T8(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Pve(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Xve(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function Kve(n){return dR.apply(this,arguments)}function dR(){return(dR=un(function*(n){const e=new hh(n),{json:t}=e;e.removeExtension(rM);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,rM)})).apply(this,arguments)}function Zve(n){const e=new hh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,rM,{}),e.addExtension(rM))}function Qve(n){return hR.apply(this,arguments)}function hR(){return(hR=un(function*(n){const e=new hh(n),{json:t}=e,i=e.getExtension(Pm);i&&(e.json.lights=i.lights,e.removeExtension(Pm));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Pm);s&&(r.light=s.light),e.removeObjectExtension(r,Pm)}})).apply(this,arguments)}function Jve(n){return fR.apply(this,arguments)}function fR(){return(fR=un(function*(n){const e=new hh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Pm);Oa(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Pm,i);delete e.json.lights}})).apply(this,arguments)}function ebe(n){return pR.apply(this,arguments)}function pR(){return(pR=un(function*(n){const e=new hh(n),{json:t}=e,i=e.getExtension(sM);if(i){const r=nbe(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,sM);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=ibe(s.technique,e)),e.removeObjectExtension(s,sM)}e.removeExtension(sM)}})).apply(this,arguments)}function tbe(n,e){return gR.apply(this,arguments)}function gR(){return(gR=un(function*(n,e){})).apply(this,arguments)}function nbe(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function ibe(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const I8={KHR_draco_mesh_compression:_t,KHR_materials_unlit:k,KHR_lights_punctual:It,KHR_techniques_webgl:Pt};function rbe(n){return mR.apply(this,arguments)}function mR(){return(mR=un(function*(n,e={},t){for(const r in I8){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield I8[r].decode(n,e,t))}})).apply(this,arguments)}const P8={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},obe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class abe{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new hh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,D8);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(D8)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in P8)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in P8)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=obe[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function lbe(n,e={}){return(new abe).normalize(n,e)}const cbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ube={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_l={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},dbe={magFilter:_l.TEXTURE_MAG_FILTER,minFilter:_l.TEXTURE_MIN_FILTER,wrapS:_l.TEXTURE_WRAP_S,wrapT:_l.TEXTURE_WRAP_T},hbe={[_l.TEXTURE_MAG_FILTER]:_l.LINEAR,[_l.TEXTURE_MIN_FILTER]:_l.NEAREST_MIPMAP_LINEAR,[_l.TEXTURE_WRAP_S]:_l.REPEAT,[_l.TEXTURE_WRAP_]:_l.REPEAT};class gbe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Oa(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=J({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=J({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=J({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=J({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=J({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=J({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=J({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return ube[n]}(e.componentType),e.components=function(n){return cbe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=A8(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):hbe,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return dbe[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function mbe(n,e){return(new gbe).postProcess(n,e)}const R8=1735152710,Rm=!0;function yR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Tb(i,4)}function vR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Tb(i,4)}function Abe(n,e){return bR.apply(this,arguments)}function bR(){return(bR=un(function*(n,e,t=0,i,r){var s,o,a,l;Dbe(n,e,t,i),lbe(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Obe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Ibe(n,i,r);c.push(f)}const d=rbe(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?mbe(n,i):n})).apply(this,arguments)}function Dbe(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=R8}=t,s=i.getUint32(e,!1);return s===r||s===R8}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?c8(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?c8(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,Rm),a=r.getUint32(t+8,Rm);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){Qf(n.header.byteLength>20);const i=e.getUint32(t+0,Rm),r=e.getUint32(t+4,Rm);return t+=8,Qf(0===r),yR(n,e,t,i),(t+=i)+vR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Qf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,Rm),s=e.getUint32(t+4,Rm);switch(t+=8,s){case 1313821514:yR(n,e,t,r);break;case 5130562:vR(n,e,t,r);break;case 0:i.strict||yR(n,e,t,r);break;case 1:i.strict||vR(n,e,t,r)}t+=Tb(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),Oa("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Oa(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Obe(n,e,t){return CR.apply(this,arguments)}function CR(){return(CR=un(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield Fbe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function Fbe(n){return xR.apply(this,arguments)}function xR(){return(xR=un(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const k8=[255,255,255,255],Bbe={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:k8},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[km]};let Vbe=(()=>{class n extends SP{getShaders(){const t=[jH,GH];return"pbr"===this.props._lighting&&t.push(JH),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:k8,transition:!0},instanceModelMatrix:KH})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Dm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Gye(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=J({gltf:l},c),function(n){return MR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Zn.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Dm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Zn.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Zn.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Dm&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:J({isInstanced:!0,transpileToGLSL100:!Mn(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:ZH(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=Bbe,n})();const jbe=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Ube=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),zbe=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Hbe=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),$be={POSITION:{size:3,value:new Float32Array(Ube)},NORMAL:{size:3,value:new Float32Array(zbe)},TEXCOORD_0:{size:2,value:new Float32Array(Hbe)}};class Gbe extends QS{constructor(e={}){const{id:t=Wc("cube-geometry")}=e;super(an(J({},e),{id:t,indices:{size:1,value:new Uint16Array(jbe)},attributes:J(J({},$be),e.attributes)}))}}class tu{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new S){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new S){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new S){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new S){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new S){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new S){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new S){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=qbe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=Ybe;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(F8),F8.almostEquals(e,t)}clone(){return new S(this.x,this.y,this.z)}}S.ZERO=void 0,S.UNIT_X=void 0,S.UNIT_Y=void 0,S.UNIT_Z=void 0,S.ZERO=new S(0,0,0),S.UNIT_X=new S(1,0,0),S.UNIT_Y=new S(0,1,0),S.UNIT_Z=new S(0,0,1);const qbe=new S,Ybe=new S,F8=new S;class Mi{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new S,this.upperBound=new S,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=L8;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=L8;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const N8=new S,L8=[new S,new S,new S,new S,new S,new S,new S,new S];class Rr{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new S){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=Kbe;e.tangents(i,Zbe),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(zi(e.length(),2)*zi(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new Rr){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new Rr){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new Rr){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new S){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new Rr(this.x,this.y,this.z,this.w)}slerp(e,t,i=new Rr){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,y,v,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-t)*p)/_,v=Math.sin(t*p)/_):(y=1-t,v=t),i.x=y*r+v*l,i.y=y*s+v*c,i.z=y*o+v*d,i.w=y*a+v*f,i}integrate(e,t,i,r=new Rr){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const Kbe=new S,Zbe=new S,Qbe={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let ut=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=Qbe,n})();class Qn{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new S,this.quaternion=new Rr,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Qn.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Qn.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new S){return i.vsub(e,r),t.conjugate(V8),V8.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new S){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new S){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new S){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const V8=new Rr;class tp extends ut{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:ut.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new S;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=y,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new S,d=new S,f=new S,p=new S,g=new S,_=new S;let y=Number.MAX_VALUE;const v=this;if(v.uniqueAxes)for(let w=0;w!==v.uniqueAxes.length;w++){i.vmult(v.uniqueAxes[w],c);const C=v.testSepAxis(c,e,t,i,r,s);if(!1===C)return!1;C0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){tp.project(this,e,i,r,TR),tp.project(t,e,s,o,AR);const l=TR[0],c=TR[1],d=AR[0],f=AR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?dt.STATIC:dt.DYNAMIC,typeof e.type==typeof dt.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=dt.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new S,this.quaternion=new Rr,this.initQuaternion=new Rr,this.previousQuaternion=new Rr,this.interpolatedQuaternion=new Rr,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new S,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new S,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new S,this.invInertia=new S,this.invInertiaWorld=new tu,this.invMassSolve=0,this.invInertiaSolve=new S,this.invInertiaWorldSolve=new tu,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new S(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new S(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new Mi,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new S,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=dt.AWAKE,this.wakeUpAfterNarrowphase=!1,e===dt.SLEEPING&&this.dispatchEvent(dt.wakeupEvent)}sleep(){this.sleepState=dt.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=zi(this.sleepSpeedLimit,2);t===dt.AWAKE&&ir?this.wakeUp():t===dt.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(dt.sleepEvent))}}updateSolveMassProperties(){this.sleepState===dt.SLEEPING||this.type===dt.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new S){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new S){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new S,s=new Rr;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=t0e,o=n0e,a=this.quaternion,l=this.aabb,c=i0e;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=r0e,r=s0e;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new S){if(this.type!==dt.DYNAMIC)return;this.sleepState===dt.SLEEPING&&this.wakeUp();const i=o0e;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new S){if(this.type!==dt.DYNAMIC)return;const i=a0e,r=l0e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===dt.DYNAMIC&&(this.sleepState===dt.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new S){if(this.type!==dt.DYNAMIC)return;this.sleepState===dt.SLEEPING&&this.wakeUp();const i=t,r=c0e;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=u0e;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new S){if(this.type!==dt.DYNAMIC)return;const i=d0e,r=h0e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=f0e;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),aM.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new S;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==dt.DYNAMIC&&this.type!==dt.KINEMATIC||this.sleepState===dt.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,y=this.angularFactor,v=l.x*y.x,w=l.y*y.y,C=l.z*y.z;s.x+=e*(_[0]*v+_[1]*w+_[2]*C),s.y+=e*(_[3]*v+_[4]*w+_[5]*C),s.z+=e*(_[6]*v+_[7]*w+_[8]*C),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}dt.idCounter=0,dt.COLLIDE_EVENT_NAME="collide",dt.DYNAMIC=1,dt.STATIC=2,dt.KINEMATIC=4,dt.AWAKE=0,dt.SLEEPY=1,dt.SLEEPING=2,dt.wakeupEvent={type:"wakeup"},dt.sleepyEvent={type:"sleepy"},dt.sleepEvent={type:"sleep"};const t0e=new S,n0e=new Rr,i0e=new Mi,r0e=new tu,s0e=new tu,o0e=new S,a0e=new S,l0e=new S,c0e=new S,u0e=new S,d0e=new S,h0e=new S,f0e=new S;new S,new S;class lM{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new S,this.rayToWorld=new S,this.hitNormalWorld=new S,this.hitPointWorld=new S,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let j8,U8,z8,H8,$8,G8,W8;j8=ut.types.SPHERE,U8=ut.types.PLANE,z8=ut.types.BOX,H8=ut.types.CYLINDER,$8=ut.types.CONVEXPOLYHEDRON,G8=ut.types.HEIGHTFIELD,W8=ut.types.TRIMESH;class zr{get[j8](){return this._intersectSphere}get[U8](){return this._intersectPlane}get[z8](){return this._intersectBox}get[H8](){return this._intersectConvex}get[$8](){return this._intersectConvex}get[G8](){return this._intersectHeightfield}get[W8](){return this._intersectTrimesh}constructor(e=new S,t=new S){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new S,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=zr.ANY,this.result=new lM,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||zr.ANY,this.result=t.result||new lM,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(q8),PR.length=0,e.broadphase.aabbQuery(e,q8,PR),this.intersectBodies(PR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=b0e,s=C0e;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new S(0,0,1);t.vmult(c,c);const d=new S;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&y<=1&&(o.lerp(a,y,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=x0e,l=X8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,v=_.distanceTo(this.to),w=c?c.length:d.length,C=this.result;for(let x=0;!C.shouldStop&&xv||this.reportIntersection(a,na,s,r,L)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=T0e,l=R0e,c=k0e,d=X8,f=A0e,p=D0e,g=O0e,_=P0e,y=I0e,v=e.indices,w=this.from,C=this.to,x=this.direction;c.position.copy(i),c.quaternion.copy(t),Qn.vectorToLocalFrame(i,t,x,f),Qn.pointToLocalFrame(i,t,w,p),Qn.pointToLocalFrame(i,t,C,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const L=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let U=0,$=l.length;!this.result.shouldStop&&U!==$;U++){const ee=l[U];e.getNormal(ee,a),e.getVertex(v[3*ee],ac),ac.vsub(p,d);const fe=f.dot(a),pe=a.dot(d)/fe;if(pe<0)continue;f.scale(pe,na),na.vadd(p,na),e.getVertex(v[3*ee+1],iu),e.getVertex(v[3*ee+2],ru);const ve=na.distanceSquared(p);!zr.pointInTriangle(na,iu,ac,ru)&&!zr.pointInTriangle(na,ac,iu,ru)||ve>L||(Qn.vectorToWorldFrame(t,a,y),Qn.pointToWorldFrame(i,t,na,_),this.reportIntersection(y,_,s,r,ee))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case zr.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case zr.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var su=Ve(517);function Bm(n,e,t){e||(e=new Lt(Lt.IDENTITY));const i=new Lt(Lt.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new Lt(Lt.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new Lt(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===Bm(s,r,t))return!1;return!0}function j6(){W5([h8,km])}function U6(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||Bm(r,new Lt(Lt.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function NR(n,e){return gl(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield VS(i,km,{DracoLoader:aR,gltf:{decompressMeshes:!0,postProcess:!0}});return U6(n.scenegraphNode,r)})}function FEe(n,e){return gl(this,void 0,void 0,function*(){return U6(n,yield e)})}function LR(n,e,t){if(e&&0!==e.length)return new uye(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Hn.CARTESIAN,data:e,mesh:new Gbe,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let LEe=(()=>{class n extends hge{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),j6()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){gl(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new Lt(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new Mi({lowerBound:new S(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new S(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield jS(o.scenegraph,km,{DracoLoader:aR,decompress:!0,postProcess:!0});for(const l of a.scenes)Bm(l,new Lt(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new Mi({lowerBound:new S(...p.map((_,y)=>Math.min(_,g[y]))),upperBound:new S(...g.map((_,y)=>Math.max(_,p[y])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=NR({scenegraph:l.scenegraph},n.gltfCache));return[LR("cubes",i,{wireframe:!1,pickable:!1}),LR("pickableCubes",r,{wireframe:!1,pickable:!0}),LR("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new Vbe({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Hn.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?FEe(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function z6(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),z6(t,e);return e}let VEe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new LEe({}),this.nodeClickSubject=new we,this.nodeHoverStartSubject=new we,this.nodeHoverStopSubject=new we,this.sceneRotationSubject=new sr([0,0]),this.nodeDragStartSubject=new we,this.nodeDragSubject=new we,this.nodeDragEndSubject=new we,this.nodeClick$=this.nodeClickSubject.pipe(Vs()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Vs()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Vs()),this.sceneRotation$=this.sceneRotationSubject.pipe(Vs()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Vs()),this.nodeDrag$=this.nodeDragSubject.pipe(Vs()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Vs());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Sge({flipY:!1,near:-1e3}):new Tge({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new OP({ambientLight:new nH({color:[255,255,255],intensity:10})})]),this.deck=new ZS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return gl(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new Lt([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return gl(this,void 0,void 0,function*(){j6();const i=yield NR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)Bm(o,e=new Lt(e||Lt.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new Lt(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new Lt(e||Lt.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new Mi({lowerBound:new S(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new S(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of z6(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new S(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new Lt(Lt.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new Lt(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return De([su.ZP],n.prototype,"_onHover",null),De([su.ZP],n.prototype,"_onClick",null),De([su.ZP],n.prototype,"_onViewStateChange",null),De([su.ZP],n.prototype,"_onDragStart",null),De([su.ZP],n.prototype,"_onDrag",null),De([su.ZP],n.prototype,"_onDragEnd",null),n})();function jEe(n,e){return n===e}function UEe(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let BR=(()=>{class n{constructor(){this.bootstrap$=new Hg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const VR=new _e("INITIAL_STATE_TOKEN");let $Ee=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const $6=new _e("Internals.StateContextFactory"),G6=new _e("Internals.StateFactory");function W6(n,e){return e?t=>t.pipe(W6((i,r)=>li(n(i,r)).pipe(be((s,o)=>e(i,s,r,o))))):t=>t.lift(new GEe(n))}class GEe{constructor(e){this.project=e}call(e,t){return t.subscribe(new WEe(e,this.project))}}class WEe extends ei{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new $r(this),i=this.destination;i.add(t);const r=oo(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function _M(n=null){return e=>e.lift(new qEe(n))}class qEe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new YEe(e,this.defaultValue))}}class YEe extends Rt{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}const Ia={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let q6=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return wD(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return lt.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return lt.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof lt||console.warn(Ia.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(cl))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Y6=new _e("ROOT_STATE_TOKEN"),X6=new _e("FEATURE_STATE_TOKEN"),jR=new _e("NGXS_PLUGINS"),K6=new _e("NG_TEST_MODE"),Z6=new _e("NG_DEV_MODE"),sd="NGXS_META",Q6="NGXS_OPTIONS_META",UR="NGXS_SELECTOR_META";let op=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=q6}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class XEe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const J6=new _e("NGXS_EXECUTION_STRATEGY");function ap(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const zR=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},Vm=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),HR=n=>n&&"object"==typeof n&&!Array.isArray(n),$R=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(HR(n)&&HR(t))for(const i in t)HR(t[i])?(n[i]||Object.assign(n,{[i]:{}}),$R(n[i],t[i])):Object.assign(n,{[i]:t[i]});return $R(n,...e)};function Fb(n){return n[sd]}function qR(n){return n[UR]}function t$(n,e){const t=Vm(e.currentAppState,n.path),i=Vm(e.newAppState,n.path);return new XEe(t,i,!n.isInitialised)}function rSe(...n){return function(n,e,t=aSe){const i=function(n){return n.reduce((e,t)=>(e[ap(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Tn(t=>{const i=ap(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function aSe(){return be(n=>n.action)}function yM(n){return e=>new oe(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let vM=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(I(J6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class uSe extends we{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let bM=(()=>{class n extends uSe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),dSe=(()=>{class n extends oe{constructor(t,i){super(r=>{const s=t.pipe(yM(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(I(bM),I(vM))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const n$=n=>(...e)=>n.shift()(...e,(...i)=>n$(n)(...i));let CM=(()=>{class n extends sr{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),YR=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(I(n,12),I(jR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),XR=(()=>{class n extends we{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),i$=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Uo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(yM(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?st(this._stateStream.getValue()):Bv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!ap(t))return zg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return n$([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(Hc())}getActionResultStream(t){return this._actionResults.pipe(Tn(i=>i.action===t&&"DISPATCHED"!==i.status),_i(1),Hc())}createDispatchObservable(t){return t.pipe(W6(i=>{switch(i.status){case"SUCCESSFUL":return st(this._stateStream.getValue());case"ERRORED":return zg(i.error);default:return Ql}})).pipe(Hc())}}return n.\u0275fac=function(t){return new(t||n)(I(Tt),I(bM),I(XR),I(YR),I(CM),I(vM))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const r$=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&r$(n[i])}),n};let s$=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(I(Z6),I(K6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),o$=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Ia.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ia.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(I(s$),I(op))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Um=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=r$(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(I(CM),I(i$),I(op),I(o$))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),wM=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Vm(l,t.path)}function s(l,c){const d=zR(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=t$(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Ia.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ia.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(I(Um))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class EM{static stateNameErrorMessage(e){return Ia.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ia.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Ia.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=Fb(e);if(!t)throw new Error(Ia.STATE_DECORATOR());return t}}EM.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let zm=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=H6(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(EM.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[sd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[sd];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[sd].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[sd];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>zR(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Tn(t=>"DISPATCHED"===t.status),ci(({action:t})=>this.invokeActions(this._actions,t).pipe(be(()=>({action:t,status:"SUCCESSFUL"})),_M({action:t,status:"CANCELED"}),Sa(i=>st({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=ap(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=li(d)),d instanceof oe?(d=d.pipe(_M({})),l.options.cancelUncompleted&&(d=d.pipe(zn(t.pipe(rSe(i)))))):d=st({}).pipe(Hc()),s.push(d)}catch(d){s.push(zg(d))}}}return s.length||s.push(st({})),Bv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=EM.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==Vm(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(I(Tt),I(op),I(n,12),I(bM),I(XR),I(wM),I(VR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),KR=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Tn(()=>!!i),Di(()=>this.invokeInit(i.states)),ci(()=>this.bootstrapper.appBootstrapped$),Tn(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=t$(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Um),I(wM),I(BR))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();let ph=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(be(i),Sa(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?st(void 0):zg(r)}),Xo(),yM(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(_i(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(yM(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=qR(n)||Fb(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(I(CM),I(Um),I(op),I(vM),I(zm),I(VR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Nb=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(I(ph),I(op))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class c${static get type(){return"@@INIT"}}class u${constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const MM=new Hg(1);let vSe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&wo();MM.next(t)}catch(n){MM.next(!1)}finally{MM.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new c$,l)}}return n.\u0275fac=function(t){return new(t||n)(I(zm),I(Um),I(ph),I(Nb),I(Y6,8),I(KR))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),bSe=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new u$(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(I(ph),I(Um),I(zm),I(X6,8),I(KR))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();class ia{static forRoot(e=[],t={}){return{ngModule:vSe,providers:[zm,wM,dSe,bM,BR,o$,s$,KR,i$,XR,Um,vM,ph,CM,Nb,YR,...e,...ia.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:bSe,providers:[zm,YR,...e,{provide:X6,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:K6,useValue:HEe},{provide:Z6,useValue:wo},{provide:J6,useClass:t.executionStrategy||q6},{provide:Y6,useValue:e},{provide:ia.ROOT_OPTIONS,useValue:t},{provide:op,useFactory:ia.ngxsConfigFactory,deps:[ia.ROOT_OPTIONS]},{provide:pv,useFactory:ia.appBootstrapListenerFactory,multi:!0,deps:[BR]},{provide:VR,useFactory:ia.getInitialState},{provide:$6,useExisting:wM},{provide:G6,useExisting:zm}]}static ngxsConfigFactory(e){return $R(new op,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return $Ee.pop()}}function gh(n){return i=>{!function(n){MM.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ia.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(sd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,sd,{value:e})}return Fb(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[Q6]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;EM.checkCorrectStateName(d),s.hasOwnProperty(sd)&&(r.actions=Object.assign({},r.actions,(s[sd]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[Q6]=a}}ia.\u0275fac=function(e){return new(e||ia)},ia.\u0275mod=xe({type:ia}),ia.\u0275inj=Ee({}),ia.ROOT_OPTIONS=new _e("ROOT_OPTIONS");let d$=(()=>{class n{constructor(t,i){this._renderer=t,this._elementRef=i,this.onChange=r=>{},this.onTouched=()=>{}}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return n.\u0275fac=function(t){return new(t||n)(E(Lc),E(nt))},n.\u0275dir=he({type:n}),n})(),lp=(()=>{class n extends d${}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,features:[ht]}),n})();const Ao=new _e("NgValueAccessor"),ASe={provide:Ao,useExisting:T(()=>Lb),multi:!0},OSe=new _e("CompositionEventMode");let Lb=(()=>{class n extends d${constructor(t,i,r){super(t,i),this._compositionMode=r,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const n=Vc()?Vc().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return n.\u0275fac=function(t){return new(t||n)(E(Lc),E(nt),E(OSe,8))},n.\u0275dir=he({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,i){1&t&&ye("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},features:[At([ASe]),ht]}),n})();function mh(n){return null==n||0===n.length}function f$(n){return null!=n&&"number"==typeof n.length}const ws=new _e("NgValidators"),_h=new _e("NgAsyncValidators"),ISe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class p${static min(e){return function(n){return e=>{if(mh(e.value)||mh(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t{if(mh(e.value)||mh(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}(e)}static required(e){return function(n){return mh(n.value)?{required:!0}:null}(e)}static requiredTrue(e){return function(n){return!0===n.value?null:{required:!0}}(e)}static email(e){return function(n){return mh(n.value)||ISe.test(n.value)?null:{email:!0}}(e)}static minLength(e){return function(n){return e=>mh(e.value)||!f$(e.value)?null:e.value.lengthf$(e.value)&&e.value.length>n?{maxlength:{requiredLength:n,actualLength:e.value.length}}:null}(e)}static pattern(e){return function(n){if(!n)return yh;let e,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),i=>{if(mh(i.value))return null;const r=i.value;return e.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}(e)}static nullValidator(e){return null}static compose(e){return A$(e)}static composeAsync(e){return D$(e)}}function yh(n){return null}function E$(n){return null!=n}function S$(n){const e=Wy(n)?li(n):n;return yw(e),e}function M$(n){let e={};return n.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function x$(n,e){return e.map(t=>t(n))}function T$(n){return n.map(e=>function(n){return!n.validate}(e)?e:t=>e.validate(t))}function A$(n){if(!n)return null;const e=n.filter(E$);return 0==e.length?null:function(t){return M$(x$(t,e))}}function ZR(n){return null!=n?A$(T$(n)):null}function D$(n){if(!n)return null;const e=n.filter(E$);return 0==e.length?null:function(t){return Bv(x$(t,e).map(S$)).pipe(be(M$))}}function QR(n){return null!=n?D$(T$(n)):null}function O$(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function I$(n){return n._rawValidators}function P$(n){return n._rawAsyncValidators}function JR(n){return n?Array.isArray(n)?n:[n]:[]}function xM(n,e){return Array.isArray(n)?n.includes(e):n===e}function R$(n,e){const t=JR(e);return JR(n).forEach(r=>{xM(t,r)||t.push(r)}),t}function k$(n,e){return JR(e).filter(t=>!xM(n,t))}let F$=(()=>{class n{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=ZR(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=QR(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,i){return!!this.control&&this.control.hasError(t,i)}getError(t,i){return this.control?this.control.getError(t,i):null}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n}),n})(),Do=(()=>{class n extends F${get formDirective(){return null}get path(){return null}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,features:[ht]}),n})();class lc extends F${constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let ek=(()=>{class n extends class{constructor(e){this._cd=e}is(e){var t,i,r;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(r=null===(i=this._cd)||void 0===i?void 0:i.control)||void 0===r?void 0:r[e])}}{constructor(t){super(t)}}return n.\u0275fac=function(t){return new(t||n)(E(lc,2))},n.\u0275dir=he({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,i){2&t&&at("ng-untouched",i.is("untouched"))("ng-touched",i.is("touched"))("ng-pristine",i.is("pristine"))("ng-dirty",i.is("dirty"))("ng-valid",i.is("valid"))("ng-invalid",i.is("invalid"))("ng-pending",i.is("pending"))},features:[ht]}),n})();function Bb(n,e){ik(n,e),e.valueAccessor.writeValue(n.value),function(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&B$(n,e)})}(n,e),function(n,e){const t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&B$(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function(n,e){if(e.valueAccessor.setDisabledState){const t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function DM(n,e,t=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),IM(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function OM(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function ik(n,e){const t=I$(n);null!==e.validator?n.setValidators(O$(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const i=P$(n);null!==e.asyncValidator?n.setAsyncValidators(O$(i,e.asyncValidator)):"function"==typeof i&&n.setAsyncValidators([i]);const r=()=>n.updateValueAndValidity();OM(e._rawValidators,r),OM(e._rawAsyncValidators,r)}function IM(n,e){let t=!1;if(null!==n){if(null!==e.validator){const r=I$(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.validator);s.length!==r.length&&(t=!0,n.setValidators(s))}}if(null!==e.asyncValidator){const r=P$(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.asyncValidator);s.length!==r.length&&(t=!0,n.setAsyncValidators(s))}}}const i=()=>{};return OM(e._rawValidators,i),OM(e._rawAsyncValidators,i),t}function B$(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function V$(n,e){ik(n,e)}function rk(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}function j$(n,e){n._syncPendingControls(),e.forEach(t=>{const i=t.control;"submit"===i.updateOn&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function sk(n,e){if(!e)return null;let t,i,r;return Array.isArray(e),e.forEach(s=>{s.constructor===Lb?t=s:function(n){return Object.getPrototypeOf(n.constructor)===lp}(s)?i=s:r=s}),r||i||t||null}function PM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const Vb="VALID",RM="INVALID",Hm="PENDING",jb="DISABLED";function ok(n){return(lk(n)?n.validators:n)||null}function U$(n){return Array.isArray(n)?ZR(n):n||null}function ak(n,e){return(lk(e)?e.asyncValidators:n)||null}function z$(n){return Array.isArray(n)?QR(n):n||null}function lk(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}class ck{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=U$(this._rawValidators),this._composedAsyncValidatorFn=z$(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===Vb}get invalid(){return this.status===RM}get pending(){return this.status==Hm}get disabled(){return this.status===jb}get enabled(){return this.status!==jb}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=U$(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=z$(e)}addValidators(e){this.setValidators(R$(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(R$(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(k$(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(k$(e,this._rawAsyncValidators))}hasValidator(e){return xM(this._rawValidators,e)}hasAsyncValidator(e){return xM(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Hm,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=jb,this.errors=null,this._forEachChild(i=>{i.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(i=>i(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Vb,this._forEachChild(i=>{i.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Vb||this.status===Hm)&&this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?jb:Vb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Hm,this._hasOwnPendingAsyncValidator=!0;const t=S$(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(i=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(i,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(n,e,t){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=n;return e.forEach(r=>{i=i instanceof uk?i.controls.hasOwnProperty(r)?i.controls[r]:null:i instanceof $Se&&i.at(r)||null}),i}(this,e)}getError(e,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Pe,this.statusChanges=new Pe}_calculateStatus(){return this._allControlsDisabled()?jb:this.errors?RM:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Hm)?Hm:this._anyControlsHaveStatus(RM)?RM:Vb}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){lk(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class vh extends ck{constructor(e=null,t,i){super(ok(t),ak(i,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(i=>i(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){PM(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){PM(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class uk extends ck{constructor(e,t,i){super(ok(t),ak(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t instanceof vh?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>!!i._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error(`Cannot find form control with name: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const i=this.controls[t];if(this.contains(t)&&e(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,i)=>((t.enabled||this.disabled)&&(e[i]=t.value),e))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class $Se extends ck{constructor(e,t,i){super(ok(t),ak(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,i={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((i,r)=>{this._throwIfControlMissing(r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof vh?e.value:e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce((t,i)=>!!i._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error(`Cannot find form control at index ${e}`)}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const GSe={provide:Do,useExisting:T(()=>cp)},Ub=(()=>Promise.resolve(null))();let cp=(()=>{class n extends Do{constructor(t,i){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Pe,this.form=new uk({},ZR(t),QR(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){Ub.then(()=>{const i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),Bb(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){Ub.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name),PM(this._directives,t)})}addFormGroup(t){Ub.then(()=>{const i=this._findContainer(t.path),r=new uk({});V$(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){Ub.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){Ub.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,j$(this.form,this._directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10))},n.\u0275dir=he({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,i){1&t&&ye("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[At([GSe]),ht]}),n})();const qSe={provide:lc,useExisting:T(()=>dk)},W$=(()=>Promise.resolve(null))();let dk=(()=>{class n extends lc{constructor(t,i,r,s){super(),this.control=new vh,this._registered=!1,this.update=new Pe,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=sk(0,s)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),rk(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(n,e){return[...e.path,n]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Bb(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){W$.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const i=t.isDisabled.currentValue,r=""===i||i&&"false"!==i;W$.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable()})}}return n.\u0275fac=function(t){return new(t||n)(E(Do,9),E(ws,10),E(_h,10),E(Ao,10))},n.\u0275dir=he({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[At([qSe]),ht,qn]}),n})(),X$=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const hk=new _e("NgModelWithFormControlWarning"),QSe={provide:lc,useExisting:T(()=>kM)};let kM=(()=>{class n extends lc{constructor(t,i,r,s){super(),this._ngModelWarningConfig=s,this.update=new Pe,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=sk(0,r)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const i=t.form.previousValue;i&&DM(i,this,!1),Bb(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}rk(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&DM(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_isControlChanged(t){return t.hasOwnProperty("form")}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10),E(Ao,10),E(hk,8))},n.\u0275dir=he({type:n,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[At([QSe]),ht,qn]}),n._ngModelWarningSentOnce=!1,n})();const JSe={provide:Do,useExisting:T(()=>$m)};let $m=(()=>{class n extends Do{constructor(t,i){super(),this.validators=t,this.asyncValidators=i,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Pe,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(IM(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const i=this.form.get(t.path);return Bb(i,t),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}removeControl(t){DM(t.control||null,t,!1),PM(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this.submitted=!0,j$(this.form,this.directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const i=t.control,r=this.form.get(t.path);i!==r&&(DM(i||null,t),r instanceof vh&&(Bb(r,t),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const i=this.form.get(t.path);V$(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const i=this.form.get(t.path);i&&function(n,e){return IM(n,e)}(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){ik(this.form,this),this._oldForm&&IM(this._oldForm,this)}_checkFormPresent(){}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10))},n.\u0275dir=he({type:n,selectors:[["","formGroup",""]],hostBindings:function(t,i){1&t&&ye("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[At([JSe]),ht,qn]}),n})(),uG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[X$]]}),n})(),yk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[uG]}),n})(),vk=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:hk,useValue:t.warnOnNgModelWithFormControl}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[uG]}),n})();function zb(n){return new oe(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?li(t):fE()).subscribe(e)})}function bk(n,e=Tf){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new yMe(i,e))}class yMe{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new Ck(e,this.delay,this.scheduler))}}class Ck extends Rt{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(Ck.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new vMe(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(qo.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(qo.createComplete()),this.unsubscribe()}}class vMe{constructor(e,t){this.time=e,this.notification=t}}const pG=Yg({passive:!0});let gG=(()=>{class n{constructor(t,i){this._platform=t,this._ngZone=i,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return Ql;const i=Hu(t),r=this._monitoredElements.get(i);if(r)return r.subject;const s=new we,o="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||i.classList.contains(o)?"cdk-text-field-autofill-end"===l.animationName&&i.classList.contains(o)&&(i.classList.remove(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!1}))):(i.classList.add(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{i.addEventListener("animationstart",a,pG),i.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(i,{subject:s,unlisten:()=>{i.removeEventListener("animationstart",a,pG)}}),s}stopMonitoring(t){const i=Hu(t),r=this._monitoredElements.get(i);r&&(r.unlisten(),r.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((t,i)=>this.stopMonitoring(i))}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt))},token:n,providedIn:"root"}),n})(),mG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Av]]}),n})();const NMe=new _e("MAT_INPUT_VALUE_ACCESSOR"),LMe=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let BMe=0;const VMe=CO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let Hb=(()=>{class n extends VMe{constructor(t,i,r,s,o,a,l,c,d,f){super(a,s,o,r),this._elementRef=t,this._platform=i,this._autofillMonitor=c,this._formField=f,this._uid="mat-input-"+BMe++,this.focused=!1,this.stateChanges=new we,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._required=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(_=>Q3().has(_));const p=this._elementRef.nativeElement,g=p.nodeName.toLowerCase();this._inputValueAccessor=l||p,this._previousNativeValue=this.value,this.id=this.id,i.IOS&&d.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",_=>{const y=_.target;!y.value&&0===y.selectionStart&&0===y.selectionEnd&&(y.setSelectionRange(1,1),y.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===g,this._isTextarea="textarea"===g,this._isInFormField=!!f,this._isNativeSelect&&(this.controlType=p.multiple?"mat-native-select-multiple":"mat-native-select")}get disabled(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Dt(t),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(t){this._id=t||this._uid}get required(){return this._required}set required(t){this._required=Dt(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&Q3().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(t){t!==this.value&&(this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=Dt(t)}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}ngDoCheck(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}_focusChanged(t){t!==this.focused&&(this.focused=t,this.stateChanges.next())}_onInput(){}_dirtyCheckPlaceholder(){var t,i;const r=(null===(i=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===i?void 0:i.call(t))?null:this.placeholder;if(r!==this._previousPlaceholder){const s=this._elementRef.nativeElement;this._previousPlaceholder=r,r?s.setAttribute("placeholder",r):s.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){LMe.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const t=this._elementRef.nativeElement,i=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&i&&i.label)}return this.focused||!this.empty}setDescribedByIds(t){t.length?this._elementRef.nativeElement.setAttribute("aria-describedby",t.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(ii),E(lc,10),E(cp,8),E($m,8),E(kv),E(NMe,10),E(gG),E(lt),E(XE,8))},n.\u0275dir=he({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:9,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&t&&(sl("disabled",i.disabled)("required",i.required),en("id",i.id)("data-placeholder",i.placeholder)("readonly",i.readonly&&!i._isNativeSelect||null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required),at("mat-input-server",i._isServer))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[At([{provide:Nv,useExisting:n}]),ht,qn]}),n})(),$b=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[kv],imports:[[mG,Lv,Nn],mG,Lv]}),n})();function lr(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>be(function(n,e){return i=>{let r=i;for(let s=0;si.lift(new $Me(n,e,t.leading,t.trailing))}class $Me{constructor(e,t,i,r){this.duration=e,this.scheduler=t,this.leading=i,this.trailing=r}call(e,t){return t.subscribe(new GMe(e,this.duration,this.scheduler,this.leading,this.trailing))}}class GMe extends Rt{constructor(e,t,i,r,s){super(e),this.duration=t,this.scheduler=i,this.leading=r,this.trailing=s,this._hasTrailingValue=!1,this._trailingValue=null}_next(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(WMe,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)}}function WMe(n){const{subscriber:e}=n;e.clearThrottle()}var vG=Ve(266);const qMe={tooltipState:Jl("state",[br("initial, void, hidden",Kn({opacity:0,transform:"scale(0)"})),br("visible",Kn({transform:"scale(1)"})),Qs("* => visible",Mo("200ms cubic-bezier(0, 0, 0.2, 1)",kne([Kn({opacity:0,transform:"scale(0)",offset:0}),Kn({opacity:.5,transform:"scale(0.99)",offset:.5}),Kn({opacity:1,transform:"scale(1)",offset:1})]))),Qs("* => hidden",Mo("100ms cubic-bezier(0, 0, 0.2, 1)",Kn({opacity:0})))])},bG="tooltip-panel",CG=Yg({passive:!0}),wG=new _e("mat-tooltip-scroll-strategy"),ZMe={provide:wG,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition({scrollThrottle:20})}},QMe=new _e("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let e1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p,g){this._overlay=t,this._elementRef=i,this._scrollDispatcher=r,this._viewContainerRef=s,this._ngZone=o,this._platform=a,this._ariaDescriber=l,this._focusMonitor=c,this._dir=f,this._defaultOptions=p,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new we,this._handleKeydown=_=>{this._isTooltipVisible()&&27===_.keyCode&&!Yo(_)&&(_.preventDefault(),_.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=d,this._document=g,p&&(p.position&&(this.position=p.position),p.touchGestures&&(this.touchGestures=p.touchGestures)),f.change.pipe(zn(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),o.runOutsideAngular(()=>{i.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var i;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(i=this._tooltipInstance)||void 0===i||i.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}get message(){return this._message}set message(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")})}))}get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(zn(this._destroyed)).subscribe(t=>{t?"keyboard"===t&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const t=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),t.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(([i,r])=>{t.removeEventListener(i,r,CG)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay){if(this.disabled||!this.message||this._isTooltipVisible()&&!this._tooltipInstance._showTimeoutId&&!this._tooltipInstance._hideTimeoutId)return;const i=this._createOverlay();this._detach(),this._portal=this._portal||new sm(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=i.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(zn(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}hide(t=this.hideDelay){this._tooltipInstance&&this._tooltipInstance.hide(t)}toggle(){this._isTooltipVisible()?this.hide():this.show()}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(){if(this._overlayRef)return this._overlayRef;const t=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),i=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return i.positionChanges.pipe(zn(this._destroyed)).subscribe(r=>{this._updateCurrentPositionClass(r.connectionPair),this._tooltipInstance&&r.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:i,panelClass:`${this._cssClassPrefix}-${bG}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(zn(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(zn(this._destroyed)).subscribe(()=>{var r;return null===(r=this._tooltipInstance)||void 0===r?void 0:r._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const i=t.getConfig().positionStrategy,r=this._getOrigin(),s=this._getOverlayPosition();i.withPositions([this._addOffset(Object.assign(Object.assign({},r.main),s.main)),this._addOffset(Object.assign(Object.assign({},r.fallback),s.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i||"below"==i?r={originX:"center",originY:"above"==i?"top":"bottom"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={originX:"start",originY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={originX:"end",originY:"center"});const{x:s,y:o}=this._invertPosition(r.originX,r.originY);return{main:r,fallback:{originX:s,originY:o}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i?r={overlayX:"center",overlayY:"bottom"}:"below"==i?r={overlayX:"center",overlayY:"top"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={overlayX:"end",overlayY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={overlayX:"start",overlayY:"center"});const{x:s,y:o}=this._invertPosition(r.overlayX,r.overlayY);return{main:r,fallback:{overlayX:s,overlayY:o}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(_i(1),zn(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,i){return"above"===this.position||"below"===this.position?"top"===i?i="bottom":"bottom"===i&&(i="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:i}}_updateCurrentPositionClass(t){const{overlayY:i,originX:r,originY:s}=t;let o;if(o="center"===i?this._dir&&"rtl"===this._dir.value?"end"===r?"left":"right":"start"===r?"left":"right":"bottom"===i&&"top"===s?"above":"below",o!==this._currentPosition){const a=this._overlayRef;if(a){const l=`${this._cssClassPrefix}-${bG}-`;a.removePanelClass(l+this._currentPosition),a.addPanelClass(l+o)}this._currentPosition=o}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",()=>{this._setupPointerExitEventsIfNeeded(),this.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",()=>{this._setupPointerExitEventsIfNeeded(),clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>this.show(),500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",()=>this.hide()],["wheel",i=>this._wheelListener(i)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const i=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",i],["touchcancel",i])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([i,r])=>{this._elementRef.nativeElement.addEventListener(i,r,CG)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const i=this._document.elementFromPoint(t.clientX,t.clientY),r=this._elementRef.nativeElement;i!==r&&!r.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const i=this._elementRef.nativeElement,r=i.style;("on"===t||"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName)&&(r.userSelect=r.msUserSelect=r.webkitUserSelect=r.MozUserSelect="none"),("on"===t||!i.draggable)&&(r.webkitUserDrag="none"),r.touchAction="none",r.webkitTapHighlightColor="transparent"}}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(nt),E(rm),E(es),E(lt),E(ii),E(iV),E(hl),E(void 0),E(Ko),E(void 0),E(rt))},n.\u0275dir=he({type:n,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),n})(),cc=(()=>{class n extends e1e{constructor(t,i,r,s,o,a,l,c,d,f,p,g){super(t,i,r,s,o,a,l,c,d,f,p,g),this._tooltipComponent=n1e}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(nt),E(rm),E(es),E(lt),E(ii),E(iV),E(hl),E(wG),E(Ko,8),E(QMe,8),E(rt))},n.\u0275dir=he({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[ht]}),n})(),t1e=(()=>{class n{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new we}show(t){clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(()=>{this._visibility="visible",this._showTimeoutId=void 0,this._onShow(),this._markForCheck()},t)}hide(t){clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._visibility="hidden",this._hideTimeoutId=void 0,this._markForCheck()},t)}afterHidden(){return this._onHide}isVisible(){return"visible"===this._visibility}ngOnDestroy(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}_animationStart(){this._closeOnInteraction=!1}_animationDone(t){const i=t.toState;"hidden"===i&&!this.isVisible()&&this._onHide.next(),("visible"===i||"hidden"===i)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return n.\u0275fac=function(t){return new(t||n)(E(Un))},n.\u0275dir=he({type:n}),n})(),n1e=(()=>{class n extends t1e{constructor(t,i){super(t),this._breakpointObserver=i,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return n.\u0275fac=function(t){return new(t||n)(E(Un),E(kO))},n.\u0275cmp=Le({type:n,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,i){2&t&&gf("zoom","visible"===i._visibility?1:null)},features:[ht],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,i){if(1&t&&(F(0,"div",0),ye("@state.start",function(){return i._animationStart()})("@state.done",function(s){return i._animationDone(s)}),yn(1,"async"),Te(2),N()),2&t){let r;at("mat-tooltip-handset",null==(r=wn(1,5,i._isHandset))?null:r.matches),ie("ngClass",i.tooltipClass)("@state",i._visibility),Y(2),Ai(i.message)}},directives:[sE],pipes:[zu],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[qMe.tooltipState]},changeDetection:0}),n})(),uc=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[ZMe],imports:[[Ine,bn,$v,Nn],Nn,zv]}),n})();const i1e=["sliderWrapper"],yl=Yg({passive:!1}),l1e={provide:Ao,useExisting:T(()=>wk),multi:!0};class c1e{}const u1e=Nf(kf(em(class{constructor(n){this._elementRef=n}}),"accent"));let wk=(()=>{class n extends u1e{constructor(t,i,r,s,o,a,l,c){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this._dir=s,this._ngZone=a,this._animationMode=c,this._invert=!1,this._max=100,this._min=0,this._step=1,this._thumbLabel=!1,this._tickInterval=0,this._value=null,this._vertical=!1,this.change=new Pe,this.input=new Pe,this.valueChange=new Pe,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=Ie.EMPTY,this._pointerDown=d=>{this.disabled||this._isSliding||!Gb(d)&&0!==d.button||this._ngZone.run(()=>{this._touchId=Gb(d)?function(n,e){for(let t=0;t{if("pointer"===this._isSliding){const f=EG(d,this._touchId);if(f){d.preventDefault();const p=this.value;this._lastPointerEvent=d,this._updateValueFromPosition(f),p!=this.value&&this._emitInputEvent()}}},this._pointerUp=d=>{"pointer"===this._isSliding&&(!Gb(d)||"number"!=typeof this._touchId||Ek(d.changedTouches,this._touchId))&&(d.preventDefault(),this._removeGlobalEvents(),this._isSliding=null,this._touchId=void 0,this._valueOnSlideStart!=this.value&&!this.disabled&&this._emitChangeEvent(),this._valueOnSlideStart=this._lastPointerEvent=null)},this._windowBlur=()=>{this._lastPointerEvent&&this._pointerUp(this._lastPointerEvent)},this._document=l,this.tabIndex=parseInt(o)||0,a.runOutsideAngular(()=>{const d=t.nativeElement;d.addEventListener("mousedown",this._pointerDown,yl),d.addEventListener("touchstart",this._pointerDown,yl)})}get invert(){return this._invert}set invert(t){this._invert=Dt(t)}get max(){return this._max}set max(t){this._max=So(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=So(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=So(t,this._step),this._step%1!=0&&(this._roundToDecimal=this._step.toString().split(".").pop().length),this._changeDetectorRef.markForCheck()}get thumbLabel(){return this._thumbLabel}set thumbLabel(t){this._thumbLabel=Dt(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?So(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let i=So(t,0);this._roundToDecimal&&i!==this.min&&i!==this.max&&(i=parseFloat(i.toFixed(this._roundToDecimal))),this._value=i,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=Dt(t)}get displayValue(){return this.displayWith?this.displayWith(this.value):this._roundToDecimal&&this.value&&this.value%1!=0?this.value.toFixed(this._roundToDecimal):this.value||0}focus(t){this._focusHostElement(t)}blur(){this._blurHostElement()}get percent(){return this._clamp(this._percent)}_shouldInvertAxis(){return this.vertical?!this.invert:this.invert}_isMinValue(){return 0===this.percent}_getThumbGap(){return this.disabled?7:this._isMinValue()&&!this.thumbLabel?this._isActive?10:7:0}_getTrackBackgroundStyles(){const i=this.vertical?`1, ${1-this.percent}, 1`:1-this.percent+", 1, 1";return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"-":""}${this._getThumbGap()}px) scale3d(${i})`}}_getTrackFillStyles(){const t=this.percent,r=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${r})`,display:0===t?"none":""}}_getTicksContainerStyles(){return{transform:`translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"-":""}${this._tickIntervalPercent/2*100}%)`}}_getTicksStyles(){let t=100*this._tickIntervalPercent,a={backgroundSize:this.vertical?`2px ${t}%`:`${t}% 2px`,transform:`translateZ(0) translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"":"-"}${t/2}%)${this.vertical||"rtl"!=this._getDirection()?"":" rotate(180deg)"}`};if(this._isMinValue()&&this._getThumbGap()){const l=this._shouldInvertAxis();let c;c=this.vertical?l?"Bottom":"Top":l?"Right":"Left",a[`padding${c}`]=`${this._getThumbGap()}px`}return a}_getThumbContainerStyles(){const t=this._shouldInvertAxis();return{transform:`translate${this.vertical?"Y":"X"}(-${100*(("rtl"!=this._getDirection()||this.vertical?t:!t)?this.percent:1-this.percent)}%)`}}_shouldInvertMouseCoords(){const t=this._shouldInvertAxis();return"rtl"!=this._getDirection()||this.vertical?t:!t}_getDirection(){return this._dir&&"rtl"==this._dir.value?"rtl":"ltr"}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{this._isActive=!!t&&"keyboard"!==t,this._changeDetectorRef.detectChanges()}),this._dir&&(this._dirChangeSubscription=this._dir.change.subscribe(()=>{this._changeDetectorRef.markForCheck()}))}ngOnDestroy(){const t=this._elementRef.nativeElement;t.removeEventListener("mousedown",this._pointerDown,yl),t.removeEventListener("touchstart",this._pointerDown,yl),this._lastPointerEvent=null,this._removeGlobalEvents(),this._focusMonitor.stopMonitoring(this._elementRef),this._dirChangeSubscription.unsubscribe()}_onMouseenter(){this.disabled||(this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent())}_onFocus(){this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent()}_onBlur(){this.onTouched()}_onKeydown(t){if(this.disabled||Yo(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const i=this.value;switch(t.keyCode){case 33:this._increment(10);break;case 34:this._increment(-10);break;case 35:this.value=this.max;break;case 36:this.value=this.min;break;case 37:this._increment("rtl"==this._getDirection()?1:-1);break;case 38:this._increment(1);break;case 39:this._increment("rtl"==this._getDirection()?-1:1);break;case 40:this._increment(-1);break;default:return}i!=this.value&&(this._emitInputEvent(),this._emitChangeEvent()),this._isSliding="keyboard",t.preventDefault()}_onKeyup(){"keyboard"===this._isSliding&&(this._isSliding=null)}_getWindow(){return this._document.defaultView||window}_bindGlobalEvents(t){const i=this._document,r=Gb(t),o=r?"touchend":"mouseup";i.addEventListener(r?"touchmove":"mousemove",this._pointerMove,yl),i.addEventListener(o,this._pointerUp,yl),r&&i.addEventListener("touchcancel",this._pointerUp,yl);const a=this._getWindow();void 0!==a&&a&&a.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,yl),t.removeEventListener("mouseup",this._pointerUp,yl),t.removeEventListener("touchmove",this._pointerMove,yl),t.removeEventListener("touchend",this._pointerUp,yl),t.removeEventListener("touchcancel",this._pointerUp,yl);const i=this._getWindow();void 0!==i&&i&&i.removeEventListener("blur",this._windowBlur)}_increment(t){this.value=this._clamp((this.value||0)+this.step*t,this.min,this.max)}_updateValueFromPosition(t){if(!this._sliderDimensions)return;let o=this._clamp(((this.vertical?t.y:t.x)-(this.vertical?this._sliderDimensions.top:this._sliderDimensions.left))/(this.vertical?this._sliderDimensions.height:this._sliderDimensions.width));if(this._shouldInvertMouseCoords()&&(o=1-o),0===o)this.value=this.min;else if(1===o)this.value=this.max;else{const a=this._calculateValue(o),l=Math.round((a-this.min)/this.step)*this.step+this.min;this.value=this._clamp(l,this.min,this.max)}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.value),this.valueChange.emit(this.value),this.change.emit(this._createChangeEvent())}_emitInputEvent(){this.input.emit(this._createChangeEvent())}_updateTickIntervalPercent(){if(this.tickInterval&&this._sliderDimensions)if("auto"==this.tickInterval){let t=this.vertical?this._sliderDimensions.height:this._sliderDimensions.width,s=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=s/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let i=new c1e;return i.source=this,i.value=t,i}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,i=0,r=1){return Math.max(i,Math.min(t,r))}_getSliderDimensions(){return this._sliderWrapper?this._sliderWrapper.nativeElement.getBoundingClientRect():null}_focusHostElement(t){this._elementRef.nativeElement.focus(t)}_blurHostElement(){this._elementRef.nativeElement.blur()}writeValue(t){this.value=t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Un),E(Ko,8),fs("tabindex"),E(lt),E(rt),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-slider"]],viewQuery:function(t,i){if(1&t&&ni(i1e,5),2&t){let r;Mt(r=xt())&&(i._sliderWrapper=r.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()})("keydown",function(s){return i._onKeydown(s)})("keyup",function(){return i._onKeyup()})("mouseenter",function(){return i._onMouseenter()})("selectstart",function(s){return s.preventDefault()}),2&t&&(sl("tabIndex",i.tabIndex),en("aria-disabled",i.disabled)("aria-valuemax",i.max)("aria-valuemin",i.min)("aria-valuenow",i.value)("aria-valuetext",null==i.valueText?i.displayValue:i.valueText)("aria-orientation",i.vertical?"vertical":"horizontal"),at("mat-slider-disabled",i.disabled)("mat-slider-has-ticks",i.tickInterval)("mat-slider-horizontal",!i.vertical)("mat-slider-axis-inverted",i._shouldInvertAxis())("mat-slider-invert-mouse-coords",i._shouldInvertMouseCoords())("mat-slider-sliding",i._isSliding)("mat-slider-thumb-label-showing",i.thumbLabel)("mat-slider-vertical",i.vertical)("mat-slider-min-value",i._isMinValue())("mat-slider-hide-last-tick",i.disabled||i._isMinValue()&&i._getThumbGap()&&i._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{disabled:"disabled",color:"color",tabIndex:"tabIndex",invert:"invert",max:"max",min:"min",step:"step",thumbLabel:"thumbLabel",tickInterval:"tickInterval",value:"value",vertical:"vertical",displayWith:"displayWith",valueText:"valueText"},outputs:{change:"change",input:"input",valueChange:"valueChange"},exportAs:["matSlider"],features:[At([l1e]),ht],decls:13,vars:6,consts:[[1,"mat-slider-wrapper"],["sliderWrapper",""],[1,"mat-slider-track-wrapper"],[1,"mat-slider-track-background",3,"ngStyle"],[1,"mat-slider-track-fill",3,"ngStyle"],[1,"mat-slider-ticks-container",3,"ngStyle"],[1,"mat-slider-ticks",3,"ngStyle"],[1,"mat-slider-thumb-container",3,"ngStyle"],[1,"mat-slider-focus-ring"],[1,"mat-slider-thumb"],[1,"mat-slider-thumb-label"],[1,"mat-slider-thumb-label-text"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"div",2),et(3,"div",3),et(4,"div",4),N(),F(5,"div",5),et(6,"div",6),N(),F(7,"div",7),et(8,"div",8),et(9,"div",9),F(10,"div",10),F(11,"span",11),Te(12),N(),N(),N(),N()),2&t&&(Y(3),ie("ngStyle",i._getTrackBackgroundStyles()),Y(1),ie("ngStyle",i._getTrackFillStyles()),Y(1),ie("ngStyle",i._getTicksContainerStyles()),Y(1),ie("ngStyle",i._getTicksStyles()),Y(1),ie("ngStyle",i._getThumbContainerStyles()),Y(5),Ai(i.displayValue))},directives:[M3],styles:['.mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:"";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n'],encapsulation:2,changeDetection:0}),n})();function Gb(n){return"t"===n.type[0]}function EG(n,e){let t;return t=Gb(n)?"number"==typeof e?Ek(n.touches,e)||Ek(n.changedTouches,e):n.touches[0]||n.changedTouches[0]:n,t?{x:t.clientX,y:t.clientY}:void 0}function Ek(n,e){for(let t=0;t{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn],Nn]}),n})();function h1e(n,e){}class Sk{constructor(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.maxWidth="80vw",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.autoFocus=!0,this.restoreFocus=!0,this.closeOnNavigation=!0}}const f1e={dialogContainer:Jl("dialogContainer",[br("void, exit",Kn({opacity:0,transform:"scale(0.7)"})),br("enter",Kn({transform:"none"})),Qs("* => enter",Mo("150ms cubic-bezier(0, 0, 0.2, 1)",Kn({transform:"none",opacity:1}))),Qs("* => void, * => exit",Mo("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",Kn({opacity:0})))])};let p1e=(()=>{class n extends nS{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new Pe,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_initializeWithAttachedContent(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()}attachComponentPortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(t)}_recaptureFocus(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()}_trapFocus(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()}_restoreFocus(){const t=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&t&&"function"==typeof t.focus){const i=vE(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_setupFocusTrap(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)}_capturePreviouslyFocusedElement(){this._document&&(this._elementFocusedBeforeDialogWasOpened=vE())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=vE();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(dV),E(Un),E(rt,8),E(Sk),E(hl))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&ni(zf,7),2&t){let r;Mt(r=xt())&&(i._portalOutlet=r.first)}},features:[ht]}),n})(),g1e=(()=>{class n extends p1e{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275cmp=Le({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&qy("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(sl("id",i._id),en("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),Sg("@dialogContainer",i._state))},features:[ht],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&Ct(0,h1e,0,0,"ng-template",0)},directives:[zf],styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[f1e.dialogContainer]}}),n})(),m1e=0;class Gm{constructor(e,t,i="mat-dialog-"+m1e++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new we,this._afterClosed=new we,this._beforeClosed=new we,this._state=0,t._id=i,t._animationStateChanged.pipe(Tn(r=>"opened"===r.state),_i(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Tn(r=>"closed"===r.state),_i(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Tn(r=>27===r.keyCode&&!this.disableClose&&!Yo(r))).subscribe(r=>{r.preventDefault(),Mk(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():Mk(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Tn(t=>"closing"===t.state),_i(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.totalTime+100)}),this._state=1,this._containerInstance._startExitAnimation()}afterOpened(){return this._afterOpened}afterClosed(){return this._afterClosed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._overlayRef.backdropClick()}keydownEvents(){return this._overlayRef.keydownEvents()}updatePosition(e){let t=this._getPositionStrategy();return e&&(e.left||e.right)?e.left?t.left(e.left):t.right(e.right):t.centerHorizontally(),e&&(e.top||e.bottom)?e.top?t.top(e.top):t.bottom(e.bottom):t.centerVertically(),this._overlayRef.updatePosition(),this}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function Mk(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const xk=new _e("MatDialogData"),_1e=new _e("mat-dialog-default-options"),MG=new _e("mat-dialog-scroll-strategy"),v1e={provide:MG,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.block()}};let b1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=d,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new we,this._afterOpenedAtThisLevel=new we,this._ariaHiddenElements=new Map,this.afterAllClosed=zb(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(ns(void 0))),this._scrollStrategy=a}get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){const t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}open(t,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new Sk)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new Hv({positionStrategy:this._overlay.position().global(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,disposeOnNavigation:t.closeOnNavigation});return t.backdropClass&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Tt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:Sk,useValue:i}]}),o=new sm(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Xs)i.attachTemplatePortal(new Uf(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new sm(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Ko,null,vt.Optional))&&o.push({provide:Ko,useValue:{value:t.direction,change:st()}}),Tt.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Tt),E(void 0),E(void 0),E(om),E(void 0),E(Su),E(Su),E(_e))},n.\u0275dir=he({type:n}),n})(),Wm=(()=>{class n extends b1e{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,Gm,g1e,xk)}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(Tt),I(Ug,8),I(_1e,8),I(MG),I(n,12),I(om))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),w1e=0,xG=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+w1e++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.id):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{const t=this._dialogRef._containerInstance;t&&!t._ariaLabelledBy&&(t._ariaLabelledBy=this.id)})}}return n.\u0275fac=function(t){return new(t||n)(E(Gm,8),E(nt),E(Wm))},n.\u0275dir=he({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&sl("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),TG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();let Tk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[Wm,v1e],imports:[[$v,iS,Nn],Nn]}),n})();const Ak=new _e("CdkAccordion");let M1e=0,T1e=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=Ie.EMPTY,this.closed=new Pe,this.opened=new Pe,this.destroyed=new Pe,this.expandedChange=new Pe,this.id="cdk-accordion-child-"+M1e++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=Dt(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ak,12),E(Un),E(tS))},n.\u0275dir=he({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[At([{provide:Ak,useValue:void 0}])]}),n})(),A1e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const D1e=["body"];function O1e(n,e){}const I1e=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],P1e=["mat-expansion-panel-header","*","mat-action-row"];function R1e(n,e){1&n&&et(0,"span",2),2&n&&ie("@indicatorRotate",bt()._getExpandedState())}const k1e=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],F1e=["mat-panel-title","mat-panel-description","*"],Dk=new _e("MAT_ACCORDION"),DG="225ms cubic-bezier(0.4,0.0,0.2,1)",OG={indicatorRotate:Jl("indicatorRotate",[br("collapsed, void",Kn({transform:"rotate(0deg)"})),br("expanded",Kn({transform:"rotate(180deg)"})),Qs("expanded <=> collapsed, void => collapsed",Mo(DG))]),bodyExpansion:Jl("bodyExpansion",[br("collapsed, void",Kn({height:"0px",visibility:"hidden"})),br("expanded",Kn({height:"*",visibility:"visible"})),Qs("expanded <=> collapsed, void => collapsed",Mo(DG))])};let N1e=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(E(Xs))},n.\u0275dir=he({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),L1e=0;const IG=new _e("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let NM=(()=>{class n extends T1e{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new Pe,this.afterCollapse=new Pe,this._inputChanges=new we,this._headerId="mat-expansion-panel-header-"+L1e++,this._bodyAnimationDone=new we,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(Xo((c,d)=>c.fromState===d.fromState&&c.toState===d.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=Dt(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe(ns(null),Tn(()=>this.expanded&&!this._portal),_i(1)).subscribe(()=>{this._portal=new Uf(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(E(Dk,12),E(Un),E(tS),E(es),E(rt),E(Zo,8),E(IG,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,N1e,5),2&t){let s;Mt(s=xt())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&ni(D1e,5),2&t){let r;Mt(r=xt())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&at("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[At([{provide:Dk,useValue:void 0}]),ht,qn],ngContentSelectors:P1e,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,i){1&t&&(Dr(I1e),In(0),F(1,"div",0,1),ye("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),F(3,"div",2),In(4,1),Ct(5,O1e,0,0,"ng-template",3),N(),In(6,2),N()),2&t&&(Y(1),ie("@bodyExpansion",i._getExpandedState())("id",i.id),en("aria-labelledby",i._headerId),Y(4),ie("cdkPortalOutlet",i._portal))},directives:[zf],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[OG.bodyExpansion]},changeDetection:0}),n})();class V1e{}const j1e=Nf(V1e);let LM=(()=>{class n extends j1e{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=Ie.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Tn(d=>!(!d.hideToggle&&!d.togglePosition))):Ql;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=ki(t.opened,t.closed,c,t._inputChanges.pipe(Tn(d=>!!(d.hideToggle||d.disabled||d.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Tn(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case 32:case 13:Yo(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return n.\u0275fac=function(t){return new(t||n)(E(NM,1),E(nt),E(hl),E(Un),E(IG,8),E(Zo,8),fs("tabindex"))},n.\u0275cmp=Le({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&ye("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(en("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),gf("height",i._getHeaderHeight()),at("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[ht],ngContentSelectors:F1e,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(Dr(k1e),F(0,"span",0),In(1),In(2,1),In(3,2),N(),Ct(4,R1e,1,1,"span",1)),2&t&&(Y(4),ie("ngIf",i._showToggle()))},directives:[Is],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[OG.indicatorRotate]},changeDetection:0}),n})(),PG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),n})(),Ok=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn,A1e,iS]]}),n})();var RG=Ve(478);Object.create(Error.prototype);const $1e=["*"];var VM=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(VM||(VM={})),VM))();class W1e{}const FG=new _e("SECURITY_CONTEXT");let Ik=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new RG.Renderer},this.options=s}get options(){return this._options}set options(t){this._options=Object.assign(Object.assign({},this.initialMarkedOptions),t)}get renderer(){return this.options.renderer}set renderer(t){this.options.renderer=t}compile(t,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=RG.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}getSource(t){if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(t,{responseType:"text"}).pipe(be(i=>this.handleExtension(t,i)))}highlight(t){if(xf(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!xf(this.platform))return t;if("undefined"==typeof katex||void 0===katex.renderToString)throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");return t.replace(/\$([^\s][^$]*?[^\s])\$/gm,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!xf(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!xf(this.platform))return t;if("undefined"==typeof joypixels||void 0===joypixels.shortnameToUnicode)throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(t)}trimIndentation(t){if(!t)return"";let i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(I(cl),I(FG),I(im,8),I(W1e,8),I(Kd))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),NG=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new Pe,this.load=new Pe,this.ready=new Pe,this._emoji=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1}get emoji(){return this._emoji}set emoji(t){this._emoji=this.coerceBooleanProperty(t)}get katex(){return this._katex}set katex(t){this._katex=this.coerceBooleanProperty(t)}get lineHighlight(){return this._lineHighlight}set lineHighlight(t){this._lineHighlight=this.coerceBooleanProperty(t)}get lineNumbers(){return this._lineNumbers}set lineNumbers(t){this._lineNumbers=this.coerceBooleanProperty(t)}ngOnChanges(){null==this.data?null==this.src||this.handleSrc():this.handleData()}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion()}render(t,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,this.handlePlugins(),this.markdownService.highlight(this.element.nativeElement),this.ready.emit()}coerceBooleanProperty(t){return null!=t&&"false"!=`${String(t)}`}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe(t=>{this.render(t),this.load.emit(t)},t=>this.error.emit(t))}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,VM.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;s{class n{static forRoot(t){return{ngModule:n,providers:[Ik,t&&t.loader||[],t&&t.markedOptions||[],{provide:FG,useValue:t&&null!=t.sanitize?t.sanitize:on.HTML}]}}static forChild(){return{ngModule:n}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function LG(n,e,t){return t?LG(n,e).pipe(be(i=>Fe(i)?t(...i):t(i))):new oe(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(ft(e))return()=>e(r,s)})}function jM(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new J1e(n,t))}}class J1e{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new exe(e,this.observables,this.project))}}class exe extends RU{constructor(e,t,i){super(e),this.observables=t,this.project=i,this.toRespond=[];const r=t.length;this.values=new Array(r);for(let s=0;s0){const s=r.indexOf(i);-1!==s&&r.splice(s,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}class txe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new nxe(e,this.accumulator,this.seed,this.hasSeed))}}class nxe extends Rt{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class sxe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new oxe(e,this.predicate))}}class oxe extends Rt{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const axe=["youtubeContainer"];let jG=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new we,this._destroyed=new we,this._playerChanges=new sr(void 0),this._videoId=new sr(void 0),this._height=new sr(390),this._width=new sr(640),this._startSeconds=new sr(void 0),this._endSeconds=new sr(void 0),this._suggestedQuality=new sr(void 0),this._playerVars=new sr(void 0),this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange"),this._isBrowser=xf(i)}get videoId(){return this._videoId.value}set videoId(t){this._videoId.next(t)}get height(){return this._height.value}set height(t){this._height.next(t||390)}get width(){return this._width.value}set width(t){this._width.next(t||640)}set startSeconds(t){this._startSeconds.next(t)}set endSeconds(t){this._endSeconds.next(t)}set suggestedQuality(t){this._suggestedQuality.next(t)}get playerVars(){return this._playerVars.value}set playerVars(t){this._playerVars.next(t)}ngOnInit(){if(!this._isBrowser)return;let t=st(!0);if(!window.YT||!window.YT.Player){const r=new we;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(_i(1),ns(!1))}const i=function(n,e,t,i,r,s,o){const a=or([e,s]).pipe(jM(or([i,r])),be(([l,c])=>{const[d,f]=l,[p,g]=c;return d?{videoId:d,playerVars:f,width:p,height:g}:void 0}));return or([n,a,st(o)]).pipe(function(n){return Er(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&Fe(n[0])&&(n=n[0].slice()),t=>t.lift.call(li([t,...n]),new NU(e))}(n),function(n){return e=>e.lift(new sxe(n))}(([e,t])=>!t),be(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new txe(n,e,t))}}(fxe,void 0),Xo())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Di(r=>{this._playerChanges.next(r)}),ci(e=>e?UG(e)?st(e):new oe(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{UG(r)||r.destroy()})(e)}}).pipe(_i(1),ns(void 0)):st(void 0)),zn(this._destroyed),pc(new we));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){or([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){or([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=or([t,i]).pipe(be(([d,f])=>({startSeconds:d,endSeconds:f}))),a=o.pipe(Rk(n,d=>!!d&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(d))),l=e.pipe(Rk(n,(d,f)=>!!d&&d.videoId!==f));ki(n.pipe(Rk(or([e,o]),([d,f],p)=>!(!p||d==p.videoId&&!f.startSeconds&&!f.endSeconds))),l,a).pipe(jM(or([n,e,o,r])),be(([d,f])=>f),zn(s)).subscribe(([d,f,p,g])=>{!f||!d||(d.videoId=f,d.cueVideoById(Object.assign({videoId:f,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.connect()}createEventsBoundInZone(){return{}}ngAfterViewInit(){this._youtubeContainer.next(this.youtubeContainer.nativeElement)}ngOnDestroy(){this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._videoId.complete(),this._height.complete(),this._width.complete(),this._startSeconds.complete(),this._endSeconds.complete(),this._suggestedQuality.complete(),this._youtubeContainer.complete(),this._playerVars.complete(),this._destroyed.next(),this._destroyed.complete()}playVideo(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}pauseVideo(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}stopVideo(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}seekTo(t,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}mute(){this._player?this._player.mute():this._getPendingState().muted=!0}unMute(){this._player?this._player.unMute():this._getPendingState().muted=!1}isMuted(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}setVolume(t){this._player?this._player.setVolume(t):this._getPendingState().volume=t}getVolume(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}setPlaybackRate(t){if(this._player)return this._player.setPlaybackRate(t);this._getPendingState().playbackRate=t}getPlaybackRate(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}getAvailablePlaybackRates(){return this._player?this._player.getAvailablePlaybackRates():[]}getVideoLoadedFraction(){return this._player?this._player.getVideoLoadedFraction():0}getPlayerState(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}getCurrentTime(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}getPlaybackQuality(){return this._player?this._player.getPlaybackQuality():"default"}getAvailableQualityLevels(){return this._player?this._player.getAvailableQualityLevels():[]}getDuration(){return this._player?this._player.getDuration():0}getVideoUrl(){return this._player?this._player.getVideoUrl():""}getVideoEmbedCode(){return this._player?this._player.getVideoEmbedCode():""}_getPendingState(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}_initializePlayer(t,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Ir(i=>i?LG(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):st()),i=>new oe(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),zn(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(E(lt),E(cl))},n.\u0275cmp=Le({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&ni(axe,5),2&t){let r;Mt(r=xt())&&(i.youtubeContainer=r.first)}},inputs:{videoId:"videoId",height:"height",width:"width",startSeconds:"startSeconds",endSeconds:"endSeconds",suggestedQuality:"suggestedQuality",playerVars:"playerVars",showBeforeIframeApiLoads:"showBeforeIframeApiLoads"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},decls:2,vars:0,consts:[["youtubeContainer",""]],template:function(t,i){1&t&&et(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function fxe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function UG(n){return"getPlayerStatus"in n}function Rk(n,e){return Er(jM(n),Tn(([t,i])=>e(i,t)),be(([t])=>t))}let mxe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function qb(n){return!0===n}function no(n){return null==n}function Pa(n){return!no(n)}function kk(n){return Boolean(n)}function $G(n){return no(n)?n:JSON.parse(JSON.stringify(n))}const zM=n=>{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&zM(n[o])}),n};function GG(n){return Pa(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const YG="NGXS_DATA_META",Nk="NGXS_META",XG="NGXS_ARGUMENT_REGISTRY_META";let KG=(()=>{class n{constructor(t){this.sequence$=new sr(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(I(ph,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function Yb(n){return n[YG]}let Ra=(()=>{class n{constructor(t,i,r){n.store=t.get(ph),n.ngZone=t.get(lt),n.factory=i,n.context=r,n.computed=t.get(KG)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(I(Tt),I(G6),I($6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class kr{constructor(){kr.statesCachedMeta.clear()}static createStateContext(e){return Ra.context.createStateContext(e)}static ensureMappedState(e){if(no(Ra.factory)||no(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(Pa(e.name)?kr.statesCachedMeta.get(e.name):null)||kr.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Yb(kr.getStateClassByInstance(e)))&&void 0!==t?t:null;if(no(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=kr.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=kr.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=Pa(e.name)?null===(t=Ra.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Pa(i)&&Pa(e.name)&&kr.statesCachedMeta.set(e.name,i),i}}kr.statesCachedMeta=new Map,kr.\u0275fac=function(e){return new(e||kr)},kr.\u0275prov=ae({token:kr,factory:kr.\u0275fac}),new Hg(1);class Vxe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Pa(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function ZG(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function QG(n){var e;const t=ZG(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=$G(void 0===t.defaults?{}:t.defaults);if(i.length){if(GG(s))return function(n,e){return e.reduce((t,i)=>{const r=ZG(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=QG(i),t},null!=n?n:{})}(s,i);throw new Vxe(s)}return s}function eW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function tW(){var n,e;return null!==(e=null===(n=null==Ra?void 0:Ra.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function Hxe(n){let e=!1;return Uv(n)&&(e=!0),e}function Lk(n){return n[XG]}class $xe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class Gxe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(kk(this.argumentMap.has(e))||kk(this.payloadMap.has(e)))throw new $xe(e,t)}}function Bk(n){return wo()?zM(n):n}function Kxe(n){return{enumerable:!0,configurable:!0,get(){const e=Yb(n),t=kr.ensureMappedState(e.stateMeta);return kr.createStateContext(t)}}}function Vk(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>wo()?zM(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}function ri(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(GG(i))for(;null!==i;){if(qb(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return no(eW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),eW(n)}(this),o=null==s?void 0:s.get(i);if(qb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(no(o)||o.sequenceId!==tW()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:tW(),isObservable:Hxe(l)}),l}return o.value},t}}const tTe={cancelUncompleted:!0,insideZone:!1};function Xt(n=tTe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=kr.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=Lk(r);if(no(f)){const C=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),x=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var C;return qb(n.insideZone)?null===(C=Ra.ngZone)||void 0===C||C.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Uv(l)?st(null).pipe(be(()=>l)):l};const v=kr.createAction(f,o,g),w=Ra.store.dispatch(v);return Uv(l)?function(n,e){return Bv([n,e]).pipe(be(t=>t.pop()))}(w,l):l},i}}function Es(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return no(Lk(t))&&Object.defineProperties(t,{[XG]:{enumerable:!0,configurable:!0,value:new Gxe}}),Lk(t)})(e,t).createPayloadType(r,t,i)}}function Ch(){return n=>{const e=function(n){if(function(n){return!kk(n)}(n.hasOwnProperty(Nk))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,Nk,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[Nk]}(n)}(n);if(no(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=Yb(n))&&void 0!==e?e:null;return(no(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,YG,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Yb(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>$G(t)},context:Kxe(n)})}(n,e,QG(n)),function(n){var e,t;const i=Yb(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(Pa(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Pa(this[s]))return this[s];if(no(Ra.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ra.store.select(n).pipe(be(o=>wo()?zM(o):o),Hc({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}var $M=(()=>(function(n){n.ID="id"}($M||($M={})),$M))(),Xb=(()=>(function(n){n.ASC="asc",n.DESC="desc"}(Xb||(Xb={})),Xb))();let jk=(()=>{class n{constructor(){this.browserStorageEvents$=new we,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),rTe=(()=>{class n extends jk{get snapshot(){return Bk(this.getState())}get ctx(){return Vk(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([Xt(),bs(0,Es("patchValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"patchState",null),De([Xt(),bs(0,Es("stateValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setState",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),n})(),sTe=(()=>{class n extends jk{constructor(){super(...arguments),this.primaryKey=$M.ID,this.comparator=null}get snapshot(){return Bk(this.getState())}get ids(){return this.snapshot.ids}get entities(){return this.snapshot.entities}get entitiesArray(){const t=this.snapshot;return t.ids.map(i=>t.entities[i])}get ids$(){return this.state$.pipe(be(t=>t.ids))}get entities$(){return this.state$.pipe(be(t=>t.entities))}get entitiesArray$(){return this.state$.pipe(be(t=>t.ids.map(i=>t.entities[i])))}get ctx(){return Vk(this.context)}setComparator(t){return this.comparator=t,this}dispatch(t){return this.ctx.dispatch(t)}getState(){return this.ctx.getState()}selectId(t){var i;return null===(i=t)||void 0===i?void 0:i[this.primaryKey]}selectOne(t){var i;return null!==(i=this.snapshot.entities[t])&&void 0!==i?i:null}selectAll(){const t=this.getState();return t.ids.map(i=>t.entities[i])}reset(){this.setEntitiesState(this.initialState),this.markAsDirtyAfterReset()}addOne(t){this.addEntityOne(t)}addMany(t){this.addEntitiesMany(t)}setOne(t){this.setEntityOne(t)}setMany(t){this.setEntitiesMany(t)}setAll(t){this.setEntitiesAll(t)}updateOne(t){this.updateEntitiesMany([t])}updateMany(t){this.updateEntitiesMany(t)}upsertOne(t){this.upsertEntitiesMany([t])}upsertMany(t){this.upsertEntitiesMany(t)}removeOne(t){this.removeEntitiesMany([t])}removeMany(t){this.removeEntitiesMany(t)}removeByEntity(t){const i=this.selectId(t);this.removeEntitiesMany([i])}removeByEntities(t){const i=[];for(const r of t){const s=this.selectId(r);i.push(s)}this.removeEntitiesMany(i)}removeAll(){this.setEntitiesState(this.initialState)}sort(t){this.comparator=null!=t?t:this.comparator,no(this.comparator)?console.warn("You must set the compare function before sorting."):this.setEntitiesState(this.getState())}addEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);r in i.entities||this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}addEntitiesMany(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities||a in r||(s.push(a),r[a]=o)}s.length&&this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,...s],entities:Object.assign(Object.assign({},i.entities),r)}))}setEntitiesAll(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in r||(s.push(a),r[a]=o)}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:s,entities:r}))}setEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);this.setEntitiesState(Object.assign(Object.assign({},i),r in i.entities?{entities:Object.assign(Object.assign({},i.entities),{[r]:t})}:{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}setEntitiesMany(t){for(const i of t)this.setEntityOne(i)}updateEntitiesMany(t){const i=this.getState(),r=t.filter(a=>a.id in i.entities);if(0===r.length)return;const s=this.generateKeyMap(i),o=Object.assign({},i.entities);for(const a of r){const l=this.updateOrigin(o,a),c=this.selectIdValue(l);c!==a.id&&(delete s[a.id],delete o[a.id]),s[a.id]=c,o[c]=l}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.map(a=>{var l;return null!==(l=s[a])&&void 0!==l?l:a}),entities:o}))}upsertEntitiesMany(t){const i=this.getState(),r=[],s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities?r.push({id:a,changes:o}):s.push(o)}this.updateMany(r),this.addMany(s)}removeEntitiesMany(t){const i=this.getState(),r=this.generateKeyMap(i),s=Object.assign({},i.entities);for(const o of t)o in s&&(delete r[o],delete s[o]);this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.filter(o=>o in r),entities:s}))}setEntitiesState(t){const i=this.sortKeysByComparator(t.ids,t.entities);this.ctx.setState(Object.assign(Object.assign({},t),{ids:i,entities:t.entities}))}sortKeysByComparator(t,i){if(no(this.comparator))return t;const r=t.slice(),s=this.comparator;return"function"==typeof s?r.sort((o,a)=>s(i[o],i[a])):this.sortByComparatorOptions(r,s,i)}sortByComparatorOptions(t,i,r){switch(null==i?void 0:i.sortByOrder){case Xb.ASC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?-1:0}(null==i?void 0:i.sortBy,r[s],r[o]));case Xb.DESC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?-1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?1:0}(null==i?void 0:i.sortBy,r[s],r[o]));default:return wo()&&console.warn(`Invalid --\x3e { sortByOrder: "${null==i?void 0:i.sortByOrder}" } not supported!`),t}}generateKeyMap(t){return t.ids.reduce((i,r)=>(i[r]=r,i),{})}updateOrigin(t,i){return Object.assign(Object.assign({},t[i.id]),i.changes)}selectIdValue(t){const i=this.selectId(t);return no(i)&&wo()&&console.warn(`The entity passed to the 'selectId' implementation returned ${i}.`,"You should probably provide your own 'selectId' implementation.","The entity that was passed:",t,"The current `selectId` implementation: (entity: V): K => entity.id"),i}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([ri(),Ge("design:type",Array),Ge("design:paramtypes",[])],n.prototype,"ids",null),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"entities",null),De([ri(),Ge("design:type",Array),Ge("design:paramtypes",[])],n.prototype,"entitiesArray",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"ids$",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"entities$",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"entitiesArray$",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"addOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"addMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"setMany",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"setAll",null),De([Xt(),bs(0,Es("update")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"updateOne",null),De([Xt(),bs(0,Es("updates")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"updateMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"upsertOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"upsertMany",null),De([Xt(),bs(0,Es("id")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"removeOne",null),De([Xt(),bs(0,Es("ids")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"removeMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"removeByEntity",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"removeByEntities",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"removeAll",null),De([Xt(),bs(0,Es("comparator")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"sort",null),n})(),qm=(()=>{class n extends jk{get snapshot(){return Bk(this.getState())}get ctx(){return Vk(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([Xt(),bs(0,Es("patchValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"patchState",null),De([Xt(),bs(0,Es("stateValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setState",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),n})();function Uk(){return Tn(n=>null!=n)}const oTe={};function zk(...n){const e=n[n.length-1];let t=n,i=oTe;return"object"==typeof e&&(i=e,t=t.slice(0,-1)),r=>r.pipe(lr(...t),Xo(i.compare),Hc(1))}const Jm=new _e("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),dF=new _e("ngx-window",{providedIn:"root",factory:()=>function(n){return xf(n)?window:null}(Ac(cl))}),_De=new _e("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Ac(dF))}),hF=new _e("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Ac(dF),Ac(_De))});let io=(()=>{class n{constructor(t,i,r){this.settings=t,this._document=i,this._gtag=r}get document(){return this._document}throw(t){(this.settings.enableTracing||wo())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((i,[r,s])=>Object.defineProperty(i,r,{value:s,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(i=>void 0!==i))}catch(i){this.throw(i)}}event(t,i,r,s,o){try{const a=new Map;i&&a.set("event_category",i),r&&a.set("event_label",r),s&&a.set("value",s),void 0!==o&&a.set("interaction",o);const l=this.toKeyValue(a);l?this.gtag("event",t,l):this.gtag("event",t)}catch(a){this.throw(a)}}pageView(t,i,r,s){try{const o=new Map([["page_path",t]]);i&&o.set("page_title",i),(r||this.document)&&o.set("page_location",r||this.document.location.href),s&&Object.entries(s).map(([a,l])=>o.set(a,l)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(o))}catch(o){this.throw(o)}}appView(t,i,r,s,o){try{const a=new Map([["screen_name",t],["app_name",i]]);r&&a.set("app_id",r),s&&a.set("app_version",s),o&&a.set("app_installer_id",o),this.gtag("event","screen_view",this.toKeyValue(a))}catch(a){this.throw(a)}}set(...t){try{this._gtag("set",...t)}catch(i){this.throw(i)}}exception(t,i){try{const r=new Map;t&&r.set("description",t),i&&r.set("fatal",i),this.toKeyValue(r)?this.gtag("event","exception",this.toKeyValue(r)):this.gtag("event","exception")}catch(r){this.throw(r)}}}return n.\u0275fac=function(t){return new(t||n)(I(Jm),I(rt),I(hF))},n.\u0275prov=ae({factory:function(){return new n(I(Jm),I(rt),I(hF))},token:n,providedIn:"root"}),n})();const bDe={provide:Cf,multi:!0,useFactory:function(n,e,t){return()=>gl(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(wo()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(wo()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));t||wo()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),n.uri=n.uri||`https://www.googletagmanager.com/gtag/js?id=${n.trackingCode}`,n.initCommands=null!==(i=null==n?void 0:n.initCommands)&&void 0!==i?i:[],n.initCommands.find(o=>"config"===o.command)||n.initCommands.unshift({command:"config",values:[n.trackingCode]}),n.initCommands.find(o=>"js"===o.command)||n.initCommands.unshift({command:"js",values:[new Date]});for(const o of n.initCommands)e(o.command,...o.values);const r=t.createElement("script");r.async=!0,r.src=n.uri,n.nonce&&r.setAttribute("nonce",n.nonce),t.getElementsByTagName("head")[0].appendChild(r)})},deps:[Jm,hF,rt]};new _e("ngx-google-analytics-routing-settings",{factory:()=>({})});let fF=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:Jm,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},bDe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[]]}),n})(),o0=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new Hg(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),SDe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new Ie,this.token=r,this.subscriptions.add(t.consentChange.subscribe(s=>this.toggleGoogleAnalytics("rescinded"===s)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return n.\u0275fac=function(t){return new(t||n)(I(o0),I(dF),I(Jm))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const MDe=new _e("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),rq=[o0,SDe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new Ie;try{this.storage=localStorage}catch(r){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(r=>this.saveConsent(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,i;const r=null===(i=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===i?void 0:i.call(t,this.key);if(null==r)return"not-set";const s=r.trim().toLowerCase();switch(s){case"given":case"rescinded":return s;default:return"not-set"}}saveConsent(t){var i,r;null===(r=null===(i=this.storage)||void 0===i?void 0:i.setItem)||void 0===r||r.call(i,this.key,t)}}return n.\u0275fac=function(t){return new(t||n)(I(o0),I(MDe))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})()];function TDe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let DDe=(()=>{class n{static forRoot(t){const{providers:i=[]}=fF.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[TDe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[...rq,{provide:Cf,multi:!0,useFactory:()=>()=>{},deps:rq}],imports:[[fF]]}),n})();const ODe=["bodyCanvas"];let IDe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Pe,this.nodeDrag=new Pe,this.nodeClick=new Pe,this.nodeHoverStart=new Pe,this.nodeHoverStop=new Pe,this.initialized=new Pe,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return gl(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new VEe({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))],this.initialized.emit()})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&ni(ODe,5,nt),2&t){let r;Mt(r=xt())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&et(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),PDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})();function LDe(n,e){if(1&n&&(F(0,"li",4),Te(1),yn(2,"json"),N()),2&n){const t=e.$implicit;Y(1),bw(" ",t[0],": ",wn(2,2,t[1])," ")}}function BDe(n,e){if(1&n&&(F(0,"div",1),F(1,"div"),Te(2),N(),F(3,"ul",2),Ct(4,LDe,3,4,"li",3),N(),N()),2&n){const t=e.$implicit;Y(2),Ai(t[0]),Y(2),ie("ngForOf",t[1])}}let VDe=(()=>{class n{constructor(t,i){this.clsName="ccf-store-debug",this.root={},this.subscriptions=new Ie;const r=t.subscribe(s=>{this.root=s,i.markForCheck()});this.subscriptions.add(r)}get data(){return Object.entries(this.root).map(([s,o])=>[s,Object.entries(o)]).filter(([s,o])=>o.length>0)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(ph),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-store-debug"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:1,vars:1,consts:[["class","state",4,"ngFor","ngForOf"],[1,"state"],[1,"kvlist"],["class","kvpair",4,"ngFor","ngForOf"],[1,"kvpair"]],template:function(t,i){1&t&&Ct(0,BDe,5,2,"div",0),2&t&&ie("ngForOf",i.data)},directives:[Xl],pipes:[T3],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),n})(),jDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})();new _e("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const GDe=["carouselContainer"],WDe=["itemlist"],qDe=["itemcontainer"];function YDe(n,e){if(1&n&&(F(0,"div",14),Te(1),N()),2&n){const t=bt().$implicit,i=bt();Y(1),Ai(i.occurenceData[t.id]||0)}}function XDe(n,e){if(1&n){const t=Lr();F(0,"div",9),ye("click",function(){const s=Vn(t).$implicit;return bt().selectOrgan(s)}),et(1,"mat-icon",10),F(2,"div",11),F(3,"div",12),Te(4),N(),Ct(5,YDe,2,1,"div",13),N(),N()}if(2&n){const t=e.$implicit,i=bt();at("disabled",t.disabled)("selected",i.isSelected(t)),Y(1),Yy("svgIcon",t.src),Y(3),Ai(t.name),Y(1),ie("ngIf",void 0!==t.numResults)}}const a0=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_54449"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/FMA_7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/FMA_7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let oq=(()=>{class n{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=a0,this.selectedOrgans=[],this.organsChanged=new Pe,this.onLeft=!0,this.onRight=!1,this.step=72}set occurenceData(t){this._occurenceData=t}get occurenceData(){return this._occurenceData}ngAfterViewInit(){const{carouselContainer:t}=this;this.sensor=new vG.ResizeSensor(t.nativeElement,()=>{this.set()})}ngOnChanges(t){"organList"in t&&this.set()}ngOnDestroy(){this.sensor.detach()}get error(){return!(!this.displayErrors||0===this.selectedOrgans.length)}shift(t){const{itemList:i}=this;let r=parseInt(i.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(r="right"===t?r-this.step:r+this.step,i.nativeElement.style.left=r+"px",this.setLeftRight(r))}scroll(t){this.timeoutHandler=setInterval(()=>{this.shift(t)},200)}stopScroll(){this.timeoutHandler&&(clearInterval(this.timeoutHandler),this.timeoutHandler=void 0)}selectOrgan(t){this.selectedOrgans=this.multiselect?this.selectedOrgans.includes(t)?this.selectedOrgans.filter(i=>t!==i):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:i,carouselContainer:r}=this,s=parseInt(t.nativeElement.style.left,10)||0;if(t.nativeElement.offsetWidth>=this.organList.length*this.step)t.nativeElement.style.left="0px",this.onLeft=!0,this.onRight=!0;else{this.setLeftRight(s);const o=this.step*Math.floor(r.nativeElement.offsetWidth/this.step)-64;i.nativeElement.style.width=`${o}px`}}setWidth(){const{itemContainer:t,carouselContainer:i}=this,r=this.step*Math.floor(i.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${r}px`}setLeftRight(t){const{itemContainer:i}=this;this.onLeft=0===t,this.onRight=t<=i.nativeElement.offsetWidth-this.organList.length*this.step}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-organ-selector"]],viewQuery:function(t,i){if(1&t&&(ni(GDe,7),ni(WDe,7),ni(qDe,7)),2&t){let r;Mt(r=xt())&&(i.carouselContainer=r.first),Mt(r=xt())&&(i.itemList=r.first),Mt(r=xt())&&(i.itemContainer=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[qn],decls:11,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],[1,"carousel-left-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item",3,"click"],[1,"carousel-icon",3,"svgIcon"],[1,"carousel-text-container"],[1,"carousel-text"],["class","num-results",4,"ngIf"],[1,"num-results"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"mat-icon",2),ye("touchstart",function(){return i.scroll("left")})("touchend",function(){return i.stopScroll()})("click",function(){return i.shift("left")})("mousedown",function(){return i.scroll("left")})("mouseup",function(){return i.stopScroll()}),Te(3,"chevron_left"),N(),F(4,"div",3,4),F(6,"div",5,6),Ct(8,XDe,6,7,"div",7),N(),N(),F(9,"mat-icon",8),ye("touchstart",function(){return i.scroll("right")})("touchend",function(){return i.stopScroll()})("click",function(){return i.shift("right")})("mousedown",function(){return i.scroll("right")})("mouseup",function(){return i.stopScroll()}),Te(10,"chevron_right"),N(),N()),2&t&&(at("error",i.error),ie("matTooltipDisabled",i.multiselect),Y(2),at("disabled",i.onLeft),Y(6),ie("ngForOf",i.organList),Y(1),at("disabled",i.onRight))},directives:[cc,Rs,Xl,Is],styles:["[_nghost-%COMP%] .container[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;justify-content:space-between}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{font-size:2rem;transform:scaleY(1.2);height:2rem;width:2rem;cursor:pointer}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon.disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon.disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{text-align:left}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{overflow:hidden;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{position:relative;left:0rem;display:flex;transition:all .2s linear;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;padding:.25rem .5rem;height:100%;transition:.6s}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-icon[_ngcontent-%COMP%]{text-align:center;width:3.5rem;height:2rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:4rem;justify-content:center;text-align:center}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .carousel-text[_ngcontent-%COMP%]{display:flex;justify-content:center;font-size:.625rem;max-width:3.5rem;line-height:.8rem;min-height:1.6rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{font-size:.6875rem;line-height:1.5}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .error-message[_ngcontent-%COMP%]{color:red;height:1rem}[_nghost-%COMP%] .error-message.hidden[_ngcontent-%COMP%]{opacity:0}"]}),n})(),aq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,uc]]}),n})(),KDe=(()=>{class n{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Pe,this.visibilityToggle=new Pe,this.opacityReset=new Pe}ngOnInit(){this.prevOpacity=this.visible?0:20}reset(){this.prevOpacity=20}changeOpacity(t){this.opacity=parseInt(t,10),this.opacityChange.emit(this.opacity)}toggleVisibility(){const t=this.opacity;this.opacity=this.prevOpacity,this.prevOpacity=t,this.visibilityToggle.emit(),this.opacityChange.emit(this.opacity)}resetOpacity(){this.prevOpacity=0,this.opacityReset.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{opacity:"opacity",visible:"visible"},outputs:{opacityChange:"opacityChange",visibilityToggle:"visibilityToggle",opacityReset:"opacityReset"},decls:10,vars:17,consts:[[1,"slider-box"],[1,"slider-and-label"],[1,"slider",3,"step","min","max","value","input"],[1,"opacity-value"],[1,"icons"],["matRipple","","svgIcon","app:visibility_off",1,"visibility","icon","invisible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","","svgIcon","app:visibility_on",1,"visibility","icon","visible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"mat-slider",2),ye("input",function(s){return i.changeOpacity(s.value)}),N(),F(3,"span",3),Te(4),N(),N(),F(5,"div",4),F(6,"mat-icon",5),ye("click",function(){return i.toggleVisibility()}),N(),F(7,"mat-icon",6),ye("click",function(){return i.toggleVisibility()}),N(),F(8,"mat-icon",7),ye("click",function(){return i.resetOpacity()}),Te(9,"refresh"),N(),N(),N()),2&t&&(Y(2),at("disabled",!i.visible),ie("step",1)("min",0)("max",100)("value",i.opacity),Y(2),Os("",i.opacity,"%"),Y(2),at("hidden",i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(1),at("hidden",!i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(1),ie("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[wk,Rs,Qo],styles:["[_nghost-%COMP%]{height:2.25rem;display:flex;align-items:center;justify-content:space-between;border-radius:.1875rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%]{width:60%;display:flex;align-items:center;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .mat-slider-wrapper{top:1.125rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .opacity-value[_ngcontent-%COMP%]{width:1.5rem;margin-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%]{display:flex;cursor:pointer!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{margin-right:1rem;padding:.25rem;cursor:pointer;transition:.6s;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility[_ngcontent-%COMP%]{transition:.6s;cursor:pointer;padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),n})(),lq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,SG,ec]]}),n})();function ZDe(n,e){if(1&n&&(F(0,"div",15),et(1,"youtube-player",16),N()),2&n){const t=bt(3);Y(1),Yy("videoId",t.videoID)}}function QDe(n,e){if(1&n&&(F(0,"mat-expansion-panel",10),F(1,"mat-expansion-panel-header"),F(2,"h2",11),Te(3),N(),N(),F(4,"div",12),et(5,"markdown",13),Ct(6,ZDe,2,1,"div",14),N(),N()),2&n){const t=bt(),i=t.index,r=t.$implicit;ie("expanded",0===i),Y(3),Ai(r.title),Y(2),at("first",0===i),ie("data",r.content),Y(1),ie("ngIf",0===i)}}function JDe(n,e){if(1&n&&(F(0,"div",8),Ct(1,QDe,7,6,"mat-expansion-panel",9),N()),2&n){const t=e.$implicit;Y(1),ie("ngIf",t)}}let eOe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.videoID}ngOnInit(){const t=document.createElement("script");t.src="https://www.youtube.com/iframe_api",document.body.appendChild(t)}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return n.\u0275fac=function(t){return new(t||n)(E(Gm),E(xk))},n.\u0275cmp=Le({type:n,selectors:[["ccf-info-dialog"]],decls:10,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography","dialog-content"],["class","panel",4,"ngFor","ngForOf"],[1,"panel"],[3,"expanded",4,"ngIf"],[3,"expanded"],[1,"no-header-margin"],[1,"top-padding"],[1,"variable-binding",3,"data"],["class","video-player",4,"ngIf"],[1,"video-player"],[3,"videoId"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),F(3,"mat-icon",3),ye("click",function(){return i.close()}),Te(4,"clear"),N(),N(),F(5,"div",4),F(6,"h2",5),Te(7),N(),F(8,"mat-dialog-content",6),Ct(9,JDe,2,1,"div",7),N(),N(),N(),N()),2&t&&(Y(7),Ai(i.infoTitle),Y(2),ie("ngForOf",i.documentationContents))},directives:[Rs,xG,TG,Xl,Is,NM,LM,NG,jG],styles:[".mat-dialog-container{padding:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;text-align:left}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.5rem;margin-bottom:1rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;cursor:pointer}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:2.25rem;text-align:center}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:1rem;margin-top:0;margin-bottom:.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{margin-bottom:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .no-header-margin[_ngcontent-%COMP%]{font-weight:300;margin-bottom:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%]{display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%] markdown[_ngcontent-%COMP%] ul{margin-top:0;padding-left:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{height:50rem;min-height:10rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%]{font-weight:300}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:3rem;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%]{position:relative;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%] iframe{width:100%;height:100%;max-height:17.5rem}"]}),n})(),tOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,Ok,mxe,Z1e.forRoot({})]]}),n})(),iOe=(()=>{class n{constructor(t){this.http=t,this.markdownContent=new sr([])}readMarkdown(){this.http.get("assets/docs/README.md",{responseType:"text"}).subscribe(t=>{const i=this.parseMarkdown(t);this.markdownContent.next(i)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.split("\n\n");i.push({title:o[0],content:o.splice(1).join("\n\n")})}return i}}return n.\u0275fac=function(t){return new(t||n)(I(im))},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),rOe=(()=>{class n{constructor(t,i){this.dialog=t,this.infoButtonService=i,this.infoTitle="",this.subscriptions=new Ie,this.subscriptions.add(i.markdownContent.subscribe(r=>{r.length&&this.launchInfoDialog(r)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){this.dialog.open(eOe,{autoFocus:!1,panelClass:"modal-animated",width:"60rem",data:{title:this.infoTitle,content:t,videoID:this.videoID}})}onDialogButtonClick(){this.infoButtonService.readMarkdown()}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(iOe))},n.\u0275cmp=Le({type:n,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID"},decls:3,vars:0,consts:[[1,"info-button-wrapper"],["aria-hidden","false","aria-label","Page information",1,"ccf-info-button",3,"click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"mat-icon",1),ye("click",function(){return i.onDialogButtonClick()}),Te(2," info "),N(),N())},directives:[Rs],styles:[".info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.65rem;transition:.6s}.info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.5rem;vertical-align:sub}"]}),n})(),sOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,tOe,Pr,nU]]}),n})(),oOe=(()=>{class n{constructor(t){this.el=t}onInputChange(t){const i=this.el.nativeElement.value;this.el.nativeElement.value=i.replace(/[^0-9]*/g,""),i!==this.el.nativeElement.value&&t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(nt))},n.\u0275dir=he({type:n,selectors:[["input","ccfNumbersOnly",""]],hostBindings:function(t,i){1&t&&ye("input",function(s){return i.onInputChange(s)})}}),n})(),aOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),cq=(()=>{class n{get obj(){const t=this.findGlobalObject();return Object.defineProperties(this,{obj:{configurable:!1,writable:!1,value:t}}),t}has(t){const{obj:i}=this;return null!=i&&t in i}get(t,i){var r;const{obj:s}=this;return null!==(r=s&&s[t])&&void 0!==r?r:i}set(t,i){const{obj:r}=this;r&&(r[t]=i)}remove(t){const{obj:i}=this;i&&delete i[t]}findGlobalObject(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof window)return window;if("undefined"!=typeof self)return self;try{return new Function("return this;")()}catch(t){}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Eh=(()=>{let n=class extends qm{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Uk(),Hc(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(lr(...t),Xo(),Hc(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(lr(...t),Xo(),Hc(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri()],n.prototype,"config$",null),n=De([Ch(),gh({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();let dOe=(()=>{class n{constructor(t,i){t&&function(n,e){zc(n,"mousemove").pipe(yG(1e3),be(r=>{const{clientWidth:s,clientHeight:o}=n,{clientX:a,clientY:l}=r;return[a,l,s,o].join("_")})).subscribe(r=>e.event("webpage","mousemove",r))}(t.body,i)}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(io))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function hOe(n,e){if(1&n){const t=Lr();F(0,"button",1),ye("click",function(){return Vn(t),bt().submit(!0)}),Te(1),N()}if(2&n){const t=bt();Y(1),Os(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function fOe(n,e){if(1&n){const t=Lr();F(0,"button",1),ye("click",function(){return Vn(t),bt().submit(!1)}),Te(1,"Opt out"),N()}}let pOe=(()=>{class n{constructor(t,i,r){this.consentService=i,this.data=r,this.clsName="ccf-tracking-popup",this.container=t.nativeElement}get allowTelemetry(){return this.consentService.consent}dismiss(){this.data.preClose()}submit(t){this.consentService.setConsent(t?"given":"rescinded"),this.dismiss()}showButton(t){const{allowTelemetry:i}=this;return"not-set"===i||("opt-in"===t?"rescinded"===i:"given"===i)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(o0),E(FO))},n.\u0275cmp=Le({type:n,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,i){1&t&&(F(0,"p"),Te(1,"We log usage to improve this service."),N(),Ct(2,hOe,2,1,"button",0),Ct(3,fOe,2,0,"button",0)),2&t&&(Y(2),ie("ngIf",i.showButton("opt-in")),Y(1),ie("ngIf",i.showButton("opt-out")))},directives:[Is,$f],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:400px;color:#ffffffb3;background:#323232;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;z-index:9999}[_nghost-%COMP%] p[_ngcontent-%COMP%]{margin:24px}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin:1rem;min-width:6rem;background-color:#007cbe;display:flex;justify-content:center}"],changeDetection:0}),n})(),gOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf]]}),n})();function a1(n){return Array.isArray(n)?n.join(","):`${n}`}a1([1,110]),a1([13,83]),a1(["http://purl.obolibrary.org/obo/UBERON_0013702"]);const bOe={initialConfig:{},parse:{},rename:{}};class COe{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},bOe),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let wOe=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new COe(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=he({type:n,features:[qn]}),n})();const EOe={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var mF,SOe=Ve(815);class xOe{constructor(e){this.value=e}call(e,t){return t.subscribe(new TOe(e,this.value))}}class TOe extends Rt{constructor(e,t){super(e),this.value=t}_next(e){this.destination.next(this.value)}}class DOe{constructor(e){this.notifier=e}call(e,t){return t.subscribe(new OOe(e,this.notifier))}}class OOe extends ei{constructor(e,t){super(e),this.hasValue=!1;const i=new $r(this);this.add(i),this.innerSubscription=i;const r=oo(t,i);r!==i&&(this.add(r),this.innerSubscription=r)}_next(e){this.hasValue&&super._next(e)}notifyNext(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()}notifyComplete(){}}function pF(n){return"function"==typeof n}function hq(n){return void 0===n}function POe(n,e,t){return function(r){let s=!!n;return function(n){return"function"==typeof n}(n)&&(s=n(r)),function(n,e){return pF(n)?n(e):hq(n)?e:n}(s?e:t,r)}}function ROe(n,e){return function(i){if(function(n){return null===n||hq(n)}(n)&&i)return i;if(!Array.isArray(i))return[n];const r=i.slice();let s=0;return e>0&&(s=e),r.splice(s,0,n),r}}function l0(n){return function(t){let i=null;for(const r in n){const s=n[r],o=t[r],a=pF(s)?s(o):s;a!==o&&(i||(i=Object.assign({},t)),i[r]=a)}return i||t}}const Sh={production:!0,disableDbWorker:!0,dbOptions:{ccfOwlUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf.owl",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(mF=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==mF?mF:""},skipUnsavedChangesConfirmation:!1,googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};let Ui=class extends qm{constructor(e){super(),this.globalConfig=e,this.user$=this.state$.pipe(lr("user")),this.registrationStarted$=this.state$.pipe(zk("registrationStarted")),this.useCancelRegistrationCallback$=this.state$.pipe(lr("useCancelRegistrationCallback")),this.registrationCallbackSet$=this.state$.pipe(lr("registrationCallbackSet"))}get skipConfirmation$(){return this.state$.pipe(zk("skipConfirmation"))}get globalSkipConfirmation$(){return this.globalConfig.getOption("skipUnsavedChangesConfirmation").pipe(be(e=>null!=e?e:Sh.skipUnsavedChangesConfirmation),Xo())}get hasChanges$(){return this.state$.pipe(zk("hasChanges"))}ngxsOnInit(){super.ngxsOnInit(),this.globalConfig.config$.pipe(_i(1),Di(e=>this.setState(l0({registrationCallbackSet:!!e.register,useCancelRegistrationCallback:!!e.cancelRegistration,user:POe(!!e.user,e.user),registrationStarted:!!e.user||void 0})))).subscribe(),this.initSkipConfirmationListeners()}cancelRegistration(){const{globalConfig:{snapshot:{cancelRegistration:e}},snapshot:{useCancelRegistrationCallback:t,skipConfirmation:i}}=this;t&&(i||confirm("Changes you made may not be saved."))&&(null==e||e())}setUseCancelRegistrationCallback(e){this.ctx.patchState({useCancelRegistrationCallback:e})}setUserName(e){this.ctx.setState(l0({user:l0(e)}))}registrationStarted(){this.ctx.setState(l0({registrationStarted:!0}))}setHasChanges(){const{snapshot:{registrationStarted:e,hasChanges:t}}=this;e&&!t&&this.ctx.patchState({hasChanges:!0})}clearHasChanges(){this.ctx.patchState({hasChanges:!1})}initSkipConfirmationListeners(){const e=i=>this.patchState({skipConfirmation:i});this.globalSkipConfirmation$.pipe(Tn(i=>i)).subscribe(e),this.hasChanges$.pipe(jM(this.globalSkipConfirmation$),be(([i,r])=>r||!i),Xo()).subscribe(e);const t=i=>(i.preventDefault(),i.returnValue="Changes you made may not be saved.",i.returnValue);this.skipConfirmation$.subscribe(i=>{i?removeEventListener("beforeunload",t):addEventListener("beforeunload",t)})}};Ui.\u0275fac=function(e){return new(e||Ui)(I(Eh))},Ui.\u0275prov=ae({token:Ui,factory:Ui.\u0275fac}),De([ri()],Ui.prototype,"skipConfirmation$",null),De([ri()],Ui.prototype,"globalSkipConfirmation$",null),De([ri()],Ui.prototype,"hasChanges$",null),De([Xt()],Ui.prototype,"setUseCancelRegistrationCallback",null),De([Xt()],Ui.prototype,"setUserName",null),De([Xt()],Ui.prototype,"registrationStarted",null),De([Xt()],Ui.prototype,"setHasChanges",null),De([Xt()],Ui.prototype,"clearHasChanges",null),Ui=De([Ch(),gh({name:"page",defaults:{user:{firstName:"",lastName:""},registrationStarted:!1,useCancelRegistrationCallback:!1,registrationCallbackSet:!1,skipConfirmation:!0,hasChanges:!1}})],Ui);let dc=class extends qm{constructor(e,t){super(),this.globals=e,this.globalConfig=t}ngxsOnInit(){super.ngxsOnInit(),this.getSourceDB().subscribe(e=>{this.setState(e),Sh.production||this.globals.set("db",e)})}getSourceDB(){return this.globalConfig.getOption("baseHref").pipe(be(e=>(null!=e?e:"")+"assets/reference-organ-data.json"),Ir(e=>li(fetch(e)).pipe(Ir(t=>t.json()),Sa(()=>Ql))))}normalizePlacement(e){const i=this.snapshot.placementPatches[null==e?void 0:e.target];if(i){const r=function(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(Jv),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}(new Lt(Lt.IDENTITY),i),s={x:e.x_translation,y:e.y_translation,z:e.z_translation},[o,a,l]=r.transformAsPoint([s.x,s.y,s.z],[]),c=Object.assign(Object.assign({},e),{target:i.target});return c.x_translation=o,c.y_translation=a,c.z_translation=l,c}return e}getReferenceOrganIri(e,t,i,r){const s=this.snapshot;"KIDNEY"!==e.toUpperCase()&&(i=""),(null==r?void 0:r.sex)&&(t=r.sex);const o=[e,t,i||(null==r?void 0:r.side)].join("|").toUpperCase(),a=Object.keys(s.organIRILookup).find(l=>l.toUpperCase().endsWith(o));return a?s.organIRILookup[a]:void 0}getOrganData(e){var t,i,r;const o=this.snapshot.organSpatialEntities[e];if(!o)return;const a=null!==(t=o.label)&&void 0!==t?t:"",l=a0.find(c=>a.endsWith(c.organ));return l?{organ:l,sex:null===(i=o.sex)||void 0===i?void 0:i.toLowerCase(),side:null===(r=o.side)||void 0===r?void 0:r.toLowerCase()}:void 0}};dc.\u0275fac=function(e){return new(e||dc)(I(cq),I(Eh))},dc.\u0275prov=ae({token:dc,factory:dc.\u0275fac}),dc=De([Ch(),gh({name:"reference",defaults:{organIRILookup:{},organSpatialEntities:{},anatomicalStructures:{},extractionSets:{},sceneNodeLookup:{},simpleSceneNodeLookup:{},placementPatches:{}}})],dc);const _F=a0;let si=class extends qm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.id$=this.state$.pipe(lr("id")),this.blockSize$=this.state$.pipe(lr("blockSize")),this.rotation$=this.state$.pipe(lr("rotation")),this.position$=this.state$.pipe(lr("position")),this.slicesConfig$=this.state$.pipe(lr("slicesConfig")),this.viewType$=this.state$.pipe(lr("viewType")),this.viewSide$=this.state$.pipe(lr("viewSide")),this.organ$=this.state$.pipe(lr("organ")),this.organIri$=this.state$.pipe(lr("organIri")),this.organDimensions$=this.state$.pipe(lr("organDimensions")),this.sex$=this.state$.pipe(lr("sex")),this.side$=this.state$.pipe(lr("side")),this.showPrevious$=this.state$.pipe(lr("showPrevious")),this.extractionSites$=this.state$.pipe(lr("extractionSites")),this.anatomicalStructures$=this.state$.pipe(lr("anatomicalStructures")),this.extractionSets$=this.state$.pipe(lr("extractionSets"))}get modelChanged$(){const e=["viewType","viewSide","showPrevious"],t=Object.keys(this.initialState).filter(i=>!e.includes(i));return this.state$.pipe(yG(0,void 0,{leading:!1,trailing:!0}),Xo((i,r)=>{for(const s of t)if(i[s]!==r[s])return!1;return!0}),e=>e.lift(new xOe(void 0)))}ngxsOnInit(){super.ngxsOnInit(),this.referenceData=this.injector.get(dc),this.page=this.injector.get(Ui),this.globalConfig.getOption("organ").pipe(Uk(),Ir(e=>{var t,i;const r=e.name.toLowerCase(),s=e.side;let a=this.idMatches(e.ontologyId,s);return a||(a=this.nameMatches(r,s)),a?(this.ctx.patchState({organ:a,sex:null===(t=e.sex)||void 0===t?void 0:t.toLowerCase(),side:null===(i=null==a?void 0:a.side)||void 0===i?void 0:i.toLowerCase()}),this.referenceData.state$.pipe($g(100),_i(1),bk(200),Di(()=>this.onOrganIriChange()))):Ql})).subscribe(),this.modelChanged$.pipe(function(n){return e=>e.lift(new DOe(n))}(this.page.registrationStarted$.pipe(Tn(e=>e),bk(5)))).subscribe(()=>this.page.setHasChanges())}idMatches(e,t){return a0.find(i=>!(!e||i.id!==e||i.side&&i.side!==t))}nameMatches(e,t){return a0.find(i=>i.side?i.organ.toLowerCase()===e&&i.side===t:i.organ.toLowerCase()===e)}setBlockSize(e){this.ctx.patchState({blockSize:e})}setRotation(e){this.ctx.patchState({rotation:e})}setPosition(e){this.ctx.patchState({position:e})}setSlicesConfig(e){this.ctx.patchState({slicesConfig:e})}setViewType(e){this.ctx.patchState({viewType:e})}setViewSide(e){this.ctx.patchState({viewSide:e})}get defaultPosition(){const e=this.snapshot.organDimensions;return{x:e.x+2*this.snapshot.blockSize.x,y:e.y/2,z:e.z/2}}setOrgan(e){this.ctx.patchState({organ:e}),e.side&&this.ctx.patchState({side:e.side}),this.onOrganIriChange()}setSex(e){this.ctx.patchState({sex:e}),this.onOrganIriChange()}setSide(e){this.ctx.patchState({side:e}),this.onOrganIriChange()}setShowPrevious(e){this.ctx.patchState({showPrevious:e})}setExtractionSites(e){this.ctx.patchState({extractionSites:e})}setAnatomicalStructures(e){this.ctx.patchState({anatomicalStructures:e})}setExtractionSets(e){this.ctx.patchState({extractionSets:e})}toggleRegistrationBlocksVisibility(e,t){if(this.setShowPrevious(e),e){const i=t.map(r=>{var s;return Object.assign(Object.assign({},r),{opacity:Math.min(20,null!==(s=r.opacity)&&void 0!==s?s:20)})});this.setAnatomicalStructures(i)}else this.setAnatomicalStructures(t)}onOrganIriChange(){var e,t,i,r,s;const o=this.referenceData.getReferenceOrganIri((null===(e=this.snapshot.organ)||void 0===e?void 0:e.organ)||"",this.snapshot.sex,this.snapshot.side,this.snapshot.organ),a={x:100,y:100,z:100};if((null===(t=this.snapshot.organ)||void 0===t?void 0:t.sex)&&this.ctx.patchState({sex:null===(i=this.snapshot.organ)||void 0===i?void 0:i.sex}),o){const l=this.referenceData.snapshot,c={};for(const p of l.anatomicalStructures[o]||[]){const g=null!==(r=p.representation_of)&&void 0!==r?r:p["@id"];c[g]||(c[g]={id:null!==(s=p.representation_of)&&void 0!==s?s:p["@id"],name:p.label,visible:!0,opacity:20,tooltip:p.comment})}this.ctx.patchState({anatomicalStructures:Object.values(c)});const d=(l.extractionSets[o]||[]).map(p=>({name:p.label,sites:(0,SOe.sortBy)(p.extractionSites.map(g=>({id:g["@id"],name:g.label,visible:!1,opacity:0,tooltip:g.comment})),"name")}));this.ctx.patchState({extractionSets:d}),this.ctx.patchState({extractionSites:d.length>0?d[0].sites:[]});const f=l.organSpatialEntities[o];a.x=f.x_dimension,a.y=f.y_dimension,a.z=f.z_dimension}this.ctx.patchState({organIri:o,organDimensions:a}),this.ctx.patchState({position:this.defaultPosition})}};si.\u0275fac=function(e){return new(e||si)(I(Tt),I(Eh))},si.\u0275prov=ae({token:si,factory:si.\u0275fac}),De([ri()],si.prototype,"modelChanged$",null),De([Xt()],si.prototype,"setBlockSize",null),De([Xt()],si.prototype,"setRotation",null),De([Xt()],si.prototype,"setPosition",null),De([Xt()],si.prototype,"setSlicesConfig",null),De([Xt()],si.prototype,"setViewType",null),De([Xt()],si.prototype,"setViewSide",null),De([ri()],si.prototype,"defaultPosition",null),De([Xt()],si.prototype,"setOrgan",null),De([Xt()],si.prototype,"setSex",null),De([Xt()],si.prototype,"setSide",null),De([Xt()],si.prototype,"setShowPrevious",null),De([Xt()],si.prototype,"setExtractionSites",null),De([Xt()],si.prototype,"setAnatomicalStructures",null),De([Xt()],si.prototype,"setExtractionSets",null),si=De([Ch(),gh({name:"model",defaults:{id:"",label:"",organ:{src:"",name:""},organIri:"",organDimensions:{x:90,y:90,z:90},sex:"male",side:"left",blockSize:{x:10,y:10,z:10},rotation:{x:0,y:0,z:0},position:{x:0,y:0,z:0},slicesConfig:{thickness:NaN,numSlices:NaN},viewType:"register",viewSide:"anterior",showPrevious:!1,extractionSites:[],anatomicalStructures:[],extractionSets:[]}})],si);const mq=new _e("Default theme class");let yF=(()=>{class n{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(t){const{injector:i,location:r}=t;i.get(n).initialize(r,i)}getTheme(){return this.theme}setTheme(t){t!==this.theme&&(this.applyThemeClass(this.theme,"remove"),this.applyThemeClass(t),this.theme=t)}resetTheme(){this.setTheme(this.defaultTheme)}initialize(t,i){this.element=t,this.injector=i,this.applyThemeClass(this.getTheme())}applyThemeClass(t,i="add"){var r;const{element:s,injector:o}=this;if(!t||!s||!o)return;const a=o.get(Lc,null);if(!a)return;const l=s.nativeElement,c=null===(r=o.get(om,null))||void 0===r?void 0:r.getContainerElement(),d="add"===i?"addClass":"removeClass";a[d](l,t),c&&a[d](c,t)}}return n.\u0275fac=function(t){return new(t||n)(I(mq,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),FOe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-name-input",this.firstNameValidator=new vh("",[p$.required]),this.lastNameValidator=new vh("",[p$.required]),this._name={firstName:"",lastName:""},this.nameChange=new Pe}get name(){return this._name}set name(t){this._name=t,this.firstNameValidator.setValue((null==t?void 0:t.firstName)||""),this.lastNameValidator.setValue((null==t?void 0:t.lastName)||"")}updateName(t,i){const r=t.target;this.name=Object.assign(Object.assign({},this.name),{[i]:r.value}),this.ga.event("name_updated","name_input",i),this.nameChange.emit(this.name)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-name-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{name:"name"},outputs:{nameChange:"nameChange"},decls:8,vars:2,consts:[[1,"field"],[1,"text","label"],["matInput","","matTooltip","Add your first name.",1,"input",3,"value","input"],["matInput","","matTooltip","Add your last name.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"mat-form-field",0),F(1,"mat-label",1),Te(2,"First Name "),N(),F(3,"input",2),ye("input",function(s){return i.updateName(s,"firstName")}),N(),N(),F(4,"mat-form-field",0),F(5,"mat-label",1),Te(6,"Last Name "),N(),F(7,"input",3),ye("input",function(s){return i.updateName(s,"lastName")}),N(),N()),2&t&&(Y(3),ie("value",i.firstNameValidator.value),Y(4),ie("value",i.lastNameValidator.value))},directives:[tm,Bf,Hb,cc],styles:["[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:left;width:100%}"],changeDetection:0}),n})();const NOe=["thumbContainer"],LOe=["toggleBar"],BOe=["input"],VOe=function(n){return{enterDuration:n}},jOe=["*"],UOe=new _e("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let zOe=0;const HOe={provide:Ao,useExisting:T(()=>_q),multi:!0};class $Oe{constructor(e,t){this.source=e,this.checked=t}}const GOe=Nf(kf(Ff(em(class{constructor(n){this._elementRef=n}}))));let _q=(()=>{class n extends GOe{constructor(t,i,r,s,o,a){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this.defaults=o,this._onChange=l=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++zOe,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new Pe,this.toggleChange=new Pe,this.tabIndex=parseInt(s)||0,this.color=this.defaultColor=o.color||"accent",this._noopAnimations="NoopAnimations"===a}get required(){return this._required}set required(t){this._required=Dt(t)}get checked(){return this._checked}set checked(t){this._checked=Dt(t),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new $Oe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Un),fs("tabindex"),E(UOe),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(ni(NOe,5),ni(LOe,5),ni(BOe,5)),2&t){let r;Mt(r=xt())&&(i._thumbEl=r.first),Mt(r=xt())&&(i._thumbBarEl=r.first),Mt(r=xt())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(sl("id",i.id),en("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),at("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[At([HOe]),ht],ngContentSelectors:jOe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"div",2,3),F(4,"input",4,5),ye("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),N(),F(6,"div",6,7),et(8,"div",8),F(9,"div",9),et(10,"div",10),N(),N(),N(),F(11,"span",11,12),ye("cdkObserveContent",function(){return i._onLabelTextChange()}),F(13,"span",13),Te(14,"\xa0"),N(),In(15),N(),N()),2&t){const r=Ys(1),s=Ys(12);en("for",i.inputId),Y(2),at("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),Y(2),ie("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),en("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),Y(5),ie("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Fg(18,VOe,i._noopAnimations?0:150))}},directives:[Qo,kD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),yq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),vq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[yq,ec,Nn,_E],yq,Nn]}),n})(),vF=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-labeled-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new Pe}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.ga.event("slide_toggle_toggled","slide_toggle",this.value),this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-labeled-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{labels:"labels",value:"value",disabled:"disabled"},outputs:{valueChange:"valueChange"},decls:6,vars:12,consts:[[1,"slide-label",3,"click"],[1,"slider",3,"disabled","checked","change"],["toggle",""]],template:function(t,i){if(1&t){const r=Lr();F(0,"span",0),ye("click",function(){Vn(r);const o=Ys(3);return i.left||o.toggle(),i.updateToggle(!0)}),Te(1),N(),F(2,"mat-slide-toggle",1,2),ye("change",function(o){return i.updateToggle(!o.checked)}),N(),F(4,"span",0),ye("click",function(){Vn(r);const o=Ys(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Te(5),N()}2&t&&(at("disabled",i.disabled)("highlighted",i.left),Y(1),Ai(i.labels[0]),Y(1),ie("disabled",i.disabled)("checked",!i.left),Y(2),at("disabled",i.disabled)("highlighted",!i.left),Y(1),Ai(i.labels[1]))},directives:[_q],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%;cursor:not-allowed}"],changeDetection:0}),n})();const YOe=function(){return["Male","Female"]},XOe=function(n){return[n]};let KOe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.dialogRef=r,this.clsName="ccf-registration-content",this.sexByLabel$=this.model.sex$.pipe(be(s=>"female"===s?"Female":"Male")),this.organList=_F,r.disableClose=!0}setSexFromLabel(t){this.currentSex=t,this.sexSelected=!0}checkNameValid(t){this.nameValid=t.firstName.length>0&&t.lastName.length>0}organSelect(t){this.currentOrgan=t,this.organSelected=!0}registerButtonClick(t){t&&t.preventDefault(),this.organSelected&&this.nameValid&&this.closeDialog()}closeDialog(){this.model.setSex("Female"===this.currentSex?"female":"male"),this.model.setOrgan(this.currentOrgan),this.dialogRef.close(!0),this.page.registrationStarted()}}return n.\u0275fac=function(t){return new(t||n)(E(Ui),E(si),E(Gm))},n.\u0275cmp=Le({type:n,selectors:[["ccf-registration-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:17,vars:17,consts:[[1,"modal"],["mat-dialog-content",""],[3,"name","nameChange"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"labels","value","valueChange"],[1,"selector-label"],[1,"selector-container"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],["mat-button","",1,"registration-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"ccf-name-input",2),ye("nameChange",function(s){return i.page.setUserName(s),i.checkNameValid(s)}),yn(3,"async"),N(),F(4,"div",3),F(5,"div",4),Te(6,"Donor Sex:"),N(),F(7,"ccf-labeled-slide-toggle",5),ye("valueChange",function(s){return i.setSexFromLabel(s)}),yn(8,"async"),N(),N(),F(9,"div",6),Te(10,"Select an organ"),N(),F(11,"div",7),F(12,"ccf-organ-selector",8,9),ye("organsChanged",function(s){return i.organSelect(s[0])}),yn(14,"async"),N(),N(),N(),F(15,"button",10),ye("click",function(s){return i.registerButtonClick(s)}),Te(16,"START REGISTRATION"),N(),N()),2&t&&(Y(2),ie("name",wn(3,8,i.page.user$)),Y(5),ie("labels",lv(14,YOe))("value",wn(8,10,i.sexByLabel$)),Y(5),ie("organList",i.organList)("selectedOrgans",Fg(15,XOe,wn(14,12,i.model.organ$))),Y(3),at("disabled",!i.organSelected||!i.nameValid),ie("matTooltip",i.organSelected&&i.nameValid?"":"Required: Enter first and last name, and select an organ"))},directives:[FOe,cc,vF,oq,$f],pipes:[zu],styles:[".modal[_ngcontent-%COMP%]{padding:1rem;border-radius:4px;width:35rem;height:22rem}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}.modal[_ngcontent-%COMP%] .selector-label[_ngcontent-%COMP%]{font-weight:600;height:3rem;line-height:3rem}.modal[_ngcontent-%COMP%] .selector-container[_ngcontent-%COMP%]{height:4rem;width:31rem;margin:0 auto}.modal[_ngcontent-%COMP%] .registration-button[_ngcontent-%COMP%]{display:block;margin:2rem auto 0}"],changeDetection:0}),n})(),ZOe=(()=>{class n{constructor(t,i,r){this.dialog=t,this.page=i,this.model=r,this.clsName="ccf-registration-modal"}ngOnInit(){or([this.page.user$,this.model.organ$]).pipe($g(500),_i(1),Di(([t,i])=>{""!==t.firstName&&""!==t.lastName&&""!==i.src||this.openDialog()})).subscribe()}openDialog(){this.dialog.open(KOe,{autoFocus:!1})}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(Ui),E(si))},n.\u0275cmp=Le({type:n,selectors:[["ccf-registration-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:0,vars:0,template:function(t,i){},encapsulation:2}),n})();function QOe(n,e){1&n&&function(n,e,t){ff(n,e,t),pf()}(0)}function JOe(n,e){if(1&n){const t=Lr();F(0,"div",4),ye("click",function(){return Vn(t),bt().page.cancelRegistration()}),F(1,"mat-icon",5),Te(2,"chevron_left"),N(),F(3,"span",6),Te(4,"BACK"),N(),N()}}function eIe(n,e){1&n&&(F(0,"a",7),et(1,"mat-icon",8),N())}let tIe=(()=>{class n{constructor(t){this.page=t,this.clsName="ccf-header"}}return n.\u0275fac=function(t){return new(t||n)(E(Ui))},n.\u0275cmp=Le({type:n,selectors:[["ccf-header"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:7,vars:5,consts:[[4,"ngIf","ngIfThen","ngIfElse"],["backButton",""],["logo",""],[1,"filler"],["rel","noreferrer noopener",1,"link","home",3,"click"],[1,"icon","backbutton"],[1,"text"],["href","https://ingest.hubmapconsortium.org/","rel","noreferrer noopener","matTooltip","Human BioMolecular Atlas Project","matTooltipPosition","right",1,"link","hubmap"],["svgIcon","app:logo",1,"icon","logo"]],template:function(t,i){if(1&t&&(Ct(0,QOe,1,0,"ng-container",0),yn(1,"async"),Ct(2,JOe,5,0,"ng-template",null,1,Rw),Ct(4,eIe,2,0,"ng-template",null,2,Rw),et(6,"div",3)),2&t){const r=Ys(3),s=Ys(5);ie("ngIf",wn(1,3,i.page.useCancelRegistrationCallback$))("ngIfThen",r)("ngIfElse",s)}},directives:[Is,Rs,cc],pipes:[zu],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid}[_nghost-%COMP%] .text[_ngcontent-%COMP%]{padding:.25rem 0;height:2rem;display:flex;align-items:center;font-weight:lighter;font-size:1.5rem}[_nghost-%COMP%] .link[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;text-decoration:none;padding:.25rem 0}[_nghost-%COMP%] .home[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{transition:color .6s}[_nghost-%COMP%] .home[_ngcontent-%COMP%] .backbutton[_ngcontent-%COMP%]{font-size:2.25rem;width:2.25rem;height:2.25rem}[_nghost-%COMP%] .hubmap[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;margin-right:1rem}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}"],changeDetection:0}),n})();const bq={isolated:!0},Cq=new _e("Message service configuration",{providedIn:"root",factory:()=>bq});let nIe=(()=>{class n{constructor(t,i,r){this.source=t,this.channel=i,this.messages=r}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Tn(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Tn(i=>i.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Tn(i=>t.includes(i.source)))}nextMessageId(){return n.counter++}}return n.counter=0,n})();const c0=(()=>{class n{constructor(t,i){this.config=t,this.parent=i,this.channel=new we,this.messages=t.isolated||!i?this.channel.asObservable():li([this.channel,i.messages.pipe(_U(()=>!this.channel.closed))]).pipe(ao())}ngOnDestroy(){this.channel.complete()}connect(t){return new nIe(t,this.channel,this.messages)}}return n.\u0275fac=function(t){return new(t||n)(I(Cq),I(n,12))},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),iIe=["*"];let l1=(()=>{class n{constructor(t,i){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new Ie;const r=t.connect(this).getMessages();this.subscriptions.add(r.subscribe(s=>{this.handleMessage(s)&&i.markForCheck()}))}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){switch(t.payload.type){case"drawer-containers-changed":return this.drawers=t.payload.drawers,this.updateFaded(),!0;case"drawer-initialized":return this.animationsEnabled=!0,!0;case"drawer-toggled":{const i=t.source.position,{opened:r,width:s,margin:o}=t.payload;return this.updateMargin(i,r,s,o),this.updateFaded(),!0}default:return!1}}updateMargin(t,i,r,s){const o=i?r+s:s;"start"===t?this.leftMargin=o:this.rightMargin=o}updateFaded(){const[t,i]=this.drawers;this.faded=!!((null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==i?void 0:i.opened)&&(null==i?void 0:i.expanded))}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,i){2&t&&(Sg("@fadeInOut",i.faded),Fn(i.className),gf("margin-left",i.leftMargin,"px")("margin-right",i.rightMargin,"px"),at("cff-drawer-content-animations",i.animationsEnabled))},ngContentSelectors:iIe,decls:1,vars:0,template:function(t,i){1&t&&(Dr(),In(0))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;z-index:2;overflow:auto}.cff-drawer-content-animations[_nghost-%COMP%]{transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:margin-left,margin-right}"],data:{animation:[Jl("fadeInOut",[br("false",Kn({opacity:1})),br("true",Kn({opacity:0})),Qs("false <=> true",Mo("1s"))])]},changeDetection:0}),n})();const rIe=["*"],bF={params:{width:0,margin:0,margin2:0}};class sIe{constructor(){this.initialized=!1,this.deferred=new Promise(e=>{this.resolve=e})}set(){this.initialized=!0,this.resolve()}wait(){return gl(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let CF=(()=>{class n{constructor(t,i,r){this.element=r,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Pe(!0),this.expandedChange=new Pe(!0),this.stateChange=new Pe(!0),this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._measuredWidth=0,this.width=0,this._measuredMargin=0,this.margin2=0,this.initialized=new sIe,this.subscriptions=new Ie,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(s=>{this.handleMessage(s)&&i.markForCheck()}))}get classEnd(){return"end"===this.position}get position(){return this._position}set position(t){this._position=t||"start"}get opened(){return this._opened}set opened(t){this.toggle(Dt(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(Dt(t))}get expandedStateObj(){return{value:this.expandedState2,params:{width:this.width,margin:this.measuredMargin,margin2:this.margin2}}}get measuredWidth(){if(this._measuredWidth>0)return this._measuredWidth;const t=this.element.nativeElement;if(!t)return 0;const i=t.getBoundingClientRect(),r=i.right-i.left;return 0===r?0:(this._measuredWidth=r,r)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const s=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),o=Number(s.slice(0,-2));return this._measuredMargin=o,o}ngAfterViewInit(){this.initialized.set(),setTimeout(()=>this.channel.sendMessage({type:"drawer-initialized"}))}ngOnDestroy(){this.subscriptions.unsubscribe()}open(){this.toggle(!0)}close(){this.toggle(!1)}toggle(t=!this.opened){this.opened!==t&&(t?this.openedState=this.initialized.valueOf()?"open":"open-instant":(this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._expanded=!1),this._opened=t,this.sendToggle())}openExpanded(){this.toggleExpanded(!0)}closeExpanded(){this.toggleExpanded(!1)}toggleExpanded(t=!this.expanded){this.expanded!==t&&(t?this.expandedState=this.initialized.valueOf()?"open":"open-instant":(this.expandedState="closed",this.expandedState2="collapsed"),this._expanded=t,this.sendToggle())}closeOpenDone(){this.openedChange.emit(this.opened)}expandCollapseDone(){this.expandedChange.emit(this.expanded)}sendToggle(){return gl(this,void 0,void 0,function*(){yield this.initialized.wait(),this.channel.sendMessage({type:"drawer-toggled",opened:this.opened,expanded:this.expanded,width:this.measuredWidth,margin:this.measuredMargin}),this.stateChange.emit()})}handleMessage(t){switch(t.payload.type){case"drawer-toggled":return this.syncExpanded(t.source),!0;default:return!1}}syncExpanded(t){(this.expanded||t.expanded)&&(this.expanded&&t.expanded?this.expandedState2=t.expandedState2="half":this.expanded?t.opened?(this.expandedState2="extended",this.width=t.measuredWidth+t.measuredMargin):(this.expandedState2="full",this.margin2=t.measuredMargin):this.opened?(t.expandedState2="extended",t.width=this.measuredWidth+this.measuredMargin):(t.expandedState2="full",t.margin2=this.measuredMargin))}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un),E(nt))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,i){1&t&&qy("@openClose.done",function(){return i.closeOpenDone()})("@expandCollapse.done",function(){return i.expandCollapseDone()}),2&t&&(Sg("@openClose",i.openedState)("@expandCollapse",i.expandedStateObj),Fn(i.className),at("ccf-drawer-end",i.classEnd)("ccf-drawer-opened",i.opened)("ccf-drawer-expanded",i.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:rIe,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,i){1&t&&(Dr(),F(0,"div",0),In(1),N())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%)}.ccf-drawer-end[_nghost-%COMP%]{right:0;transform:translate(100%)}[_nghost-%COMP%] .cff-drawer-inner-container[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}"],data:{animation:[Jl("openClose",[br("open, open-instant",Kn({transform:"none"})),br("closed",Kn({})),Qs("closed => open-instant",Mo(0)),Qs("closed <=> open, open-instant => closed",Mo(".5s ease-in-out"))]),Jl("expandCollapse",[br("collapsed",Kn({})),br("half",Kn({width:"calc(50% - {{ margin }}px)"}),bF),br("extended",Kn({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),bF),br("full",Kn({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),bF),Qs("* <=> *",Mo(".5s ease-in-out"))])]},changeDetection:0}),n})();function oIe(n,e){1&n&&(F(0,"ccf-drawer-content"),In(1,2),N())}const aIe=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],lIe=["ccf-drawer","ccf-drawer-content","*"];function wq(n){throw new Error(`Multiple drawers in position ${n}`)}let cIe=(()=>{class n{constructor(t,i){this.cdr=i,this.className="ccf-drawer-container",this.subscriptions=new Ie,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(r=>{this.handleMessage(r)&&i.markForCheck()}))}get content(){var t;return null!==(t=this.content1.first)&&void 0!==t?t:this.content2.first}get hasWrappedContent(){return 0!==this.content1.length}ngAfterViewInit(){this.drawers.changes.pipe(ns(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(ns(null)).subscribe(()=>{this.channel.sendMessage({type:"content-container-changed",content:this.content}),this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return!0}validateDrawers(){const t=this.drawers.toArray(),i=t.filter(s=>"start"===s.position),r=t.filter(s=>"end"===s.position);return i.length>1&&wq("start"),r.length>1&&wq("end"),[i[0],r[0]]}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-container"]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,CF,5),Fi(r,l1,5)),2&t){let s;Mt(s=xt())&&(i.drawers=s),Mt(s=xt())&&(i.content1=s)}},viewQuery:function(t,i){if(1&t&&ni(l1,5),2&t){let r;Mt(r=xt())&&(i.content2=r)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.className)},exportAs:["ccfDrawerContainer"],features:[At([c0])],ngContentSelectors:lIe,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&(Dr(aIe),In(0),In(1,1),Ct(2,oIe,2,0,"ccf-drawer-content",0)),2&t&&(Y(2),ie("ngIf",!i.hasWrappedContent))},directives:[Is,l1],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),n})();var c1,uIe=Ve(457),dIe=new Uint8Array(16);function hIe(){if(!c1&&!(c1="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c1(dIe)}const fIe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,gIe=function(n){return"string"==typeof n&&fIe.test(n)};for(var Ls=[],wF=0;wF<256;++wF)Ls.push((wF+256).toString(16).substr(1));const vIe=function(n,e,t){var i=(n=n||{}).random||(n.rng||hIe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(Ls[n[e+0]]+Ls[n[e+1]]+Ls[n[e+2]]+Ls[n[e+3]]+"-"+Ls[n[e+4]]+Ls[n[e+5]]+"-"+Ls[n[e+6]]+Ls[n[e+7]]+"-"+Ls[n[e+8]]+Ls[n[e+9]]+"-"+Ls[n[e+10]]+Ls[n[e+11]]+Ls[n[e+12]]+Ls[n[e+13]]+Ls[n[e+14]]+Ls[n[e+15]]).toLowerCase();if(!gIe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function Eq(n){const e=new Lt(n.transformMatrix),t=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return new Mi({lowerBound:new S(...t.map((r,s)=>Math.min(r,i[s]))),upperBound:new S(...i.map((r,s)=>Math.max(r,t[s])))})}let ss=class extends qm{constructor(e){super(),this.injector=e,this.gizmo$=st([{"@id":"http://purl.org/ccf/latest/ccf.owl#VHMaleOrgans_VHM_Spleen_Colic_Surface","@type":"SpatialSceneNode",scenegraph:"https://hubmapconsortium.github.io/ccf-3d-reference-object-library/Assets/body4Mesh_1338.glb",transformMatrix:new Lt(Lt.IDENTITY).scale([2,2,2]).rotateY(Jv(0)),tooltip:"Gizmo",unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!1,color:[255,255,255,255],opacity:1}])}get nodes$(){return or([this.placementCube$,this.referenceOrganNodes$,this.previousRegistrationNodes$,this.nodeCollisions$]).pipe(be(([e,t,i,r])=>[...e,...i,...t,...this.snapshot.showCollisions?r:[]]))}get rotatedNodes$(){return or([this.rotation$,this.nodes$]).pipe(be(([e,t])=>0===e?t:t.map(i=>Object.assign(Object.assign({},i),{transformMatrix:new Lt(Lt.IDENTITY).rotateY(Jv(e)).multiplyRight(i.transformMatrix)}))))}get referenceOrganNodes$(){return or([this.model.anatomicalStructures$,this.model.extractionSites$,this.model.organIri$]).pipe($g(400),be(([e,t,i])=>this.createSceneNodes(i,[...e,...t])))}get referenceOrganSimpleNodes$(){return or([this.model.anatomicalStructures$,this.model.organIri$,this.referenceData.state$]).pipe(be(([e,t,i])=>e.map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.simpleSceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[t]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.simpleSceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])))}get nodeCollisions$(){return or([this.referenceOrganSimpleNodes$,this.placementCube$]).pipe(Tn(([e,t])=>t.length>0),be(([e,t])=>{const i=Eq(t[0]);return e.filter(r=>i.overlaps(Eq(r)))}))}get previousRegistrationNodes$(){return or([this.model.organIri$,this.model.showPrevious$,this.registration.previousRegistrations$]).pipe(be(([e,t,i])=>t?i.map(r=>{const s=Array.isArray(r.placement)?r.placement[0]:r.placement;if(s.target===e){const o=this.model.snapshot.organDimensions,a=[o.x,o.y,o.z].map(l=>-l/1e3/2);return{"@id":r["@id"],"@type":"SpatialSceneNode",transformMatrix:new Lt(Lt.IDENTITY).translate([s.x_translation,s.y_translation,s.z_translation].map((l,c)=>l/1e3+a[c])).rotateXYZ([s.x_rotation,s.y_rotation,s.z_rotation].map(Jv)).scale([r.x_dimension,r.y_dimension,r.z_dimension].map(l=>l/1e3/2)),color:[25,118,210,200],tooltip:r.label,unpickable:!0}}}).filter(r=>!!r):[]))}get placementCube$(){return or([this.model.viewType$,this.model.blockSize$,this.model.rotation$,this.model.position$,this.model.organ$]).pipe(be(([e,t,i,r,s])=>""===s.src?[]:[this.placementCube]))}get placementCube(){const{viewType:e,blockSize:t,rotation:i,position:r,organDimensions:s}=this.model.snapshot,o=[s.x,s.y,s.z].map(a=>-a/1e3/2);return{"@id":"#DraftPlacement","@type":"SpatialSceneNode",transformMatrix:new Lt(Lt.IDENTITY).translate([r.x,r.y,r.z].map((a,l)=>a/1e3+o[l])).rotateXYZ([i.x,i.y,i.z].map(Jv)).scale([t.x,t.y,t.z].map(a=>a/1e3/2)),color:[255,255,0,200],tooltip:"Draft Placement",unpickable:"3d"===e}}get rotation$(){return this.model.viewSide$.pipe(be(e=>{let t=0;switch(e){case"left":t=-90;break;case"right":t=90;break;case"posterior":t=180}return t}))}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(si),this.registration=this.injector.get(wr),this.referenceData=this.injector.get(dc)}createSceneNodes(e,t){const i=this.referenceData.snapshot;return t.filter(r=>r.visible&&r.opacity&&r.opacity>0).map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.sceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[e]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.sceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])}};ss.\u0275fac=function(e){return new(e||ss)(I(Tt))},ss.\u0275prov=ae({token:ss,factory:ss.\u0275fac}),De([ri()],ss.prototype,"nodes$",null),De([ri()],ss.prototype,"rotatedNodes$",null),De([ri()],ss.prototype,"referenceOrganNodes$",null),De([ri()],ss.prototype,"referenceOrganSimpleNodes$",null),De([ri()],ss.prototype,"nodeCollisions$",null),De([ri()],ss.prototype,"previousRegistrationNodes$",null),De([ri()],ss.prototype,"placementCube$",null),De([ri()],ss.prototype,"placementCube",null),De([ri()],ss.prototype,"rotation$",null),ss=De([Ch(),gh({name:"scene",defaults:{showCollisions:!Sh.production}})],ss);let Io=class extends sTe{constructor(e){super(),this.injector=e,this._latestTags=[]}get tags$(){return or([this.entities$,this.scene.nodeCollisions$]).pipe(be(([e,t])=>{const i=[],r=new Set,s=new Set;Object.entries(e).forEach(([o,a])=>{"removed"===a.type?s.add(o):(r.add(o),i.push(a))});for(const o of t){const a=o.representation_of;a&&!s.has(a)&&!r.has(a)&&(r.add(a),i.push({id:a,label:o.tooltip,type:"assigned"}))}return i}))}get latestTags(){return this._latestTags}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(si),this.scene=this.injector.get(ss),this.page=this.injector.get(Ui),this.tags$.subscribe(e=>{this._latestTags=e}),this.entities$.subscribe(()=>this.page.setHasChanges())}addTags(e){for(const t of e)this.addTagRaw(t)}addTag(e){this.addTagRaw(e)}removeTag(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"removed"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"removed"}))}searchExternal(e,t){const i=this.model.snapshot.anatomicalStructures.filter(r=>-1!==r.name.toLowerCase().indexOf(e.toLowerCase()));return[{totalCount:i.length,results:i.map(r=>({id:r.id,label:r.name,type:"added"})).slice(0,t)}]}addTagRaw(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"added"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"added"}))}};Io.\u0275fac=function(e){return new(e||Io)(I(Tt))},Io.\u0275prov=ae({token:Io,factory:Io.\u0275fac}),De([ri()],Io.prototype,"tags$",null),De([Xt()],Io.prototype,"addTags",null),De([Xt()],Io.prototype,"addTag",null),De([Xt()],Io.prototype,"removeTag",null),De([su.ak],Io.prototype,"searchExternal",null),Io=De([Ch(),gh({name:"tags",defaults:Object.assign({},{ids:[],entities:{}})})],Io);let wr=class extends qm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.displayErrors$=this.state$.pipe(lr("displayErrors"))}get metadata$(){return or([this.page.state$,this.model.state$,this.tags.tags$]).pipe(be(([e,t,i])=>this.buildMetadata(e,t,i)))}get jsonld$(){return or([this.page.state$,this.model.state$,this.tags.tags$]).pipe(be(([e,t,i])=>this.buildJsonLd(e,t,i)))}get valid$(){return or([this.page.state$,this.model.state$]).pipe(be(()=>this.isValid))}get previousRegistrations$(){const{globalConfig:e,state$:t}=this;return or([t.pipe(lr("registrations")),e.getOption("fetchPreviousRegistrations").pipe(Ir(s=>{var o;return null!==(o=null==s?void 0:s())&&void 0!==o?o:[[]]}),ns([]))]).pipe(be(([s,o])=>[...s,...o]))}get currentIdentifier(){return vIe()}get currentDate(){return(new Date).toISOString().split("T")[0]}ngxsOnInit(){super.ngxsOnInit(),this.page=this.injector.get(Ui),this.model=this.injector.get(si),this.tags=this.injector.get(Io),this.refData=this.injector.get(dc),this.globalConfig.config$.pipe(_i(1),Di(({useDownload:e,register:t})=>this.ctx.patchState({useRegistrationCallback:!(e||!t)}))).subscribe(),this.globalConfig.getOption("editRegistration").pipe(Uk(),Di(e=>this.editRegistration(e))).subscribe()}editRegistration(e){return gl(this,void 0,void 0,function*(){const t=this.refData.normalizePlacement(Array.isArray(e.placement)?e.placement[0]:e.placement),i=this.refData.getOrganData(t.target);this.page.setUserName({firstName:e.creator_first_name,lastName:e.creator_last_name}),i&&(this.model.setOrgan(i.organ),i.sex&&this.model.setSex(i.sex),i.side&&this.model.setSide(i.side)),this.model.setBlockSize({x:e.x_dimension,y:e.y_dimension,z:e.z_dimension}),this.model.setRotation({x:t.x_rotation,y:t.y_rotation,z:t.z_rotation}),this.model.setSlicesConfig({thickness:e.slice_thickness||NaN,numSlices:e.slice_count||NaN}),yield new Promise(s=>{setTimeout(s,1e3)}),this.model.setPosition({x:t.x_translation,y:t.y_translation,z:t.z_translation});const r=new Set(e.ccf_annotations);this.tags.addTags(this.model.snapshot.anatomicalStructures.filter(s=>r.has(s.id)).map(s=>({id:s.id,label:s.name,type:"added"}))),this.page.registrationStarted()})}setUseRegistrationCallback(e){this.ctx.patchState({useRegistrationCallback:e})}setDisplayErrors(e){this.ctx.patchState({displayErrors:e})}addRegistration(e){this.ctx.setState(l0({registrations:ROe(e)}))}isDataValid(e,t){return[e.user.firstName,e.user.lastName,t.organ.src,t.organ.name,t.organ.organ].every(r=>!!r)}get isValid(){return this.isDataValid(this.page.snapshot,this.model.snapshot)}register(e){if(!this.isValid)return;const{globalConfig:{snapshot:{register:t}},page:i,model:r,snapshot:s}=this,o=this.buildJsonLd(i.snapshot,r.snapshot,this.tags.latestTags),a=JSON.stringify(o,void 0,2);if(e||void 0===e&&s.useRegistrationCallback)null==t||t(a);else{const l=new Blob([a],{type:"application/json",endings:"native"});(0,uIe.saveAs)(l,"registration-data.json")}this.addRegistration(o),this.setDisplayErrors(!1),this.page.clearHasChanges()}buildMetadata(e,t,i){const r=[];return e.registrationCallbackSet||r.push({label:"First Name",value:e.user.firstName},{label:"Last Name",value:e.user.lastName}),r.push({label:"Reference Organ Name",value:t.organ.name},{label:"Tissue Block Dimensions (mm)",value:this.xyzTripletToString(t.blockSize)},{label:"Tissue Block Position (mm)",value:this.xyzTripletToString(t.position)},{label:"Tissue Block Rotation",value:this.xyzTripletToString(t.rotation)},{label:"Anatomical Structure Tags",value:i.map(s=>s.label).join(", ")},{label:"Time Stamp",value:this.currentDate},{label:"Alignment ID",value:this.currentIdentifier}),r}buildJsonLd(e,t,i){var r,s;return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}`,"@type":"SpatialEntity",label:t.label||void 0,creator:`${e.user.firstName} ${e.user.lastName}`,creator_first_name:e.user.firstName,creator_last_name:e.user.lastName,creation_date:this.currentDate,ccf_annotations:i.map(o=>o.id),slice_thickness:(null===(r=t.slicesConfig)||void 0===r?void 0:r.thickness)||void 0,slice_count:(null===(s=t.slicesConfig)||void 0===s?void 0:s.numSlices)||void 0,x_dimension:+t.blockSize.x.toFixed(3),y_dimension:+t.blockSize.y.toFixed(3),z_dimension:+t.blockSize.z.toFixed(3),dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}_placement`,"@type":"SpatialPlacement",target:t.organIri,placement_date:this.currentDate,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:+t.rotation.x.toFixed(3),y_rotation:+t.rotation.y.toFixed(3),z_rotation:+t.rotation.z.toFixed(3),rotation_order:"XYZ",rotation_units:"degree",x_translation:+t.position.x.toFixed(3),y_translation:+t.position.y.toFixed(3),z_translation:+t.position.z.toFixed(3),translation_units:"millimeter"}}}xyzTripletToString(e){return`${Math.round(e.x)}, ${Math.round(e.y)}, ${Math.round(e.z)}`}};wr.\u0275fac=function(e){return new(e||wr)(I(Tt),I(Eh))},wr.\u0275prov=ae({token:wr,factory:wr.\u0275fac}),De([ri()],wr.prototype,"metadata$",null),De([ri()],wr.prototype,"jsonld$",null),De([ri()],wr.prototype,"valid$",null),De([ri()],wr.prototype,"previousRegistrations$",null),De([ri()],wr.prototype,"currentIdentifier",null),De([ri()],wr.prototype,"currentDate",null),De([Xt()],wr.prototype,"setUseRegistrationCallback",null),De([Xt()],wr.prototype,"setDisplayErrors",null),De([Xt()],wr.prototype,"addRegistration",null),De([ri()],wr.prototype,"isValid",null),wr=De([Ch(),gh({name:"registration",defaults:{useRegistrationCallback:!1,displayErrors:!1,registrations:[]}})],wr);let Sq=(()=>{class n{constructor(){this._vertical=!1,this._inset=!1}get vertical(){return this._vertical}set vertical(t){this._vertical=Dt(t)}get inset(){return this._inset}set inset(t){this._inset=Dt(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(t,i){2&t&&(en("aria-orientation",i.vertical?"vertical":"horizontal"),at("mat-divider-vertical",i.vertical)("mat-divider-horizontal",!i.vertical)("mat-divider-inset",i.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(t,i){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),n})(),EF=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn],Nn]}),n})();function CIe(n,e){if(1&n){const t=Lr();F(0,"mat-icon",2),ye("click",function(){return Vn(t),bt().setAllOpacity(20)}),Te(1,"refresh"),N()}2&n&&ie("matRippleCentered",!0)("matRippleUnbounded",!0)}function wIe(n,e){if(1&n){const t=Lr();F(0,"div",3),ye("mouseenter",function(){const s=Vn(t).$implicit;return bt().mouseOver(s)})("mouseleave",function(){return Vn(t),bt().mouseOut()}),et(1,"mat-icon",4),F(2,"div",5),Te(3),N(),F(4,"div",6),F(5,"ccf-opacity-slider",7,8),ye("opacityChange",function(r){return Vn(t),bt().updateOpacity(r)})("opacityReset",function(){return Vn(t),bt().resetItem()})("visibilityToggle",function(){const s=Vn(t).$implicit;return bt().toggleVisibility(s)}),N(),N(),N()}if(2&n){const t=e.$implicit,i=bt();at("selected",!!i.selection&&i.getId(0,i.selection)===i.getId(0,t)),Y(1),at("fade",!t.visible),Y(1),at("hidden",t.id===(null==i.selection?null:i.selection.id)),Yy("title",t.name),Y(1),Ai(t.name),Y(1),at("hidden",t.id!==(null==i.selection?null:i.selection.id)),Y(1),ie("visible",t.visible)("opacity",i.selection?null==i.selection?null:i.selection.opacity:20)}}let EIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-menu",this.hover=new Pe,this.itemsChange=new Pe}toggleVisibility(t){t=Object.assign(Object.assign({},t),{visible:!t.visible}),this.selection&&t.id===this.selection.id&&(this.selection=Object.assign(Object.assign({},this.selection),{visible:t.visible})),this.ga.event("visibility_toggled","visibility_menu",""+t.id,+t.visible),this.updateOpacity(t.opacity)}mouseOver(t){this.selection=t===this.selection?void 0:t,this.hover.emit(t)}mouseOut(){this.selection=void 0,this.hover.emit(void 0)}updateOpacity(t){if(!this.selection)return;const i=Object.assign(Object.assign({},this.selection),{opacity:t});this.selection=i,this.items=this.items.map(r=>r.id===i.id?i:r),this.ga.event("opacity_update","visibility_menu",""+i.id,i.opacity),this.itemsChange.emit(this.items)}resetItem(){if(this.selection){const t=Object.assign(Object.assign({},this.selection),{opacity:20,visible:!0});this.selection=t,this.items=this.items.map(i=>i.id===t.id?t:i),this.ga.event("item_reset","visibility_menu",""+t.id),this.itemsChange.emit(this.items)}}setAllOpacity(t){this.items=this.items.map(i=>Object.assign(Object.assign({},i),{opacity:t,visible:!0})),this.ga.event("all_items_opacity_update","visibility_menu",void 0,t),this.itemsChange.emit(this.items)}getId(t,i){return i.id}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-visibility-menu"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{items:"items",selection:"selection"},outputs:{hover:"hover",itemsChange:"itemsChange"},decls:2,vars:3,consts:[["class","icon reset","matRipple","",3,"matRippleCentered","matRippleUnbounded","click",4,"ngIf"],["class","item-entry",3,"selected","mouseenter","mouseleave",4,"ngFor","ngForOf","ngForTrackBy"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"item-entry",3,"mouseenter","mouseleave"],["svgIcon","app:opacity",1,"opacity-icon"],[1,"item-name",3,"title"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider",""]],template:function(t,i){1&t&&(Ct(0,CIe,2,2,"mat-icon",0),Ct(1,wIe,7,12,"div",1)),2&t&&(ie("ngIf",i.items.length),Y(1),ie("ngForOf",i.items)("ngForTrackBy",i.getId))},directives:[Is,Xl,Rs,Qo,KDe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;margin-right:0;margin-left:0;max-height:18rem;overflow-y:auto;scrollbar-width:thin}[_nghost-%COMP%] .icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s;position:absolute;top:3rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%]{display:flex;height:2.25rem;align-items:center;flex-shrink:0;position:relative}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]{z-index:1;transition:.6s}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:.5rem;opacity:1;transition-duration:.4s;transition-timing-function:ease-in-out;transition-property:opacity;max-width:calc(100% - 2.5rem)}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:calc(100% - 2rem);transition-duration:.3s;transition-timing-function:ease-in-out;transition-property:opacity;left:2rem;position:absolute;opacity:1}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.1s;transition-timing-function:ease-in-out;transition-property:opacity}"],changeDetection:0}),n})();const SIe=["*"],Mq=new _e("MatChipRemove"),xq=new _e("MatChipAvatar"),Tq=new _e("MatChipTrailingIcon");class MIe{constructor(e){this._elementRef=e}}const xIe=Nf(kf(Ff(MIe),"primary"),-1);let u0=(()=>{class n extends xIe{constructor(t,i,r,s,o,a,l,c){super(t),this._ngZone=i,this._changeDetectorRef=o,this._hasFocus=!1,this.chipListSelectable=!0,this._chipListMultiple=!1,this._chipListDisabled=!1,this._selected=!1,this._selectable=!0,this._disabled=!1,this._removable=!0,this._onFocus=new we,this._onBlur=new we,this.selectionChange=new Pe,this.destroyed=new Pe,this.removed=new Pe,this._addHostClassName(),this._chipRippleTarget=a.createElement("div"),this._chipRippleTarget.classList.add("mat-chip-ripple"),this._elementRef.nativeElement.appendChild(this._chipRippleTarget),this._chipRipple=new Oj(this,i,this._chipRippleTarget,r),this._chipRipple.setupTriggerEvents(t),this.rippleConfig=s||{},this._animationsDisabled="NoopAnimations"===l,this.tabIndex=null!=c&&parseInt(c)||-1}get rippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||!!this.rippleConfig.disabled}get selected(){return this._selected}set selected(t){const i=Dt(t);i!==this._selected&&(this._selected=i,this._dispatchSelectionChange())}get value(){return void 0!==this._value?this._value:this._elementRef.nativeElement.textContent}set value(t){this._value=t}get selectable(){return this._selectable&&this.chipListSelectable}set selectable(t){this._selectable=Dt(t)}get disabled(){return this._chipListDisabled||this._disabled}set disabled(t){this._disabled=Dt(t)}get removable(){return this._removable}set removable(t){this._removable=Dt(t)}get ariaSelected(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null}_addHostClassName(){const t="mat-basic-chip",i=this._elementRef.nativeElement;i.hasAttribute(t)||i.tagName.toLowerCase()===t?i.classList.add(t):i.classList.add("mat-standard-chip")}ngOnDestroy(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()}select(){this._selected||(this._selected=!0,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}deselect(){this._selected&&(this._selected=!1,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}selectViaInteraction(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0),this._changeDetectorRef.markForCheck())}toggleSelected(t=!1){return this._selected=!this.selected,this._dispatchSelectionChange(t),this._changeDetectorRef.markForCheck(),this.selected}focus(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0}remove(){this.removable&&this.removed.emit({chip:this})}_handleClick(t){this.disabled?t.preventDefault():t.stopPropagation()}_handleKeydown(t){if(!this.disabled)switch(t.keyCode){case 46:case 8:this.remove(),t.preventDefault();break;case 32:this.selectable&&this.toggleSelected(!0),t.preventDefault()}}_blur(){this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this._ngZone.run(()=>{this._hasFocus=!1,this._onBlur.next({chip:this})})})}_dispatchSelectionChange(t=!1){this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(lt),E(ii),E(Ij,8),E(Un),E(rt),E(Zo,8),fs("tabindex"))},n.\u0275dir=he({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,xq,5),Fi(r,Tq,5),Fi(r,Mq,5)),2&t){let s;Mt(s=xt())&&(i.avatar=s.first),Mt(s=xt())&&(i.trailingIcon=s.first),Mt(s=xt())&&(i.removeIcon=s.first)}},hostAttrs:["role","option",1,"mat-chip","mat-focus-indicator"],hostVars:14,hostBindings:function(t,i){1&t&&ye("click",function(s){return i._handleClick(s)})("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i.focus()})("blur",function(){return i._blur()}),2&t&&(en("tabindex",i.disabled?null:i.tabIndex)("disabled",i.disabled||null)("aria-disabled",i.disabled.toString())("aria-selected",i.ariaSelected),at("mat-chip-selected",i.selected)("mat-chip-with-avatar",i.avatar)("mat-chip-with-trailing-icon",i.trailingIcon||i.removeIcon)("mat-chip-disabled",i.disabled)("_mat-animation-noopable",i._animationsDisabled))},inputs:{color:"color",disableRipple:"disableRipple",tabIndex:"tabIndex",selected:"selected",value:"value",selectable:"selectable",disabled:"disabled",removable:"removable"},outputs:{selectionChange:"selectionChange",destroyed:"destroyed",removed:"removed"},exportAs:["matChip"],features:[ht]}),n})(),Aq=(()=>{class n{constructor(t,i){this._parentChip=t,"BUTTON"===i.nativeElement.nodeName&&i.nativeElement.setAttribute("type","button")}_handleClick(t){const i=this._parentChip;i.removable&&!i.disabled&&i.remove(),t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(u0),E(nt))},n.\u0275dir=he({type:n,selectors:[["","matChipRemove",""]],hostAttrs:[1,"mat-chip-remove","mat-chip-trailing-icon"],hostBindings:function(t,i){1&t&&ye("click",function(s){return i._handleClick(s)})},features:[At([{provide:Mq,useExisting:n}])]}),n})();const Dq=new _e("mat-chips-default-options"),DIe=CO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let OIe=0;class IIe{constructor(e,t){this.source=e,this.value=t}}let Oq=(()=>{class n extends DIe{constructor(t,i,r,s,o,a,l){super(a,s,o,l),this._elementRef=t,this._changeDetectorRef=i,this._dir=r,this.controlType="mat-chip-list",this._lastDestroyedChipIndex=null,this._destroyed=new we,this._uid="mat-chip-list-"+OIe++,this._tabIndex=0,this._userTabIndex=null,this._onTouched=()=>{},this._onChange=()=>{},this._multiple=!1,this._compareWith=(c,d)=>c===d,this._required=!1,this._disabled=!1,this.ariaOrientation="horizontal",this._selectable=!0,this.change=new Pe,this.valueChange=new Pe,this.ngControl&&(this.ngControl.valueAccessor=this)}get selected(){var t,i;return this.multiple?(null===(t=this._selectionModel)||void 0===t?void 0:t.selected)||[]:null===(i=this._selectionModel)||void 0===i?void 0:i.selected[0]}get role(){return this.empty?null:"listbox"}get multiple(){return this._multiple}set multiple(t){this._multiple=Dt(t),this._syncChipsState()}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this.writeValue(t),this._value=t}get id(){return this._chipInput?this._chipInput.id:this._uid}get required(){return this._required}set required(t){this._required=Dt(t),this.stateChanges.next()}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get focused(){return this._chipInput&&this._chipInput.focused||this._hasFocusedChip()}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this.chips||0===this.chips.length)}get shouldLabelFloat(){return!this.empty||this.focused}get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Dt(t),this._syncChipsState()}get selectable(){return this._selectable}set selectable(t){this._selectable=Dt(t),this.chips&&this.chips.forEach(i=>i.chipListSelectable=this._selectable)}set tabIndex(t){this._userTabIndex=t,this._tabIndex=t}get chipSelectionChanges(){return ki(...this.chips.map(t=>t.selectionChange))}get chipFocusChanges(){return ki(...this.chips.map(t=>t._onFocus))}get chipBlurChanges(){return ki(...this.chips.map(t=>t._onBlur))}get chipRemoveChanges(){return ki(...this.chips.map(t=>t.destroyed))}ngAfterContentInit(){this._keyManager=new aV(this.chips).withWrap().withVerticalOrientation().withHomeAndEnd().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe(zn(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.tabOut.pipe(zn(this._destroyed)).subscribe(()=>{this._allowFocusEscape()}),this.chips.changes.pipe(ns(null),zn(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>{this._syncChipsState()}),this._resetChips(),this._initializeSelection(),this._updateTabIndex(),this._updateFocusForDestroyedChips(),this.stateChanges.next()})}ngOnInit(){this._selectionModel=new uU(this.multiple,void 0,!1),this.stateChanges.next()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==this._disabled&&(this.disabled=!!this.ngControl.disabled))}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()}registerInput(t){this._chipInput=t,this._elementRef.nativeElement.setAttribute("data-mat-chip-input",t.id)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}writeValue(t){this.chips&&this._setSelectionByValue(t,!1)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}onContainerClick(t){this._originatesFromChip(t)||this.focus()}focus(t){this.disabled||this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(t),this.stateChanges.next()))}_focusInput(t){this._chipInput&&this._chipInput.focus(t)}_keydown(t){const i=t.target;i&&i.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())}_updateTabIndex(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)}_updateFocusForDestroyedChips(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){const t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=null}_isValidIndex(t){return t>=0&&tr.deselect()),Array.isArray(t))t.forEach(r=>this._selectValue(r,i)),this._sortValues();else{const r=this._selectValue(t,i);r&&i&&this._keyManager.setActiveItem(r)}}_selectValue(t,i=!0){const r=this.chips.find(s=>null!=s.value&&this._compareWith(s.value,t));return r&&(i?r.selectViaInteraction():r.select(),this._selectionModel.select(r)),r}_initializeSelection(){Promise.resolve().then(()=>{(this.ngControl||this._value)&&(this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value,!1),this.stateChanges.next())})}_clearSelection(t){this._selectionModel.clear(),this.chips.forEach(i=>{i!==t&&i.deselect()}),this.stateChanges.next()}_sortValues(){this._multiple&&(this._selectionModel.clear(),this.chips.forEach(t=>{t.selected&&this._selectionModel.select(t)}),this.stateChanges.next())}_propagateChanges(t){let i=null;i=Array.isArray(this.selected)?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.change.emit(new IIe(this,i)),this.valueChange.emit(i),this._onChange(i),this._changeDetectorRef.markForCheck()}_blur(){this._hasFocusedChip()||this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(()=>{this.focused||this._markAsTouched()}):this._markAsTouched())}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}_allowFocusEscape(){-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(()=>{this._tabIndex=this._userTabIndex||0,this._changeDetectorRef.markForCheck()}))}_resetChips(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()}_dropSubscriptions(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=null)}_listenToChipsSelection(){this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(t=>{t.source.selected?this._selectionModel.select(t.source):this._selectionModel.deselect(t.source),this.multiple||this.chips.forEach(i=>{!this._selectionModel.isSelected(i)&&i.selected&&i.deselect()}),t.isUserInput&&this._propagateChanges()})}_listenToChipsFocus(){this._chipFocusSubscription=this.chipFocusChanges.subscribe(t=>{let i=this.chips.toArray().indexOf(t.chip);this._isValidIndex(i)&&this._keyManager.updateActiveItem(i),this.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(()=>{this._blur(),this.stateChanges.next()})}_listenToChipsRemoved(){this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(t=>{const i=t.chip,r=this.chips.toArray().indexOf(t.chip);this._isValidIndex(r)&&i._hasFocus&&(this._lastDestroyedChipIndex=r)})}_originatesFromChip(t){let i=t.target;for(;i&&i!==this._elementRef.nativeElement;){if(i.classList.contains("mat-chip"))return!0;i=i.parentElement}return!1}_hasFocusedChip(){return this.chips&&this.chips.some(t=>t._hasFocus)}_syncChipsState(){this.chips&&this.chips.forEach(t=>{t._chipListDisabled=this._disabled,t._chipListMultiple=this.multiple})}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(Ko,8),E(cp,8),E($m,8),E(kv),E(lc,10))},n.\u0275cmp=Le({type:n,selectors:[["mat-chip-list"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,u0,5),2&t){let s;Mt(s=xt())&&(i.chips=s)}},hostAttrs:[1,"mat-chip-list"],hostVars:15,hostBindings:function(t,i){1&t&&ye("focus",function(){return i.focus()})("blur",function(){return i._blur()})("keydown",function(s){return i._keydown(s)}),2&t&&(sl("id",i._uid),en("tabindex",i.disabled?null:i._tabIndex)("aria-describedby",i._ariaDescribedby||null)("aria-required",i.role?i.required:null)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-multiselectable",i.multiple)("role",i.role)("aria-orientation",i.ariaOrientation),at("mat-chip-list-disabled",i.disabled)("mat-chip-list-invalid",i.errorState)("mat-chip-list-required",i.required))},inputs:{ariaOrientation:["aria-orientation","ariaOrientation"],multiple:"multiple",compareWith:"compareWith",value:"value",required:"required",placeholder:"placeholder",disabled:"disabled",selectable:"selectable",tabIndex:"tabIndex",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},exportAs:["matChipList"],features:[At([{provide:Nv,useExisting:n}]),ht],ngContentSelectors:SIe,decls:2,vars:0,consts:[[1,"mat-chip-list-wrapper"]],template:function(t,i){1&t&&(Dr(),F(0,"div",0),In(1),N())},styles:['.mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:"";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n'],encapsulation:2,changeDetection:0}),n})();const kIe={separatorKeyCodes:[13]};let Iq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[kv,{provide:Dq,useValue:kIe}],imports:[[Nn]]}),n})(),FIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-toggle",this.visible=!1,this.toggleLabel="",this.disabled=!1,this.visibilityChanged=new Pe}toggleVisibility(){this.visible=!this.visible,this.ga.event("visibility_toggled","visibility_toggle",""+this.visible),this.visibilityChanged.emit(this.visible)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-visibility-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{visible:"visible",toggleLabel:"toggleLabel",disabled:"disabled"},outputs:{visibilityChanged:"visibilityChanged"},decls:8,vars:9,consts:[[1,"toggle-div"],[1,"toggle-wrapper",3,"click"],[1,"icon-background"],["svgIcon","app:visibility_off_cube",1,"icon","block"],[1,"icon","green"],[1,"toggle-label"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"mat-chip",1),ye("click",function(){return i.toggleVisibility()}),F(2,"div",2),et(3,"mat-icon",3),F(4,"mat-icon",4),Te(5,"done"),N(),N(),F(6,"div",5),Te(7),N(),N(),N()),2&t&&(Y(1),at("disabled",i.disabled),Y(1),at("disabled",i.disabled),Y(1),at("hidden",i.visible),Y(1),at("hidden",!i.visible),Y(3),Ai(i.toggleLabel))},directives:[u0,Rs],styles:["[_nghost-%COMP%]{height:3rem;display:flex;align-items:center}[_nghost-%COMP%] .mat-chip{padding:0!important}[_nghost-%COMP%] .mat-chip.disabled{cursor:not-allowed!important}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;padding-top:1.5rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;display:flex;padding-left:.5rem;cursor:pointer;align-items:center;position:relative;border-width:.075rem;border-style:solid;height:2.25rem;border-radius:1.5rem;transition:background-color .2s ease-in-out}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%]{border-radius:1.5rem;height:2.06rem;width:2.06rem;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transition:.6s;position:absolute}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.block[_ngcontent-%COMP%]{width:1.125rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .toggle-label[_ngcontent-%COMP%]{font-weight:bold;margin-left:.5rem;padding-right:1.25rem;padding-left:.25rem}"],changeDetection:0}),n})();const NIe=["fileInput"];let LIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-json-file-reader",this.label="Upload",this.parsedJson=new Pe}triggerFileInput(){this.fileInput.nativeElement.click()}handleFile(t){const i=t.target;if(!i.files)return;const r=i.files[0],s=new FileReader;s.onload=()=>{const o=JSON.parse(s.result);this.ga.event("json_file_load_end","json_file_reader"),this.parsedJson.emit(o)},this.ga.event("json_file_load_start","json_file_reader"),s.readAsText(r)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-json-file-reader"]],viewQuery:function(t,i){if(1&t&&ni(NIe,5),2&t){let r;Mt(r=xt())&&(i.fileInput=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{label:"label"},outputs:{parsedJson:"parsedJson"},decls:4,vars:1,consts:[["mat-button","",1,"upload-button",3,"click"],["type","file","accept","application/JSON","name","fileInput","id","fileInput",2,"display","none",3,"change"],["fileInput",""]],template:function(t,i){1&t&&(F(0,"button",0),ye("click",function(){return i.triggerFileInput()}),Te(1),N(),F(2,"input",1,2),ye("change",function(s){return i.handleFile(s)}),N()),2&t&&(Y(1),Ai(i.label))},directives:[$f],styles:["[_nghost-%COMP%] .upload-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;cursor:pointer;font-weight:500}"]}),n})(),BIe=(()=>{class n{constructor(){this.clsName="ccf-details-label",this.details=[]}arrayToString(t){return t.join(", ")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-details-label"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{details:"details"},decls:1,vars:1,template:function(t,i){1&t&&Te(0),2&t&&Ai(i.arrayToString(i.details))},styles:["[_nghost-%COMP%]{display:block;height:2.25rem}"],changeDetection:0}),n})();const VIe=["trigger"],jIe=["panel"];function UIe(n,e){if(1&n&&(F(0,"span",8),Te(1),N()),2&n){const t=bt();Y(1),Ai(t.placeholder)}}function zIe(n,e){if(1&n&&(F(0,"span",12),Te(1),N()),2&n){const t=bt(2);Y(1),Ai(t.triggerValue)}}function HIe(n,e){1&n&&In(0,0,["*ngSwitchCase","true"])}function $Ie(n,e){1&n&&(F(0,"span",9),Ct(1,zIe,2,1,"span",10),Ct(2,HIe,1,0,"ng-content",11),N()),2&n&&(ie("ngSwitch",!!bt().customTrigger),Y(2),ie("ngSwitchCase",!0))}function GIe(n,e){if(1&n){const t=Lr();F(0,"div",13),F(1,"div",14,15),ye("@transformPanel.done",function(r){return Vn(t),bt()._panelDoneAnimatingStream.next(r.toState)})("keydown",function(r){return Vn(t),bt()._handleKeydown(r)}),In(3,1),N(),N()}if(2&n){const t=bt();ie("@transformPanelWrap",void 0),Y(1),function(n,e,t){zl(go,Nc,pg(Ce(),n,e,t),!0)}("mat-select-panel ",t._getPanelTheme(),""),gf("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),ie("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),en("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const WIe=[[["mat-select-trigger"]],"*"],qIe=["mat-select-trigger","*"],Pq={transformPanelWrap:Jl("transformPanelWrap",[Qs("* => void",Nne("@transformPanel",[Fne()],{optional:!0}))]),transformPanel:Jl("transformPanel",[br("void",Kn({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),br("showing",Kn({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),br("showing-multiple",Kn({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Qs("void => *",Mo("120ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void",Mo("100ms 25ms linear",Kn({opacity:0})))])};let Rq=0;const Fq=new _e("mat-select-scroll-strategy"),ZIe=new _e("MAT_SELECT_CONFIG"),QIe={provide:Fq,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};class JIe{constructor(e,t){this.source=e,this.value=t}}const ePe=Ff(Nf(em(CO(class{constructor(n,e,t,i,r){this._elementRef=n,this._defaultErrorStateMatcher=e,this._parentForm=t,this._parentFormGroup=i,this.ngControl=r}})))),Nq=new _e("MatSelectTrigger");let tPe=(()=>{class n extends ePe{constructor(t,i,r,s,o,a,l,c,d,f,p,g,_,y){var v,w,C;super(o,s,l,c,f),this._viewportRuler=t,this._changeDetectorRef=i,this._ngZone=r,this._dir=a,this._parentFormField=d,this._liveAnnouncer=_,this._defaultOptions=y,this._panelOpen=!1,this._compareWith=(x,L)=>x===L,this._uid="mat-select-"+Rq++,this._triggerAriaLabelledBy=null,this._destroy=new we,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+Rq++,this._panelDoneAnimatingStream=new we,this._overlayPanelClass=(null===(v=this._defaultOptions)||void 0===v?void 0:v.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(C=null===(w=this._defaultOptions)||void 0===w?void 0:w.disableOptionCentering)&&void 0!==C&&C,this.ariaLabel="",this.optionSelectionChanges=zb(()=>{const x=this.options;return x?x.changes.pipe(ns(x),Ir(()=>ki(...x.map(L=>L.onSelectionChange)))):this._ngZone.onStable.pipe(_i(1),Ir(()=>this.optionSelectionChanges))}),this.openedChange=new Pe,this._openedStream=this.openedChange.pipe(Tn(x=>x),be(()=>{})),this._closedStream=this.openedChange.pipe(Tn(x=>!x),be(()=>{})),this.selectionChange=new Pe,this.valueChange=new Pe,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==y?void 0:y.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=y.typeaheadDebounceInterval),this._scrollStrategyFactory=g,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(p)||0,this.id=this.id}get focused(){return this._focused||this._panelOpen}get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get required(){return this._required}set required(t){this._required=Dt(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=Dt(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=Dt(t)}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){(t!==this._value||this._multiple&&Array.isArray(t))&&(this.options&&this._setSelectionByValue(t),this._value=t)}get typeaheadDebounceInterval(){return this._typeaheadDebounceInterval}set typeaheadDebounceInterval(t){this._typeaheadDebounceInterval=So(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new uU(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Xo(),zn(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(zn(this._destroy)).subscribe(t=>{t.added.forEach(i=>i.select()),t.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(ns(null),zn(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?i.setAttribute("aria-labelledby",t):i.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}ngOnChanges(t){t.disabled&&this.stateChanges.next(),t.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}ngOnDestroy(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}close(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}writeValue(t){this.value=t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){const t=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&t.reverse(),t.join(", ")}return this._selectionModel.selected[0].viewValue}_isRtl(){return!!this._dir&&"rtl"===this._dir.value}_handleKeydown(t){this.disabled||(this.panelOpen?this._handleOpenKeydown(t):this._handleClosedKeydown(t))}_handleClosedKeydown(t){const i=t.keyCode,r=40===i||38===i||37===i||39===i,s=13===i||32===i,o=this._keyManager;if(!o.isTyping()&&s&&!Yo(t)||(this.multiple||t.altKey)&&r)t.preventDefault(),this.open();else if(!this.multiple){const a=this.selected;o.onKeydown(t);const l=this.selected;l&&a!==l&&this._liveAnnouncer.announce(l.viewValue,1e4)}}_handleOpenKeydown(t){const i=this._keyManager,r=t.keyCode,s=40===r||38===r,o=i.isTyping();if(s&&t.altKey)t.preventDefault(),this.close();else if(o||13!==r&&32!==r||!i.activeItem||Yo(t))if(!o&&this._multiple&&65===r&&t.ctrlKey){t.preventDefault();const a=this.options.some(l=>!l.disabled&&!l.selected);this.options.forEach(l=>{l.disabled||(a?l.select():l.deselect())})}else{const a=i.activeItemIndex;i.onKeydown(t),this._multiple&&s&&t.shiftKey&&i.activeItem&&i.activeItemIndex!==a&&i.activeItem._selectViaInteraction()}else t.preventDefault(),i.activeItem._selectViaInteraction()}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_onAttached(){this._overlayDir.positionChange.pipe(_i(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()})}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value),this.stateChanges.next()})}_setSelectionByValue(t){if(this._selectionModel.selected.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(i=>this._selectValue(i)),this._sortValues();else{const i=this._selectValue(t);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const i=this.options.find(r=>{if(this._selectionModel.isSelected(r))return!1;try{return null!=r.value&&this._compareWith(r.value,t)}catch(s){return!1}});return i&&this._selectionModel.select(i),i}_initKeyManager(){this._keyManager=new oV(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(zn(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(zn(this._destroy)).subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){const t=ki(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(zn(t)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),ki(...this.options.map(i=>i._stateChanges)).pipe(zn(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,i){const r=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(r!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),i&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),i&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),r!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((i,r)=>this.sortComparator?this.sortComparator(i,r,t):t.indexOf(i)-t.indexOf(r)),this.stateChanges.next()}}_propagateChanges(t){let i=null;i=this.multiple?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}_canOpen(){var t;return!this._panelOpen&&!this.disabled&&(null===(t=this.options)||void 0===t?void 0:t.length)>0}focus(t){this._elementRef.nativeElement.focus(t)}_getPanelAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(i?i+" ":"")+this.ariaLabelledby:i}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let r=(i?i+" ":"")+this._valueId;return this.ariaLabelledby&&(r+=" "+this.ariaLabelledby),r}_panelDoneAnimating(t){this.openedChange.emit(t)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}return n.\u0275fac=function(t){return new(t||n)(E(jf),E(Un),E(lt),E(kv),E(nt),E(Ko,8),E(cp,8),E($m,8),E(XE,8),E(lc,10),fs("tabindex"),E(Fq),E(wE),E(ZIe,8))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&(ni(VIe,5),ni(jIe,5),ni(DU,5)),2&t){let r;Mt(r=xt())&&(i.trigger=r.first),Mt(r=xt())&&(i.panel=r.first),Mt(r=xt())&&(i._overlayDir=r.first)}},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[ht,qn]}),n})(),nPe=(()=>{class n extends tPe{constructor(){super(...arguments),this._scrollTop=0,this._triggerFontSize=0,this._transformOrigin="top",this._offsetY=0,this._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}]}_calculateOverlayScroll(t,i,r){const s=this._getItemHeight();return Math.min(Math.max(0,s*t-i+s/2),r)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(zn(this._destroy)).subscribe(()=>{this.panelOpen&&(this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._changeDetectorRef.markForCheck())})}open(){super._canOpen()&&(super.open(),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const i=EO(t,this.options,this.optionGroups),r=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===i?0:function(n,e,t,i){return nt+i?Math.max(0,n-i+e):t}((t+i)*r,r,this.panel.nativeElement.scrollTop,256)}_positioningSettled(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}_panelDoneAnimating(t){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),super._panelDoneAnimating(t)}_getChangeEvent(t){return new JIe(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),i=this._viewportRuler.getViewportSize(),r=this._isRtl(),s=this.multiple?56:32;let o;if(this.multiple)o=40;else if(this.disableOptionCentering)o=16;else{let c=this._selectionModel.selected[0]||this.options.first;o=c&&c.group?32:16}r||(o*=-1);const a=0-(t.left+o-(r?s:0)),l=t.right+o-i.width+(r?0:s);a>0?o+=a+8:l>0&&(o-=l+8),this._overlayDir.offsetX=Math.round(o),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,i,r){const s=this._getItemHeight(),o=(s-this._triggerRect.height)/2,a=Math.floor(256/s);let l;return this.disableOptionCentering?0:(l=0===this._scrollTop?t*s:this._scrollTop===r?(t-(this._getItemCount()-a))*s+(s-(this._getItemCount()*s-256)%s):i-s/2,Math.round(-1*l-o))}_checkOverlayWithinViewport(t){const i=this._getItemHeight(),r=this._viewportRuler.getViewportSize(),s=this._triggerRect.top-8,o=r.height-this._triggerRect.bottom-8,a=Math.abs(this._offsetY),c=Math.min(this._getItemCount()*i,256)-a-this._triggerRect.height;c>o?this._adjustPanelUp(c,o):a>s?this._adjustPanelDown(a,s,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,i){const r=Math.round(t-i);this._scrollTop-=r,this._offsetY-=r,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,i,r){const s=Math.round(t-i);if(this._scrollTop+=s,this._offsetY+=s,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=r)return this._scrollTop=r,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),i=this._getItemCount(),r=Math.min(i*t,256),o=i*t-r;let a;a=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),a+=EO(a,this.options,this.optionGroups);const l=r/2;this._scrollTop=this._calculateOverlayScroll(a,l,o),this._offsetY=this._calculateOverlayOffsetY(a,l,o),this._checkOverlayWithinViewport(o)}_getOriginBasedOnOption(){const t=this._getItemHeight(),i=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-i+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275cmp=Le({type:n,selectors:[["mat-select"]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,Nq,5),Fi(r,WE,5),Fi(r,GE,5)),2&t){let s;Mt(s=xt())&&(i.customTrigger=s.first),Mt(s=xt())&&(i.options=s),Mt(s=xt())&&(i.optionGroups=s)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,i){1&t&&ye("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),2&t&&(en("id",i.id)("tabindex",i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-describedby",i._ariaDescribedby||null)("aria-activedescendant",i._getAriaActiveDescendant()),at("mat-select-disabled",i.disabled)("mat-select-invalid",i.errorState)("mat-select-required",i.required)("mat-select-empty",i.empty)("mat-select-multiple",i.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[At([{provide:Nv,useExisting:n},{provide:$E,useExisting:n}]),ht],ngContentSelectors:qIe,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(t,i){if(1&t&&(Dr(WIe),F(0,"div",0,1),ye("click",function(){return i.toggle()}),F(3,"div",2),Ct(4,UIe,2,1,"span",3),Ct(5,$Ie,3,2,"span",4),N(),F(6,"div",5),et(7,"div",6),N(),N(),Ct(8,GIe,4,14,"ng-template",7),ye("backdropClick",function(){return i.close()})("attach",function(){return i._onAttached()})("detach",function(){return i.close()})),2&t){const r=Ys(1);en("aria-owns",i.panelOpen?i.id+"-panel":null),Y(3),ie("ngSwitch",i.empty),en("id",i._valueId),Y(1),ie("ngSwitchCase",!0),Y(1),ie("ngSwitchCase",!1),Y(3),ie("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",r)("cdkConnectedOverlayOpen",i.panelOpen)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayMinWidth",null==i._triggerRect?null:i._triggerRect.width)("cdkConnectedOverlayOffsetY",i._offsetY)}},directives:[Doe,Cv,vD,DU,E3,sE],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[Pq.transformPanelWrap,Pq.transformPanel]},changeDetection:0}),n})(),Lq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[QIe],imports:[[bn,$v,qE,Nn],zv,Lv,qE,Nn]}),n})();function iPe(n,e){if(1&n&&(F(0,"mat-option",5),Te(1),N()),2&n){const t=e.$implicit;ie("value",t),Y(1),bw(" ",t.name," (",t.sites.length,") ")}}function rPe(n,e){if(1&n){const t=Lr();F(0,"mat-form-field",1),F(1,"mat-label",2),Te(2,"Landmark Set"),N(),F(3,"mat-select",3),ye("selectionChange",function(r){return Vn(t),bt().extractionSetChanged(r.value)}),Ct(4,iPe,2,3,"mat-option",4),N(),N()}if(2&n){const t=bt();Y(3),ie("value",t.sets[0]),Y(1),ie("ngForOf",t.sets)}}let sPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-extraction-set-dropdown",this.setChange=new Pe}extractionSetChanged(t){this.selected=t,this.ga.event("selected_extraction_set_change","extraction_set_dropdown",t.name),this.setChange.emit(t)}isMultiple(){return this.sets.length>1}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-extraction-set-dropdown"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{sets:"sets"},outputs:{setChange:"setChange"},decls:1,vars:1,consts:[["class","dropdown-form-field","appearance","fill",4,"ngIf"],["appearance","fill",1,"dropdown-form-field"],[1,"extraction-dropdown-label"],["disableOptionCentering","true","panelClass","extraction-set-panel",3,"value","selectionChange"],["class","extraction-set-options",3,"value",4,"ngFor","ngForOf"],[1,"extraction-set-options",3,"value"]],template:function(t,i){1&t&&Ct(0,rPe,5,2,"mat-form-field",0),2&t&&ie("ngIf",i.isMultiple())},directives:[Is,tm,Bf,nPe,Xl,WE],styles:[".extraction-set-panel{box-shadow:0 0 .3rem .1rem #9e9e9e;position:absolute;top:-1rem;left:1rem;width:10.5rem} .extraction-set-panel .extraction-set-options{height:2.5rem!important} .extraction-set-panel .extraction-set-options:first-child{margin-top:.5rem} .extraction-set-panel .extraction-set-options:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .mat-form-field{width:10.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper{padding-bottom:.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-flex{padding:0}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:.75rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:none} .cdk-overlay-pane{min-width:0rem!important}"],changeDetection:0}),n})();function oPe(n,e){if(1&n&&(ff(0),et(1,"ccf-details-label",19),yn(2,"async"),pf()),2&n){const t=bt();Y(1),ie("details",wn(2,1,t.detailsLabels$))}}function aPe(n,e){if(1&n){const t=Lr();F(0,"div",9),F(1,"ccf-extraction-set-dropdown",20,21),ye("setChange",function(r){return Vn(t),bt().model.setExtractionSites(r.sites)}),yn(3,"async"),N(),F(4,"ccf-visibility-menu",22),ye("itemsChange",function(r){return Vn(t),bt().model.setExtractionSites(r)})("hover",function(r){return Vn(t),bt().updateExtractionSiteTooltip(r)}),yn(5,"async"),N(),N()}if(2&n){const t=bt();Y(1),ie("sets",wn(3,2,t.model.extractionSets$)),Y(3),ie("items",wn(5,4,t.model.extractionSites$))}}function lPe(n,e){if(1&n&&(F(0,"div",23),Te(1),N()),2&n){const t=bt();Y(1),Os(" ",t.extractionSiteTooltip," ")}}const cPe=function(){return["Male","Female"]};let uPe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.registration=r,this.clsName="ccf-left-sidebar",this.disableSlider=!1,this.modalClosed=!1,this.sexByLabel$=this.model.sex$.pipe(be(s=>"female"===s?"Female":"Male")),this.sideByLabel$=this.model.side$.pipe(be(s=>"left"===s?"L":"R")),this.organSelected$=this.model.organ$.pipe(be(s=>void 0!==s)),this.detailsLabels$=or([this.model.organ$,this.model.side$,this.model.sex$]).pipe(be(([s,o,a])=>[null==s?void 0:s.name,o,a])),this.extractionSiteTooltip="",this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures],this.organList=_F}updateExtractionSiteTooltip(t){this.extractionSiteTooltip=(null==t?void 0:t.tooltip)?t.tooltip:""}setSexFromLabel(t){this.model.setSex("Female"===t?"female":"male")}setSideFromLabel(t){this.model.setSide("L"===t?"left":"right")}togglePreviousRegistrationBlocks(t){t&&(this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures]),this.model.toggleRegistrationBlocksVisibility(t,this.previousVisibilityItems)}updateRegistration(t){this.registration.editRegistration(t)}}return n.\u0275fac=function(t){return new(t||n)(E(Ui),E(si),E(wr))},n.\u0275cmp=Le({type:n,selectors:[["ccf-left-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{disableSlider:"disableSlider",modalClosed:"modalClosed"},decls:31,vars:22,consts:[[1,"scroll-wrapper"],[1,"container"],[4,"ngIf"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"disabled","labels","value","valueChange"],[1,"anatomical-structures-menu",3,"expanded"],[1,"expansion-header"],["matTooltip","Use opacity icons to change visibility of anatomical structures",1,"expansion-title"],[1,"expansion-content"],[3,"items","itemsChange"],[1,"extraction-menu",3,"expanded"],["matTooltip","Some organs have predefined landmarks to guide manual tissue registration--you can turn these on/off.",1,"expansion-title"],["class","expansion-content",4,"ngIf"],["toggleLabel","Previously Registered Blocks","matTooltip","If you previously registered tissue blocks, you can turn their positions on/off.",3,"visible","disabled","visibilityChanged"],[1,"space"],["class","extraction-site-tooltip mat-elevation-z8",4,"ngIf"],[1,"filler"],["label","UPLOAD PREVIOUS REGISTRATION DATA",3,"parsedJson"],[3,"details"],[3,"sets","setChange"],["dropdown",""],[3,"items","itemsChange","hover"],[1,"extraction-site-tooltip","mat-elevation-z8"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),Ct(2,oPe,3,3,"ng-container",2),yn(3,"async"),F(4,"div",3),F(5,"div",4),Te(6,"Donor Sex:"),N(),F(7,"ccf-labeled-slide-toggle",5),ye("valueChange",function(s){return i.setSexFromLabel(s)}),yn(8,"async"),N(),N(),et(9,"mat-divider"),F(10,"mat-expansion-panel",6),F(11,"mat-expansion-panel-header",7),F(12,"mat-panel-title",8),Te(13,"Anatomical Structures"),N(),N(),F(14,"div",9),F(15,"ccf-visibility-menu",10),ye("itemsChange",function(s){return i.model.setAnatomicalStructures(s)}),yn(16,"async"),N(),N(),N(),et(17,"mat-divider"),F(18,"mat-expansion-panel",11),F(19,"mat-expansion-panel-header",7),F(20,"mat-panel-title",12),Te(21,"Landmarks"),N(),N(),Ct(22,aPe,6,6,"div",13),yn(23,"async"),N(),et(24,"mat-divider"),F(25,"ccf-visibility-toggle",14),ye("visibilityChanged",function(s){return i.togglePreviousRegistrationBlocks(s)}),yn(26,"async"),N(),et(27,"div",15),Ct(28,lPe,2,1,"div",16),et(29,"div",17),F(30,"ccf-json-file-reader",18),ye("parsedJson",function(s){return i.updateRegistration(s)}),N(),N(),N()),2&t&&(Y(2),ie("ngIf",wn(3,11,i.page.registrationCallbackSet$)),Y(5),ie("disabled",i.disableSlider)("labels",lv(21,cPe))("value",wn(8,13,i.sexByLabel$)),Y(3),ie("expanded",i.modalClosed),Y(5),ie("items",wn(16,15,i.model.anatomicalStructures$)),Y(3),ie("expanded",i.modalClosed),Y(4),ie("ngIf",wn(23,17,i.organSelected$)),Y(3),ie("visible",wn(26,19,i.model.showPrevious$))("disabled",i.disableSlider),Y(3),ie("ngIf",i.extractionSiteTooltip.length>0))},directives:[Is,cc,vF,Sq,NM,LM,PG,EIe,FIe,LIe,BIe,sPe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{overflow-y:scroll;height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:1.5rem;margin-right:.375rem;min-height:100%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .space[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .ccf-organ-selector[_ngcontent-%COMP%]{margin-top:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .expansion-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header{-webkit-user-select:none;-moz-user-select:none;padding:0;font-weight:bold;height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator{display:flex;align-items:center;justify-content:center;height:24px;width:24px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%]{margin-bottom:.75rem;text-align:center;margin-top:2.25rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%]{width:100%;font-size:.9rem;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-site-tooltip[_ngcontent-%COMP%]{position:absolute;top:4rem;left:27rem;width:21rem;padding:1rem;border-radius:.5rem;border:1px solid;z-index:2}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})(),dPe=(()=>{class n{constructor(t,i,r){this.drawer=t,this.cdr=r,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new Ie;const s=i.connect(this);this.subscriptions.add(s.getMessagesFromSource(t).subscribe(o=>{this.handleMessage(o)&&r.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",i="arrow_left";return"end"===this.position&&([t,i]=[i,t]),this.opened?i:t}ngAfterViewInit(){setTimeout(()=>{this.position=this.drawer.position,this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return"drawer-toggled"===t.payload.type&&(this.opened=t.payload.opened,!0)}toggle(){const t=this.drawer,{opened:i,expanded:r}=t;i?r?t.closeExpanded():t.close():t.open()}}return n.\u0275fac=function(t){return new(t||n)(E(CF),E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,i){2&t&&(Fn(i.className),at("ccf-drawer-toggle-button-end",i.classEnd))},decls:4,vars:4,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,i){1&t&&(F(0,"mat-icon",0),ye("click",function(){return i.toggle()}),Te(1," arrow_right\n"),N(),F(2,"mat-icon",0),ye("click",function(){return i.toggle()}),Te(3," arrow_left\n"),N()),2&t&&(at("hidden","arrow_left"===i.icon),Y(2),at("hidden","arrow_right"===i.icon))},directives:[Rs],styles:["[_nghost-%COMP%]{position:absolute;top:calc(50% - 2.0625rem);right:-1.0625rem;width:1.0625rem;height:3rem;border-radius:0 .25rem .25rem 0;cursor:pointer;transition:.25s}.ccf-drawer-toggle-button-end[_nghost-%COMP%]{right:unset;left:calc(-1rem - 1px);border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{position:absolute;right:0rem;transition:.6s;padding-left:.15rem}[_nghost-%COMP%] .expand-collapse-icon.hidden[_ngcontent-%COMP%]{opacity:0}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}.mat-icon[_ngcontent-%COMP%]{right:.3rem;top:.675rem;padding-top:.05rem}"],changeDetection:0}),n})();const Bq={x:10,y:10,z:10};let hPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-block-size-input",this.blockSize=Bq,this.blockSizeChange=new Pe}updateBlockSizes(t,i){const r=t.target;this.blockSize=Object.assign(Object.assign({},this.blockSize),{[i]:+r.value}),this.ga.event("block_size_change","block_size_input",i,this.blockSize[i]),this.blockSizeChange.emit(this.blockSize)}refreshBlockSize(){this.blockSize=Bq,this.ga.event("block_size_reset","block_size_input"),this.blockSizeChange.emit(this.blockSize)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-block-size-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{blockSize:"blockSize"},outputs:{blockSizeChange:"blockSizeChange"},decls:19,vars:5,consts:[["matTooltip","Set the tissue block width, height and depth (dimensions)",1,"header"],[1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"size-inputs"],["floatLabel","always",1,"field"],[1,"text","label"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block width.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block height.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block depth.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Block Dimensions (mm)"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.refreshBlockSize()}),Te(5,"refresh"),N(),N(),F(6,"div",4),F(7,"mat-form-field",5),F(8,"mat-label",6),Te(9,"Width (X)"),N(),F(10,"input",7),ye("input",function(s){return i.updateBlockSizes(s,"x")}),N(),N(),F(11,"mat-form-field",5),F(12,"mat-label",6),Te(13,"Height (Y)"),N(),F(14,"input",8),ye("input",function(s){return i.updateBlockSizes(s,"y")}),N(),N(),F(15,"mat-form-field",5),F(16,"mat-label",6),Te(17,"Depth (Z)"),N(),F(18,"input",9),ye("input",function(s){return i.updateBlockSizes(s,"z")}),N(),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("value",i.blockSize.x),Y(4),ie("value",i.blockSize.y),Y(4),ie("value",i.blockSize.z))},directives:[cc,Rs,Qo,tm,Bf,Hb],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;height:1.5rem;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const Vq={thickness:NaN,numSlices:NaN};let fPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-slices-input",this.slicesConfig=Vq,this.slicesConfigChange=new Pe}get hasThicknessValue(){return!isNaN(this.slicesConfig.thickness)}updateSlicesData(t,i){const{value:r}=t.target;this.slicesConfig=Object.assign(Object.assign({},this.slicesConfig),{[i]:""!==r?+r:NaN}),this.ga.event("slice_config_update","slice_input",i,this.slicesConfig[i]),this.slicesConfigChange.emit(this.slicesConfig)}refreshSlices(){this.slicesConfig=Vq,this.ga.event("slice_config_reset","slice_input"),this.slicesConfigChange.emit(this.slicesConfig)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-slices-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{slicesConfig:"slicesConfig"},outputs:{slicesConfigChange:"slicesConfigChange"},decls:17,vars:6,consts:[[1,"header"],["matTooltip","\u201cAdd thickness of tissue sections and the total number of sections",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slices-inputs"],[1,"field"],[1,"text","label"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter thickness of tissue sections",1,"input",3,"value","input"],["matSuffix","",1,"suffix"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter total number of sections",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Sections"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.refreshSlices()}),Te(5," refresh "),N(),N(),F(6,"div",4),F(7,"mat-form-field",5),F(8,"mat-label",6),Te(9,"Thickness"),N(),F(10,"input",7),ye("input",function(s){return i.updateSlicesData(s,"thickness")}),N(),F(11,"div",8),Te(12,"\u03bcm"),N(),N(),F(13,"mat-form-field",5),F(14,"mat-label",6),Te(15,"# Sections"),N(),F(16,"input",9),ye("input",function(s){return i.updateSlicesData(s,"numSlices")}),N(),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("value",i.slicesConfig.thickness),Y(1),at("show",i.hasThicknessValue),Y(5),ie("value",i.slicesConfig.numSlices))},directives:[cc,Rs,Qo,tm,Bf,Hb,oOe,SO],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field.mat-focused[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%], [_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix.show[_ngcontent-%COMP%]{display:initial}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const jq={x:0,y:0,z:0};let pPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-rotation-slider",this.rotation=jq,this.rotationChange=new Pe}changeRotation(t,i){this.rotation=Object.assign(Object.assign({},this.rotation),{[i]:+t}),this.ga.event("rotation_update","rotation_slider",i,+t),this.rotationChange.emit(this.rotation)}resetRotation(){this.rotation=jq,this.ga.event("rotation_reset","rotation_slider"),this.rotationChange.emit(this.rotation)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-rotation-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{rotation:"rotation"},outputs:{rotationChange:"rotationChange"},decls:27,vars:23,consts:[[1,"header"],["matTooltip","Use sliders below to rotate tissue block for registration",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slider-box","red"],[1,"text","label"],[1,"slider-container"],[1,"slider",3,"max","min","step","thumbLabel","tickInterval","value","input"],[1,"text","value"],[1,"slider-box","green"],[1,"slider-box","blue"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Block Rotation"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.resetRotation()}),Te(5,"refresh"),N(),N(),F(6,"div",4),F(7,"span",5),Te(8,"X"),N(),F(9,"div",6),F(10,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"x")}),N(),N(),F(11,"span",8),Te(12),N(),N(),F(13,"div",9),F(14,"span",5),Te(15,"Y"),N(),F(16,"div",6),F(17,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"y")}),N(),N(),F(18,"span",8),Te(19),N(),N(),F(20,"div",10),F(21,"span",5),Te(22,"Z"),N(),F(23,"div",6),F(24,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"z")}),N(),N(),F(25,"span",8),Te(26),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.x),Y(2),Ai(i.rotation.x),Y(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.y),Y(2),Ai(i.rotation.y),Y(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.z),Y(2),Ai(i.rotation.z))},directives:[cc,Rs,Qo,wk],styles:["[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;height:4rem;padding-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:1rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{width:2.75rem;text-align:center}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{width:100%;padding:1rem 2rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:not(.cdk-focused) .mat-slider-thumb{width:1.25rem;height:1.25rem;transform:none}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper{right:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper:after{margin-top:-.25rem;height:.625rem!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container{margin-top:-.25rem;height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container .mat-slider-ticks{height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function mPe(n){const{subscriber:e,counter:t,period:i}=n;e.next(t),this.schedule({subscriber:e,counter:t+1,period:i},i)}const _Pe=["input"],yPe=function(n){return{enterDuration:n}},vPe=["*"],bPe=new _e("mat-checkbox-default-options",{providedIn:"root",factory:Uq});function Uq(){return{color:"accent",clickAction:"check-indeterminate"}}let CPe=0;const zq=Uq(),wPe={provide:Ao,useExisting:T(()=>Hq),multi:!0};class EPe{}const SPe=Nf(kf(Ff(em(class{constructor(n){this._elementRef=n}}))));let Hq=(()=>{class n extends SPe{constructor(t,i,r,s,o,a,l){super(t),this._changeDetectorRef=i,this._focusMonitor=r,this._ngZone=s,this._animationMode=a,this._options=l,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++CPe,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Pe,this.indeterminateChange=new Pe,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||zq,this.color=this.defaultColor=this._options.color||zq.color,this.tabIndex=parseInt(o)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=Dt(t)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t||Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}),this._syncIndeterminate(this._indeterminate)}ngAfterViewChecked(){}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}get checked(){return this._checked}set checked(t){t!=this.checked&&(this._checked=t,this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){const i=Dt(t);i!==this.disabled&&(this._disabled=i,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const i=t!=this._indeterminate;this._indeterminate=Dt(t),i&&(this._transitionCheckState(this._indeterminate?3:this.checked?1:2),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(t){this.checked=!!t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_getAriaChecked(){return this.checked?"true":this.indeterminate?"mixed":"false"}_transitionCheckState(t){let i=this._currentCheckState,r=this._elementRef.nativeElement;if(i!==t&&(this._currentAnimationClass.length>0&&r.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){r.classList.add(this._currentAnimationClass);const s=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{r.classList.remove(s)},1e3)})}}_emitChangeEvent(){const t=new EPe;t.source=this,t.checked=this.checked,this._controlValueAccessorChangeFn(this.checked),this.change.emit(t),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked}_onInputClick(t){var i;const r=null===(i=this._options)||void 0===i?void 0:i.clickAction;t.stopPropagation(),this.disabled||"noop"===r?!this.disabled&&"noop"===r&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==r&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,i){t?this._focusMonitor.focusVia(this._inputElement,t,i):this._inputElement.nativeElement.focus(i)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,i){if("NoopAnimations"===this._animationMode)return"";let r="";switch(t){case 0:if(1===i)r="unchecked-checked";else{if(3!=i)return"";r="unchecked-indeterminate"}break;case 2:r=1===i?"unchecked-checked":"unchecked-indeterminate";break;case 1:r=2===i?"checked-unchecked":"checked-indeterminate";break;case 3:r=1===i?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${r}`}_syncIndeterminate(t){const i=this._inputElement;i&&(i.nativeElement.indeterminate=t)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(hl),E(lt),fs("tabindex"),E(Zo,8),E(bPe,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-checkbox"]],viewQuery:function(t,i){if(1&t&&(ni(_Pe,5),ni(Qo,5)),2&t){let r;Mt(r=xt())&&(i._inputElement=r.first),Mt(r=xt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,i){2&t&&(sl("id",i.id),en("tabindex",null),at("mat-checkbox-indeterminate",i.indeterminate)("mat-checkbox-checked",i.checked)("mat-checkbox-disabled",i.disabled)("mat-checkbox-label-before","before"==i.labelPosition)("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],id:"id",labelPosition:"labelPosition",name:"name",required:"required",checked:"checked",disabled:"disabled",indeterminate:"indeterminate",ariaDescribedby:["aria-describedby","ariaDescribedby"],value:"value"},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[At([wPe]),ht],ngContentSelectors:vPe,decls:17,vars:21,consts:[[1,"mat-checkbox-layout"],["label",""],[1,"mat-checkbox-inner-container"],["type","checkbox",1,"mat-checkbox-input","cdk-visually-hidden",3,"id","required","checked","disabled","tabIndex","change","click"],["input",""],["matRipple","",1,"mat-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleRadius","matRippleCentered","matRippleAnimation"],[1,"mat-ripple-element","mat-checkbox-persistent-ripple"],[1,"mat-checkbox-frame"],[1,"mat-checkbox-background"],["version","1.1","focusable","false","viewBox","0 0 24 24",0,"xml","space","preserve","aria-hidden","true",1,"mat-checkbox-checkmark"],["fill","none","stroke","white","d","M4.1,12.7 9,17.6 20.3,6.3",1,"mat-checkbox-checkmark-path"],[1,"mat-checkbox-mixedmark"],[1,"mat-checkbox-label",3,"cdkObserveContent"],["checkboxLabel",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"span",2),F(3,"input",3,4),ye("change",function(s){return i._onInteractionEvent(s)})("click",function(s){return i._onInputClick(s)}),N(),F(5,"span",5),et(6,"span",6),N(),et(7,"span",7),F(8,"span",8),Ut.lFrame.currentNamespace=Bn,F(9,"svg",9),et(10,"path",10),N(),Ut.lFrame.currentNamespace=null,et(11,"span",11),N(),N(),F(12,"span",12,13),ye("cdkObserveContent",function(){return i._onLabelTextChange()}),F(14,"span",14),Te(15,"\xa0"),N(),In(16),N(),N()),2&t){const r=Ys(1),s=Ys(13);en("for",i.inputId),Y(2),at("mat-checkbox-inner-container-no-side-margin",!s.textContent||!s.textContent.trim()),Y(1),ie("id",i.inputId)("required",i.required)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex),en("value",i.value)("name",i.name)("aria-label",i.ariaLabel||null)("aria-labelledby",i.ariaLabelledby)("aria-checked",i._getAriaChecked())("aria-describedby",i.ariaDescribedby),Y(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Fg(19,yPe,"NoopAnimations"===i._animationMode?0:150))}},directives:[Qo,kD],styles:["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"],encapsulation:2,changeDetection:0}),n})(),$q=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),TPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn,_E,$q],Nn,$q]}),n})();const APe=["closeSearch"];function DPe(n,e){if(1&n){const t=Lr();F(0,"div",12),F(1,"mat-checkbox",13),ye("ngModelChange",function(r){const o=Vn(t).$implicit;return bt(2).checkedResults[o.id]=r}),Te(2),N(),N()}if(2&n){const t=e.$implicit,i=bt(2);Y(1),ie("ngModel",i.checkedResults[t.id]),Y(1),Os(" ",t.label," ")}}function OPe(n,e){if(1&n&&(F(0,"div",9),Ct(1,DPe,3,2,"div",10),F(2,"div",11),Te(3),yn(4,"i18nPlural"),N(),N()),2&n){const t=bt();Y(1),ie("ngForOf",t.searchResults.results)("ngForTrackBy",t.tagId),Y(2),Os(" ",QL(4,3,t.searchResults.totalCount,t.countMapping)," ")}}const Gq=5,d1={totalCount:0,results:[]};class gp{constructor(e,t,i){this.el=e,this.ga=t,this.clsName="ccf-tag-search",this.placeholder="Add Anatomical Structures ...",this.added=new Pe,this.countMapping={"=1":"1 result",other:"# results"},this.searchControl=new vh,this.searchResults=d1,this.checkedResults={},this.resultsVisible=!1,this.destroy$=new we,this.searchControl.valueChanges.pipe(zn(this.destroy$),function(n,e=_G){return t=>t.lift(new zMe(n,!!e.leading,!!e.trailing))}(()=>{var r;return function(n=0,e=Tf){return(!IO(n)||n<0)&&(n=0),(!e||"function"!=typeof e.schedule)&&(e=Tf),new oe(t=>(t.add(e.schedule(mPe,n,{subscriber:t,counter:0,period:n})),t))}(null!==(r=this.searchThrottle)&&void 0!==r?r:100)},{leading:!0,trailing:!0}),Ir(this.executeSearch)).subscribe(r=>{this.searchResults=r,this.checkedResults=this.getUpdatedCheckedResults(r),i.markForCheck()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}tagId(e,t){return t.id}hasCheckedTags(){return Object.values(this.checkedResults).some(e=>e)}addTags(){const{searchControl:e,searchResults:t,checkedResults:i}=this,r=t.results.filter(s=>i[s.id]);r.length>0&&(e.reset(),this.searchResults=d1,this.checkedResults={},this.ga.event("tags_added","tag_search",r.map(s=>s.label).join(",")),this.added.emit(r))}openResults(){this.resultsVisible||(this.resultsVisible=!0)}closeResults(e){const{closeSearch:t}=this;this.resultsVisible&&e.target instanceof Node&&(!this.el.nativeElement.contains(e.target)||t.nativeElement.contains(e.target))&&(this.resultsVisible=!1)}executeSearch(e){const{search:t,searchLimit:i=Gq}=this;return e&&t?li(t(e,i)).pipe(Sa(()=>[d1]),be(this.truncateResults)):[d1]}truncateResults(e){const{searchLimit:t=Gq}=this,i=e.results;return i.length>t?Object.assign(Object.assign({},e),{results:i.slice(0,t)}):e}getUpdatedCheckedResults(e){const t=this.checkedResults;return e.results.reduce((i,{id:r})=>{var s;return i[r]=null!==(s=t[r])&&void 0!==s&&s,i},{})}}function PPe(n,e){if(1&n&&(F(0,"div",11),F(1,"div",12),Te(2),N(),F(3,"div",13),Te(4),N(),N()),2&n){const t=e.$implicit;Y(2),Ai(t.label),Y(2),Ai(t.value)}}gp.\u0275fac=function(e){return new(e||gp)(E(nt),E(io),E(Un))},gp.\u0275cmp=Le({type:gp,selectors:[["ccf-tag-search"]],viewQuery:function(e,t){if(1&e&&ni(APe,5,nt),2&e){let i;Mt(i=xt())&&(t.closeSearch=i.first)}},hostVars:2,hostBindings:function(e,t){1&e&&ye("click",function(){return t.openResults()})("focusin",function(){return t.openResults()})("click",function(r){return t.closeResults(r)},!1,ny)("focusin",function(r){return t.closeResults(r)},!1,ny),2&e&&Fn(t.clsName)},inputs:{placeholder:"placeholder",search:"search",searchLimit:"searchLimit",searchThrottle:"searchThrottle"},outputs:{added:"added"},decls:10,vars:8,consts:[[1,"spacer"],["appearance","outline",1,"overlay"],[1,"search-box"],["matInput","","type","search",3,"placeholder","formControl"],["search",""],["matSuffix","",1,"add-button",3,"disabled","click"],["closeSearch",""],[1,"icon"],["class","results",4,"ngIf"],[1,"results"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"count"],[1,"item"],["labelPosition","after",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e){const i=Lr();et(0,"div",0),F(1,"mat-form-field",1),F(2,"div",2),et(3,"input",3,4),F(5,"button",5,6),ye("click",function(){Vn(i);const s=Ys(4);return t.addTags(),s.focus()}),F(7,"mat-icon",7),Te(8,"add"),N(),N(),N(),Ct(9,OPe,5,6,"div",8),N()}2&e&&(Y(1),at("expanded",t.resultsVisible),Y(2),ie("placeholder",t.placeholder)("formControl",t.searchControl),Y(2),at("active",t.hasCheckedTags()),ie("disabled",!t.hasCheckedTags()),Y(4),ie("ngIf",t.resultsVisible))},directives:[tm,Hb,Lb,ek,kM,SO,Rs,Is,Xl,Hq,dk],pipes:[x3],styles:["[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] .spacer[_ngcontent-%COMP%]{height:3.25rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;z-index:10}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;height:3rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .add-button[_ngcontent-%COMP%]{border-radius:.25rem;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;height:100%}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-top:.5rem;font-size:.75rem;text-align:end}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:0;border-radius:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex{padding-right:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline{opacity:1!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline-thick{opacity:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-infix{padding:.313rem .063rem .063rem;border:0}[_nghost-%COMP%] .overlay.expanded[_ngcontent-%COMP%] .mat-form-field-wrapper{box-shadow:0 0 .3rem .1rem #9e9e9e5e}"],changeDetection:0}),De([su.ak],gp.prototype,"executeSearch",null),De([su.ak],gp.prototype,"truncateResults",null);let RPe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.clsName="ccf-review-modal",this.metaData=i.metaData,this.registrationCallbackSet=i.registrationCallbackSet}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return n.\u0275fac=function(t){return new(t||n)(E(Gm),E(xk))},n.\u0275cmp=Le({type:n,selectors:[["ccf-review-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:14,vars:2,consts:[[1,"ccf-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography"],[1,"display-fields"],["class","field",4,"ngFor","ngForOf"],[1,"footer"],["mat-button","",1,"download-button",3,"click"],[1,"field"],[1,"label"],[1,"data"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),F(3,"mat-icon",3),ye("click",function(){return i.close()}),Te(4,"clear"),N(),N(),F(5,"div",4),F(6,"h2",5),Te(7,"Registration Review"),N(),F(8,"mat-dialog-content",6),F(9,"div",7),Ct(10,PPe,5,2,"div",8),N(),N(),F(11,"div",9),F(12,"button",10),ye("click",function(){return i.dialogRef.close(!0)}),Te(13),N(),N(),N(),N(),N()),2&t&&(Y(10),ie("ngForOf",i.metaData),Y(3),Ai(i.registrationCallbackSet?"REGISTER":"DOWNLOAD REGISTRATION DATA"))},directives:[Rs,xG,TG,Xl,$f],styles:[".mat-dialog-container{padding:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;background-color:#fff}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{text-align:center;font-size:1.5rem;margin-bottom:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%]{justify-content:space-around;display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%]{margin-top:2rem;margin-bottom:2rem;width:100%}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:50%;text-align:right;padding-right:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .data[_ngcontent-%COMP%]{width:50%;text-align:left;padding-left:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;margin-top:1rem;margin-right:1rem;cursor:pointer}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{padding-top:1.5rem;display:flex;justify-content:space-around}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .review-button[_ngcontent-%COMP%]{height:3rem}"]}),n})(),kPe=(()=>{class n{constructor(t,i){this.dialog=t,this.ga=i,this.clsName="ccf-review-button",this.registrationCallbackSet=!0,this.metaData=[],this.displayErrors=!0,this.registrationIsValid=!1,this.registerData=new Pe,this.enterErrorMode=new Pe}ngOnChanges(){this.registrationIsValid=this.metaData.length>=3&&this.metaData.slice(0,3).every(t=>t.value)}get disabled(){return!this.registrationIsValid}registerButtonClick(t){return t&&t.preventDefault(),this.enterErrorMode.emit(),this.registrationIsValid&&(this.ga.event("review_start","review_button"),this.launchReviewModal()),!1}launchReviewModal(){this.dialog.open(RPe,{panelClass:"modal-animated",width:"60rem",data:{registrationCallbackSet:this.registrationCallbackSet,metaData:this.metaData}}).afterClosed().subscribe(i=>{i&&(this.ga.event("register","review_button"),this.registerData.emit())})}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-review-button"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{registrationCallbackSet:"registrationCallbackSet",metaData:"metaData",displayErrors:"displayErrors",registrationIsValid:"registrationIsValid"},outputs:{registerData:"registerData",enterErrorMode:"enterErrorMode"},features:[qn],decls:2,vars:4,consts:[["mat-button","",1,"review-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(F(0,"button",0),ye("click",function(s){return i.registerButtonClick(s)}),Te(1),N()),2&t&&(at("disabled",i.disabled),ie("matTooltip",i.disabled?"Required: Select an organ and position tissue block inside organ.":"Review registration and submit/download."),Y(1),Os(" ",i.registrationCallbackSet?"REVIEW AND REGISTER":"REVIEW AND DOWNLOAD","\n"))},directives:[$f,cc],styles:[".review-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;font-weight:500}.review-button.disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]}),n})();function FPe(n,e){if(1&n){const t=Lr();F(0,"mat-chip",2),ye("removed",function(){const s=Vn(t).$implicit;return bt().removeTag(s)}),Te(1),F(2,"mat-icon",3),Te(3,"cancel"),N(),N()}if(2&n){const t=e.$implicit;Fn(bt().tagClasses(t)),Y(1),Os(" ",t.label," ")}}let NPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-tag-list",this.tagRemoved=new Pe,this.tagsChange=new Pe}tagId(t,i){return i.id}tagClasses(t){return"added"===t.type?["added"]:["assigned"]}removeTag(t){this.tags=this.tags.filter(i=>i!==t),this.ga.event("tag_removed","tag_list",t.label),this.tagRemoved.emit(t),this.tagsChange.emit(this.tags)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-tag-list"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{tags:"tags"},outputs:{tagRemoved:"tagRemoved",tagsChange:"tagsChange"},decls:2,vars:2,consts:[["selectable","false"],["removable","","disableRipple","",3,"class","removed",4,"ngFor","ngForOf","ngForTrackBy"],["removable","","disableRipple","",3,"removed"],["matChipRemove","",1,"icon","remove"]],template:function(t,i){1&t&&(F(0,"mat-chip-list",0),Ct(1,FPe,4,3,"mat-chip",1),N()),2&t&&(Y(1),ie("ngForOf",i.tags)("ngForTrackBy",i.tagId))},directives:[Oq,Xl,u0,Rs,Aq],styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto}[_nghost-%COMP%] .mat-chip-list-wrapper{margin:0}"],changeDetection:0}),n})();function LPe(n,e){if(1&n){const t=Lr();F(0,"ccf-tag-list",20),ye("tagRemoved",function(r){return Vn(t),bt().astags.removeTag(r)}),yn(1,"async"),N()}2&n&&ie("tags",wn(1,1,bt().astags.tags$))}function BPe(n,e){}const VPe=function(){return[]};let jPe=(()=>{class n{constructor(t,i,r,s){this.model=t,this.registration=i,this.page=r,this.astags=s,this.clsName="ccf-right-sidebar",this.modalClosed=!1}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(wr),E(Ui),E(Io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-right-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{modalClosed:"modalClosed"},decls:34,vars:28,consts:[[1,"scroll-wrapper"],[1,"container"],[1,"info-button-container"],["videoID","gY3_-LIoKaU","infoTitle","HuBMAP CCF Registration User Interface"],[3,"blockSize","blockSizeChange"],[3,"slicesConfig","slicesConfigChange"],[3,"rotation","rotationChange"],[1,"tags-container",3,"expanded"],[1,"header"],["matTooltip","Review tags generated via collision detection. Add or delete tags as needed."],[3,"search","added"],["class","tag-list",3,"tags","tagRemoved",4,"ngIf","ngIfElse"],["tagListPlaceholder",""],[1,"legend"],[1,"dot","assigned"],[1,"text","assigned"],[1,"dot","added"],[1,"text","added"],[1,"filler"],[3,"registrationCallbackSet","displayErrors","registrationIsValid","metaData","registerData","enterErrorMode"],[1,"tag-list",3,"tags","tagRemoved"]],template:function(t,i){if(1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),et(3,"ccf-info-button",3),N(),F(4,"ccf-block-size-input",4),ye("blockSizeChange",function(s){return i.model.setBlockSize(s)}),yn(5,"async"),N(),F(6,"ccf-slices-input",5),ye("slicesConfigChange",function(s){return i.model.setSlicesConfig(s)}),yn(7,"async"),N(),F(8,"ccf-rotation-slider",6),ye("rotationChange",function(s){return i.model.setRotation(s)}),yn(9,"async"),N(),et(10,"mat-divider"),F(11,"mat-expansion-panel",7),F(12,"mat-expansion-panel-header",8),F(13,"mat-panel-title",9),Te(14,"Anatomical Structure Tags"),N(),N(),F(15,"ccf-tag-search",10),ye("added",function(s){return i.astags.addTags(s)}),N(),Ct(16,LPe,2,3,"ccf-tag-list",11),yn(17,"async"),Ct(18,BPe,0,0,"ng-template",null,12,Rw),F(20,"div",13),et(21,"span",14),F(22,"span",15),Te(23,"Assigned"),N(),et(24,"span",16),F(25,"span",17),Te(26,"Added"),N(),N(),N(),et(27,"mat-divider"),et(28,"div",18),F(29,"ccf-review-button",19),ye("registerData",function(){return i.registration.register()})("enterErrorMode",function(){return i.registration.setDisplayErrors(!i.registration.isValid)}),yn(30,"async"),yn(31,"async"),yn(32,"async"),yn(33,"async"),N(),N(),N()),2&t){const r=Ys(19);let s,o;Y(4),ie("blockSize",wn(5,11,i.model.blockSize$)),Y(2),ie("slicesConfig",wn(7,13,i.model.slicesConfig$)),Y(2),ie("rotation",wn(9,15,i.model.rotation$)),Y(3),ie("expanded",i.modalClosed),Y(4),ie("search",i.astags.searchExternal),Y(1),ie("ngIf",null==(s=wn(17,17,i.model.organ$))?null:s.name)("ngIfElse",r),Y(13),ie("registrationCallbackSet",wn(30,19,i.page.registrationCallbackSet$))("displayErrors",wn(31,21,i.registration.displayErrors$))("registrationIsValid",wn(32,23,i.registration.valid$))("metaData",null!==(o=wn(33,25,i.registration.metadata$))&&void 0!==o?o:lv(27,VPe))}},directives:[rOe,hPe,fPe,pPe,Sq,NM,LM,PG,cc,gp,Is,kPe,NPe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100%;margin-left:1.5rem;margin-right:.375rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .info-button-container[_ngcontent-%COMP%]{height:3.75rem;display:flex;justify-content:flex-end}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 .5rem 0 0;font-weight:bold;-webkit-user-select:none;-moz-user-select:none;font-size:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%]{overflow:visible}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding-left:0;padding-right:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{margin-top:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%] .icon.add[_ngcontent-%COMP%]{position:absolute;width:3.625rem;height:3.625rem;font-size:3.625rem;top:-1.9375rem;right:-1.1875rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list[_ngcontent-%COMP%]{max-height:32rem;margin-left:-1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list-placeholder[_ngcontent-%COMP%]{display:flex;height:4rem;align-items:center;justify-content:center;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{display:flex;width:100%;margin-top:1.5rem;align-items:center;font-size:.9rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{display:inline-block;width:1rem;height:1rem;border-radius:50%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.assigned[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.added[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function Wq(n,e){return Xo((t,i)=>e?e(t[n],i[n]):t[n]===i[n])}const UPe=["input"],zPe=function(n){return{enterDuration:n}},HPe=["*"],$Pe=new _e("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let qq=0;const WPe={provide:Ao,useExisting:T(()=>Zq),multi:!0};class Yq{constructor(e,t){this.source=e,this.value=t}}const Xq=new _e("MatRadioGroup");let Kq=(()=>{class n{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+qq++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new Pe}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=Dt(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(i=>{i.checked=this.value===i.value,i.checked&&(this._selected=i)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new Yq(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return n.\u0275fac=function(t){return new(t||n)(E(Un))},n.\u0275dir=he({type:n,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),n})(),Zq=(()=>{class n extends Kq{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,selectors:[["mat-radio-group"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,Qq,5),2&t){let s;Mt(s=xt())&&(i._radios=s)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[At([WPe,{provide:Xq,useExisting:n}]),ht]}),n})();class qPe{constructor(e){this._elementRef=e}}const YPe=Ff(Nf(qPe));let XPe=(()=>{class n extends YPe{constructor(t,i,r,s,o,a,l,c){super(i),this._changeDetector=r,this._focusMonitor=s,this._radioDispatcher=o,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++qq,this.id=this._uniqueId,this.change=new Pe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===a,c&&(this.tabIndex=So(c,0)),this._removeUniqueSelectionListener=o.listen((d,f)=>{d!==this.id&&f===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const i=Dt(t);this._checked!==i&&(this._checked=i,i&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!i&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),i&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(Dt(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=Dt(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new Yq(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const i=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),i&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(Kq),E(nt),E(Un),E(hl),E(tS),E(String),E(void 0),E(String))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&ni(UPe,5),2&t){let r;Mt(r=xt())&&(i._inputElement=r.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[ht]}),n})(),Qq=(()=>{class n extends XPe{constructor(t,i,r,s,o,a,l,c){super(t,i,r,s,o,a,l,c)}}return n.\u0275fac=function(t){return new(t||n)(E(Xq,8),E(nt),E(Un),E(hl),E(tS),E(Zo,8),E($Pe,8),fs("tabindex"))},n.\u0275cmp=Le({type:n,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._inputElement.nativeElement.focus()}),2&t&&(en("tabindex",null)("id",i.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),at("mat-radio-checked",i.checked)("mat-radio-disabled",i.disabled)("_mat-animation-noopable",i._noopAnimations)("mat-primary","primary"===i.color)("mat-accent","accent"===i.color)("mat-warn","warn"===i.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[ht],ngContentSelectors:HPe,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"span",2),et(3,"span",3),et(4,"span",4),F(5,"input",5,6),ye("change",function(s){return i._onInputInteraction(s)})("click",function(s){return i._onInputClick(s)}),N(),F(7,"span",7),et(8,"span",8),N(),N(),F(9,"span",9),F(10,"span",10),Te(11,"\xa0"),N(),In(12),N(),N()),2&t){const r=Ys(1);en("for",i.inputId),Y(5),ie("id",i.inputId)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex)("required",i.required),en("name",i.name)("value",i.value)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),Y(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Fg(18,zPe,i._noopAnimations?0:150)),Y(2),at("mat-radio-label-before","before"==i.labelPosition)}},directives:[Qo],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),n})(),KPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn],Nn]}),n})();const ZPe=["label"],QPe=["options"],JPe=function(){return["Register","3D\xa0Preview"]};let eRe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-stage-nav",this.side="anterior",this.view3D=!1,this.sideChange=new Pe,this.view3DChange=new Pe,this.isDropdownActive=!1,this.isDropdownHidden=!0}set useDropdownMenu(t){this.isDropdownActive=t,this.isDropdownHidden=!0}get labelEl(){return this.labelRef.nativeElement}get optionsEl(){return this.optionsRef.nativeElement}handleClick(t){const{isDropdownHidden:i,labelEl:r,optionsEl:s}=this;r.contains(t)?this.isDropdownHidden=!i:s.contains(t)||(this.isDropdownHidden=!0)}updateSide(t){this.ga.event("side_update","stage_nav",t),"3D"===t?this.updateView(!0):(this.updateView(!1),this.side=t,this.sideChange.emit(this.side))}updateView(t){this.view3D=t,this.ga.event("view_update","stage_nav",t?"3D":"Register"),this.view3DChange.emit(this.view3D)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-stage-nav"]],viewQuery:function(t,i){if(1&t&&(ni(ZPe,7),ni(QPe,7)),2&t){let r;Mt(r=xt())&&(i.labelRef=r.first),Mt(r=xt())&&(i.optionsRef=r.first)}},hostVars:2,hostBindings:function(t,i){1&t&&ye("click",function(s){return i.handleClick(s.target)},!1,Qp),2&t&&Fn(i.clsName)},inputs:{useDropdownMenu:"useDropdownMenu",side:"side",view3D:"view3D"},outputs:{sideChange:"sideChange",view3DChange:"view3DChange"},decls:18,vars:10,consts:[[1,"dropdown-label"],["label",""],[1,"stage-options"],["options",""],[1,"input-group",3,"value","change"],["value","left",1,"nav-input"],["value","right",1,"nav-input"],["value","anterior","checked","",1,"nav-input"],["value","posterior",1,"nav-input"],["matTooltip","Change view.",1,"view-slider",3,"labels","value","valueChange"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"mat-label"),Te(3,"Options"),N(),F(4,"mat-icon"),Te(5,"arrow_drop_down"),N(),N(),F(6,"div",2,3),F(8,"mat-radio-group",4),ye("change",function(s){return i.updateSide(s.value)}),F(9,"mat-radio-button",5),Te(10,"Left"),N(),F(11,"mat-radio-button",6),Te(12,"Right"),N(),F(13,"mat-radio-button",7),Te(14,"Anterior"),N(),F(15,"mat-radio-button",8),Te(16,"Posterior"),N(),N(),F(17,"ccf-labeled-slide-toggle",9),ye("valueChange",function(s){return i.updateView("Register"!==s)}),N(),N()),2&t&&(at("dropdown",i.isDropdownActive),Y(6),at("dropdowncontainer",i.isDropdownActive)("hidden",i.isDropdownActive&&i.isDropdownHidden),Y(2),ie("value",i.side),Y(9),ie("labels",lv(9,JPe))("value",i.view3D?"3D\xa0Preview":"Register"))},directives:[Bf,Rs,Zq,Qq,vF,cc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%]{display:none;align-items:center}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-label[_ngcontent-%COMP%], [_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{line-height:1.5rem}[_nghost-%COMP%] .dropdown-label.dropdown[_ngcontent-%COMP%]{display:flex;cursor:pointer;align-items:start}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{margin-right:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{margin-left:-1rem;margin-bottom:1.5rem;white-space:nowrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-radius:.25rem;width:16.5rem;position:absolute;top:3.5rem;z-index:1;transition:opacity .25s}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{margin-left:1.5rem;margin-right:0;display:flex;flex-wrap:wrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{display:flex;margin:0 1.5rem 0 0;height:2.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{display:flex;align-items:center;height:3rem;margin:0 .5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:visible;border-top:2px solid}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%]{visibility:hidden;opacity:0;transition:visibility .25s,opacity .25s}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:hidden}"],changeDetection:0}),n})();function tRe(n,e){if(1&n){const t=Lr();F(0,"ccf-body-ui",16),ye("rotationChange",function(r){Vn(t),bt();const s=Ys(24);return s.rotation=r[0],s.rotationX=r[1]}),yn(1,"async"),yn(2,"async"),yn(3,"async"),N()}if(2&n){const t=bt();ie("scene",wn(1,5,t.scene.nodes$))("rotation",wn(2,7,t.scene.rotation$))("bounds",wn(3,9,t.bounds$))("zoom",11.5)("interactive",!0)}}function nRe(n,e){if(1&n){const t=Lr();F(0,"ccf-body-ui",17),ye("nodeDrag",function(r){return Vn(t),bt().handleNodeDrag(r)}),yn(1,"async"),yn(2,"async"),N()}if(2&n){const t=bt();ie("scene",wn(1,4,t.scene.rotatedNodes$))("interactive",!1)("bounds",wn(2,6,t.bounds$))("zoom",11.5)}}function iRe(n,e){1&n&&et(0,"ccf-store-debug",18)}function rRe(n,e){if(1&n){const t=Lr();F(0,"div",19),F(1,"button",20),ye("click",function(){Vn(t);const r=bt();return r.debugMode=!r.debugMode}),Te(2,"State"),N(),F(3,"button",21),ye("click",function(){return Vn(t),bt().registration.setUseRegistrationCallback(!0)}),Te(4,"Use callback"),N(),F(5,"button",21),ye("click",function(){return Vn(t),bt().registration.setUseRegistrationCallback(!1)}),Te(6,"Use download"),N(),N()}}let sRe=(()=>{class n{constructor(t,i,r,s,o,a){this.model=t,this.page=i,this.registration=r,this.scene=s,this.rootRef=o,this.cdr=a,this.clsName="ccf-content",this.position$=this.model.position$.pipe(be(l=>({x:Math.floor(l.x),y:Math.floor(l.y),z:Math.floor(l.z)}))),this.is3DView$=this.model.viewType$.pipe(be(l=>"3d"===l)),this.bounds$=this.model.organDimensions$.pipe(be(l=>({x:Math.max(l.x,this.model.defaultPosition.x+40)/1e3,y:Math.max(l.y,this.model.defaultPosition.y+40)/1e3,z:Math.max(l.z,this.model.defaultPosition.z+40)/1e3})),Wq("x"),Wq("y")),this.isNarrowView=!1,this.debugMode=!1,this.showDebugButtons=!Sh.production}ngOnInit(){this.sensor=new vG.ResizeSensor(this.rootRef.nativeElement,({width:t})=>{const i=t<440;this.isNarrowView!==i&&(this.isNarrowView=i,this.cdr.markForCheck())})}ngOnDestroy(){this.sensor.detach()}setViewType(t){this.model.setViewType(t?"3d":"register")}resetStage(){this.model.setPosition(this.model.defaultPosition),this.model.setViewSide("anterior"),this.model.setViewType("register")}handleNodeDrag(t){if("#DraftPlacement"===t.node["@id"]&&t.info.coordinate){const[i,r]=t.info.coordinate.map(d=>1e3*d),{position:s,viewSide:o,organDimensions:a}=this.model.snapshot,l=[a.x,a.y,a.z].map(d=>d/2);let c=s;switch(o){case"anterior":c={x:i+l[0],y:r+l[1],z:s.z};break;case"posterior":c={x:-i+l[0],y:r+l[1],z:s.z};break;case"left":c={x:s.x,y:r+l[1],z:-i+l[2]};break;case"right":c={x:s.x,y:r+l[1],z:i+l[2]}}this.model.setPosition(c)}}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(Ui),E(wr),E(ss),E(nt),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:29,vars:34,consts:[[1,"top-bar"],[3,"useDropdownMenu","view3D","side","view3DChange","sideChange"],["matRipple","","matRippleColor","rgba(204, 204, 204, 0.25)",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"main-content"],["class","body-ui","camera","perspective",3,"scene","rotation","bounds","zoom","interactive","rotationChange",4,"ngIf"],["class","body-ui","camera","orthographic",3,"scene","interactive","bounds","zoom","nodeDrag",4,"ngIf"],[1,"gizmo-area"],[1,"position-display"],[1,"position"],[1,"x"],[1,"y"],[1,"z"],[1,"gizmo",3,"scene","rotation","interactive","zoom"],["gizmo",""],["class","debug",4,"ngIf"],["style","position: absolute; bottom: 1rem; display: flex; flex-direction: row; justify-content: space-between; width: 7rem;",4,"ngIf"],["camera","perspective",1,"body-ui",3,"scene","rotation","bounds","zoom","interactive","rotationChange"],["camera","orthographic",1,"body-ui",3,"scene","interactive","bounds","zoom","nodeDrag"],[1,"debug"],[2,"position","absolute","bottom","1rem","display","flex","flex-direction","row","justify-content","space-between","width","7rem"],[2,"width","3rem","font-size",".7rem",3,"click"],[3,"click"]],template:function(t,i){if(1&t&&(F(0,"div",0),F(1,"ccf-stage-nav",1),ye("view3DChange",function(s){return i.setViewType(s)})("sideChange",function(s){return i.model.setViewSide(s)}),yn(2,"async"),yn(3,"async"),N(),F(4,"mat-icon",2),ye("click",function(){return i.resetStage()}),Te(5,"refresh"),N(),N(),F(6,"div",3),Ct(7,tRe,4,11,"ccf-body-ui",4),yn(8,"async"),Ct(9,nRe,3,8,"ccf-body-ui",5),yn(10,"async"),F(11,"div",6),F(12,"div",7),F(13,"div",8),F(14,"div",9),Te(15),yn(16,"async"),N(),F(17,"div",10),Te(18),yn(19,"async"),N(),F(20,"div",11),Te(21),yn(22,"async"),N(),N(),N(),et(23,"ccf-body-ui",12,13),yn(25,"async"),yn(26,"async"),N(),N(),Ct(27,iRe,1,0,"ccf-store-debug",14),Ct(28,rRe,7,0,"div",15)),2&t){let r,s,o;Y(1),ie("useDropdownMenu",i.isNarrowView)("view3D",wn(2,16,i.is3DView$))("side",wn(3,18,i.model.viewSide$)),Y(3),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(3),ie("ngIf","3d"===wn(8,20,i.model.viewType$)),Y(2),ie("ngIf","register"===wn(10,22,i.model.viewType$)),Y(6),Os("X: ",null==(r=wn(16,24,i.position$))?null:r.x,""),Y(3),Os("Y: ",null==(s=wn(19,26,i.position$))?null:s.y,""),Y(3),Os("Z: ",null==(o=wn(22,28,i.position$))?null:o.z,""),Y(2),ie("scene",wn(25,30,i.scene.gizmo$))("rotation",wn(26,32,i.scene.rotation$))("interactive",!1)("zoom",9.5),Y(4),ie("ngIf",i.showDebugButtons&&i.debugMode),Y(1),ie("ngIf",i.showDebugButtons)}},directives:[eRe,Rs,Qo,Is,IDe,VDe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;padding:1.5rem;overflow:hidden}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%]{display:flex;height:calc(100% - 1rem)}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .body-ui[_ngcontent-%COMP%]{flex:auto;transition:opacity 1s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%]{width:4rem;margin-top:1.5rem;margin-left:1.5rem;z-index:10}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .position-display[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:1.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%]{height:5.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{opacity:0;z-index:0}[_nghost-%COMP%] .ccf-store-debug[_ngcontent-%COMP%]{color:#fff;position:absolute;top:.5rem;max-width:55rem}"],changeDetection:0}),n})();const oRe=function(n){return[n]};let aRe=(()=>{class n{constructor(t,i,r,s,o,a,l,c){this.model=t,this.page=i,this.consentService=r,this.snackbar=s,this.theming=o,this.globalConfig=c,this.organList=_F,this.open=!0,this.registrationStarted=!1,this.disablePositionChange=!1,this.subscriptions=new Ie,o.initialize(a,l),this.subscriptions.add(i.registrationCallbackSet$.subscribe(d=>{this.open=!d})),this.subscriptions.add(i.registrationStarted$.subscribe(d=>{this.registrationStarted=d}))}ngOnInit(){const t=this.snackbar.openFromComponent(pOe,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3})}handleKey(t){const i=this.model.snapshot.position;if(this.disablePositionChange||!this.registrationStarted)return;t.preventDefault();const r=t.repeat?1:.5;let s=i;switch(t.key){case"q":s=Object.assign(Object.assign({},i),{z:i.z+r});break;case"e":s=Object.assign(Object.assign({},i),{z:i.z-r});break;case"w":s=Object.assign(Object.assign({},i),{y:i.y+r});break;case"s":s=Object.assign(Object.assign({},i),{y:i.y-r});break;case"a":s=Object.assign(Object.assign({},i),{x:i.x-r});break;case"d":s=Object.assign(Object.assign({},i),{x:i.x+r})}this.model.setPosition(s)}handleClick(t){this.disablePositionChange="INPUT"===t.nodeName}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(Ui),E(o0),E(Woe),E(yF),E(nt),E(Tt),E(Eh))},n.\u0275cmp=Le({type:n,selectors:[["ccf-root"]],hostBindings:function(t,i){1&t&&ye("keydown",function(s){return i.handleKey(s)},!1,Qp)("click",function(s){return i.handleClick(s.target)},!1,Qp)},decls:18,vars:16,consts:[["opened",""],[3,"modalClosed","disableSlider"],["position","end","opened",""],[3,"modalClosed"],[1,"selector-drawer"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],[1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",3,"click"],[1,"stage-content"]],template:function(t,i){if(1&t&&(et(0,"ccf-registration-modal"),et(1,"ccf-header"),F(2,"ccf-drawer-container"),F(3,"ccf-drawer",0),et(4,"ccf-left-sidebar",1),et(5,"ccf-drawer-toggle-button"),N(),F(6,"ccf-drawer",2),et(7,"ccf-right-sidebar",3),et(8,"ccf-drawer-toggle-button"),N(),F(9,"ccf-drawer-content"),F(10,"div",4),F(11,"ccf-organ-selector",5,6),ye("organsChanged",function(s){return i.model.setOrgan(s[0])}),yn(13,"async"),N(),F(14,"div",7),F(15,"mat-icon",8),ye("click",function(){return i.open=!i.open}),Te(16),N(),N(),N(),et(17,"ccf-content",9),N(),N()),2&t){const r=Ys(12);Y(4),ie("modalClosed",i.registrationStarted)("disableSlider",!(null!=r.selectedOrgans[0]&&r.selectedOrgans[0].hasSex)),Y(3),ie("modalClosed",i.registrationStarted),Y(3),at("closed",!i.open),Y(1),at("closed",!i.open),ie("organList",i.organList)("selectedOrgans",Fg(14,oRe,wn(13,12,i.model.organ$))),Y(5),Os(" ",i.open?"arrow_drop_up":"arrow_drop_down"," "),Y(1),at("expanded-stage",!i.open)}},directives:[ZOe,tIe,cIe,CF,uPe,dPe,jPe,l1,oq,Rs,sRe],pipes:[zu],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;color:#000}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:25.5rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{position:relative;z-index:1}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-organ-selector[_ngcontent-%COMP%]{height:100%;padding-top:.5rem;transition:all .5s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-organ-selector.closed[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;justify-content:center;height:5.688rem;transition:all .5s ease-in-out}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{width:3rem;height:1.2rem;position:absolute;bottom:0;right:calc(50% - 1.5rem);margin-bottom:-1.2rem;z-index:99;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:#fff;border-bottom-left-radius:.2rem;border-bottom-right-radius:.2rem;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]:hover{background-color:#ececec}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:3rem;top:-2.9rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{border-radius:.5rem!important;height:calc(100% - 2.688rem - 3rem - 1.5rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 1.5rem);padding-bottom:1rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-content[_ngcontent-%COMP%]{position:absolute;transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:all;bottom:1.5rem;z-index:1}"],changeDetection:0}),n})();function lRe(n,e){1&n&&et(0,"ccf-root")}let cRe=(()=>{class n extends wOe{constructor(t,i){var r;super(t,i,{initialDelay:500,initialConfig:null!==(r=globalThis.ruiConfig)&&void 0!==r?r:{},parse:{useDownload:EOe.boolean,user:EOe.json,organ:EOe.json,editRegistration:EOe.json,register:EOe.function,cancelRegistration:EOe.function,fetchPreviousRegistrations:EOe.function,skipUnsavedChangesConfirmation:EOe.boolean}})}}return n.\u0275fac=function(t){return new(t||n)(E(Eh),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-root-wc"]],inputs:{baseHref:"baseHref",useDownload:"useDownload",user:"user",organ:"organ",editRegistration:"editRegistration",register:"register",cancelRegistration:"cancelRegistration",fetchPreviousRegistrations:"fetchPreviousRegistrations",skipUnsavedChangesConfirmation:"skipUnsavedChangesConfirmation"},features:[ht],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&Ct(0,lRe,1,0,"ccf-root",0),2&t&&ie("ngIf",i.initialized)},directives:[Is,aRe],encapsulation:2,changeDetection:0}),n})();const uRe=new _e("Global configuration object");function dRe(n){return n.get("ruiConfig",{user:{firstName:"",lastName:""}})}let hRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:uRe,useFactory:dRe,deps:[cq]}]}),n})(),fRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:pv,useValue:yF.initialize,multi:!0},yF]}),n})(),pRe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[kr,Ra,KG,...t]}}}return n.\u0275fac=function(t){return new(t||n)(I(kr,2),I(Ra,2))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const h1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class _Re{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=ap(this.action),i=function(n){return h1(n.getHours(),2)+":"+h1(n.getMinutes(),2)+":"+h1(n.getSeconds(),2)+"."+h1(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class yRe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const Jq=new _e("NGXS_LOGGER_PLUGIN_OPTIONS");let vRe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new yRe(this._options),this._store=this._store||this._injector.get(ph);const s=new _Re(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Di(o=>{s.completed(o)}),Sa(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(I(Jq),I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const e9=new _e("LOGGER_USER_OPTIONS");function bRe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let CRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:jR,useClass:vRe,multi:!0},{provide:e9,useValue:t},{provide:Jq,useFactory:bRe,deps:[e9]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const SF=new _e("NGXS_STORAGE_PLUGIN_OPTION"),t9=new _e("STORAGE_ENGINE"),MF="@@STATE",n9="NGXS_OPTIONS_META";function wRe(n){return Array.isArray(n)||(n=[n]),n.map(e=>(e.hasOwnProperty(n9)&&(e=e[n9].name),e instanceof class{constructor(e){this.name=e,(function(n){return n.hasOwnProperty(UR)||Object.defineProperty(n,UR,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),qR(n)}(this)).makeRootSelector=i=>i.getStateGetter(this.name)}getName(){return this.name}toString(){return`StateToken[${this.name}]`}}?e.getName():e))}function ERe(n){return void 0!==n&&n.key&&(n.key=wRe(n.key)),Object.assign({key:[MF],storage:0,serialize:JSON.stringify,deserialize:JSON.parse,beforeSerialize:e=>e,afterDeserialize:e=>e},n)}function SRe(n,e){return wD(e)?null:0===n.storage?localStorage:1===n.storage?sessionStorage:null}let MRe=(()=>{class n{constructor(t,i,r){this._options=t,this._engine=i,this._platformId=r}handle(t,i,r){if(wD(this._platformId)&&null===this._engine)return r(t,i);const s=this._options.key,o=function(n){const e=ap(n);return function(t){return e===ap(t)}}(i),a=o(c$)||o(u$);let l=!1;if(a)for(const c of s){const d=c===MF;let f=this._engine.getItem(c);if("undefined"!==f&&null!=f){try{const p=this._options.deserialize(f);f=this._options.afterDeserialize(p,c)}catch(p){console.error("Error ocurred while deserializing the store value, falling back to empty object."),f={}}this._options.migrations&&this._options.migrations.forEach(p=>{p.version===Vm(f,p.versionKey||"version")&&(!p.key&&d||p.key===c)&&(f=p.migrate(f),l=!0)}),t=d?Object.assign({},t,f):zR(t,c,f)}}return r(t,i).pipe(Di(c=>{if(!a||a&&l)for(const d of s){let f=c;d!==MF&&(f=Vm(c,d));try{const p=this._options.beforeSerialize(f,d);this._engine.setItem(d,this._options.serialize(p))}catch(p){console.error("Error ocurred while serializing the store value, value not updated.")}}}))}}return n.\u0275fac=function(t){return new(t||n)(I(SF),I(t9),I(cl))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const i9=new _e("USER_OPTIONS");let xRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:jR,useClass:MRe,multi:!0},{provide:i9,useValue:t},{provide:SF,useFactory:ERe,deps:[i9]},{provide:t9,useFactory:SRe,deps:[SF,cl]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const r9=[{name:"logo",namespace:"app",url:"assets/icons/logo-rui.svg"},{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.svg"},{name:"bone-marrow",namespace:"app",url:"assets/icons/organs/ico-organs-bone-marrow.svg"},{name:"brain",namespace:"app",url:"assets/icons/organs/ico-organs-brain.svg"},{name:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.svg"},{name:"heart",namespace:"app",url:"assets/icons/organs/ico-organs-heart.svg"},{name:"kidney-left",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-left.svg"},{name:"kidney-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.svg"},{name:"large-intestine",namespace:"app",url:"assets/icons/organs/ico-organs-large-intestine.svg"},{name:"liver",namespace:"app",url:"assets/icons/organs/ico-organs-liver.svg"},{name:"lung-left",namespace:"app",url:"assets/icons/organs/ico-organs-lung-left.svg"},{name:"lung-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.svg"},{name:"skin",namespace:"app",url:"assets/icons/organs/ico-organs-skin.svg"},{name:"small-intestine",namespace:"app",url:"assets/icons/organs/ico-organs-small intestine.svg"},{name:"spleen",namespace:"app",url:"assets/icons/organs/ico-organs-spleen.svg"},{name:"stomach",namespace:"app",url:"assets/icons/organs/ico-organs-stomach.svg"},{name:"thymus",namespace:"app",url:"assets/icons/organs/ico-organs-thymus.svg"},{name:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.svg"},{name:"opacity",namespace:"app",url:"assets/icons/opacity-24px.svg"},{name:"visibility_on",namespace:"app",url:"assets/icons/visibility-on-24px.svg"},{name:"visibility_off",namespace:"app",url:"assets/icons/visibility-off-24px.svg"},{name:"visibility_off_cube",namespace:"app",url:"assets/icons/ico-cube.svg"}];let ld=class extends rTe{constructor(e,t,i){super(),this.registry=e,this.sanitizer=t,this.globalConfig=i}ngxsOnInit(){var e;r9.filter(t=>void 0!==t.html).map(t=>Object.assign(Object.assign({},t),{html:this.sanitizer.bypassSecurityTrustHtml(t.html)})).forEach(t=>this.registerIconImpl(t)),null===(e=this.registry)||void 0===e||e.addSvgIconResolver((t,i)=>{var r;const s=r9.find(a=>{var l,c;return(null!==(l=a.name)&&void 0!==l?l:"")===t&&(null!==(c=a.namespace)&&void 0!==c?c:"")===i});if(void 0===s||void 0===s.url)return null;const o=null!==(r=this.globalConfig.snapshot.baseHref)&&void 0!==r?r:"";return this.sanitizer.bypassSecurityTrustResourceUrl(o+s.url)})}registerIcon(e){return this.registerIconImpl(e)}registerIconImpl(e){if(!this.registry||!e.url&&!e.html)return!1;const t=this.registry,r=t[this.getMethodName(e)],s=this.getArguments(e);if(!r)return!1;try{return r.apply(t,s),!0}catch(o){return!1}}getMethodName({name:e,namespace:t,url:i}){const r=["addSvgIcon"];return e||r.push("Set"),i||r.push("Literal"),t&&r.push("InNamespace"),r.join("")}getArguments({name:e,namespace:t,url:i,html:r}){return[t,e,null!=i?i:r].filter(o=>!!o)}};ld.\u0275fac=function(e){return new(e||ld)(I(jv,8),I(Kd),I(Eh))},ld.\u0275prov=ae({token:ld,factory:ld.\u0275fac}),De([Xt()],ld.prototype,"registerIcon",null),ld=De([Ch(),gh({name:"iconRegistry"})],ld);const TRe=[Eh,ld,Ui,si,Io,dc,wr,ss];let ARe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[pRe.forRoot(),ia.forRoot(TRe,{developmentMode:!Sh.production}),xRe.forRoot({key:["registration.registrations"]}),CRe.forRoot({disabled:Sh.production})]]}),n})(),DRe=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[nU,DDe.forRoot({gaToken:Sh.googleAnalyticsToken,appName:"rui"}),dOe,hRe,ARe,fRe]]}),n})(),xF=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,vq]]}),n})(),ORe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,KPe,Lq,Pr,EF,xF,uc]]}),n})(),IRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr]]}),n})(),PRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,ORe,Pr,jDe,IRe,ec,PDe]]}),n})(),RRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,uc]]}),n})(),kRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})(),FRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Lq]]}),n})(),s9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,vq,$b,yk,vk,uc]]}),n})(),NRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,ec,lq]]}),n})(),o9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,Iq]]}),n})(),LRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf]]}),n})(),BRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Ok,Pr,uc,EF,kRe,xF,s9,o9,FRe,lq,NRe,o9,LRe]]}),n})(),VRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf,uc,s9,xF,aq]]}),n})(),jRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,VRe]]}),n})(),URe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,$b,Pr,ec,uc]]}),n})(),zRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,SG,ec,uc]]}),n})(),HRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,$b,Pr,ec,uc,aOe]]}),n})(),$Re=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Iq,Pr]]}),n})(),GRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,yk,vk,Gf,TPe,Lv,Pr,$b]]}),n})(),WRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,Gf]]}),n})(),qRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,WRe,Gf,uc]]}),n})(),YRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Ok,EF,Pr,bO,uc,URe,qRe,zRe,HRe,$Re,GRe,sOe]]}),n})(),XRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:Cq,useValue:bq}],imports:[[dE,bO,Pr]]}),n})(),KRe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ol).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new Ote(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends Pte{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(cRe,{injector:this.injector});customElements.define("ccf-rui",t)}}return n.\u0275fac=function(t){return new(t||n)(I(Tt))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:mq,useValue:"light-theme"},{provide:zj,useValue:{appearance:"standard",floatLabel:!1,hideRequiredMarker:!0}}],imports:[[dE,bO,DRe,Pr,XRe,RRe,PRe,BRe,YRe,aq,jRe,gOe,UU]]}),n})();Sh.production&&function(){if(DB)throw new Error("Cannot enable prod mode after platform setup.");AB=!1}(),Jee().bootstrapModule(KRe).catch(n=>console.error(n))},948:pt=>{pt.exports=function(Ve){return Ve&&Ve.__esModule?Ve:{default:Ve}},pt.exports.default=pt.exports,pt.exports.__esModule=!0},321:pt=>{function We(Ve){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(pt.exports=We=function(k){return typeof k},pt.exports.default=pt.exports,pt.exports.__esModule=!0):(pt.exports=We=function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},pt.exports.default=pt.exports,pt.exports.__esModule=!0),We(Ve)}pt.exports=We,pt.exports.default=pt.exports,pt.exports.__esModule=!0},833:pt=>{function We(Ve){return Promise.resolve().then(()=>{var _t=new Error("Cannot find module '"+Ve+"'");throw _t.code="MODULE_NOT_FOUND",_t})}We.keys=()=>[],We.resolve=We,We.id=833,pt.exports=We},521:()=>{},125:()=>{},307:()=>{}},pt=>{pt(pt.s=473)}]); \ No newline at end of file diff --git a/rui/wc.js b/rui/wc.js index 3a1d05a95..76ed370c4 100644 --- a/rui/wc.js +++ b/rui/wc.js @@ -2,4 +2,4 @@ (self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[429],{138:()=>{!function(){"use strict";!function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const G=HTMLElement;window.HTMLElement=function(){return Reflect.construct(G,[],this.constructor)},HTMLElement.prototype=G.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,G)}()}()},142:()=>{!function(G,ne){"use strict";function he(){var e=Ge.splice(0,Ge.length);for(V=0;e.length;)e.shift().call(null,e.shift())}function ye(e,r){for(var i=0,h=e.length;i1)&&tt(this)}}}),x(o,Ee,{value:function(p){-1>0,me="__"+se+dt,be="addEventListener",Le="attached",ce="Callback",pe="detached",te="extends",Ee="attributeChanged"+ce,vt=Le+ce,rt="connected"+ce,mt="disconnected"+ce,qe="created"+ce,kt=pe+ce,ot="ADDITION",pt="REMOVAL",He="DOMAttrModified",bt="DOMContentLoaded",Et="DOMSubtreeModified",Xe="<",st="=",Mt=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,wt=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],Ne=[],Ye=[],le="",De=A.documentElement,Te=Ne.indexOf||function(e){for(var r=this.length;r--&&this[r]!==e;);return r},it=re.prototype,Pe=it.hasOwnProperty,at=it.isPrototypeOf,Re=re.defineProperty,Oe=[],Ke=re.getOwnPropertyDescriptor,Y=re.getOwnPropertyNames,Ct=re.getPrototypeOf,$e=re.setPrototypeOf,Se=!!re.__proto__,Je="__dreCEv1",Me=G.customElements,t=!/^force/.test(ne.type)&&!!(Me&&Me.define&&Me.get&&Me.whenDefined),a=re.create||re,u=G.Map||function(){var e,r=[],i=[];return{get:function(h){return i[Te.call(r,h)]},set:function(h,s){(e=Te.call(r,h))<0?i[r.push(h)-1]=s:i[e]=s}}},c=G.Promise||function(e){function r(o){for(h=!0;i.length;)i.shift()(o)}var i=[],h=!1,s={catch:function(){return s},then:function(o){return i.push(o),h&&setTimeout(r,1),s}};return e(r),s},f=!1,m=a(null),E=a(null),v=new u,C=function(e){return e.toLowerCase()},w=re.create||function e(r){return r?(e.prototype=r,new e):this},b=$e||(Se?function(e,r){return e.__proto__=r,e}:Y&&Ke?function(){function e(r,i){for(var h,s=Y(i),o=0,l=s.length;o
    ",new N(function(e,r){if(e[0]&&"childList"==e[0].type&&!e[0].removedNodes[0].childNodes.length){var i=(Ce=Ke(P,"innerHTML"))&&Ce.set;i&&Re(P,"innerHTML",{set:function(h){for(;this.lastChild;)this.removeChild(this.lastChild);i.call(this,h)}})}r.disconnect(),Ce=null}).observe(Ce,{childList:!0,subtree:!0}),Ce.innerHTML=""),ue||($e||Se?(we=function(e,r){at.call(r,e)||Be(e,r)},ae=Be):ae=we=function(e,r){e[me]||(e[me]=re(!0),Be(e,r))},z?(I=!1,e=Ke(P,be),r=e.value,i=function(o){var l=new CustomEvent(He,{bubbles:!0});l.attrName=o,l.prevValue=R.call(this,o),l.newValue=null,l[pt]=l.attrChange=2,F.call(this,o),K.call(this,l)},h=function(o,l){var d=Q.call(this,o),p=d&&R.call(this,o),y=new CustomEvent(He,{bubbles:!0});$.call(this,o,l),y.attrName=o,y.prevValue=d?p:null,y.newValue=l,d?y.MODIFICATION=y.attrChange=1:y[ot]=y.attrChange=0,K.call(this,y)},s=function(o){var l,d=o.currentTarget,p=d[me],y=o.propertyName;p.hasOwnProperty(y)&&(p=p[y],(l=new CustomEvent(He,{bubbles:!0})).attrName=p.name,l.prevValue=p.value||null,l.newValue=p.value=d[y]||null,null==l.prevValue?l[ot]=l.attrChange=0:l.MODIFICATION=l.attrChange=1,K.call(d,l))},e.value=function(o,l,d){o===He&&this[Ee]&&this.setAttribute!==h&&(this[me]={className:{name:"class",value:this.className}},this.setAttribute=h,this.removeAttribute=i,r.call(this,"propertychange",s)),r.call(this,o,l,d)},Re(P,be,e)):N||(De[be](He,_e),De.setAttribute(me,1),De.removeAttribute(me),I&&(xe=function(e){var r,i,h,s=this;if(s===e.target){for(h in r=s[me],s[me]=i=nt(s),i){if(!(h in r))return ze(0,s,h,r[h],i[h],ot);if(i[h]!==r[h])return ze(1,s,h,r[h],i[h],"MODIFICATION")}for(h in r)if(!(h in i))return ze(2,s,h,r[h],i[h],pt)}},ze=function(e,r,i,h,s,o){var l={attrChange:e,currentTarget:r,attrName:i,prevValue:h,newValue:s};l[o]=e,Ue(l)},nt=function(e){for(var r,i,h={},s=e.attributes,o=0,l=s.length;o$");if(r[te]="a",(e.prototype=w(S.prototype)).constructor=e,G.customElements.define(i,e,r),!h.test(A.createElement("a",{is:i}).outerHTML)||!h.test((new e).outerHTML))throw r}(function e(){return Reflect.construct(S,[],e)},{},"document-register-element-a"+dt)}catch(e){ft()}if(!ne.noBuiltIn)try{if(O.call(A,"a","a").outerHTML.indexOf("is")<0)throw{}}catch(e){C=function(r){return{is:r.toLowerCase()}}}}(window)},277:()=>{"use strict";!function(t){const a=t.performance;function u(I){a&&a.mark&&a.mark(I)}function c(I,k){a&&a.measure&&a.measure(I,k)}u("Zone");const f=t.__Zone_symbol_prefix||"__zone_symbol__";function m(I){return f+I}const E=!0===t[m("forceDuplicateZoneCheck")];if(t.Zone){if(E||"function"!=typeof t.Zone.__symbol__)throw new Error("Zone already loaded.");return t.Zone}let v=(()=>{class I{constructor(n,e){this._parent=n,this._name=e?e.name||"unnamed":"",this._properties=e&&e.properties||{},this._zoneDelegate=new w(this,this._parent&&this._parent._zoneDelegate,e)}static assertZonePatched(){if(t.Promise!==oe.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let n=I.current;for(;n.parent;)n=n.parent;return n}static get current(){return V.zone}static get currentTask(){return ue}static __load_patch(n,e,r=!1){if(oe.hasOwnProperty(n)){if(!r&&E)throw Error("Already loaded patch: "+n)}else if(!t["__Zone_disable_"+n]){const i="Zone:"+n;u(i),oe[n]=e(t,I,_e),c(i,i)}}get parent(){return this._parent}get name(){return this._name}get(n){const e=this.getZoneWith(n);if(e)return e._properties[n]}getZoneWith(n){let e=this;for(;e;){if(e._properties.hasOwnProperty(n))return e;e=e._parent}return null}fork(n){if(!n)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,n)}wrap(n,e){if("function"!=typeof n)throw new Error("Expecting function got: "+n);const r=this._zoneDelegate.intercept(this,n,e),i=this;return function(){return i.runGuarded(r,this,arguments,e)}}run(n,e,r,i){V={parent:V,zone:this};try{return this._zoneDelegate.invoke(this,n,e,r,i)}finally{V=V.parent}}runGuarded(n,e=null,r,i){V={parent:V,zone:this};try{try{return this._zoneDelegate.invoke(this,n,e,r,i)}catch(h){if(this._zoneDelegate.handleError(this,h))throw h}}finally{V=V.parent}}runTask(n,e,r){if(n.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(n.zone||W).name+"; Execution: "+this.name+")");if(n.state===B&&(n.type===H||n.type===j))return;const i=n.state!=Q;i&&n._transitionTo(Q,R),n.runCount++;const h=ue;ue=n,V={parent:V,zone:this};try{n.type==j&&n.data&&!n.data.isPeriodic&&(n.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,n,e,r)}catch(s){if(this._zoneDelegate.handleError(this,s))throw s}}finally{n.state!==B&&n.state!==$&&(n.type==H||n.data&&n.data.isPeriodic?i&&n._transitionTo(R,Q):(n.runCount=0,this._updateTaskCount(n,-1),i&&n._transitionTo(B,Q,B))),V=V.parent,ue=h}}scheduleTask(n){if(n.zone&&n.zone!==this){let r=this;for(;r;){if(r===n.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${n.zone.name}`);r=r.parent}}n._transitionTo(K,B);const e=[];n._zoneDelegates=e,n._zone=this;try{n=this._zoneDelegate.scheduleTask(this,n)}catch(r){throw n._transitionTo($,K,B),this._zoneDelegate.handleError(this,r),r}return n._zoneDelegates===e&&this._updateTaskCount(n,1),n.state==K&&n._transitionTo(R,K),n}scheduleMicroTask(n,e,r,i){return this.scheduleTask(new b(O,n,e,r,i,void 0))}scheduleMacroTask(n,e,r,i,h){return this.scheduleTask(new b(j,n,e,r,i,h))}scheduleEventTask(n,e,r,i,h){return this.scheduleTask(new b(H,n,e,r,i,h))}cancelTask(n){if(n.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(n.zone||W).name+"; Execution: "+this.name+")");n._transitionTo(F,R,Q);try{this._zoneDelegate.cancelTask(this,n)}catch(e){throw n._transitionTo($,F),this._zoneDelegate.handleError(this,e),e}return this._updateTaskCount(n,-1),n._transitionTo(B,F),n.runCount=0,n}_updateTaskCount(n,e){const r=n._zoneDelegates;-1==e&&(n._zoneDelegates=null);for(let i=0;iI.hasTask(n,e),onScheduleTask:(I,k,n,e)=>I.scheduleTask(n,e),onInvokeTask:(I,k,n,e,r,i)=>I.invokeTask(n,e,r,i),onCancelTask:(I,k,n,e)=>I.cancelTask(n,e)};class w{constructor(k,n,e){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=k,this._parentDelegate=n,this._forkZS=e&&(e&&e.onFork?e:n._forkZS),this._forkDlgt=e&&(e.onFork?n:n._forkDlgt),this._forkCurrZone=e&&(e.onFork?this.zone:n._forkCurrZone),this._interceptZS=e&&(e.onIntercept?e:n._interceptZS),this._interceptDlgt=e&&(e.onIntercept?n:n._interceptDlgt),this._interceptCurrZone=e&&(e.onIntercept?this.zone:n._interceptCurrZone),this._invokeZS=e&&(e.onInvoke?e:n._invokeZS),this._invokeDlgt=e&&(e.onInvoke?n:n._invokeDlgt),this._invokeCurrZone=e&&(e.onInvoke?this.zone:n._invokeCurrZone),this._handleErrorZS=e&&(e.onHandleError?e:n._handleErrorZS),this._handleErrorDlgt=e&&(e.onHandleError?n:n._handleErrorDlgt),this._handleErrorCurrZone=e&&(e.onHandleError?this.zone:n._handleErrorCurrZone),this._scheduleTaskZS=e&&(e.onScheduleTask?e:n._scheduleTaskZS),this._scheduleTaskDlgt=e&&(e.onScheduleTask?n:n._scheduleTaskDlgt),this._scheduleTaskCurrZone=e&&(e.onScheduleTask?this.zone:n._scheduleTaskCurrZone),this._invokeTaskZS=e&&(e.onInvokeTask?e:n._invokeTaskZS),this._invokeTaskDlgt=e&&(e.onInvokeTask?n:n._invokeTaskDlgt),this._invokeTaskCurrZone=e&&(e.onInvokeTask?this.zone:n._invokeTaskCurrZone),this._cancelTaskZS=e&&(e.onCancelTask?e:n._cancelTaskZS),this._cancelTaskDlgt=e&&(e.onCancelTask?n:n._cancelTaskDlgt),this._cancelTaskCurrZone=e&&(e.onCancelTask?this.zone:n._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const r=e&&e.onHasTask;(r||n&&n._hasTaskZS)&&(this._hasTaskZS=r?e:C,this._hasTaskDlgt=n,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=k,e.onScheduleTask||(this._scheduleTaskZS=C,this._scheduleTaskDlgt=n,this._scheduleTaskCurrZone=this.zone),e.onInvokeTask||(this._invokeTaskZS=C,this._invokeTaskDlgt=n,this._invokeTaskCurrZone=this.zone),e.onCancelTask||(this._cancelTaskZS=C,this._cancelTaskDlgt=n,this._cancelTaskCurrZone=this.zone))}fork(k,n){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,k,n):new v(k,n)}intercept(k,n,e){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,k,n,e):n}invoke(k,n,e,r,i){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,k,n,e,r,i):n.apply(e,r)}handleError(k,n){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,k,n)}scheduleTask(k,n){let e=n;if(this._scheduleTaskZS)this._hasTaskZS&&e._zoneDelegates.push(this._hasTaskDlgtOwner),e=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,k,n),e||(e=n);else if(n.scheduleFn)n.scheduleFn(n);else{if(n.type!=O)throw new Error("Task is missing scheduleFn.");T(n)}return e}invokeTask(k,n,e,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,k,n,e,r):n.callback.apply(e,r)}cancelTask(k,n){let e;if(this._cancelTaskZS)e=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,k,n);else{if(!n.cancelFn)throw Error("Task is not cancelable");e=n.cancelFn(n)}return e}hasTask(k,n){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,k,n)}catch(e){this.handleError(k,e)}}_updateTaskCount(k,n){const e=this._taskCounts,r=e[k],i=e[k]=r+n;if(i<0)throw new Error("More tasks executed then were scheduled.");0!=r&&0!=i||this.hasTask(this.zone,{microTask:e.microTask>0,macroTask:e.macroTask>0,eventTask:e.eventTask>0,change:k})}}class b{constructor(k,n,e,r,i,h){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=k,this.source=n,this.data=r,this.scheduleFn=i,this.cancelFn=h,!e)throw new Error("callback is not defined");this.callback=e;const s=this;this.invoke=k===H&&r&&r.useG?b.invokeTask:function(){return b.invokeTask.call(t,s,this,arguments)}}static invokeTask(k,n,e){k||(k=this),fe++;try{return k.runCount++,k.zone.runTask(k,n,e)}finally{1==fe&&Z(),fe--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(B,K)}_transitionTo(k,n,e){if(this._state!==n&&this._state!==e)throw new Error(`${this.type} '${this.source}': can not transition to '${k}', expecting state '${n}'${e?" or '"+e+"'":""}, was '${this._state}'.`);this._state=k,k==B&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const N=m("setTimeout"),S=m("Promise"),P=m("then");let L,z=[],x=!1;function T(I){if(0===fe&&0===z.length)if(L||t[S]&&(L=t[S].resolve(0)),L){let k=L[P];k||(k=L.then),k.call(L,Z)}else t[N](Z,0);I&&z.push(I)}function Z(){if(!x){for(x=!0;z.length;){const I=z;z=[];for(let k=0;kV,onUnhandledError:X,microtaskDrainDone:X,scheduleMicroTask:T,showUncaughtError:()=>!v[m("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:X,patchMethod:()=>X,bindArguments:()=>[],patchThen:()=>X,patchMacroTask:()=>X,patchEventPrototype:()=>X,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>X,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>X,wrapWithCurrentZone:()=>X,filterProperties:()=>[],attachOriginToPatched:()=>X,_redefineProperty:()=>X,patchCallbacks:()=>X};let V={parent:null,zone:new v(null,null)},ue=null,fe=0;function X(){}c("Zone","Zone"),t.Zone=v}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global);const ne=Object.getOwnPropertyDescriptor,he=Object.defineProperty,ye=Object.getPrototypeOf,_t=Object.create,Ve=Array.prototype.slice,Ie="addEventListener",Ze="removeEventListener",Ue=Zone.__symbol__(Ie),et=Zone.__symbol__(Ze),de="true",ve="false",Ae=Zone.__symbol__("");function Be(t,a){return Zone.current.wrap(t,a)}function lt(t,a,u,c,f){return Zone.current.scheduleMacroTask(t,a,u,c,f)}const U=Zone.__symbol__,je="undefined"!=typeof window,ke=je?window:void 0,J=je&&ke||"object"==typeof self&&self||global,yt=[null];function tt(t,a){for(let u=t.length-1;u>=0;u--)"function"==typeof t[u]&&(t[u]=Be(t[u],a+"_"+u));return t}function ft(t){return!t||!1!==t.writable&&!("function"==typeof t.get&&void 0===t.set)}const A="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,re=!("nw"in J)&&void 0!==J.process&&"[object process]"==={}.toString.call(J.process),ht=!re&&!A&&!(!je||!ke.HTMLElement),Ge=void 0!==J.process&&"[object process]"==={}.toString.call(J.process)&&!A&&!(!je||!ke.HTMLElement),xe={},ze=function(t){if(!(t=t||J.event))return;let a=xe[t.type];a||(a=xe[t.type]=U("ON_PROPERTY"+t.type));const u=this||t.target||J,c=u[a];let f;if(ht&&u===ke&&"error"===t.type){const m=t;f=c&&c.call(this,m.message,m.filename,m.lineno,m.colno,m.error),!0===f&&t.preventDefault()}else f=c&&c.apply(this,arguments),null!=f&&!f&&t.preventDefault();return f};function nt(t,a,u){let c=ne(t,a);if(!c&&u&&ne(u,a)&&(c={enumerable:!0,configurable:!0}),!c||!c.configurable)return;const f=U("on"+a+"patched");if(t.hasOwnProperty(f)&&t[f])return;delete c.writable,delete c.value;const m=c.get,E=c.set,v=a.substr(2);let C=xe[v];C||(C=xe[v]=U("ON_PROPERTY"+v)),c.set=function(w){let b=this;!b&&t===J&&(b=J),b&&(b[C]&&b.removeEventListener(v,ze),E&&E.apply(b,yt),"function"==typeof w?(b[C]=w,b.addEventListener(v,ze,!1)):b[C]=null)},c.get=function(){let w=this;if(!w&&t===J&&(w=J),!w)return null;const b=w[C];if(b)return b;if(m){let N=m&&m.call(this);if(N)return c.set.call(this,N),"function"==typeof w.removeAttribute&&w.removeAttribute(a),N}return null},he(t,a,c),t[f]=!0}function We(t,a,u){if(a)for(let c=0;cfunction(E,v){const C=u(E,v);return C.cbIdx>=0&&"function"==typeof v[C.cbIdx]?lt(C.name,v[C.cbIdx],C,f):m.apply(E,v)})}function se(t,a){t[U("OriginalDelegate")]=a}let dt=!1,me=!1;function Le(){if(dt)return me;dt=!0;try{const t=ke.navigator.userAgent;(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/")||-1!==t.indexOf("Edge/"))&&(me=!0)}catch(t){}return me}Zone.__load_patch("ZoneAwarePromise",(t,a,u)=>{const c=Object.getOwnPropertyDescriptor,f=Object.defineProperty,E=u.symbol,v=[],C=!0===t[E("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],w=E("Promise"),b=E("then");u.onUnhandledError=s=>{if(u.showUncaughtError()){const o=s&&s.rejection;o?console.error("Unhandled Promise rejection:",o instanceof Error?o.message:o,"; Zone:",s.zone.name,"; Task:",s.task&&s.task.source,"; Value:",o,o instanceof Error?o.stack:void 0):console.error(s)}},u.microtaskDrainDone=()=>{for(;v.length;){const s=v.shift();try{s.zone.runGuarded(()=>{throw s.throwOriginal?s.rejection:s})}catch(o){P(o)}}};const S=E("unhandledPromiseRejectionHandler");function P(s){u.onUnhandledError(s);try{const o=a[S];"function"==typeof o&&o.call(this,s)}catch(o){}}function z(s){return s&&s.then}function x(s){return s}function L(s){return n.reject(s)}const T=E("state"),Z=E("value"),W=E("finally"),B=E("parentPromiseValue"),K=E("parentPromiseState"),Q=null,F=!0,$=!1;function j(s,o){return l=>{try{V(s,o,l)}catch(d){V(s,!1,d)}}}const _e=E("currentTaskTrace");function V(s,o,l){const d=function(){let s=!1;return function(l){return function(){s||(s=!0,l.apply(null,arguments))}}}();if(s===l)throw new TypeError("Promise resolved with itself");if(s[T]===Q){let p=null;try{("object"==typeof l||"function"==typeof l)&&(p=l&&l.then)}catch(y){return d(()=>{V(s,!1,y)})(),s}if(o!==$&&l instanceof n&&l.hasOwnProperty(T)&&l.hasOwnProperty(Z)&&l[T]!==Q)fe(l),V(s,l[T],l[Z]);else if(o!==$&&"function"==typeof p)try{p.call(l,d(j(s,o)),d(j(s,!1)))}catch(y){d(()=>{V(s,!1,y)})()}else{s[T]=o;const y=s[Z];if(s[Z]=l,s[W]===W&&o===F&&(s[T]=s[K],s[Z]=s[B]),o===$&&l instanceof Error){const _=a.currentTask&&a.currentTask.data&&a.currentTask.data.__creationTrace__;_&&f(l,_e,{configurable:!0,enumerable:!1,writable:!0,value:_})}for(let _=0;_{try{const g=s[Z],M=!!l&&W===l[W];M&&(l[B]=g,l[K]=y);const D=o.run(_,void 0,M&&_!==L&&_!==x?[]:[g]);V(l,!0,D)}catch(g){V(l,!1,g)}},l)}const k=function(){};class n{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(o){return V(new this(null),F,o)}static reject(o){return V(new this(null),$,o)}static race(o){let l,d,p=new this((g,M)=>{l=g,d=M});function y(g){l(g)}function _(g){d(g)}for(let g of o)z(g)||(g=this.resolve(g)),g.then(y,_);return p}static all(o){return n.allWithCallback(o)}static allSettled(o){return(this&&this.prototype instanceof n?this:n).allWithCallback(o,{thenCallback:d=>({status:"fulfilled",value:d}),errorCallback:d=>({status:"rejected",reason:d})})}static allWithCallback(o,l){let d,p,y=new this((D,q)=>{d=D,p=q}),_=2,g=0;const M=[];for(let D of o){z(D)||(D=this.resolve(D));const q=g;try{D.then(ee=>{M[q]=l?l.thenCallback(ee):ee,_--,0===_&&d(M)},ee=>{l?(M[q]=l.errorCallback(ee),_--,0===_&&d(M)):p(ee)})}catch(ee){p(ee)}_++,g++}return _-=2,0===_&&d(M),y}constructor(o){const l=this;if(!(l instanceof n))throw new Error("Must be an instanceof Promise.");l[T]=Q,l[Z]=[];try{o&&o(j(l,F),j(l,$))}catch(d){V(l,!1,d)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return n}then(o,l){let d=this.constructor[Symbol.species];(!d||"function"!=typeof d)&&(d=this.constructor||n);const p=new d(k),y=a.current;return this[T]==Q?this[Z].push(y,p,o,l):X(this,y,p,o,l),p}catch(o){return this.then(null,o)}finally(o){let l=this.constructor[Symbol.species];(!l||"function"!=typeof l)&&(l=n);const d=new l(k);d[W]=W;const p=a.current;return this[T]==Q?this[Z].push(p,d,o,o):X(this,p,d,o,o),d}}n.resolve=n.resolve,n.reject=n.reject,n.race=n.race,n.all=n.all;const e=t[w]=t.Promise;t.Promise=n;const r=E("thenPatched");function i(s){const o=s.prototype,l=c(o,"then");if(l&&(!1===l.writable||!l.configurable))return;const d=o.then;o[b]=d,s.prototype.then=function(p,y){return new n((g,M)=>{d.call(this,g,M)}).then(p,y)},s[r]=!0}return u.patchThen=i,e&&(i(e),ae(t,"fetch",s=>function(s){return function(o,l){let d=s.apply(o,l);if(d instanceof n)return d;let p=d.constructor;return p[r]||i(p),d}}(s))),Promise[a.__symbol__("uncaughtPromiseErrors")]=v,n}),Zone.__load_patch("toString",t=>{const a=Function.prototype.toString,u=U("OriginalDelegate"),c=U("Promise"),f=U("Error"),m=function(){if("function"==typeof this){const w=this[u];if(w)return"function"==typeof w?a.call(w):Object.prototype.toString.call(w);if(this===Promise){const b=t[c];if(b)return a.call(b)}if(this===Error){const b=t[f];if(b)return a.call(b)}}return a.call(this)};m[u]=a,Function.prototype.toString=m;const E=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":E.call(this)}});let ce=!1;if("undefined"!=typeof window)try{const t=Object.defineProperty({},"passive",{get:function(){ce=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){ce=!1}const pe={useG:!0},te={},Ee={},vt=new RegExp("^"+Ae+"(\\w+)(true|false)$"),rt=U("propagationStopped");function mt(t,a){const u=(a?a(t):t)+ve,c=(a?a(t):t)+de,f=Ae+u,m=Ae+c;te[t]={},te[t][ve]=f,te[t][de]=m}function qe(t,a,u){const c=u&&u.add||Ie,f=u&&u.rm||Ze,m=u&&u.listeners||"eventListeners",E=u&&u.rmAll||"removeAllListeners",v=U(c),C="."+c+":",N=function(L,T,Z){if(L.isRemoved)return;const W=L.callback;"object"==typeof W&&W.handleEvent&&(L.callback=K=>W.handleEvent(K),L.originalDelegate=W),L.invoke(L,T,[Z]);const B=L.options;B&&"object"==typeof B&&B.once&&T[f].call(T,Z.type,L.originalDelegate?L.originalDelegate:L.callback,B)},S=function(L){if(!(L=L||t.event))return;const T=this||L.target||t,Z=T[te[L.type][ve]];if(Z)if(1===Z.length)N(Z[0],T,L);else{const W=Z.slice();for(let B=0;Bfunction(f,m){f[rt]=!0,c&&c.apply(f,m)})}function pt(t,a,u,c,f){const m=Zone.__symbol__(c);if(a[m])return;const E=a[m]=a[c];a[c]=function(v,C,w){return C&&C.prototype&&f.forEach(function(b){const N=`${u}.${c}::`+b,S=C.prototype;if(S.hasOwnProperty(b)){const P=t.ObjectGetOwnPropertyDescriptor(S,b);P&&P.value?(P.value=t.wrapWithCurrentZone(P.value,N),t._redefineProperty(C.prototype,b,P)):S[b]&&(S[b]=t.wrapWithCurrentZone(S[b],N))}else S[b]&&(S[b]=t.wrapWithCurrentZone(S[b],N))}),E.call(a,v,C,w)},t.attachOriginToPatched(a[c],E)}const Et=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplayconnected","vrdisplaydisconnected","vrdisplaypresentchange"],st=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],le=["load"],De=["blur","error","focus","load","resize","scroll","messageerror"],Te=["bounce","finish","start"],it=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],Pe=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],at=["close","error","open","message"],Re=["error","message"],Oe=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","orientationchange","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","touchend","transitioncancel","transitionend","waiting","wheel"].concat(["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],["autocomplete","autocompleteerror"],["toggle"],["afterscriptexecute","beforescriptexecute","DOMContentLoaded","freeze","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange","resume"],Et,["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"]);function Ke(t,a,u){if(!u||0===u.length)return a;const c=u.filter(m=>m.target===t);if(!c||0===c.length)return a;const f=c[0].ignoreProperties;return a.filter(m=>-1===f.indexOf(m))}function Y(t,a,u,c){t&&We(t,Ke(t,a,u),c)}Zone.__load_patch("util",(t,a,u)=>{u.patchOnProperties=We,u.patchMethod=ae,u.bindArguments=tt,u.patchMacroTask=Ce;const c=a.__symbol__("BLACK_LISTED_EVENTS"),f=a.__symbol__("UNPATCHED_EVENTS");t[f]&&(t[c]=t[f]),t[c]&&(a[c]=a[f]=t[c]),u.patchEventPrototype=ot,u.patchEventTarget=qe,u.isIEOrEdge=Le,u.ObjectDefineProperty=he,u.ObjectGetOwnPropertyDescriptor=ne,u.ObjectCreate=_t,u.ArraySlice=Ve,u.patchClass=we,u.wrapWithCurrentZone=Be,u.filterProperties=Ke,u.attachOriginToPatched=se,u._redefineProperty=Object.defineProperty,u.patchCallbacks=pt,u.getGlobalObjects=()=>({globalSources:Ee,zoneSymbolEventNames:te,eventNames:Oe,isBrowser:ht,isMix:Ge,isNode:re,TRUE_STR:de,FALSE_STR:ve,ZONE_SYMBOL_PREFIX:Ae,ADD_EVENT_LISTENER_STR:Ie,REMOVE_EVENT_LISTENER_STR:Ze})});const $e=U("zoneTask");function Se(t,a,u,c){let f=null,m=null;u+=c;const E={};function v(w){const b=w.data;return b.args[0]=function(){return w.invoke.apply(this,arguments)},b.handleId=f.apply(t,b.args),w}function C(w){return m.call(t,w.data.handleId)}f=ae(t,a+=c,w=>function(b,N){if("function"==typeof N[0]){const S={isPeriodic:"Interval"===c,delay:"Timeout"===c||"Interval"===c?N[1]||0:void 0,args:N},P=N[0];N[0]=function(){try{return P.apply(this,arguments)}finally{S.isPeriodic||("number"==typeof S.handleId?delete E[S.handleId]:S.handleId&&(S.handleId[$e]=null))}};const z=lt(a,N[0],S,v,C);if(!z)return z;const x=z.data.handleId;return"number"==typeof x?E[x]=z:x&&(x[$e]=z),x&&x.ref&&x.unref&&"function"==typeof x.ref&&"function"==typeof x.unref&&(z.ref=x.ref.bind(x),z.unref=x.unref.bind(x)),"number"==typeof x||x?x:z}return w.apply(t,N)}),m=ae(t,u,w=>function(b,N){const S=N[0];let P;"number"==typeof S?P=E[S]:(P=S&&S[$e],P||(P=S)),P&&"string"==typeof P.type?"notScheduled"!==P.state&&(P.cancelFn&&P.data.isPeriodic||0===P.runCount)&&("number"==typeof S?delete E[S]:S&&(S[$e]=null),P.zone.cancelTask(P)):w.apply(t,N)})}Zone.__load_patch("legacy",t=>{const a=t[Zone.__symbol__("legacyPatch")];a&&a()}),Zone.__load_patch("queueMicrotask",(t,a,u)=>{u.patchMethod(t,"queueMicrotask",c=>function(f,m){a.current.scheduleMicroTask("queueMicrotask",m[0])})}),Zone.__load_patch("timers",t=>{const a="set",u="clear";Se(t,a,u,"Timeout"),Se(t,a,u,"Interval"),Se(t,a,u,"Immediate")}),Zone.__load_patch("requestAnimationFrame",t=>{Se(t,"request","cancel","AnimationFrame"),Se(t,"mozRequest","mozCancel","AnimationFrame"),Se(t,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",(t,a)=>{const u=["alert","prompt","confirm"];for(let c=0;cfunction(C,w){return a.current.run(m,t,w,v)})}),Zone.__load_patch("EventTarget",(t,a,u)=>{(function(t,a){a.patchEventPrototype(t,a)})(t,u),function(t,a){if(Zone[a.symbol("patchEventTarget")])return;const{eventNames:u,zoneSymbolEventNames:c,TRUE_STR:f,FALSE_STR:m,ZONE_SYMBOL_PREFIX:E}=a.getGlobalObjects();for(let C=0;C{we("MutationObserver"),we("WebKitMutationObserver")}),Zone.__load_patch("IntersectionObserver",(t,a,u)=>{we("IntersectionObserver")}),Zone.__load_patch("FileReader",(t,a,u)=>{we("FileReader")}),Zone.__load_patch("on_property",(t,a,u)=>{!function(t,a){if(re&&!Ge||Zone[t.symbol("patchEvents")])return;const u="undefined"!=typeof WebSocket,c=a.__Zone_ignore_on_properties;if(ht){const E=window,v=function(){try{const t=ke.navigator.userAgent;if(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/"))return!0}catch(t){}return!1}()?[{target:E,ignoreProperties:["error"]}]:[];Y(E,Oe.concat(["messageerror"]),c&&c.concat(v),ye(E)),Y(Document.prototype,Oe,c),void 0!==E.SVGElement&&Y(E.SVGElement.prototype,Oe,c),Y(Element.prototype,Oe,c),Y(HTMLElement.prototype,Oe,c),Y(HTMLMediaElement.prototype,st,c),Y(HTMLFrameSetElement.prototype,Et.concat(De),c),Y(HTMLBodyElement.prototype,Et.concat(De),c),Y(HTMLFrameElement.prototype,le,c),Y(HTMLIFrameElement.prototype,le,c);const C=E.HTMLMarqueeElement;C&&Y(C.prototype,Te,c);const w=E.Worker;w&&Y(w.prototype,Re,c)}const f=a.XMLHttpRequest;f&&Y(f.prototype,it,c);const m=a.XMLHttpRequestEventTarget;m&&Y(m&&m.prototype,it,c),"undefined"!=typeof IDBIndex&&(Y(IDBIndex.prototype,Pe,c),Y(IDBRequest.prototype,Pe,c),Y(IDBOpenDBRequest.prototype,Pe,c),Y(IDBDatabase.prototype,Pe,c),Y(IDBTransaction.prototype,Pe,c),Y(IDBCursor.prototype,Pe,c)),u&&Y(WebSocket.prototype,at,c)}(u,t)}),Zone.__load_patch("customElements",(t,a,u)=>{!function(t,a){const{isBrowser:u,isMix:c}=a.getGlobalObjects();(u||c)&&t.customElements&&"customElements"in t&&a.patchCallbacks(a,t.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback"])}(t,u)}),Zone.__load_patch("XHR",(t,a)=>{!function(w){const b=w.XMLHttpRequest;if(!b)return;const N=b.prototype;let P=N[Ue],z=N[et];if(!P){const O=w.XMLHttpRequestEventTarget;if(O){const j=O.prototype;P=j[Ue],z=j[et]}}const x="readystatechange",L="scheduled";function T(O){const j=O.data,H=j.target;H[m]=!1,H[v]=!1;const oe=H[f];P||(P=H[Ue],z=H[et]),oe&&z.call(H,x,oe);const _e=H[f]=()=>{if(H.readyState===H.DONE)if(!j.aborted&&H[m]&&O.state===L){const ue=H[a.__symbol__("loadfalse")];if(0!==H.status&&ue&&ue.length>0){const fe=O.invoke;O.invoke=function(){const X=H[a.__symbol__("loadfalse")];for(let I=0;Ifunction(O,j){return O[c]=0==j[2],O[E]=j[1],B.apply(O,j)}),R=U("fetchTaskAborting"),Q=U("fetchTaskScheduling"),F=ae(N,"send",()=>function(O,j){if(!0===a.current[Q]||O[c])return F.apply(O,j);{const H={target:O,url:O[E],isPeriodic:!1,args:j,aborted:!1},oe=lt("XMLHttpRequest.send",Z,H,T,W);O&&!0===O[v]&&!H.aborted&&oe.state===L&&oe.invoke()}}),$=ae(N,"abort",()=>function(O,j){const H=function(O){return O[u]}(O);if(H&&"string"==typeof H.type){if(null==H.cancelFn||H.data&&H.data.aborted)return;H.zone.cancelTask(H)}else if(!0===a.current[R])return $.apply(O,j)})}(t);const u=U("xhrTask"),c=U("xhrSync"),f=U("xhrListener"),m=U("xhrScheduled"),E=U("xhrURL"),v=U("xhrErrorBeforeScheduled")}),Zone.__load_patch("geolocation",t=>{t.navigator&&t.navigator.geolocation&&function(t,a){const u=t.constructor.name;for(let c=0;c{const C=function(){return v.apply(this,tt(arguments,u+"."+f))};return se(C,v),C})(m)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",(t,a)=>{function u(c){return function(f){kt(t,c).forEach(E=>{const v=t.PromiseRejectionEvent;if(v){const C=new v(c,{promise:f.promise,reason:f.rejection});E.invoke(C)}})}}t.PromiseRejectionEvent&&(a[U("unhandledPromiseRejectionHandler")]=u("unhandledrejection"),a[U("rejectionHandledHandler")]=u("rejectionhandled"))})},648:(G,ne,he)=>{"use strict";he(277),he(142),he(138)}},G=>{G(G.s=648)}]); /*! (C) Andrea Giammarchi - @WebReflection - ISC Style License */ !function(e,t){"use strict";function n(){var e=C.splice(0,C.length);for(We=0;e.length;)e.shift().call(null,e.shift())}function r(e,t){for(var n=0,r=e.length;n1)&&E(this)}}}),Pe(l,B,{value:function(e){-1>0,R="__"+V+P,U="addEventListener",_="attached",k="Callback",x="detached",q="extends",B="attributeChanged"+k,Z=_+k,j="connected"+k,G="disconnected"+k,z="created"+k,K=x+k,X="ADDITION",$="REMOVAL",Q="DOMAttrModified",W="DOMContentLoaded",Y="DOMSubtreeModified",J="<",ee="=",te=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,ne=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],re=[],oe=[],le="",ae=g.documentElement,ie=re.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},ue=b.prototype,ce=ue.hasOwnProperty,se=ue.isPrototypeOf,me=b.defineProperty,fe=[],de=b.getOwnPropertyDescriptor,pe=b.getOwnPropertyNames,he=b.getPrototypeOf,Te=b.setPrototypeOf,Le=!!b.__proto__,Me="__dreCEv1",Ee=e.customElements,ve=!/^force/.test(t.type)&&!!(Ee&&Ee.define&&Ee.get&&Ee.whenDefined),He=b.create||b,ge=e.Map||function(){var e,t=[],n=[];return{get:function(e){return n[ie.call(t,e)]},set:function(r,o){(e=ie.call(t,r))<0?n[t.push(r)-1]=o:n[e]=o}}},be=e.Promise||function(e){function t(e){for(r=!0;n.length;)n.shift()(e)}var n=[],r=!1,o={catch:function(){return o},then:function(e){return n.push(e),r&&setTimeout(t,1),o}};return e(t),o},ye=!1,Ce=He(null),we=He(null),Ae=new ge,Oe=function(e){return e.toLowerCase()},Ne=b.create||function e(t){return t?(e.prototype=t,new e):this},De=Te||(Le?function(e,t){return e.__proto__=t,e}:pe&&de?function(){function e(e,t){for(var n,r=pe(t),o=0,l=r.length;o
    ",new Ie(function(e,t){if(e[0]&&"childList"==e[0].type&&!e[0].removedNodes[0].childNodes.length){var n=(S=de(Se,"innerHTML"))&&S.set;n&&me(Se,"innerHTML",{set:function(e){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,e)}})}t.disconnect(),S=null}).observe(S,{childList:!0,subtree:!0}),S.innerHTML=""),Ye||(Te||Le?(I=function(e,t){se.call(t,e)||f(e,t)},F=f):F=I=function(e,t){e[R]||(e[R]=b(!0),f(e,t))},Ve?(tt=!1,function(){var e=de(Se,U),t=e.value,n=function(e){var t=new CustomEvent(Q,{bubbles:!0});t.attrName=e,t.prevValue=Be.call(this,e),t.newValue=null,t[$]=t.attrChange=2,je.call(this,e),qe.call(this,t)},r=function(e,t){var n=Ze.call(this,e),r=n&&Be.call(this,e),o=new CustomEvent(Q,{bubbles:!0});Ge.call(this,e,t),o.attrName=e,o.prevValue=n?r:null,o.newValue=t,n?o.MODIFICATION=o.attrChange=1:o[X]=o.attrChange=0,qe.call(this,o)},o=function(e){var t,n=e.currentTarget,r=n[R],o=e.propertyName;r.hasOwnProperty(o)&&(r=r[o],(t=new CustomEvent(Q,{bubbles:!0})).attrName=r.name,t.prevValue=r.value||null,t.newValue=r.value=n[o]||null,null==t.prevValue?t[X]=t.attrChange=0:t.MODIFICATION=t.attrChange=1,qe.call(n,t))};e.value=function(e,l,a){e===Q&&this[B]&&this.setAttribute!==r&&(this[R]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",o)),t.call(this,e,l,a)},me(Se,U,e)}()):Ie||(ae[U](Q,Qe),ae.setAttribute(R,1),ae.removeAttribute(R),tt&&(w=function(e){var t,n,r,o=this;if(o===e.target){for(r in t=o[R],o[R]=n=O(o),n){if(!(r in t))return A(0,o,r,t[r],n[r],X);if(n[r]!==t[r])return A(1,o,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return A(2,o,r,t[r],n[r],$)}},A=function(e,t,n,r,o,l){var a={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:o};a[l]=e,i(a)},O=function(e){for(var t,n,r={},o=e.attributes,l=0,a=o.length;l$");if(n[q]="a",(t.prototype=Ne(Fe.prototype)).constructor=t,e.customElements.define(r,t,n),!o.test(g.createElement("a",{is:r}).outerHTML)||!o.test((new t).outerHTML))throw n}(function e(){return Reflect.construct(Fe,[],e)},{},"document-register-element-a"+P)}catch(e){H()}if(!t.noBuiltIn)try{if(ze.call(g,"a","a").outerHTML.indexOf("is")<0)throw{}}catch(e){Oe=function(e){return{is:e.toLowerCase()}}}}(window); -var ZRe=Object.defineProperty,QRe=Object.defineProperties,JRe=Object.getOwnPropertyDescriptors,l9=Object.getOwnPropertySymbols,eke=Object.prototype.hasOwnProperty,tke=Object.prototype.propertyIsEnumerable,zi=Math.pow,c9=(pt,We,Ve)=>We in pt?ZRe(pt,We,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):pt[We]=Ve,J=(pt,We)=>{for(var Ve in We||(We={}))eke.call(We,Ve)&&c9(pt,Ve,We[Ve]);if(l9)for(var Ve of l9(We))tke.call(We,Ve)&&c9(pt,Ve,We[Ve]);return pt},an=(pt,We)=>QRe(pt,JRe(We));(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{517:(pt,We)=>{"use strict";var _t=(()=>{return(It=_t||(_t={})).typeOfFunction="function",It.boolTrue=!0,_t;var It})();function k(It,Pt,ft){if(!ft||typeof ft.value!==_t.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+Pt+"> is not a method!");return{configurable:_t.boolTrue,get:function(){var qt=ft.value.bind(this);return Object.defineProperty(this,Pt,{value:qt,configurable:_t.boolTrue,writable:_t.boolTrue}),qt}}}We.ak=k,We.ZP=k},266:(pt,We,Ve)=>{pt.exports={ResizeSensor:Ve(835),ElementQueries:Ve(845)}},845:function(pt,We,Ve){"use strict";var _t,k,It;"undefined"!=typeof window&&window,k=[Ve(835)],void 0!==(It="function"==typeof(_t=function(Pt){var ft=function(){var yt,dn={},En=[];function Fe(Ae){Ae||(Ae=document.documentElement);var oe=window.getComputedStyle(Ae,null).fontSize;return parseFloat(oe)||16}function $t(Ae,oe){var kt=oe.split(/\d/),Bt=kt[kt.length-1];switch(oe=parseFloat(oe),Bt){case"px":return oe;case"em":return oe*Fe(Ae);case"rem":return oe*Fe();case"vw":return oe*document.documentElement.clientWidth/100;case"vh":return oe*document.documentElement.clientHeight/100;case"vmin":case"vmax":var Gt=document.documentElement.clientWidth/100,oi=document.documentElement.clientHeight/100;return oe*(0,Math["vmin"===Bt?"min":"max"])(Gt,oi);default:return oe}}function Ne(Ae,oe){this.element=Ae;var kt,Bt,Gt,oi,Oi,we,rn,Ln,be=["min-width","min-height","max-width","max-height"];this.call=function(){for(kt in Gt=function(Ae){if(!Ae.getBoundingClientRect)return{width:Ae.offsetWidth,height:Ae.offsetHeight};var oe=Ae.getBoundingClientRect();return{width:Math.round(oe.width),height:Math.round(oe.height)}}(this.element),we={},dn[oe])!dn[oe].hasOwnProperty(kt)||(oi=$t(this.element,(Bt=dn[oe][kt]).value),Oi="width"===Bt.property?Gt.width:Gt.height,rn="","min"===Bt.mode&&Oi>=oi&&(rn+=Bt.value),"max"===Bt.mode&&Oi<=oi&&(rn+=Bt.value),we[Ln=Bt.mode+"-"+Bt.property]||(we[Ln]=""),rn&&-1===(" "+we[Ln]+" ").indexOf(" "+rn+" ")&&(we[Ln]+=" "+rn));for(var Ii in be)!be.hasOwnProperty(Ii)||(we[be[Ii]]?this.element.setAttribute(be[Ii],we[be[Ii]].substr(1)):this.element.removeAttribute(be[Ii]))}}function Ie(Ae,oe){Ae.elementQueriesSetupInformation||(Ae.elementQueriesSetupInformation=new Ne(Ae,oe)),Ae.elementQueriesSensor||(Ae.elementQueriesSensor=new Pt(Ae,function(){Ae.elementQueriesSetupInformation.call()}))}function pi(Ae,oe,kt,Bt){if(void 0===dn[Ae]){dn[Ae]=[];var Gt=En.length;yt.innerHTML+="\n"+Ae+" {animation: 0.1s element-queries;}",yt.innerHTML+="\n"+Ae+" > .resize-sensor {min-width: "+Gt+"px;}",En.push(Ae)}dn[Ae].push({mode:oe,property:kt,value:Bt})}function qe(Ae){var oe;if(document.querySelectorAll&&(oe=Ae?Ae.querySelectorAll.bind(Ae):document.querySelectorAll.bind(document)),!oe&&"undefined"!=typeof $$&&(oe=$$),!oe&&"undefined"!=typeof jQuery&&(oe=jQuery),!oe)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return oe}function Rt(Ae){var oe=[],kt=[],Bt=[],Gt=0,oi=-1,Oi=[];for(var we in Ae.children)if(Ae.children.hasOwnProperty(we)&&Ae.children[we].tagName&&"img"===Ae.children[we].tagName.toLowerCase()){oe.push(Ae.children[we]);var rn=Ae.children[we].getAttribute("min-width")||Ae.children[we].getAttribute("data-min-width"),Ln=Ae.children[we].getAttribute("data-src")||Ae.children[we].getAttribute("url");Bt.push(Ln),kt.push({minWidth:rn}),rn?Ae.children[we].style.display="none":(Gt=oe.length-1,Ae.children[we].style.display="block")}function Ii(){var Sr,Ft=!1;for(Sr in oe)!oe.hasOwnProperty(Sr)||kt[Sr].minWidth&&Ae.offsetWidth>kt[Sr].minWidth&&(Ft=Sr);if(Ft||(Ft=Gt),oi!==Ft)if(Oi[Ft])oe[oi].style.display="none",oe[Ft].style.display="block",oi=Ft;else{var os=new Image;os.onload=function(){oe[Ft].src=Bt[Ft],oe[oi].style.display="none",oe[Ft].style.display="block",Oi[Ft]=!0,oi=Ft},os.src=Bt[Ft]}else oe[Ft].src=Bt[Ft]}oi=Gt,Ae.resizeSensorInstance=new Pt(Ae,Ii),Ii()}var $n=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,Ci=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function yi(Ae){var oe,kt,Bt,Gt;for(Ae=Ae.replace(/'/g,'"');null!==(oe=$n.exec(Ae));)for(kt=oe[1]+oe[3],Bt=oe[2];null!==(Gt=Ci.exec(Bt));)pi(kt,Gt[1],Gt[2],Gt[3])}function vi(Ae){var oe="";if(Ae)if("string"==typeof Ae)(-1!==(Ae=Ae.toLowerCase()).indexOf("min-width")||-1!==Ae.indexOf("max-width"))&&yi(Ae);else for(var kt=0,Bt=Ae.length;kt img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",yt.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(yt),Er=!0);for(var oe=0,kt=document.styleSheets.length;oe=je.status}function qt(Fe){try{Fe.dispatchEvent(new MouseEvent("click"))}catch($t){var je=document.createEvent("MouseEvents");je.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),Fe.dispatchEvent(je)}}var yt="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,dn=yt.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),En=yt.saveAs||("object"!=typeof window||window!==yt?function(){}:"download"in HTMLAnchorElement.prototype&&!dn?function(Fe,je,$t){var Ne=yt.URL||yt.webkitURL,Ie=document.createElement("a");Ie.download=je=je||Fe.name||"download",Ie.rel="noopener","string"==typeof Fe?(Ie.href=Fe,Ie.origin===location.origin?qt(Ie):ft(Ie.href)?Pt(Fe,je,$t):qt(Ie,Ie.target="_blank")):(Ie.href=Ne.createObjectURL(Fe),setTimeout(function(){Ne.revokeObjectURL(Ie.href)},4e4),setTimeout(function(){qt(Ie)},0))}:"msSaveOrOpenBlob"in navigator?function(Fe,je,$t){if(je=je||Fe.name||"download","string"!=typeof Fe)navigator.msSaveOrOpenBlob(function(Fe,je){return void 0===je?je={autoBom:!1}:"object"!=typeof je&&(console.warn("Deprecated: Expected third argument to be a object"),je={autoBom:!je}),je.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(Fe.type)?new Blob(["\ufeff",Fe],{type:Fe.type}):Fe}(Fe,$t),je);else if(ft(Fe))Pt(Fe,je,$t);else{var Ne=document.createElement("a");Ne.href=Fe,Ne.target="_blank",setTimeout(function(){qt(Ne)})}}:function(Fe,je,$t,Ne){if((Ne=Ne||open("","_blank"))&&(Ne.document.title=Ne.document.body.innerText="downloading..."),"string"==typeof Fe)return Pt(Fe,je,$t);var Ie="application/octet-stream"===Fe.type,pi=/constructor/i.test(yt.HTMLElement)||yt.safari,qe=/CriOS\/[\d]+/.test(navigator.userAgent);if((qe||Ie&&pi||dn)&&"undefined"!=typeof FileReader){var Jn=new FileReader;Jn.onloadend=function(){var $n=Jn.result;$n=qe?$n:$n.replace(/^data:[^;]*;/,"data:attachment/file;"),Ne?Ne.location.href=$n:location=$n,Ne=null},Jn.readAsDataURL(Fe)}else{var Rt=yt.URL||yt.webkitURL,nn=Rt.createObjectURL(Fe);Ne?Ne.location=nn:location.href=nn,Ne=null,setTimeout(function(){Rt.revokeObjectURL(nn)},4e4)}});yt.saveAs=En.saveAs=En,pt.exports=En})?Ve.apply(We,[]):Ve)&&(pt.exports=k)},524:(pt,We,Ve)=>{var _t;!function(k,It,Pt,ft){"use strict";var qe,qt=["","webkit","Moz","MS","ms","o"],yt=It.createElement("div"),En=Math.round,Fe=Math.abs,je=Date.now;function $t(A,R,j){return setTimeout($n(A,j),R)}function Ne(A,R,j){return!!Array.isArray(A)&&(Ie(A,j[R],j),!0)}function Ie(A,R,j){var te;if(A)if(A.forEach)A.forEach(R,j);else if(A.length!==ft)for(te=0;te\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",hn=k.console&&(k.console.warn||k.console.log);return hn&&hn.call(k.console,te,Re),A.apply(this,arguments)}}qe="function"!=typeof Object.assign?function(R){if(R===ft||null===R)throw new TypeError("Cannot convert undefined or null to object");for(var j=Object(R),te=1;te-1}function kt(A){return A.trim().split(/\s+/g)}function Bt(A,R,j){if(A.indexOf&&!j)return A.indexOf(R);for(var te=0;teGr[R]}):te.sort()),te}function Oi(A,R){for(var j,te,Me=R[0].toUpperCase()+R.slice(1),Re=0;Re1&&!j.firstMultiple?j.firstMultiple=La(R):1===Me&&(j.firstMultiple=!1);var Re=j.firstInput,hn=j.firstMultiple,cr=hn?hn.center:Re.center,mr=R.center=ao(te);R.timeStamp=je(),R.deltaTime=R.timeStamp-Re.timeStamp,R.angle=lo(cr,mr),R.distance=ls(cr,mr),function(A,R){var j=R.center,te=A.offsetDelta||{},Me=A.prevDelta||{},Re=A.prevInput||{};(1===R.eventType||4===Re.eventType)&&(Me=A.prevDelta={x:Re.deltaX||0,y:Re.deltaY||0},te=A.offsetDelta={x:j.x,y:j.y}),R.deltaX=Me.x+(j.x-te.x),R.deltaY=Me.y+(j.y-te.y)}(j,R),R.offsetDirection=ki(R.deltaX,R.deltaY);var Gr=Ba(R.deltaTime,R.deltaX,R.deltaY);R.overallVelocityX=Gr.x,R.overallVelocityY=Gr.y,R.overallVelocity=Fe(Gr.x)>Fe(Gr.y)?Gr.x:Gr.y,R.scale=hn?function(A,R){return ls(R[0],R[1],Fr)/ls(A[0],A[1],Fr)}(hn.pointers,te):1,R.rotation=hn?function(A,R){return lo(R[1],R[0],Fr)+lo(A[1],A[0],Fr)}(hn.pointers,te):0,R.maxPointers=j.prevInput?R.pointers.length>j.prevInput.maxPointers?R.pointers.length:j.prevInput.maxPointers:R.pointers.length,function(A,R){var Me,Re,hn,cr,j=A.lastInterval||R,te=R.timeStamp-j.timeStamp;if(8!=R.eventType&&(te>25||j.velocity===ft)){var mr=R.deltaX-j.deltaX,Gr=R.deltaY-j.deltaY,cn=Ba(te,mr,Gr);Re=cn.x,hn=cn.y,Me=Fe(cn.x)>Fe(cn.y)?cn.x:cn.y,cr=ki(mr,Gr),A.lastInterval=R}else Me=j.velocity,Re=j.velocityX,hn=j.velocityY,cr=j.direction;R.velocity=Me,R.velocityX=Re,R.velocityY=hn,R.direction=cr}(j,R);var cn=A.element;Ae(R.srcEvent.target,cn)&&(cn=R.srcEvent.target),R.target=cn}(A,j),A.emit("hammer.input",j),A.recognize(j),A.session.prevInput=j}function La(A){for(var R=[],j=0;j=Fe(R)?A<0?2:4:R<0?8:16}function ls(A,R,j){j||(j=$r);var te=R[j[0]]-A[j[0]],Me=R[j[1]]-A[j[1]];return Math.sqrt(te*te+Me*Me)}function lo(A,R,j){return j||(j=$r),180*Math.atan2(R[j[1]]-A[j[1]],R[j[0]]-A[j[0]])/Math.PI}ei.prototype={handler:function(){},init:function(){this.evEl&&vi(this.element,this.evEl,this.domHandler),this.evTarget&&vi(this.target,this.evTarget,this.domHandler),this.evWin&&vi(Ln(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Er(this.element,this.evEl,this.domHandler),this.evTarget&&Er(this.target,this.evTarget,this.domHandler),this.evWin&&Er(Ln(this.element),this.evWin,this.domHandler)}};var lu={mousedown:1,mousemove:2,mouseup:4},cu="mousedown",uu="mousemove mouseup";function wl(){this.evEl=cu,this.evWin=uu,this.pressed=!1,ei.apply(this,arguments)}nn(wl,ei,{handler:function(R){var j=lu[R.type];1&j&&0===R.button&&(this.pressed=!0),2&j&&1!==R.which&&(j=4),this.pressed&&(4&j&&(this.pressed=!1),this.callback(this.manager,j,{pointers:[R],changedPointers:[R],pointerType:as,srcEvent:R}))}});var pc={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ud={2:os,3:"pen",4:as,5:"kinect"},du="pointerdown",Vs="pointermove pointerup pointercancel";function Ye(){this.evEl=du,this.evWin=Vs,ei.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}k.MSPointerEvent&&!k.PointerEvent&&(du="MSPointerDown",Vs="MSPointerMove MSPointerUp MSPointerCancel"),nn(Ye,ei,{handler:function(R){var j=this.store,te=!1,Me=R.type.toLowerCase().replace("ms",""),Re=pc[Me],hn=ud[R.pointerType]||R.pointerType,cr=hn==os,mr=Bt(j,R.pointerId,"pointerId");1&Re&&(0===R.button||cr)?mr<0&&(j.push(R),mr=j.length-1):12&Re&&(te=!0),!(mr<0)&&(j[mr]=R,this.callback(this.manager,Re,{pointers:j,changedPointers:[R],pointerType:hn,srcEvent:R}),te&&j.splice(mr,1))}});var hu={touchstart:1,touchmove:2,touchend:4,touchcancel:8},G="touchstart",q="touchstart touchmove touchend touchcancel";function Z(){this.evTarget=G,this.evWin=q,this.started=!1,ei.apply(this,arguments)}function T(A,R){var j=Gt(A.touches),te=Gt(A.changedTouches);return 12&R&&(j=oi(j.concat(te),"identifier",!0)),[j,te]}nn(Z,ei,{handler:function(R){var j=hu[R.type];if(1===j&&(this.started=!0),this.started){var te=T.call(this,R,j);12&j&&te[0].length-te[1].length==0&&(this.started=!1),this.callback(this.manager,j,{pointers:te[0],changedPointers:te[1],pointerType:os,srcEvent:R})}}});var D={touchstart:1,touchmove:2,touchend:4,touchcancel:8},B="touchstart touchmove touchend touchcancel";function K(){this.evTarget=B,this.targetIds={},ei.apply(this,arguments)}function H(A,R){var j=Gt(A.touches),te=this.targetIds;if(3&R&&1===j.length)return te[j[0].identifier]=!0,[j,j];var Me,Re,hn=Gt(A.changedTouches),cr=[],mr=this.target;if(Re=j.filter(function(Gr){return Ae(Gr.target,mr)}),1===R)for(Me=0;Me-1&&te.splice(Re,1)},2500)}}function Cn(A){for(var R=A.srcEvent.clientX,j=A.srcEvent.clientY,te=0;te-1&&this.requireFail.splice(R,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(A){return!!this.simultaneous[A.id]},emit:function(A){var R=this,j=this.state;function te(Me){R.manager.emit(Me,A)}j<8&&te(R.options.event+ae(j)),te(R.options.event),A.additionalEvent&&te(A.additionalEvent),j>=8&&te(R.options.event+ae(j))},tryEmit:function(A){if(this.canEmit())return this.emit(A);this.state=32},canEmit:function(){for(var A=0;AR.threshold&&Me&R.direction},attrTest:function(A){return ir.prototype.attrTest.call(this,A)&&(2&this.state||!(2&this.state)&&this.directionTest(A))},emit:function(A){this.pX=A.deltaX,this.pY=A.deltaY;var R=r_(A.direction);R&&(A.additionalEvent=this.options.event+R),this._super.emit.call(this,A)}}),nn(gu,ir,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||2&this.state)},emit:function(A){1!==A.scale&&(A.additionalEvent=this.options.event+(A.scale<1?"in":"out")),this._super.emit.call(this,A)}}),nn(Th,Va,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(A){var R=this.options,j=A.pointers.length===R.pointers,te=A.distanceR.time;if(this._input=A,!te||!j||12&A.eventType&&!Me)this.reset();else if(1&A.eventType)this.reset(),this._timer=$t(function(){this.state=8,this.tryEmit()},R.time,this);else if(4&A.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(A){8===this.state&&(A&&4&A.eventType?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=je(),this.manager.emit(this.options.event,this._input)))}}),nn(mu,ir,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||2&this.state)}}),nn(la,ir,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _c.prototype.getTouchAction.call(this)},attrTest:function(A){var j,R=this.options.direction;return 30&R?j=A.overallVelocity:6&R?j=A.overallVelocityX:24&R&&(j=A.overallVelocityY),this._super.attrTest.call(this,A)&&R&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers==this.options.pointers&&Fe(j)>this.options.velocity&&4&A.eventType},emit:function(A){var R=r_(A.offsetDirection);R&&this.manager.emit(this.options.event+R,A),this.manager.emit(this.options.event,A)}}),nn(Sl,Va,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Hi]},process:function(A){var R=this.options,j=A.pointers.length===R.pointers,te=A.distance"']/g,Vs=RegExp(ud.source),Ye=RegExp(du.source),hu=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,D=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,K=RegExp(B.source),H=/^\s+/,se=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,de=/\{\n\/\* \[wrapped with (.+)\] \*/,Be=/,? & /,Kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cn=/[()=,{}\[\]\/\s]/,jt=/\\(\\)?/g,gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zt=/\w*$/,ti=/^[-+]0x[0-9a-f]+$/i,Hi=/^0b[01]+$/i,$i=/^\[object .+?Constructor\]$/,ln=/^0o[0-7]+$/i,bi=/^(?:0|[1-9]\d*)$/,gc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,co=/($^)/,dd=/['\n\r\u2028\u2029\\]/g,El="\\ud800-\\udfff",Gi="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xn="\\u2700-\\u27bf",pu="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",ir="\\ufe0e\\ufe0f",_c="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Th="["+El+"]",mu="["+_c+"]",la="["+Gi+"]",Sl="\\d+",ja="["+xn+"]",mp="["+pu+"]",vt="[^"+El+_c+Sl+xn+pu+Ee+"]",Ml="\\ud83c[\\udffb-\\udfff]",ca="[^"+El+"]",hd="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",R="["+Ee+"]",j="\\u200d",te="(?:"+mp+"|"+vt+")",Me="(?:"+R+"|"+vt+")",Re="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",hn="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",cr="(?:"+la+"|"+Ml+")?",mr="["+ir+"]?",f1=mr+cr+"(?:"+j+"(?:"+[ca,hd,A].join("|")+")"+mr+cr+")*",fd="(?:"+[ja,hd,A].join("|")+")"+f1,gi="(?:"+[ca+la+"?",la,hd,A,Th].join("|")+")",yp=RegExp("['\u2019]","g"),s_=RegExp(la,"g"),Ah=RegExp(Ml+"(?="+Ml+")|"+gi+f1,"g"),h0=RegExp([R+"?"+mp+"+"+Re+"(?="+[mu,R,"$"].join("|")+")",Me+"+"+hn+"(?="+[mu,R+te,"$"].join("|")+")",R+"?"+te+"+"+Re,R+"+"+hn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sl,fd].join("|"),"g"),p1=RegExp("["+j+El+Gi+ir+"]"),xl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Dh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],g1=-1,Le={};Le[ao]=Le[Ba]=Le[ki]=Le[ls]=Le[lo]=Le[fc]=Le[Cl]=Le[lu]=Le[cu]=!0,Le[as]=Le[sa]=Le[bl]=Le[ai]=Le[La]=Le[ot]=Le[Pi]=Le[oa]=Le[Ri]=Le[Hr]=Le[nr]=Le[$r]=Le[Fr]=Le[ei]=Le[ci]=!1;var wi={};wi[as]=wi[sa]=wi[bl]=wi[La]=wi[ai]=wi[ot]=wi[ao]=wi[Ba]=wi[ki]=wi[ls]=wi[lo]=wi[Ri]=wi[Hr]=wi[nr]=wi[$r]=wi[Fr]=wi[ei]=wi[hc]=wi[fc]=wi[Cl]=wi[lu]=wi[cu]=!0,wi[Pi]=wi[oa]=wi[ci]=!1;var xe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},m1=parseFloat,m0=parseInt,he="object"==typeof global&&global&&global.Object===Object&&global,cs="object"==typeof self&&self&&self.Object===Object&&self,Wn=he||cs||Function("return this")(),Tl=We&&!We.nodeType&&We,ua=Tl&&pt&&!pt.nodeType&&pt,uo=ua&&ua.exports===Tl,o_=uo&&he.process,Wi=function(){try{return ua&&ua.require&&ua.require("util").types||o_&&o_.binding&&o_.binding("util")}catch(ue){}}(),Ze=Wi&&Wi.isArrayBuffer,fn=Wi&&Wi.isDate,xi=Wi&&Wi.isMap,Us=Wi&&Wi.isRegExp,yc=Wi&&Wi.isSet,Mr=Wi&&Wi.isTypedArray;function xr(W,ue,ne){switch(ne.length){case 0:return W.call(ue);case 1:return W.call(ue,ne[0]);case 2:return W.call(ue,ne[0],ne[1]);case 3:return W.call(ue,ne[0],ne[1],ne[2])}return W.apply(ue,ne)}function ur(W,ue,ne,it){for(var Et=-1,Bn=null==W?0:W.length;++Et-1}function Oh(W,ue,ne){for(var it=-1,Et=null==W?0:W.length;++it-1;);return ne}function b1(W,ue){for(var ne=W.length;ne--&&Ua(ue,W[ne],0)>-1;);return ne}function AF(W,ue){for(var ne=W.length,it=0;ne--;)W[ne]===ue&&++it;return it}var DF=Po({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),OF=Po({"&":"&","<":"<",">":">",'"':""","'":"'"});function IF(W){return"\\"+xe[W]}function Rh(W){return p1.test(W)}function y0(W){var ue=-1,ne=Array(W.size);return W.forEach(function(it,Et){ne[++ue]=[Et,it]}),ne}function C1(W,ue){return function(ne){return W(ue(ne))}}function yu(W,ue){for(var ne=-1,it=W.length,Et=0,Bn=[];++ne",""":'"',"'":"'"}),Fh=function W(ue){var u,ne=(ue=null==ue?Wn:Fh.defaults(Wn.Object(),ue,Fh.pick(Wn,Dh))).Array,it=ue.Date,Et=ue.Error,Bn=ue.Function,_r=ue.Math,di=ue.Object,f_=ue.RegExp,p_=ue.String,fa=ue.TypeError,Ti=ne.prototype,vu=di.prototype,bp=ue["__core-js_shared__"],qi=Bn.prototype.toString,hi=vu.hasOwnProperty,LF=0,Nh=(u=/[^.]+$/.exec(bp&&bp.keys&&bp.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ss=vu.toString,S1=qi.call(di),g_=Wn._,vd=f_("^"+qi.call(hi).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ds=uo?ue.Buffer:k,Dl=ue.Symbol,bd=ue.Uint8Array,C0=ds?ds.allocUnsafe:k,pa=C1(di.getPrototypeOf,di),m_=di.create,Cp=vu.propertyIsEnumerable,Ut=Ti.splice,M1=Dl?Dl.isConcatSpreadable:k,Lh=Dl?Dl.iterator:k,bu=Dl?Dl.toStringTag:k,wp=function(){try{var u=Oc(di,"defineProperty");return u({},"",{}),u}catch(h){}}(),w0=ue.clearTimeout!==Wn.clearTimeout&&ue.clearTimeout,x1=it&&it.now!==Wn.Date.now&&it.now,T1=ue.setTimeout!==Wn.setTimeout&&ue.setTimeout,Ce=_r.ceil,Sn=_r.floor,Vn=di.getOwnPropertySymbols,Tr=ds?ds.isBuffer:k,__=ue.isFinite,Bh=Ti.join,Ha=C1(di.keys,di),hr=_r.max,Nr=_r.min,BF=it.now,A1=ue.parseInt,Vh=_r.random,Ep=Ti.reverse,qr=Oc(ue,"DataView"),zs=Oc(ue,"Map"),Sp=Oc(ue,"Promise"),ga=Oc(ue,"Set"),fo=Oc(ue,"WeakMap"),jh=Oc(di,"create"),Uh=fo&&new fo,Cd={},D1=Pu(qr),y_=Pu(zs),v_=Pu(Sp),E0=Pu(ga),b_=Pu(fo),Mp=Dl?Dl.prototype:k,wd=Mp?Mp.valueOf:k,zh=Mp?Mp.toString:k;function O(u){if(Ki(u)&&!Ot(u)&&!(u instanceof pn)){if(u instanceof po)return u;if(hi.call(u,"__wrapped__"))return Xp(u)}return new po(u)}var Cu=function(){function u(){}return function(h){if(!Xi(h))return{};if(m_)return m_(h);u.prototype=h;var m=new u;return u.prototype=k,m}}();function Hh(){}function po(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=k}function pn(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ft,this.__views__=[]}function Hs(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function hs(u,h,m,b,M,P){var V,z=1&h,X=2&h,ge=4&h;if(m&&(V=M?m(u,b,M,P):m(u)),V!==k)return V;if(!Xi(u))return u;var me=Ot(u);if(me){if(V=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&hi.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!z)return xs(u,V)}else{var Se=gs(u),Ke=Se==oa||Se==Fa;if(el(u))return Bp(u,z);if(Se==nr||Se==as||Ke&&!M){if(V=X||Ke?{}:K0(u),!z)return X?function(u,h){return va(u,q0(u),h)}(u,function(u,h){return u&&va(h,As(h),u)}(V,u)):function(u,h){return va(u,z_(u),h)}(u,V1(V,u))}else{if(!wi[Se])return M?u:{};V=function(u,h,m){var b=u.constructor;switch(h){case bl:return Au(u);case ai:case ot:return new b(+u);case La:return function(u,h){var m=h?Au(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case ao:case Ba:case ki:case ls:case lo:case fc:case Cl:case lu:case cu:return L_(u,m);case Ri:return new b;case Hr:case ei:return new b(u);case $r:return function(u){var h=new u.constructor(u.source,Zt.exec(u));return h.lastIndex=u.lastIndex,h}(u);case Fr:return new b;case hc:return function(u){return wd?di(wd.call(u)):{}}(u)}}(u,Se,z)}}P||(P=new _a);var mt=P.get(u);if(mt)return mt;P.set(u,V),iT(u)?u.forEach(function(zt){V.add(hs(zt,h,m,zt,u,P))}):Jx(u)&&u.forEach(function(zt,_n){V.set(_n,hs(zt,h,m,_n,u,P))});var mn=me?k:(ge?X?j_:Fl:X?As:Qr)(u);return us(mn||u,function(zt,_n){mn&&(zt=u[_n=zt]),Ga(V,_n,hs(zt,h,m,_n,u,P))}),V}function Ip(u,h,m){var b=m.length;if(null==u)return!b;for(u=di(u);b--;){var M=m[b],V=u[M];if(V===k&&!(M in u)||!(0,h[M])(V))return!1}return!0}function Wh(u,h,m){if("function"!=typeof u)throw new fa(qt);return Jh(function(){u.apply(k,m)},h)}function wc(u,h,m,b){var M=-1,P=Al,V=!0,z=u.length,X=[],ge=h.length;if(!z)return X;m&&(h=ui(h,ko(m))),b?(P=Oh,V=!1):h.length>=200&&(P=Ph,V=!1,h=new ma(h));e:for(;++M-1},Ol.prototype.set=function(u,h){var m=this.__data__,b=Sd(m,u);return b<0?(++this.size,m.push([u,h])):m[b][1]=h,this},$a.prototype.clear=function(){this.size=0,this.__data__={hash:new Hs,map:new(zs||Ol),string:new Hs}},$a.prototype.delete=function(u){var h=ps(this,u).delete(u);return this.size-=h?1:0,h},$a.prototype.get=function(u){return ps(this,u).get(u)},$a.prototype.has=function(u){return ps(this,u).has(u)},$a.prototype.set=function(u,h){var m=ps(this,u),b=m.size;return m.set(u,h),this.size+=m.size==b?0:1,this},ma.prototype.add=ma.prototype.push=function(u){return this.__data__.set(u,dn),this},ma.prototype.has=function(u){return this.__data__.has(u)},_a.prototype.clear=function(){this.__data__=new Ol,this.size=0},_a.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},_a.prototype.get=function(u){return this.__data__.get(u)},_a.prototype.has=function(u){return this.__data__.has(u)},_a.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Ol){var b=m.__data__;if(!zs||b.length<199)return b.push([u,h]),this.size=++m.size,this;m=this.__data__=new $a(b)}return m.set(u,h),this.size=m.size,this};var Ec=Xa(qa),A_=Xa(Pp,!0);function D0(u,h){var m=!0;return Ec(u,function(b,M,P){return m=!!h(b,M,P)}),m}function qh(u,h,m){for(var b=-1,M=u.length;++b0&&m(z)?h>1?Yr(z,h-1,m,b,M):dr(M,z):b||(M[M.length]=z)}return M}var Md=B0(),xd=B0(!0);function qa(u,h){return u&&Md(u,h,Qr)}function Pp(u,h){return u&&xd(u,h,Qr)}function Yh(u,h){return da(h,function(m){return Ho(u[m])})}function Fo(u,h){for(var m=0,b=(h=Tc(h,u)).length;null!=u&&mh}function Td(u,h){return null!=u&&hi.call(u,h)}function Ad(u,h){return null!=u&&h in di(u)}function Eu(u,h,m){for(var b=m?Oh:Al,M=u[0].length,P=u.length,V=P,z=ne(P),X=1/0,ge=[];V--;){var me=u[V];V&&h&&(me=ui(me,ko(h))),X=Nr(me.length,X),z[V]=!m&&(h||M>=120&&me.length>=120)?new ma(V&&me):k}me=u[0];var Se=-1,Ke=z[0];e:for(;++Se=z?X:X*("desc"==m[b]?-1:1)}return u.index-h.index}(P,V,m)});ne--;)W[ne]=W[ne].value;return W}($1(u,function(P,V,z){return{criteria:ui(h,function(ge){return ge(P)}),index:++b,value:P}}))}function k0(u,h,m){for(var b=-1,M=h.length,P={};++b-1;)z!==u&&Ut.call(z,X,1),Ut.call(u,X,1);return u}function Kh(u,h){for(var m=u?h.length:0,b=m-1;m--;){var M=h[m];if(m==b||M!==P){var P=M;_o(M)?Ut.call(u,M,1):Mu(u,M)}}return u}function Il(u,h){return u+Sn(Vh()*(h-u+1))}function kp(u,h){var m="";if(!u||h<1||h>Ln)return m;do{h%2&&(m+=u),(h=Sn(h/2))&&(u+=u)}while(h);return m}function gn(u,h){return Yp(ox(u,h,Ds),u+"")}function W1(u){return S_(Wd(u))}function qF(u,h){var m=Wd(u);return Ld(m,wu(h,0,m.length))}function Fp(u,h,m,b){if(!Xi(u))return u;for(var M=-1,P=(h=Tc(h,u)).length,V=P-1,z=u;null!=z&&++MM?0:M+h),(m=m>M?M:m)<0&&(m+=M),M=h>m?0:m-h>>>0,h>>>=0;for(var P=ne(M);++b>>1,V=u[P];null!==V&&!$o(V)&&(m?V<=h:V=200){var ge=h?null:V_(u);if(ge)return u_(ge);V=!1,M=Ph,X=new ma}else X=h?[]:z;e:for(;++b=b?u:Kr(u,h,m)}var X1=w0||function(u){return Wn.clearTimeout(u)};function Bp(u,h){if(h)return u.slice();var m=u.length,b=C0?C0(m):new u.constructor(m);return u.copy(b),b}function Au(u){var h=new u.constructor(u.byteLength);return new bd(h).set(new bd(u)),h}function L_(u,h){var m=h?Au(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function Ac(u,h){if(u!==h){var m=u!==k,b=null===u,M=u==u,P=$o(u),V=h!==k,z=null===h,X=h==h,ge=$o(h);if(!z&&!ge&&!P&&u>h||P&&V&&X&&!z&&!ge||b&&V&&X||!m&&X||!M)return 1;if(!b&&!P&&!ge&&u1?m[M-1]:k,V=M>2?m[2]:k;for(P=u.length>3&&"function"==typeof P?(M--,P):k,V&&ms(m[0],m[1],V)&&(P=M<3?k:P,M=1),h=di(h);++b-1?M[P?h[V]:V]:k}}function Ou(u){return Ka(function(h){var m=h.length,b=m,M=po.prototype.thru;for(u&&h.reverse();b--;){var P=h[b];if("function"!=typeof P)throw new fa(qt);if(M&&!V&&"wrapper"==Gp(P))var V=new po([],!0)}for(b=V?b:m;++b1&&On.reverse(),me&&X<_n&&(On.length=X),this&&this!==Wn&&this instanceof zt&&(kc=mn||kd(kc)),kc.apply(il,On)}}function U0(u,h){return function(m,b){return function(u,h,m,b){return qa(u,function(M,P,V){h(b,m(M),P,V)}),b}(m,u,h(b),{})}}function B_(u,h){return function(m,b){var M;if(m===k&&b===k)return h;if(m!==k&&(M=m),b!==k){if(M===k)return b;"string"==typeof m||"string"==typeof b?(m=mo(m),b=mo(b)):(m=N0(m),b=N0(b)),M=u(m,b)}return M}}function jp(u){return Ka(function(h){return h=ui(h,ko(Nt())),gn(function(m){var b=this;return u(h,function(M){return xr(M,b,m)})})})}function Up(u,h){var m=(h=h===k?" ":mo(h)).length;if(m<2)return m?kp(h,u):h;var b=kp(h,Ce(u/kh(h)));return Rh(h)?Ya(za(b),0,u).join(""):b.slice(0,u)}function z0(u){return function(h,m,b){return b&&"number"!=typeof b&&ms(h,m,b)&&(m=b=k),h=tl(h),m===k?(m=h,h=0):m=tl(m),function(u,h,m,b){for(var M=-1,P=hr(Ce((h-u)/(m||1)),0),V=ne(P);P--;)V[b?P:++M]=u,u+=m;return V}(h,m,b=b===k?hz))return!1;var ge=P.get(u),me=P.get(h);if(ge&&me)return ge==h&&me==u;var Se=-1,Ke=!0,mt=2&m?new ma:k;for(P.set(u,h),P.set(h,u);++Se-1&&u%1==0&&u1?"& ":"")+h[b],h=h.join(m>2?", ":" "),u.replace(ce,"{\n/* [wrapped with "+h+"] */\n")}(b,function(u,h){return us(Mh,function(m){var b="_."+m[0];h&m[1]&&!Al(u,b)&&u.push(b)}),u.sort()}(function(u){var h=u.match(de);return h?h[1].split(Be):[]}(b),m)))}function Y_(u){var h=0,m=0;return function(){var b=BF(),M=16-(b-m);if(m=b,M>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(k,arguments)}}function Ld(u,h){var m=-1,b=u.length,M=b-1;for(h=h===k?b:h;++m1?u[h-1]:k;return m="function"==typeof m?(u.pop(),m):k,Dx(u,m)});function sy(u){var h=O(u);return h.__chain__=!0,h}function Vd(u,h){return h(u)}var oy=Ka(function(u){var h=u.length,m=h?u[0]:0,b=this.__wrapped__,M=function(P){return x_(P,u)};return!(h>1||this.__actions__.length)&&b instanceof pn&&_o(m)?((b=b.slice(m,+m+(h?1:0))).__actions__.push({func:Vd,args:[M],thisArg:k}),new po(b,this.__chain__).thru(function(P){return h&&!P.length&&P.push(k),P})):this.thru(M)}),Px=yr(function(u,h,m){hi.call(u,m)?++u[m]:Wa(u,m,1)}),Fx=j0(K_),Nx=j0(Z_);function uy(u,h){return(Ot(u)?us:Ec)(u,Nt(h,3))}function Jp(u,h){return(Ot(u)?pd:A_)(u,Nt(h,3))}var Bx=yr(function(u,h,m){hi.call(u,m)?u[m].push(h):Wa(u,m,[h])}),yC=gn(function(u,h,m){var b=-1,M="function"==typeof h,P=$s(u)?ne(u.length):[];return Ec(u,function(V){P[++b]=M?xr(h,V,m):ya(V,h,m)}),P}),vC=yr(function(u,h,m){Wa(u,m,h)});function Qa(u,h){return(Ot(u)?ui:$1)(u,Nt(h,3))}var CC=yr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),tg=gn(function(u,h){if(null==u)return[];var m=h.length;return m>1&&ms(u,h[0],h[1])?h=[]:m>2&&ms(h[0],h[1],h[2])&&(h=[h[0]]),Xh(u,Yr(h,1),[])}),Ru=x1||function(){return Wn.Date.now()};function ng(u,h,m){return h=m?k:h,kl(u,128,k,k,k,k,h=u&&null==h?u.length:h)}function hy(u,h){var m;if("function"!=typeof h)throw new fa(qt);return u=Jt(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=k),m}}var sf=gn(function(u,h,m){var b=1;if(m.length){var M=yu(m,Nd(sf));b|=32}return kl(u,b,h,m,M)}),Ud=gn(function(u,h,m){var b=3;if(m.length){var M=yu(m,Nd(Ud));b|=32}return kl(h,b,u,m,M)});function AC(u,h,m){var b,M,P,V,z,X,ge=0,me=!1,Se=!1,Ke=!0;if("function"!=typeof u)throw new fa(qt);function mt(Xn){var il=b,kc=M;return b=M=k,ge=Xn,V=u.apply(kc,il)}function Vt(Xn){return ge=Xn,z=Jh(_n,h),me?mt(Xn):V}function zt(Xn){var il=Xn-X;return X===k||il>=h||il<0||Se&&Xn-ge>=P}function _n(){var Xn=Ru();if(zt(Xn))return On(Xn);z=Jh(_n,function(Xn){var WT=h-(Xn-X);return Se?Nr(WT,P-(Xn-ge)):WT}(Xn))}function On(Xn){return z=k,Ke&&b?mt(Xn):(b=M=k,V)}function Go(){var Xn=Ru(),il=zt(Xn);if(b=arguments,M=this,X=Xn,il){if(z===k)return Vt(X);if(Se)return X1(z),z=Jh(_n,h),mt(X)}return z===k&&(z=Jh(_n,h)),V}return h=Gs(h)||0,Xi(m)&&(me=!!m.leading,P=(Se="maxWait"in m)?hr(Gs(m.maxWait)||0,h):P,Ke="trailing"in m?!!m.trailing:Ke),Go.cancel=function(){z!==k&&X1(z),ge=0,b=X=M=z=k},Go.flush=function(){return z===k?V:On(Ru())},Go}var zx=gn(function(u,h){return Wh(u,1,h)}),DC=gn(function(u,h,m){return Wh(u,Gs(h)||0,m)});function of(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new fa(qt);var m=function(){var b=arguments,M=h?h.apply(this,b):b[0],P=m.cache;if(P.has(M))return P.get(M);var V=u.apply(this,b);return m.cache=P.set(M,V)||P,V};return m.cache=new(of.Cache||$a),m}function gy(u){if("function"!=typeof u)throw new fa(qt);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}of.Cache=$a;var Hx=Y1(function(u,h){var m=(h=1==h.length&&Ot(h[0])?ui(h[0],ko(Nt())):ui(Yr(h,1),ko(Nt()))).length;return gn(function(b){for(var M=-1,P=Nr(b.length,m);++M=h}),Ja=j1(function(){return arguments}())?j1:function(u){return Ki(u)&&hi.call(u,"callee")&&!Cp.call(u,"callee")},Ot=ne.isArray,FC=Ze?ko(Ze):function(u){return Ki(u)&&Xr(u)==bl};function $s(u){return null!=u&&_y(u.length)&&!Ho(u)}function Yi(u){return Ki(u)&&$s(u)}var el=Tr||jy,NC=fn?ko(fn):function(u){return Ki(u)&&Xr(u)==ot};function Ca(u){if(!Ki(u))return!1;var h=Xr(u);return h==Pi||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!og(u)}function Ho(u){if(!Xi(u))return!1;var h=Xr(u);return h==oa||h==Fa||"[object AsyncFunction]"==h||"[object Proxy]"==h}function sg(u){return"number"==typeof u&&u==Jt(u)}function _y(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Ln}function Xi(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Ki(u){return null!=u&&"object"==typeof u}var Jx=xi?ko(xi):function(u){return Ki(u)&&gs(u)==Ri};function nT(u){return"number"==typeof u||Ki(u)&&Xr(u)==Hr}function og(u){if(!Ki(u)||Xr(u)!=nr)return!1;var h=pa(u);if(null===h)return!0;var m=hi.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&qi.call(m)==S1}var jC=Us?ko(Us):function(u){return Ki(u)&&Xr(u)==$r},iT=yc?ko(yc):function(u){return Ki(u)&&gs(u)==Fr};function vy(u){return"string"==typeof u||!Ot(u)&&Ki(u)&&Xr(u)==ei}function $o(u){return"symbol"==typeof u||Ki(u)&&Xr(u)==hc}var af=Mr?ko(Mr):function(u){return Ki(u)&&_y(u.length)&&!!Le[Xr(u)]},Ic=zp(R0),by=zp(function(u,h){return u<=h});function UC(u){if(!u)return[];if($s(u))return vy(u)?za(u):xs(u);if(Lh&&u[Lh])return function(W){for(var ue,ne=[];!(ue=W.next()).done;)ne.push(ue.value);return ne}(u[Lh]());var h=gs(u);return(h==Ri?y0:h==Fr?u_:Wd)(u)}function tl(u){return u?(u=Gs(u))===rn||u===-rn?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Jt(u){var h=tl(u),m=h%1;return h==h?m?h-m:h:0}function Cy(u){return u?wu(Jt(u),0,Ft):0}function Gs(u){if("number"==typeof u)return u;if($o(u))return NaN;if(Xi(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=Xi(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=_0(u);var m=Hi.test(u);return m||ln.test(u)?m0(u.slice(2),m?2:8):ti.test(u)?NaN:+u}function zC(u){return va(u,As(u))}function Yn(u){return null==u?"":mo(u)}var rT=Pl(function(u,h){if(qp(h)||$s(h))va(h,Qr(h),u);else for(var m in h)hi.call(h,m)&&Ga(u,m,h[m])}),sT=Pl(function(u,h){va(h,As(h),u)}),zd=Pl(function(u,h,m,b){va(h,As(h),u,b)}),oT=Pl(function(u,h,m,b){va(h,Qr(h),u,b)}),HC=Ka(x_),lT=gn(function(u,h){u=di(u);var m=-1,b=h.length,M=b>2?h[2]:k;for(M&&ms(h[0],h[1],M)&&(b=1);++m1),P}),va(u,j_(u),m),b&&(m=hs(m,7,Hp));for(var M=h.length;M--;)Mu(m,h[M]);return m}),fT=Ka(function(u,h){return null==u?{}:function(u,h){return k0(u,h,function(m,b){return ag(u,b)})}(u,h)});function KC(u,h){if(null==u)return{};var m=ui(j_(u),function(b){return[b]});return h=Nt(h),k0(u,m,function(b,M){return h(b,M[0])})}var pT=Iu(Qr),QC=Iu(As);function Wd(u){return null==u?[]:c_(u,Qr(u))}var vT=Rl(function(u,h,m){return h=h.toLowerCase(),u+(m?My(h):h)});function My(u){return ug(Yn(u).toLowerCase())}function xy(u){return(u=Yn(u))&&u.replace(gc,DF).replace(s_,"")}var CT=Rl(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),wT=Rl(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),pN=Vp("toLowerCase"),TT=Rl(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),Dy=Rl(function(u,h,m){return u+(m?" ":"")+ug(h)}),rw=Rl(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),ug=Vp("toUpperCase");function Ry(u,h,m){return u=Yn(u),(h=m?k:h)===k?function(W){return xl.test(W)}(u)?function(W){return W.match(h0)||[]}(u):function(W){return W.match(Kt)||[]}(u):u.match(h)||[]}var ky=gn(function(u,h){try{return xr(u,k,h)}catch(m){return Ca(m)?m:new Et(m)}}),sw=Ka(function(u,h){return us(h,function(m){m=on(m),Wa(u,m,sf(u[m],u))}),u});function Fy(u){return function(){return u}}var mN=Ou(),ku=Ou(!0);function Ds(u){return u}function Fu(u){return H1("function"==typeof u?u:hs(u,1))}var Ny=gn(function(u,h){return function(m){return ya(m,u,h)}}),ow=gn(function(u,h){return function(m){return ya(u,m,h)}});function Ly(u,h,m){var b=Qr(h),M=Yh(h,b);null==m&&(!Xi(h)||!M.length&&b.length)&&(m=h,h=u,u=this,M=Yh(h,Qr(h)));var P=!(Xi(m)&&"chain"in m&&!m.chain),V=Ho(u);return us(M,function(z){var X=h[z];u[z]=X,V&&(u.prototype[z]=function(){var ge=this.__chain__;if(P||ge){var me=u(this.__wrapped__),Se=me.__actions__=xs(this.__actions__);return Se.push({func:X,args:arguments,thisArg:u}),me.__chain__=ge,me}return X.apply(u,dr([this.value()],arguments))})}),u}function By(){}var kT=jp(ui),FT=jp(sn),lw=jp(ho);function Nu(u){return Vo(u)?a_(on(u)):function(u){return function(h){return Fo(h,u)}}(u)}var NT=z0(),LT=z0(!0);function Rc(){return[]}function jy(){return!1}var Tt=B_(function(u,h){return u+h},0),Uy=Fd("ceil"),yN=B_(function(u,h){return u/h},1),Bl=Fd("floor"),hw=B_(function(u,h){return u*h},1),fw=Fd("round"),pw=B_(function(u,h){return u-h},0);return O.after=function(u,h){if("function"!=typeof h)throw new fa(qt);return u=Jt(u),function(){if(--u<1)return h.apply(this,arguments)}},O.ary=ng,O.assign=rT,O.assignIn=sT,O.assignInWith=zd,O.assignWith=oT,O.at=HC,O.before=hy,O.bind=sf,O.bindAll=sw,O.bindKey=Ud,O.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Ot(u)?u:[u]},O.chain=sy,O.chunk=function(u,h,m){h=(m?ms(u,h,m):h===k)?1:hr(Jt(h),0);var b=null==u?0:u.length;if(!b||h<1)return[];for(var M=0,P=0,V=ne(Ce(b/h));MM?0:M+m),(b=b===k||b>M?M:Jt(b))<0&&(b+=M),b=m>b?0:Cy(b);m>>0)?(u=Yn(u))&&("string"==typeof h||null!=h&&!jC(h))&&!(h=mo(h))&&Rh(u)?Ya(za(u),0,m):u.split(h,m):[]},O.spread=function(u,h){if("function"!=typeof u)throw new fa(qt);return h=null==h?0:hr(Jt(h),0),gn(function(m){var b=m[h],M=Ya(m,0,h);return b&&dr(M,b),xr(u,this,M)})},O.tail=function(u){var h=null==u?0:u.length;return h?Kr(u,1,h):[]},O.take=function(u,h,m){return u&&u.length?Kr(u,0,(h=m||h===k?1:Jt(h))<0?0:h):[]},O.takeRight=function(u,h,m){var b=null==u?0:u.length;return b?Kr(u,(h=b-(h=m||h===k?1:Jt(h)))<0?0:h,b):[]},O.takeRightWhile=function(u,h){return u&&u.length?xu(u,Nt(h,3),!1,!0):[]},O.takeWhile=function(u,h){return u&&u.length?xu(u,Nt(h,3)):[]},O.tap=function(u,h){return h(u),u},O.throttle=function(u,h,m){var b=!0,M=!0;if("function"!=typeof u)throw new fa(qt);return Xi(m)&&(b="leading"in m?!!m.leading:b,M="trailing"in m?!!m.trailing:M),AC(u,h,{leading:b,maxWait:h,trailing:M})},O.thru=Vd,O.toArray=UC,O.toPairs=pT,O.toPairsIn=QC,O.toPath=function(u){return Ot(u)?ui(u,on):$o(u)?[u]:xs(eC(Yn(u)))},O.toPlainObject=zC,O.transform=function(u,h,m){var b=Ot(u),M=b||el(u)||af(u);if(h=Nt(h,4),null==m){var P=u&&u.constructor;m=M?b?new P:[]:Xi(u)&&Ho(P)?Cu(pa(u)):{}}return(M?us:qa)(u,function(V,z,X){return h(m,V,z,X)}),m},O.unary=function(u){return ng(u,1)},O.union=uC,O.unionBy=ny,O.unionWith=Qp,O.uniq=function(u){return u&&u.length?Mc(u):[]},O.uniqBy=function(u,h){return u&&u.length?Mc(u,Nt(h,2)):[]},O.uniqWith=function(u,h){return h="function"==typeof h?h:k,u&&u.length?Mc(u,k,h):[]},O.unset=function(u,h){return null==u||Mu(u,h)},O.unzip=dC,O.unzipWith=Dx,O.update=function(u,h,m){return null==u?u:Np(u,h,N_(m))},O.updateWith=function(u,h,m,b){return b="function"==typeof b?b:k,null==u?u:Np(u,h,N_(m),b)},O.values=Wd,O.valuesIn=function(u){return null==u?[]:c_(u,As(u))},O.without=hC,O.words=Ry,O.wrap=function(u,h){return ig(N_(h),u)},O.xor=iN,O.xorBy=yo,O.xorWith=iy,O.zip=ry,O.zipObject=function(u,h){return Lp(u||[],h||[],Ga)},O.zipObjectDeep=function(u,h){return Lp(u||[],h||[],Fp)},O.zipWith=rf,O.entries=pT,O.entriesIn=QC,O.extend=sT,O.extendWith=zd,Ly(O,O),O.add=Tt,O.attempt=ky,O.camelCase=vT,O.capitalize=My,O.ceil=Uy,O.clamp=function(u,h,m){return m===k&&(m=h,h=k),m!==k&&(m=(m=Gs(m))==m?m:0),h!==k&&(h=(h=Gs(h))==h?h:0),wu(Gs(u),h,m)},O.clone=function(u){return hs(u,4)},O.cloneDeep=function(u){return hs(u,5)},O.cloneDeepWith=function(u,h){return hs(u,5,h="function"==typeof h?h:k)},O.cloneWith=function(u,h){return hs(u,4,h="function"==typeof h?h:k)},O.conformsTo=function(u,h){return null==h||Ip(u,h,Qr(h))},O.deburr=xy,O.defaultTo=function(u,h){return null==u||u!=u?h:u},O.divide=yN,O.endsWith=function(u,h,m){u=Yn(u),h=mo(h);var b=u.length,M=m=m===k?b:wu(Jt(m),0,b);return(m-=h.length)>=0&&u.slice(m,M)==h},O.eq=St,O.escape=function(u){return(u=Yn(u))&&Ye.test(u)?u.replace(du,OF):u},O.escapeRegExp=function(u){return(u=Yn(u))&&K.test(u)?u.replace(B,"\\$&"):u},O.every=function(u,h,m){var b=Ot(u)?sn:D0;return m&&ms(u,h,m)&&(h=k),b(u,Nt(h,3))},O.find=Fx,O.findIndex=K_,O.findKey=function(u,h){return Ih(u,Nt(h,3),qa)},O.findLast=Nx,O.findLastIndex=Z_,O.findLastKey=function(u,h){return Ih(u,Nt(h,3),Pp)},O.floor=Bl,O.forEach=uy,O.forEachRight=Jp,O.forIn=function(u,h){return null==u?u:Md(u,Nt(h,3),As)},O.forInRight=function(u,h){return null==u?u:xd(u,Nt(h,3),As)},O.forOwn=function(u,h){return u&&qa(u,Nt(h,3))},O.forOwnRight=function(u,h){return u&&Pp(u,Nt(h,3))},O.get=uf,O.gt=Y,O.gte=kC,O.has=function(u,h){return null!=u&&X0(u,h,Td)},O.hasIn=ag,O.head=nC,O.identity=Ds,O.includes=function(u,h,m,b){u=$s(u)?u:Wd(u),m=m&&!b?Jt(m):0;var M=u.length;return m<0&&(m=hr(M+m,0)),vy(u)?m<=M&&u.indexOf(h,m)>-1:!!M&&Ua(u,h,m)>-1},O.indexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=null==m?0:Jt(m);return M<0&&(M=hr(b+M,0)),Ua(u,h,M)},O.inRange=function(u,h,m){return h=tl(h),m===k?(m=h,h=0):m=tl(m),function(u,h,m){return u>=Nr(h,m)&&u=-Ln&&u<=Ln},O.isSet=iT,O.isString=vy,O.isSymbol=$o,O.isTypedArray=af,O.isUndefined=function(u){return u===k},O.isWeakMap=function(u){return Ki(u)&&gs(u)==ci},O.isWeakSet=function(u){return Ki(u)&&"[object WeakSet]"==Xr(u)},O.join=function(u,h){return null==u?"":Bh.call(u,h)},O.kebabCase=CT,O.last=jo,O.lastIndexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=b;return m!==k&&(M=(M=Jt(m))<0?hr(b+M,0):Nr(M,b-1)),h==h?function(W,ue,ne){for(var it=ne+1;it--;)if(W[it]===ue)return it;return it}(u,h,M):md(u,vc,M,!0)},O.lowerCase=wT,O.lowerFirst=pN,O.lt=Ic,O.lte=by,O.max=function(u){return u&&u.length?qh(u,Ds,fs):k},O.maxBy=function(u,h){return u&&u.length?qh(u,Nt(h,2),fs):k},O.mean=function(u){return Wr(u,Ds)},O.meanBy=function(u,h){return Wr(u,Nt(h,2))},O.min=function(u){return u&&u.length?qh(u,Ds,R0):k},O.minBy=function(u,h){return u&&u.length?qh(u,Nt(h,2),R0):k},O.stubArray=Rc,O.stubFalse=jy,O.stubObject=function(){return{}},O.stubString=function(){return""},O.stubTrue=function(){return!0},O.multiply=hw,O.nth=function(u,h){return u&&u.length?Su(u,Jt(h)):k},O.noConflict=function(){return Wn._===this&&(Wn._=g_),this},O.noop=By,O.now=Ru,O.pad=function(u,h,m){u=Yn(u);var b=(h=Jt(h))?kh(u):0;if(!h||b>=h)return u;var M=(h-b)/2;return Up(Sn(M),m)+u+Up(Ce(M),m)},O.padEnd=function(u,h,m){u=Yn(u);var b=(h=Jt(h))?kh(u):0;return h&&bh){var b=u;u=h,h=b}if(m||u%1||h%1){var M=Vh();return Nr(u+M*(h-u+m1("1e-"+((M+"").length-1))),h)}return Il(u,h)},O.reduce=function(u,h,m){var b=Ot(u)?_u:Ro,M=arguments.length<3;return b(u,Nt(h,4),m,M,Ec)},O.reduceRight=function(u,h,m){var b=Ot(u)?gd:Ro,M=arguments.length<3;return b(u,Nt(h,4),m,M,A_)},O.repeat=function(u,h,m){return h=(m?ms(u,h,m):h===k)?1:Jt(h),kp(Yn(u),h)},O.replace=function(){var u=arguments,h=Yn(u[0]);return u.length<3?h:h.replace(u[1],u[2])},O.result=function(u,h,m){var b=-1,M=(h=Tc(h,u)).length;for(M||(M=1,u=k);++bLn)return[];var m=Ft,b=Nr(u,Ft);h=Nt(h),u-=Ft;for(var M=yd(b,h);++m=P)return u;var z=m-kh(b);if(z<1)return b;var X=V?Ya(V,0,z).join(""):u.slice(0,z);if(M===k)return X+b;if(V&&(z+=X.length-z),jC(M)){if(u.slice(z).search(M)){var ge,me=X;for(M.global||(M=f_(M.source,Yn(Zt.exec(M))+"g")),M.lastIndex=0;ge=M.exec(me);)var Se=ge.index;X=X.slice(0,Se===k?z:Se)}}else if(u.indexOf(mo(M),z)!=z){var Ke=X.lastIndexOf(M);Ke>-1&&(X=X.slice(0,Ke))}return X+b},O.unescape=function(u){return(u=Yn(u))&&Vs.test(u)?u.replace(ud,h_):u},O.uniqueId=function(u){var h=++LF;return Yn(u)+h},O.upperCase=rw,O.upperFirst=ug,O.each=uy,O.eachRight=Jp,O.first=nC,Ly(O,function(){var u={};return qa(O,function(h,m){hi.call(O.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),O.VERSION="4.17.21",us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){O[u].placeholder=O}),us(["drop","take"],function(u,h){pn.prototype[u]=function(m){m=m===k?1:hr(Jt(m),0);var b=this.__filtered__&&!h?new pn(this):this.clone();return b.__filtered__?b.__takeCount__=Nr(m,b.__takeCount__):b.__views__.push({size:Nr(m,Ft),type:u+(b.__dir__<0?"Right":"")}),b},pn.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),us(["filter","map","takeWhile"],function(u,h){var m=h+1,b=1==m||3==m;pn.prototype[u]=function(M){var P=this.clone();return P.__iteratees__.push({iteratee:Nt(M,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),us(["head","last"],function(u,h){var m="take"+(h?"Right":"");pn.prototype[u]=function(){return this[m](1).value()[0]}}),us(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");pn.prototype[u]=function(){return this.__filtered__?new pn(this):this[m](1)}}),pn.prototype.compact=function(){return this.filter(Ds)},pn.prototype.find=function(u){return this.filter(u).head()},pn.prototype.findLast=function(u){return this.reverse().find(u)},pn.prototype.invokeMap=gn(function(u,h){return"function"==typeof u?new pn(this):this.map(function(m){return ya(m,u,h)})}),pn.prototype.reject=function(u){return this.filter(gy(Nt(u)))},pn.prototype.slice=function(u,h){u=Jt(u);var m=this;return m.__filtered__&&(u>0||h<0)?new pn(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==k&&(m=(h=Jt(h))<0?m.dropRight(-h):m.take(h-u)),m)},pn.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},pn.prototype.toArray=function(){return this.take(Ft)},qa(pn.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),b=/^(?:head|last)$/.test(h),M=O[b?"take"+("last"==h?"Right":""):h],P=b||/^find/.test(h);!M||(O.prototype[h]=function(){var V=this.__wrapped__,z=b?[1]:arguments,X=V instanceof pn,ge=z[0],me=X||Ot(V),Se=function(_n){var On=M.apply(O,dr([_n],z));return b&&Ke?On[0]:On};me&&m&&"function"==typeof ge&&1!=ge.length&&(X=me=!1);var Ke=this.__chain__,mt=!!this.__actions__.length,Vt=P&&!Ke,mn=X&&!mt;if(!P&&me){V=mn?V:new pn(this);var zt=u.apply(V,z);return zt.__actions__.push({func:Vd,args:[Se],thisArg:k}),new po(zt,Ke)}return Vt&&mn?u.apply(this,z):(zt=this.thru(Se),Vt?b?zt.value()[0]:zt.value():zt)})}),us(["pop","push","shift","sort","splice","unshift"],function(u){var h=Ti[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",b=/^(?:pop|shift)$/.test(u);O.prototype[u]=function(){var M=arguments;if(b&&!this.__chain__){var P=this.value();return h.apply(Ot(P)?P:[],M)}return this[m](function(V){return h.apply(Ot(V)?V:[],M)})}}),qa(pn.prototype,function(u,h){var m=O[h];if(m){var b=m.name+"";hi.call(Cd,b)||(Cd[b]=[]),Cd[b].push({name:h,func:m})}}),Cd[Dc(k,2).name]=[{name:"wrapper",func:k}],pn.prototype.clone=function(){var u=new pn(this.__wrapped__);return u.__actions__=xs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=xs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=xs(this.__views__),u},pn.prototype.reverse=function(){if(this.__filtered__){var u=new pn(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},pn.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Ot(u),b=h<0,M=m?u.length:0,P=function(u,h,m){for(var b=-1,M=m.length;++b=this.__values__.length;return{done:u,value:u?k:this.__values__[this.__index__++]}},O.prototype.plant=function(u){for(var h,m=this;m instanceof Hh;){var b=Xp(m);b.__index__=0,b.__values__=k,h?M.__wrapped__=b:h=b;var M=b;m=m.__wrapped__}return M.__wrapped__=u,h},O.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof pn){var h=u;return this.__actions__.length&&(h=new pn(this)),(h=h.reverse()).__actions__.push({func:Vd,args:[ty],thisArg:k}),new po(h,this.__chain__)}return this.thru(ty)},O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=function(){return q1(this.__wrapped__,this.__actions__)},O.prototype.first=O.prototype.head,Lh&&(O.prototype[Lh]=function(){return this}),O}();Wn._=Fh,(_t=function(){return Fh}.call(We,Ve,We,pt))!==k&&(pt.exports=_t)}.call(this)},478:function(pt){pt.exports=function(){"use strict";function We(G,q){for(var Z=0;ZG.length)&&(q=G.length);for(var Z=0,T=new Array(q);Z=G.length?{done:!0}:{done:!1,value:G[T++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Pt={exports:{}};function ft(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Pt.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:ft,changeDefaults:function(G){Pt.exports.defaults=G}};var yt=/[&<>"']/,dn=/[&<>"']/g,En=/[<>"']|&(?!#?\w+;)/,Fe=/[<>"']|&(?!#?\w+;)/g,je={"&":"&","<":"<",">":">",'"':""","'":"'"},$t=function(q){return je[q]};var Ie=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function pi(G){return G.replace(Ie,function(q,Z){return"colon"===(Z=Z.toLowerCase())?":":"#"===Z.charAt(0)?"x"===Z.charAt(1)?String.fromCharCode(parseInt(Z.substring(2),16)):String.fromCharCode(+Z.substring(1)):""})}var qe=/(^|[^\[])\^/g;var Rt=/[^\w:]/g,nn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var Ci={},yi=/^[^:]+:\/*[^/]*$/,vi=/^([^:]+:)[\s\S]*$/,Er=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ae(G,q){Ci[" "+G]||(Ci[" "+G]=yi.test(G)?G+"/":Gt(G,"/",!0));var Z=-1===(G=Ci[" "+G]).indexOf(":");return"//"===q.substring(0,2)?Z?q:G.replace(vi,"$1")+q:"/"===q.charAt(0)?Z?q:G.replace(Er,"$1")+q:G+q}function Gt(G,q,Z){var T=G.length;if(0===T)return"";for(var D=0;D1;)1&q&&(Z+=G),q>>=1,G+=G;return Z+G},Ln=Pt.exports.defaults,be=Gt,Ii=function(G,q){var T=G.replace(/\|/g,function(B,K,H){for(var se=!1,ce=K;--ce>=0&&"\\"===H[ce];)se=!se;return se?"|":" |"}).split(/ \|/),D=0;if(T.length>q)T.splice(q);else for(;T.length1?{type:"space",raw:D[0]}:{raw:"\n"}},q.code=function(T){var D=this.rules.block.code.exec(T);if(D){var B=D[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:D[0],codeBlockStyle:"indented",text:this.options.pedantic?B:be(B,"\n")}}},q.fences=function(T){var D=this.rules.block.fences.exec(T);if(D){var B=D[0],K=function(G,q){var Z=G.match(/^(\s+)(?:```)/);if(null===Z)return q;var T=Z[1];return q.split("\n").map(function(D){var B=D.match(/^\s+/);return null===B?D:B[0].length>=T.length?D.slice(T.length):D}).join("\n")}(B,D[3]||"");return{type:"code",raw:B,lang:D[2]?D[2].trim():D[2],text:K}}},q.heading=function(T){var D=this.rules.block.heading.exec(T);if(D){var B=D[2].trim();if(/#$/.test(B)){var K=be(B,"#");(this.options.pedantic||!K||/ $/.test(K))&&(B=K.trim())}return{type:"heading",raw:D[0],depth:D[1].length,text:B}}},q.nptable=function(T){var D=this.rules.block.nptable.exec(T);if(D){var B={type:"table",header:Ii(D[1].replace(/^ *| *\| *$/g,"")),align:D[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:D[3]?D[3].replace(/\n$/,"").split("\n"):[],raw:D[0]};if(B.header.length===B.align.length){var H,K=B.align.length;for(H=0;H ?/gm,"");return{type:"blockquote",raw:D[0],text:B}}},q.list=function(T){var D=this.rules.block.list.exec(T);if(D){var Be,Kt,Cn,jt,gt,Zt,ti,Hi,$i,B=D[0],K=D[2],H=K.length>1,se={type:"list",raw:B,ordered:H,start:H?+K.slice(0,-1):"",loose:!1,items:[]},ce=D[0].match(this.rules.block.item),de=!1,ln=ce.length;Cn=this.rules.block.listItemStart.exec(ce[0]);for(var bi=0;biCn[1].length:jt[1].length>=Cn[0].length||jt[1].length>3){ce.splice(bi,2,ce[bi]+(!this.options.pedantic&&jt[1].length/i.test(K[0])&&(D=!1),!B&&/^<(pre|code|kbd|script)(\s|>)/i.test(K[0])?B=!0:B&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(K[0])&&(B=!1),{type:this.options.sanitize?"text":"html",raw:K[0],inLink:D,inRawBlock:B,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):Ft(K[0]):K[0]}},q.link=function(T){var D=this.rules.inline.link.exec(T);if(D){var B=D[2].trim();if(!this.options.pedantic&&/^$/.test(B))return;var K=be(B.slice(0,-1),"\\");if((B.length-K.length)%2==0)return}else{var H=Sr(D[2],"()");if(H>-1){var ce=(0===D[0].indexOf("!")?5:4)+D[1].length+H;D[2]=D[2].substring(0,H),D[0]=D[0].substring(0,ce).trim(),D[3]=""}}var de=D[2],Be="";if(this.options.pedantic){var Kt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(de);Kt&&(de=Kt[1],Be=Kt[3])}else Be=D[3]?D[3].slice(1,-1):"";return de=de.trim(),/^$/.test(B)?de.slice(1):de.slice(1,-1)),os(D,{href:de&&de.replace(this.rules.inline._escapes,"$1"),title:Be&&Be.replace(this.rules.inline._escapes,"$1")},D[0])}},q.reflink=function(T,D){var B;if((B=this.rules.inline.reflink.exec(T))||(B=this.rules.inline.nolink.exec(T))){var K=(B[2]||B[1]).replace(/\s+/g," ");if(!(K=D[K.toLowerCase()])||!K.href){var H=B[0].charAt(0);return{type:"text",raw:H,text:H}}return os(B,K,B[0])}},q.emStrong=function(T,D,B){void 0===B&&(B="");var K=this.rules.inline.emStrong.lDelim.exec(T);if(K&&(!K[3]||!B.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var H=K[1]||K[2]||"";if(!H||H&&(""===B||this.rules.inline.punctuation.exec(B))){var ce,de,se=K[0].length-1,Be=se,Kt=0,Cn="*"===K[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Cn.lastIndex=0,D=D.slice(-1*T.length+se);null!=(K=Cn.exec(D));)if(ce=K[1]||K[2]||K[3]||K[4]||K[5]||K[6]){if(de=ce.length,K[3]||K[4]){Be+=de;continue}if((K[5]||K[6])&&se%3&&!((se+de)%3)){Kt+=de;continue}if(!((Be-=de)>0))return de=Math.min(de,de+Be+Kt),Math.min(se,de)%2?{type:"em",raw:T.slice(0,se+K.index+de+1),text:T.slice(1,se+K.index+de)}:{type:"strong",raw:T.slice(0,se+K.index+de+1),text:T.slice(2,se+K.index+de-1)}}}}},q.codespan=function(T){var D=this.rules.inline.code.exec(T);if(D){var B=D[2].replace(/\n/g," "),K=/[^ ]/.test(B),H=/^ /.test(B)&&/ $/.test(B);return K&&H&&(B=B.substring(1,B.length-1)),B=Ft(B,!0),{type:"codespan",raw:D[0],text:B}}},q.br=function(T){var D=this.rules.inline.br.exec(T);if(D)return{type:"br",raw:D[0]}},q.del=function(T){var D=this.rules.inline.del.exec(T);if(D)return{type:"del",raw:D[0],text:D[2]}},q.autolink=function(T,D){var K,H,B=this.rules.inline.autolink.exec(T);if(B)return H="@"===B[2]?"mailto:"+(K=Ft(this.options.mangle?D(B[1]):B[1])):K=Ft(B[1]),{type:"link",raw:B[0],text:K,href:H,tokens:[{type:"text",raw:K,text:K}]}},q.url=function(T,D){var B;if(B=this.rules.inline.url.exec(T)){var K,H;if("@"===B[2])H="mailto:"+(K=Ft(this.options.mangle?D(B[0]):B[0]));else{var se;do{se=B[0],B[0]=this.rules.inline._backpedal.exec(B[0])[0]}while(se!==B[0]);K=Ft(B[0]),H="www."===B[1]?"http://"+K:K}return{type:"link",raw:B[0],text:K,href:H,tokens:[{type:"text",raw:K,text:K}]}}},q.inlineText=function(T,D,B){var H,K=this.rules.inline.text.exec(T);if(K)return H=D?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):Ft(K[0]):K[0]:Ft(this.options.smartypants?B(K[0]):K[0]),{type:"text",raw:K[0],text:H}},G}(),sa=rn_noopTest,Gn=rn_edit,ai=rn_merge,ot={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:sa,table:sa,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};ot.def=Gn(ot.def).replace("label",ot._label).replace("title",ot._title).getRegex(),ot.bullet=/(?:[*+-]|\d{1,9}[.)])/,ot.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ot.item=Gn(ot.item,"gm").replace(/bull/g,ot.bullet).getRegex(),ot.listItemStart=Gn(/^( *)(bull) */).replace("bull",ot.bullet).getRegex(),ot.list=Gn(ot.list).replace(/bull/g,ot.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ot.def.source+")").getRegex(),ot._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ot._comment=/|$)/,ot.html=Gn(ot.html,"i").replace("comment",ot._comment).replace("tag",ot._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ot.paragraph=Gn(ot._paragraph).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.blockquote=Gn(ot.blockquote).replace("paragraph",ot.paragraph).getRegex(),ot.normal=ai({},ot),ot.gfm=ai({},ot.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ot.gfm.nptable=Gn(ot.gfm.nptable).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.gfm.table=Gn(ot.gfm.table).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.pedantic=ai({},ot.normal,{html:Gn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ot._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:sa,paragraph:Gn(ot.normal._paragraph).replace("hr",ot.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ot.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var He={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:sa,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:sa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};He.punctuation=Gn(He.punctuation).replace(/punctuation/g,He._punctuation).getRegex(),He.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,He.escapedEmSt=/\\\*|\\_/g,He._comment=Gn(ot._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),He.emStrong.lDelim=Gn(He.emStrong.lDelim).replace(/punct/g,He._punctuation).getRegex(),He.emStrong.rDelimAst=Gn(He.emStrong.rDelimAst,"g").replace(/punct/g,He._punctuation).getRegex(),He.emStrong.rDelimUnd=Gn(He.emStrong.rDelimUnd,"g").replace(/punct/g,He._punctuation).getRegex(),He._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,He._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,He._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,He.autolink=Gn(He.autolink).replace("scheme",He._scheme).replace("email",He._email).getRegex(),He._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,He.tag=Gn(He.tag).replace("comment",He._comment).replace("attribute",He._attribute).getRegex(),He._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,He._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,He._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,He.link=Gn(He.link).replace("label",He._label).replace("href",He._href).replace("title",He._title).getRegex(),He.reflink=Gn(He.reflink).replace("label",He._label).getRegex(),He.reflinkSearch=Gn(He.reflinkSearch,"g").replace("reflink",He.reflink).replace("nolink",He.nolink).getRegex(),He.normal=ai({},He),He.pedantic=ai({},He.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Gn(/^!?\[(label)\]\((.*?)\)/).replace("label",He._label).getRegex(),reflink:Gn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",He._label).getRegex()}),He.gfm=ai({},He.normal,{escape:Gn(He.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(T="x"+T.toString(16)),q+="&#"+T+";";return q}var li=function(){function G(Z){this.tokens=[],this.tokens.links=Object.create(null),this.options=Z||Fa,this.options.tokenizer=this.options.tokenizer||new oa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var T={block:Ri.normal,inline:Hr.normal};this.options.pedantic?(T.block=Ri.pedantic,T.inline=Hr.pedantic):this.options.gfm&&(T.block=Ri.gfm,T.inline=this.options.breaks?Hr.breaks:Hr.gfm),this.tokenizer.rules=T}G.lex=function(T,D){return new G(D).lex(T)},G.lexInline=function(T,D){return new G(D).inlineTokens(T)};var q=G.prototype;return q.lex=function(T){return T=T.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(T,this.tokens,!0),this.inline(this.tokens),this.tokens},q.blockTokens=function(T,D,B){var H,se,ce,de,Be,Kt,K=this;for(void 0===D&&(D=[]),void 0===B&&(B=!0),this.options.pedantic&&(T=T.replace(/^ +$/gm,""));T;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(jt){return!!(H=jt.call(K,T,D))&&(T=T.substring(H.raw.length),D.push(H),!0)}))){if(H=this.tokenizer.space(T)){T=T.substring(H.raw.length),H.type&&D.push(H);continue}if(H=this.tokenizer.code(T)){T=T.substring(H.raw.length),(de=D[D.length-1])&&"paragraph"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H);continue}if(H=this.tokenizer.fences(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.heading(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.nptable(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.hr(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.blockquote(T)){T=T.substring(H.raw.length),H.tokens=this.blockTokens(H.text,[],B),D.push(H);continue}if(H=this.tokenizer.list(T)){for(T=T.substring(H.raw.length),ce=H.items.length,se=0;se=0&&(jt=Math.min(jt,Zt))}),jt<1/0&&jt>=0&&(Be=T.substring(0,jt+1))}(),B&&(H=this.tokenizer.paragraph(Be))){de=D[D.length-1],Kt&&"paragraph"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H),Kt=Be.length!==T.length,T=T.substring(H.raw.length);continue}if(H=this.tokenizer.text(T)){T=T.substring(H.raw.length),(de=D[D.length-1])&&"text"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H);continue}if(T){var Cn="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(Cn);break}throw new Error(Cn)}}return D},q.inline=function(T){var D,B,K,H,se,ce,de=T.length;for(D=0;D0)for(;null!=(Kt=this.tokenizer.rules.inline.reflinkSearch.exec(Be));)gt.includes(Kt[0].slice(Kt[0].lastIndexOf("[")+1,-1))&&(Be=Be.slice(0,Kt.index)+"["+Na("a",Kt[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(Kt=this.tokenizer.rules.inline.blockSkip.exec(Be));)Be=Be.slice(0,Kt.index)+"["+Na("a",Kt[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(Kt=this.tokenizer.rules.inline.escapedEmSt.exec(Be));)Be=Be.slice(0,Kt.index)+"++"+Be.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;T;)if(Cn||(jt=""),Cn=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ti){return!!(se=ti.call(H,T,D))&&(T=T.substring(se.raw.length),D.push(se),!0)}))){if(se=this.tokenizer.escape(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.tag(T,B,K)){T=T.substring(se.raw.length),B=se.inLink,K=se.inRawBlock,(ce=D[D.length-1])&&"text"===se.type&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(se=this.tokenizer.link(T)){T=T.substring(se.raw.length),"link"===se.type&&(se.tokens=this.inlineTokens(se.text,[],!0,K)),D.push(se);continue}if(se=this.tokenizer.reflink(T,this.tokens.links)){T=T.substring(se.raw.length),ce=D[D.length-1],"link"===se.type?(se.tokens=this.inlineTokens(se.text,[],!0,K),D.push(se)):ce&&"text"===se.type&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(se=this.tokenizer.emStrong(T,Be,jt)){T=T.substring(se.raw.length),se.tokens=this.inlineTokens(se.text,[],B,K),D.push(se);continue}if(se=this.tokenizer.codespan(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.br(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.del(T)){T=T.substring(se.raw.length),se.tokens=this.inlineTokens(se.text,[],B,K),D.push(se);continue}if(se=this.tokenizer.autolink(T,so)){T=T.substring(se.raw.length),D.push(se);continue}if(!B&&(se=this.tokenizer.url(T,so))){T=T.substring(se.raw.length),D.push(se);continue}if(de=T,this.options.extensions&&this.options.extensions.startInline&&function(){var ti=1/0,Hi=T.slice(1),$i=void 0;H.options.extensions.startInline.forEach(function(ln){"number"==typeof($i=ln.call(this,Hi))&&$i>=0&&(ti=Math.min(ti,$i))}),ti<1/0&&ti>=0&&(de=T.substring(0,ti+1))}(),se=this.tokenizer.inlineText(de,K,nr)){T=T.substring(se.raw.length),"_"!==se.raw.slice(-1)&&(jt=se.raw.slice(-1)),Cn=!0,(ce=D[D.length-1])&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(T){var Zt="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(Zt);break}throw new Error(Zt)}}return D},function(G,q,Z){q&&We(G.prototype,q),Z&&We(G,Z)}(G,null,[{key:"rules",get:function(){return{block:Ri,inline:Hr}}}]),G}(),$r=Pt.exports.defaults,Fr=rn_cleanUrl,ei=rn_escape,hc=function(){function G(Z){this.options=Z||$r}var q=G.prototype;return q.code=function(T,D,B){var K=(D||"").match(/\S*/)[0];if(this.options.highlight){var H=this.options.highlight(T,K);null!=H&&H!==T&&(B=!0,T=H)}return T=T.replace(/\n$/,"")+"\n",K?'
    '+(B?T:ei(T,!0))+"
    \n":"
    "+(B?T:ei(T,!0))+"
    \n"},q.blockquote=function(T){return"
    \n"+T+"
    \n"},q.html=function(T){return T},q.heading=function(T,D,B,K){return this.options.headerIds?"'+T+"\n":""+T+"\n"},q.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},q.list=function(T,D,B){var K=D?"ol":"ul";return"<"+K+(D&&1!==B?' start="'+B+'"':"")+">\n"+T+"\n"},q.listitem=function(T){return"
  • "+T+"
  • \n"},q.checkbox=function(T){return" "},q.paragraph=function(T){return"

    "+T+"

    \n"},q.table=function(T,D){return D&&(D=""+D+""),"\n\n"+T+"\n"+D+"
    \n"},q.tablerow=function(T){return"\n"+T+"\n"},q.tablecell=function(T,D){var B=D.header?"th":"td";return(D.align?"<"+B+' align="'+D.align+'">':"<"+B+">")+T+"\n"},q.strong=function(T){return""+T+""},q.em=function(T){return""+T+""},q.codespan=function(T){return""+T+""},q.br=function(){return this.options.xhtml?"
    ":"
    "},q.del=function(T){return""+T+""},q.link=function(T,D,B){if(null===(T=Fr(this.options.sanitize,this.options.baseUrl,T)))return B;var K='"+B+""},q.image=function(T,D,B){if(null===(T=Fr(this.options.sanitize,this.options.baseUrl,T)))return B;var K=''+B+'":">")},q.text=function(T){return T},G}(),oo=function(){function G(){}var q=G.prototype;return q.strong=function(T){return T},q.em=function(T){return T},q.codespan=function(T){return T},q.del=function(T){return T},q.html=function(T){return T},q.text=function(T){return T},q.link=function(T,D,B){return""+B},q.image=function(T,D,B){return""+B},q.br=function(){return""},G}(),ci=function(){function G(){this.seen={}}var q=G.prototype;return q.serialize=function(T){return T.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},q.getNextSafeSlug=function(T,D){var B=T,K=0;if(this.seen.hasOwnProperty(B)){K=this.seen[T];do{B=T+"-"+ ++K}while(this.seen.hasOwnProperty(B))}return D||(this.seen[T]=K,this.seen[B]=0),B},q.slug=function(T,D){void 0===D&&(D={});var B=this.serialize(T);return this.getNextSafeSlug(B,D.dryrun)},G}(),xh=hc,bl=oo,La=ci,ao=Pt.exports.defaults,Ba=rn_unescape,ls=li,lo=function(){function G(Z){this.options=Z||ao,this.options.renderer=this.options.renderer||new xh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new bl,this.slugger=new La}G.parse=function(T,D){return new G(D).parse(T)},G.parseInline=function(T,D){return new G(D).parseInline(T)};var q=G.prototype;return q.parse=function(T,D){void 0===D&&(D=!0);var K,H,se,ce,de,Be,Kt,Cn,jt,gt,Zt,ti,Hi,$i,ln,bi,gc,co,dd,B="",El=T.length;for(K=0;K0&&"text"===ln.tokens[0].type?(ln.tokens[0].text=co+" "+ln.tokens[0].text,ln.tokens[0].tokens&&ln.tokens[0].tokens.length>0&&"text"===ln.tokens[0].tokens[0].type&&(ln.tokens[0].tokens[0].text=co+" "+ln.tokens[0].tokens[0].text)):ln.tokens.unshift({type:"text",text:co}):$i+=co),$i+=this.parse(ln.tokens,Hi),jt+=this.renderer.listitem($i,gc,bi);B+=this.renderer.list(jt,Zt,ti);continue;case"html":B+=this.renderer.html(gt.text);continue;case"paragraph":B+=this.renderer.paragraph(this.parseInline(gt.tokens));continue;case"text":for(jt=gt.tokens?this.parseInline(gt.tokens):gt.text;K+1An error occurred:

    "+pc(se.message+"",!0)+"
    ";throw se}}return Ye.options=Ye.setOptions=function(G){return uu(Ye.defaults,G),du(Ye.defaults),Ye},Ye.getDefaults=ud,Ye.defaults=Vs,Ye.use=function(){for(var G=this,q=arguments.length,Z=new Array(q),T=0;TAn error occurred:

    "+pc(T.message+"",!0)+"
    ";throw T}},Ye.Parser=lo,Ye.parser=lo.parse,Ye.Renderer=Cl,Ye.TextRenderer=lu,Ye.Lexer=ls,Ye.lexer=ls.lex,Ye.Tokenizer=fc,Ye.Slugger=cu,Ye.parse=Ye,Ye}()},310:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.isMobile=function(){return void 0!==k.window.orientation},We.default=function(yt){if(!yt&&!(0,It.default)())return"Node";if((0,Pt.default)(yt))return"Electron";var dn="undefined"!=typeof navigator?navigator:{},En=yt||dn.userAgent||"";if(En.indexOf("Edge")>-1)return"Edge";var Fe=-1!==En.indexOf("MSIE "),je=-1!==En.indexOf("Trident/");return Fe||je?"IE":k.window.chrome?"Chrome":k.window.safari?"Safari":k.window.mozInnerScreenX?"Firefox":"Unknown"};var k=Ve(151),It=_t(Ve(602)),Pt=_t(Ve(344))},151:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.console=We.process=We.document=We.global=We.window=We.self=void 0;var k=_t(Ve(321)),It={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,k.default)(process))&&process};We.self=It.self||It.window||It.global,We.window=It.window||It.self||It.global,We.global=It.global||It.self||It.window,We.document=It.document||{},We.process=It.process||{};var En=console;We.console=En},761:(pt,We,Ve)=>{"use strict";var k=Ve(948),It=Ve(321);Object.defineProperty(We,"CO",{enumerable:!0,get:function(){return Pt.global}}),Object.defineProperty(We,"jU",{enumerable:!0,get:function(){return ft.default}}),Object.defineProperty(We,"qs",{enumerable:!0,get:function(){return qt.default}});var Pt=Ve(151),ft=En(Ve(602)),qt=En(Ve(310));k(Ve(344));function dn(Fe){if("function"!=typeof WeakMap)return null;var je=new WeakMap,$t=new WeakMap;return(dn=function(Ie){return Ie?$t:je})(Fe)}function En(Fe,je){if(!je&&Fe&&Fe.__esModule)return Fe;if(null===Fe||"object"!==It(Fe)&&"function"!=typeof Fe)return{default:Fe};var $t=dn(je);if($t&&$t.has(Fe))return $t.get(Fe);var Ne={},Ie=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var pi in Fe)if("default"!==pi&&Object.prototype.hasOwnProperty.call(Fe,pi)){var qe=Ie?Object.getOwnPropertyDescriptor(Fe,pi):null;qe&&(qe.get||qe.set)?Object.defineProperty(Ne,pi,qe):Ne[pi]=Fe[pi]}return Ne.default=Fe,$t&&$t.set(Fe,Ne),Ne}},602:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=Pt,We.isBrowserMainThread=function(){return Pt()&&"undefined"!=typeof document};var k=_t(Ve(321)),It=_t(Ve(344));function Pt(){return!("object"===("undefined"==typeof process?"undefined":(0,k.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,It.default)()}},344:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=function(Pt){if("undefined"!=typeof window&&"object"===(0,k.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,k.default)(process.versions)&&Boolean(process.versions.electron))return!0;var ft="object"===("undefined"==typeof navigator?"undefined":(0,k.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,qt=Pt||ft;return!!(qt&&qt.indexOf("Electron")>=0)};var k=_t(Ve(321))},473:(pt,We,Ve)=>{"use strict";var _t={};Ve.r(_t),Ve.d(_t,{decode:()=>$ve,encode:()=>Gve});var k={};Ve.r(k),Ve.d(k,{decode:()=>Kve,encode:()=>Zve});var It={};Ve.r(It),Ve.d(It,{decode:()=>Qve,encode:()=>Jve});var Pt={};function ft(n){return"function"==typeof n}Ve.r(Pt),Ve.d(Pt,{decode:()=>ebe,encode:()=>tbe});let qt=!1;const yt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else qt&&console.log("RxJS: Back to a better error behavior. Thank you. <3");qt=n},get useDeprecatedSynchronousErrorHandling(){return qt}};function dn(n){setTimeout(()=>{throw n},0)}const En={closed:!0,next(n){},error(n){if(yt.useDeprecatedSynchronousErrorHandling)throw n;dn(n)},complete(){}},Fe=Array.isArray||(n=>n&&"number"==typeof n.length);function je(n){return null!==n&&"object"==typeof n}const Ne=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class Ie{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof Ie)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof Ne?t.errors:t),[])}Ie.EMPTY=((n=new Ie).closed=!0,n);const qe="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class Rt extends Ie{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=En;break;case 1:if(!e){this.destination=En;break}if("object"==typeof e){e instanceof Rt?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new nn(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new nn(this,e,t,i)}}[qe](){return this}static create(e,t,i){const r=new Rt(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class nn extends Rt{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;ft(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==En&&(o=Object.create(t),ft(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;yt.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=yt;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):dn(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;dn(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);yt.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),yt.useDeprecatedSynchronousErrorHandling)throw i;dn(i)}}__tryOrSetError(e,t,i){if(!yt.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return yt.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(dn(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const yi="function"==typeof Symbol&&Symbol.observable||"@@observable";function vi(n){return n}function Er(...n){return Ae(n)}function Ae(n){return 0===n.length?vi:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let oe=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof Rt)return n;if(n[qe])return n[qe]()}return n||e||t?new Rt(n,e,t):new Rt(En)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||yt.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),yt.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){yt.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof Rt?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=kt(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[yi](){return this}pipe(...t){return 0===t.length?this:Ae(t)(this)}toPromise(t){return new(t=kt(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function kt(n){if(n||(n=yt.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const Gt=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class oi extends Ie{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class Oi extends Rt{constructor(e){super(e),this.destination=e}}let we=(()=>{class n extends oe{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[qe](){return new Oi(this)}lift(t){const i=new rn(this,this);return i.operator=t,i}next(t){if(this.closed)throw new Gt;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew rn(e,t),n})();class rn extends we{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):Ie.EMPTY}}function Ln(n){return n&&"function"==typeof n.schedule}function be(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new Ii(n,e))}}class Ii{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new Ft(e,this.project,this.thisArg))}}class Ft extends Rt{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const Sr=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function He(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Pi=n=>{if(n&&"function"==typeof n[yi])return(n=>e=>{const t=n[yi]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(ot(n))return Sr(n);if(He(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,dn),e))(n);if(n&&"function"==typeof n[as])return(n=>e=>{const t=n[as]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${je(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Ri(n,e){return new oe(t=>{const i=new Ie;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function li(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[yi]}(n))return function(n,e){return new oe(t=>{const i=new Ie;return i.add(e.schedule(()=>{const r=n[yi]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(He(n))return function(n,e){return new oe(t=>{const i=new Ie;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(ot(n))return Ri(n,e);if(function(n){return n&&"function"==typeof n[as]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new oe(t=>{const i=new Ie;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[as](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof oe?n:new oe(Pi(n))}class $r extends Rt{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class ei extends Rt{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function oo(n,e){if(e.closed)return;if(n instanceof oe)return n.subscribe(e);let t;try{t=Pi(n)(e)}catch(i){e.error(i)}return t}function ci(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(ci((r,s)=>li(n(r,s)).pipe(be((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new xh(n,t)))}class xh{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new bl(e,this.project,this.concurrent))}}class bl extends ei{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function ao(n=Number.POSITIVE_INFINITY){return ci(vi,n)}function Ba(n,e){return e?Ri(n,e):new oe(Sr(n))}function ki(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Ln(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof oe?n[0]:ao(e)(Ba(n,t))}function ls(){return function(e){return e.lift(new lo(e))}}class lo{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new fc(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class fc extends Rt{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Cl extends oe{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new Ie,e.add(this.source.subscribe(new cu(this.getSubject(),this))),e.closed&&(this._connection=null,e=Ie.EMPTY)),e}refCount(){return ls()(this)}}const lu=(()=>{const n=Cl.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class cu extends Oi{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}function pc(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new ud(r,e));const s=Object.create(i,lu);return s.source=i,s.subjectFactory=r,s}}class ud{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function du(){return new we}function Vs(){return n=>ls()(pc(du)(n))}function Ye(n){for(let e in n)if(n[e]===Ye)return e;throw Error("Could not find renamed property on target object.")}function hu(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function G(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(G).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function q(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const Z=Ye({__forward_ref__:Ye});function T(n){return n.__forward_ref__=T,n.toString=function(){return G(this())},n}function D(n){return B(n)?n():n}function B(n){return"function"==typeof n&&n.hasOwnProperty(Z)&&n.__forward_ref__===T}class H extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function de(n){return"string"==typeof n?n:null==n?"":String(n)}function Be(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():de(n)}function gt(n,e){const t=e?` in ${e}`:"";throw new H("201",`No provider for ${Be(n)} found${t}`)}function Gi(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function ae(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Ee(n){return{providers:n.providers||[],imports:n.imports||[]}}function ir(n){return _c(n,la)||_c(n,ja)}function _c(n,e){return n.hasOwnProperty(e)?n[e]:null}function mu(n){return n&&(n.hasOwnProperty(Sl)||n.hasOwnProperty(mp))?n[Sl]:null}const la=Ye({\u0275prov:Ye}),Sl=Ye({\u0275inj:Ye}),ja=Ye({ngInjectableDef:Ye}),mp=Ye({ngInjectorDef:Ye});var vt=(()=>((vt=vt||{})[vt.Default=0]="Default",vt[vt.Host=1]="Host",vt[vt.Self=2]="Self",vt[vt.SkipSelf=4]="SkipSelf",vt[vt.Optional=8]="Optional",vt))();let Ml;function ca(n){const e=Ml;return Ml=n,e}function hd(n,e,t){const i=ir(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&vt.Optional?null:void 0!==e?e:void gt(G(n),"Injector")}function R(n){return{toString:n}.toString()}var j=(()=>((j=j||{})[j.OnPush=0]="OnPush",j[j.Default=1]="Default",j))(),Re=(()=>((Re=Re||{})[Re.Emulated=0]="Emulated",Re[Re.None=2]="None",Re[Re.ShadowDom=3]="ShadowDom",Re))();const hn="undefined"!=typeof globalThis&&globalThis,cr="undefined"!=typeof window&&window,mr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Gr="undefined"!=typeof global&&global,cn=hn||Gr||cr||mr,fd={},gi=[],yp=Ye({\u0275cmp:Ye}),s_=Ye({\u0275dir:Ye}),Ah=Ye({\u0275pipe:Ye}),h0=Ye({\u0275mod:Ye}),p1=Ye({\u0275loc:Ye}),xl=Ye({\u0275fac:Ye}),Dh=Ye({__NG_ELEMENT_ID__:Ye});let g1=0;function Le(n){return R(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===j.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||gi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Re.Emulated,id:"c",styles:n.styles||gi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=g1++,i.inputs=m0(n.inputs,t),i.outputs=m0(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(f0):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(p0):null,i})}function f0(n){return Wn(n)||function(n){return n[s_]||null}(n)}function p0(n){return function(n){return n[Ah]||null}(n)}const g0={};function xe(n){return R(()=>{const e={type:n.type,bootstrap:n.bootstrap||gi,declarations:n.declarations||gi,imports:n.imports||gi,exports:n.exports||gi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(g0[n.id]=n.type),e})}function m0(n,e){if(null==n)return fd;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const he=Le;function cs(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Wn(n){return n[yp]||null}function uo(n,e){const t=n[h0]||null;if(!t&&!0===e)throw new Error(`Type ${G(n)} does not have '\u0275mod' property.`);return t}function Po(n){return Array.isArray(n)&&"object"==typeof n[1]}function Ro(n){return Array.isArray(n)&&!0===n[1]}function l_(n){return 0!=(8&n.flags)}function _d(n){return 2==(2&n.flags)}function yd(n){return 1==(1&n.flags)}function ha(n){return null!==n.template}function _0(n){return 0!=(512&n[2])}function bc(n,e){return n.hasOwnProperty(xl)?n[xl]:null}class h_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function qn(){return b0}function b0(n){return n.type.prototype.ngOnChanges&&(n.setInput=E1),w1}function w1(){const n=W(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===fd)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function E1(n,e,t,i){const r=W(n)||function(n,e){return n[Fh]=e}(n,{previous:fd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new h_(l&&l.currentValue,e,o===fd),n[i]=e}qn.ngInherit=!0;const Fh="__ngSimpleChanges__";function W(n){return n[Fh]||null}const Bn="http://www.w3.org/2000/svg";let di;function Ti(n){return!!n.listen}const vu={createRenderer:(n,e)=>void 0!==di?di:"undefined"!=typeof document?document:void 0};function qi(n){for(;Array.isArray(n);)n=n[0];return n}function Nh(n,e){return qi(e[n])}function Ss(n,e){return qi(e[n.index])}function g_(n,e){return n.data[e]}function vd(n,e){return n[e]}function ds(n,e){const t=e[n];return Po(t)?t:t[0]}function Dl(n){return 4==(4&n[2])}function bd(n){return 128==(128&n[2])}function pa(n,e){return null==e?null:n[e]}function m_(n){n[18]=0}function Cp(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Ut={lFrame:Cu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function w0(){return Ut.bindingsEnabled}function Ce(){return Ut.lFrame.lView}function Sn(){return Ut.lFrame.tView}function Vn(n){return Ut.lFrame.contextLView=n,n[8]}function Tr(){let n=__();for(;null!==n&&64===n.type;)n=n.parent;return n}function __(){return Ut.lFrame.currentTNode}function Ha(n,e){const t=Ut.lFrame;t.currentTNode=n,t.isParent=e}function hr(){return Ut.lFrame.isParent}function Nr(){Ut.lFrame.isParent=!1}function Vh(){return Ut.isInCheckNoChangesMode}function Ep(n){Ut.isInCheckNoChangesMode=n}function qr(){const n=Ut.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function zs(){return Ut.lFrame.bindingIndex}function ga(){return Ut.lFrame.bindingIndex++}function fo(n){const e=Ut.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Cd(n,e){const t=Ut.lFrame;t.bindingIndex=t.bindingRootIndex=n,y_(e)}function y_(n){Ut.lFrame.currentDirectiveIndex=n}function v_(n){const e=Ut.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function E0(){return Ut.lFrame.currentQueryIndex}function b_(n){Ut.lFrame.currentQueryIndex=n}function Mp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function wd(n,e,t){if(t&vt.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&vt.Host||(r=Mp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ut.lFrame=O();return i.currentTNode=e,i.lView=n,!0}function zh(n){const e=O(),t=n[1];Ut.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function O(){const n=Ut.lFrame,e=null===n?null:n.child;return null===e?Cu(n):e}function Cu(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Hh(){const n=Ut.lFrame;return Ut.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const po=Hh;function pn(){const n=Hh();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Ms(){return Ut.lFrame.selectedIndex}function Hs(n){Ut.lFrame.selectedIndex=n}function rr(){const n=Ut.lFrame;return g_(n.tView,n.selectedIndex)}function xp(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class $h{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Dp(n,e,t){const i=Ti(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let Sd=!0;function Op(n){const e=Sd;return Sd=n,e}let x_=0;function hs(n,e){const t=Ip(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,T_(i.data,n),T_(e,null),T_(i.blueprint,null));const r=Wh(n,e),s=n.injectorIndex;if(T0(r)){const o=Ed(r),a=Ga(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function T_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Ip(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Wh(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function wc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Dh)&&(i=t[Dh]),null==i&&(i=t[Dh]=x_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:I0:e}(t);if("function"==typeof s){if(!wd(e,n,i))return i&vt.Host?A_(r,t,i):D0(e,t,i,r);try{const o=s(i);if(null!=o||i&vt.Optional)return o;gt(t)}finally{po()}}else if("number"==typeof s){let o=null,a=Ip(n,e),l=-1,c=i&vt.Host?e[16][6]:null;for((-1===a||i&vt.SkipSelf)&&(l=-1===a?Wh(n,e):e[a+8],-1!==l&&Yh(i,!1)?(o=e[1],a=Ed(l),e=Ga(l,e)):a=-1);-1!==a;){const d=e[1];if(Pp(s,a,d.data)){const f=Yr(a,e,t,o,i,c);if(f!==O0)return f}l=e[a+8],-1!==l&&Yh(i,e[1].data[a+8]===c)&&Pp(s,a,e)?(o=d,a=Ed(l),e=Ga(l,e)):a=-1}}}return D0(e,t,i,r)}const O0={};function I0(){return new Fo(Tr(),Ce())}function Yr(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=Md(a,o,t,null==i?_d(a)&&Sd:i!=o&&0!=(3&a.type),r&vt.Host&&s===a);return null!==d?xd(e,o,d,a):O0}function Md(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&ha(g)&&g.type===t)return l}return null}function xd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof $h}(r)){const o=r;o.resolving&&function(n,e){throw new H("200",`Circular dependency in DI detected for ${n}`)}(Be(s[t]));const a=Op(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ca(o.injectImpl):null;wd(n,i,vt.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=b0(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ca(l),Op(a),o.resolving=!1,po()}}return r}function Pp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[xl]||Xr(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[xl]||Xr(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Xr(n){return B(n)?()=>{const e=Xr(D(n));return e&&e()}:bc(n)}function fs(n){return function(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const i=t.length;let r=0;for(;r{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(Ad)?l[Ad]:Object.defineProperty(l,Ad,{value:[]})[Ad];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class _e{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=ae({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const Su=Function;function No(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Lo(t,e):e(t))}function Kh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Il(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Sc(n,e){const t=[];for(let i=0;i=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function k_(n,e){const t=Kr(n,e);if(t>=0)return n[1|t]}function Kr(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):G(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Tc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[xc]=null,n}const Rd=Pd(ya("Inject",n=>({token:n})),-1),yr=Pd(ya("Optional"),8),Xa=Pd(ya("SkipSelf"),4);let Fd;function Iu(n){var e;return(null===(e=function(){if(void 0===Fd&&(Fd=null,cn.trustedTypes))try{Fd=cn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Fd}())||void 0===e?void 0:e.createHTML(n))||n}class Fl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class j_ extends Fl{getTypeName(){return"HTML"}}class U_ extends Fl{getTypeName(){return"Style"}}class Gp extends Fl{getTypeName(){return"Script"}}class Nd extends Fl{getTypeName(){return"URL"}}class Nt extends Fl{getTypeName(){return"ResourceURL"}}function ps(n){return n instanceof Fl?n.changingThisBreaksApplicationSecurity:n}function Bo(n,e){const t=Oc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Oc(n){return n instanceof Fl&&n.getTypeName()||null}class X0{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Iu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class tx{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Iu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Iu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0_o(e.trim())).join(", ")}function Vo(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Qh(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Wp=Vo("area,br,col,hr,img,wbr"),Z0=Vo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Q0=Vo("rp,rt"),H_=Qh(Wp,Qh(Z0,Vo("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Qh(Q0,Vo("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Qh(Q0,Z0)),$_=Vo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),G_=Vo("srcset"),W_=Qh($_,G_,Vo("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Vo("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),ax=Vo("script,style,template");class q_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!H_.hasOwnProperty(t))return this.sanitizedSomething=!0,!ax.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();H_.hasOwnProperty(t)&&!Wp.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Yp(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return t}}const J0=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Jh=/([^\#-~ |!])/g;function Yp(n){return n.replace(/&/g,"&").replace(J0,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Jh,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let ef;function Y_(n,e){let t=null;try{ef=ef||function(n){const e=new tx(n);return function(){try{return!!(new window.DOMParser).parseFromString(Iu(""),"text/html")}catch(n){return!1}}()?new X0(e):e}(n);let i=e?String(e):"";t=ef.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=t.innerHTML,t=ef.getInertBodyElement(i)}while(i!==s);return Iu((new q_).sanitizeChildren(Ld(t)||t))}finally{if(t){const i=Ld(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Ld(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var on=(()=>((on=on||{})[on.NONE=0]="NONE",on[on.HTML=1]="HTML",on[on.STYLE=2]="STYLE",on[on.SCRIPT=3]="SCRIPT",on[on.URL=4]="URL",on[on.RESOURCE_URL=5]="RESOURCE_URL",on))();const Z_="__ngContext__";function Zr(n,e){n[Z_]=e}function Q_(n){const e=function(n){return n[Z_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Kp(n){return n.ngOriginalError}function bx(n,...e){n.error(...e)}class Uo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||bx}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(Kp(e)):null}_findOriginalError(e){let t=e&&Kp(e);for(;t&&Kp(t);)t=Kp(t);return t||null}}const uC=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(cn))();function ny(n){return n.ownerDocument.defaultView}function Qp(n){return n.ownerDocument}function Za(n){return n instanceof Function?n():n}var yo=(()=>((yo=yo||{})[yo.Important=1]="Important",yo[yo.DashCase=2]="DashCase",yo))();function ry(n,e){return undefined(n,e)}function rf(n){const e=n[3];return Ro(e)?e[3]:e}function Vd(n){return gC(n[13])}function oy(n){return gC(n[4])}function gC(n){for(;null!==n&&!Ro(n);)n=n[4];return n}function jd(n,e,t,i,r){if(null!=i){let s,o=!1;Ro(i)?s=i:Po(i)&&(o=!0,i=i[0]);const a=qi(i);0===n&&null!==t?null==r?bC(e,t,a):Qa(e,t,a,r||null,!0):1===n&&null!==t?Qa(e,t,a,r||null,!0):2===n?function(n,e,t){const i=eg(n,e);i&&function(n,e,t,i){Ti(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==qi(t)&&jd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Il(n,10+e);!function(n,e){Ud(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function uy(n,e){if(!(256&e[2])){const t=e[11];Ti(t)&&t.destroyNode&&Ud(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Jp(n[1],n);for(;e;){let t=null;if(Po(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Po(e)&&Jp(e[1],e),e=e[3];null===e&&(e=n),Po(e)&&Jp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Jp(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==of(g,c,0)||2&i&&c!==p){if(ba(i))return!1;o=!0}}}}else{if(!o&&!ba(i)&&!ba(l))return!1;if(o&&ba(l))continue;o=!1,i=l|1&i}}return ba(i)||o}function ba(n){return 0==(1&n)}function Gx(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!ba(o)&&(e+=RC(s,r),r=""),i=o,s=s||!ba(i);t++}return""!==r&&(e+=RC(s,r)),e}const St={};function Y(n){kC(Sn(),Ce(),Ms()+n,Vh())}function kC(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Tp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Ap(e,s,0,t)}Hs(t)}function Ja(n,e){return n<<17|e<<2}function Ot(n){return n>>17&32767}function Yi(n){return 2|n}function Nl(n){return(131068&n)>>2}function el(n,e){return-131069&n|e<<2}function my(n){return 1|n}function HC(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&kC(n,e,20,Vh()),t(i,r)}finally{Hs(s)}}function GC(n,e,t){if(l_(e)){const r=e.directiveEnd;for(let s=e.directiveStart;s0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function ew(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function tw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function vT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&Ay(t)}}function Ay(n){for(let i=Vd(n);null!==i;i=oy(i))for(let r=10;r0&&Ay(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&Ay(r)}}function xT(n,e){const t=ds(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function rw(n){return n[7]||(n[7]=[])}function ug(n){return n.cleanup||(n.cleanup=[])}function Ry(n,e,t){return(null===n||ha(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function ky(n,e){const t=n[9],i=t?t.get(Uo,null):null;i&&i.handleError(e)}function sw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Lo([e],a=>this.processInjectorType(a,[],s)),this.records.set(ku,Nu(void 0,this));const o=this.records.get(Fu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:G(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=Tu,i=vt.Default){this.assertNotDestroyed();const r=Id(this),s=ca(void 0);try{if(!(i&vt.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof _e}(e)&&ir(e);a=l&&this.injectableDefInScope(l)?Nu(Vy(e),df):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&vt.Self?ow():this.parent).get(e,t=i&vt.Optional&&t===Tu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[xc]=o[xc]||[]).unshift(G(e)),r)throw o;return xs(o,e,"R3InjectorError",this.source)}throw o}finally{ca(s),Id(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(G(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=D(e)))return!1;let r=mu(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=mu(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Lo(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||gi))}}this.injectorDefTypes.add(o);const l=bc(o)||(()=>new o);this.records.set(o,Nu(l,df));const c=r.providers;if(null!=c&&!a){const d=e;Lo(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Rc(e=D(e))?e:D(e&&e.provide);const s=function(n,e,t){return cw(n)?Nu(void 0,n.useValue):Nu(lw(n),df)}(e);if(Rc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Nu(void 0,df,!0),o.factory=()=>Du(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===df&&(t.value=RT,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=D(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Vy(n){const e=ir(n),t=null!==e?e.factory:bc(n);if(null!==t)return t;if(n instanceof _e)throw new Error(`Token ${G(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=Sc(e,"?");throw new Error(`Can't resolve all parameters for ${G(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[la]||n[ja]);if(e){const t=function(n){if(n.hasOwnProperty("name"))return n.name;const e=(""+n).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${t}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${t}" class.`),e}return null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new Error("unreachable")}function lw(n,e,t){let i;if(Rc(n)){const r=D(n);return bc(r)||Vy(r)}if(cw(n))i=()=>D(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Du(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>I(D(n.useExisting));else{const r=D(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return bc(r)||Vy(r);i=()=>new r(...Du(n.deps))}return i}function Nu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function cw(n){return null!==n&&"object"==typeof n&&Bp in n}function Rc(n){return"function"==typeof n}const uw=function(n,e,t){return function(n,e=null,t=null,i){const r=aw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Tt{static create(e,t){return Array.isArray(e)?uw(e,t,""):uw(e.providers,e.parent,e.name||"")}}function u9(n,e){xp(Q_(n)[1],Tr())}function ht(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(ha(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=qT(n.inputs),o.declaredInputs=qT(n.declaredInputs),o.outputs=qT(n.outputs);const a=r.hostBindings;a&&p9(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&h9(n,l),c&&f9(n,c),hu(n.inputs,r.inputs),hu(n.declaredInputs,r.declaredInputs),hu(n.outputs,r.outputs),ha(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Gh(r.hostAttrs,t=Gh(t,r.hostAttrs))}}(i)}function qT(n){return n===fd?{}:n===gi?[]:n}function h9(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function f9(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function p9(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Tt.THROW_IF_NOT_FOUND=Tu,Tt.NULL=new Ds,Tt.\u0275prov=ae({token:Tt,providedIn:"any",factory:()=>I(ku)}),Tt.__NG_ELEMENT_ID__=-1;let gw=null;function hg(){if(!gw){const n=cn.Symbol;if(n&&n.iterator)gw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(qi(L[i.index])):i.index;if(Ti(t)){let L=null;if(!a&&l&&(L=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==L)(L.__ngLastListenerFn__||L).__ngNextListenerFn__=s,L.__ngLastListenerFn__=s,g=!1;else{s=tA(i,e,f,s,!1);const U=t.listen(w,r,s);p.push(s,U),d&&d.push(r,x,C,C+1)}}else s=tA(i,e,f,s,!0),w.addEventListener(r,s,o),p.push(s),d&&d.push(r,x,C,o)}else s=tA(i,e,f,s,!1);const _=i.outputs;let y;if(g&&null!==_&&(y=_[r])){const v=y.length;if(v)for(let w=0;w0;)e=e[15],n--;return e}(n,Ut.lFrame.contextLView))[8]}(n)}function q9(n,e){let t=null;const i=function(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(n);for(let r=0;r=0}const Jr={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function o2(n){return n.substring(Jr.key,Jr.keyEnd)}function a2(n,e){const t=Jr.textEnd;return t===e?-1:(e=Jr.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Jr.key=e,t),Eg(n,e,t))}function Eg(n,e,t){for(;e=0;t=a2(e,t))go(n,o2(e),!0)}function Ul(n,e,t,i){const r=Ce(),s=Sn(),o=fo(2);s.firstUpdatePass&&f2(s,n,o,i),e!==St&&qs(r,o,e)&&g2(s,s.data[Ms()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=G(ps(n)))),n}(e,t),i,o)}function zl(n,e,t,i){const r=Sn(),s=fo(2);r.firstUpdatePass&&f2(r,null,s,i);const o=Ce();if(t!==St&&qs(o,s,t)){const a=r.data[Ms()];if(_2(a,i)&&!h2(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=q(l,t||"")),eA(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===St&&(r=gi);let l=0,c=0,d=0=n.expandoStartIndex}function f2(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Ms()],o=h2(n,t);_2(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=v_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Xy(t=iA(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=iA(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Nl(i))return n[Ot(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=iA(null,n,e,l[1],i),l=Xy(l,e.attrs,i),function(n,e,t,i){n[Ot(t?e.classBindings:e.styleBindings)]=i}(n,e,i,l))}else s=function(n,e,t){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Ot(n[a+1]);n[i+1]=Ja(p,a),0!==p&&(n[p+1]=el(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=Ja(a,0),0!==a&&(n[a+1]=el(n[a+1],i)),a=i;else n[i+1]=Ja(l,0),0===a?a=i:n[l+1]=el(n[l+1],i),l=i;c&&(n[i+1]=Yi(n[i+1])),s2(n,d,i,!0),s2(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Kr(s,e)>=0&&(t[i+1]=my(t[i+1]))}(e,d,n,i,s),o=Ja(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function iA(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===St&&(p=f?gi:void 0);let g=f?k_(p,i):d===i?p:void 0;if(c&&!vw(g)&&(g=k_(l,i)),vw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Ot(_):Nl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=k_(l,i))}return a}function vw(n){return void 0!==n}function _2(n,e){return 0!=(n.flags&(e?16:32))}function Te(n,e=""){const t=Ce(),i=Sn(),r=n+20,s=i.firstCreatePass?Hd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return Ti(n)?n.createText(e):n.createTextNode(e)}(t[11],e);tg(i,t,o,s),Ha(s,!1)}function Ai(n){return Os("",n,""),Ai}function Os(n,e,t){const i=Ce(),r=pg(i,n,e,t);return r!==St&&Ll(i,Ms(),r),Os}function bw(n,e,t,i,r){const s=Ce(),o=function(n,e,t,i,r,s){const a=hf(n,zs(),t,r);return fo(2),a?e+de(t)+i+de(r)+s:St}(s,n,e,t,i,r);return o!==St&&Ll(s,Ms(),o),bw}function sl(n,e,t){const i=Ce();return qs(i,ga(),e)&&vo(Sn(),rr(),i,n,e,i[11],t,!0),sl}function Sg(n,e,t){const i=Ce();if(qs(i,ga(),e)){const s=Sn(),o=rr();vo(s,o,i,n,e,Ry(v_(s.data),o,i),t,!0)}return Sg}const mf=void 0;var D7=["en",[["a","p"],["AM","PM"],mf],[["AM","PM"],mf,mf],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],mf,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],mf,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",mf,"{1} 'at' {0}",mf],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Mg={};function N2(n){return n in Mg||(Mg[n]=cn.ng&&cn.ng.common&&cn.ng.common.locales&&cn.ng.common.locales[n]),Mg[n]}var tt=(()=>((tt=tt||{})[tt.LocaleId=0]="LocaleId",tt[tt.DayPeriodsFormat=1]="DayPeriodsFormat",tt[tt.DayPeriodsStandalone=2]="DayPeriodsStandalone",tt[tt.DaysFormat=3]="DaysFormat",tt[tt.DaysStandalone=4]="DaysStandalone",tt[tt.MonthsFormat=5]="MonthsFormat",tt[tt.MonthsStandalone=6]="MonthsStandalone",tt[tt.Eras=7]="Eras",tt[tt.FirstDayOfWeek=8]="FirstDayOfWeek",tt[tt.WeekendRange=9]="WeekendRange",tt[tt.DateFormat=10]="DateFormat",tt[tt.TimeFormat=11]="TimeFormat",tt[tt.DateTimeFormat=12]="DateTimeFormat",tt[tt.NumberSymbols=13]="NumberSymbols",tt[tt.NumberFormats=14]="NumberFormats",tt[tt.CurrencyCode=15]="CurrencyCode",tt[tt.CurrencySymbol=16]="CurrencySymbol",tt[tt.CurrencyName=17]="CurrencyName",tt[tt.Currencies=18]="Currencies",tt[tt.Directionality=19]="Directionality",tt[tt.PluralCase=20]="PluralCase",tt[tt.ExtraData=21]="ExtraData",tt))();const Cw="en-US";let L2=Cw;function rA(n){Gi(n,"Expected localeId to be defined"),"string"==typeof n&&(L2=n.toLowerCase().replace(/_/g,"-"))}function aA(n,e,t,i,r){if(n=D(n),Array.isArray(n))for(let s=0;s>20;if(Rc(n)||!n.multi){const g=new $h(l,r,E),_=cA(a,e,r?d:d+p,f);-1===_?(wc(hs(c,o),s,a),lA(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[_]=g,o[_]=g)}else{const g=cA(a,e,d+p,f),_=cA(a,e,d,d+p),y=g>=0&&t[g],v=_>=0&&t[_];if(r&&!v||!r&&!y){wc(hs(c,o),s,a);const w=function(n,e,t,i,r){const s=new $h(n,t,E);return s.multi=[],s.index=e,s.componentProviders=0,aL(s,r,i&&!t),s}(r?xY:MY,t.length,r,i,l);!r&&v&&(t[_].providerFactory=w),lA(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(w),o.push(w)}else lA(s,n,g>-1?g:_,aL(t[r?_:g],l,!r&&i));!r&&i&&v&&t[_].componentProviders++}}}function lA(n,e,t,i){const r=Rc(e);if(r||function(n){return!!n.useClass}(e)){const o=(e.useClass||e).prototype.ngOnDestroy;if(o){const a=n.destroyHooks||(n.destroyHooks=[]);if(!r&&e.multi){const l=a.indexOf(t);-1===l?a.push(t,[i,o]):a[l+1].push(i,o)}else a.push(t,o)}}}function aL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function cA(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Sn();if(i.firstCreatePass){const r=ha(n);aA(t,i.data,i.blueprint,r,!0),aA(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class lL{}const uL="ngComponent";class DY{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${G(n)}. Did you add it to @NgModule.entryComponents?`);return e[uL]=n,e}(e)}}class ol{}function xw(...n){}function Tg(n,e){return new nt(Ss(n,e))}ol.NULL=new DY;const PY=function(){return Tg(Tr(),Ce())};let nt=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=PY,n})();function dL(n){return n instanceof nt?n.nativeElement:n}class _f{}let Lc=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>kY(),n})();const kY=function(){const n=Ce(),t=ds(Tr().index,n);return function(n){return n[11]}(Po(t)?t:n)};let hA=(()=>{class n{}return n.\u0275prov=ae({token:n,providedIn:"root",factory:()=>null}),n})();class Lu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const hL=new Lu("12.2.5");class fL{constructor(){}supports(e){return $y(e)}create(e){return new BY(e)}}const LY=(n,e)=>e;class BY{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||LY}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new VY(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new pL),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new pL),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class VY{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class jY{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class pL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new jY,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function gL(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new zY(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class zY{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function _L(){return new Ag([new fL])}let Ag=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||_L()),deps:[[n,new Xa,new yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=ae({token:n,providedIn:"root",factory:_L}),n})();function yL(){return new Dg([new mL])}let Dg=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||yL()),deps:[[n,new Xa,new yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=ae({token:n,providedIn:"root",factory:yL}),n})();function Tw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(qi(s)),Ro(s))for(let a=10;a-1&&(cy(e,i),Il(t,i))}this._attachedToViewContainer=!1}uy(this._lView[1],this._lView)}onDestroy(e){qC(this._lView[1],this._lView,null,e)}markForCheck(){Dy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Iy(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Ep(!0);try{Iy(n,e,t)}finally{Ep(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Ud(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class $Y extends ev{constructor(e){super(e),this._view=e}detectChanges(){iw(this._view)}checkNoChanges(){!function(n){Ep(!0);try{iw(n)}finally{Ep(!1)}}(this._view)}get context(){return null}}const WY=function(n){return function(n,e,t){if(_d(n)&&!t){const i=ds(n.index,e);return new ev(i,i)}return 47&n.type?new ev(e[16],e):null}(Tr(),Ce(),16==(16&n))};let Un=(()=>{class n{}return n.__NG_ELEMENT_ID__=WY,n})();const XY=[new mL],ZY=new Ag([new fL]),QY=new Dg(XY),eX=function(){return Aw(Tr(),Ce())};let Xs=(()=>{class n{}return n.__NG_ELEMENT_ID__=eX,n})();const tX=Xs,nX=class extends tX{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=lf(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),cf(t,i,e),new ev(i)}};function Aw(n,e){return 4&n.type?new nX(e,n,Tg(n,e)):null}class Bc{}const sX=function(){return wL(Tr(),Ce())};let es=(()=>{class n{}return n.__NG_ELEMENT_ID__=sX,n})();const aX=es,bL=class extends aX{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return Tg(this._hostTNode,this._hostLView)}get injector(){return new Fo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Wh(this._hostTNode,this._hostLView);if(T0(e)){const t=Ga(e,this._hostLView),i=Ed(e);return new Fo(t[1].data[i+8],t)}return new Fo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=CL(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Bc,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Ro(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new bL(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),iuC});class $L extends lL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(Kx).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return HL(this.componentDef.inputs)}get outputs(){return HL(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,Rg,r);return s!==Rg||i===Rg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(_f,vu),a=s.get(hA,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(Ti(n))return n.selectRootElement(e,t===Re.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ly(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?Bn:"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||uC,clean:IT,playerHandler:e||null,flags:0}}(),g=lg(0,null,null,1,0,null,null,null,null,null),_=lf(null,g,p,f,null,null,o,l,a,s);let y,v;zh(_);try{const w=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Hd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(dg(l,c,!0),null!==n&&(Dp(r,n,c),null!==l.classes&&py(r,n,l.classes),null!==l.styles&&DC(r,n,l.styles)));const d=i.createRenderer(n,e),f=lf(t,ag(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(wc(hs(l,t),o,e.type),tw(o,l),My(l,t.length,1)),cg(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)Dp(l,d,["ng-version",hL.full]);else{const{attrs:C,classes:x}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&py(l,d,x.join(" "))}if(v=g_(g,20),void 0!==t){const C=v.projection=[];for(let x=0;xl(o,e)),e.contentQueries){const l=Tr();e.contentQueries(1,o,l.directiveStart)}const a=Tr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(Hs(a.index),JC(t[1],a,0,a.directiveStart,a.directiveEnd,e),ew(e,o)),o}(w,this.componentDef,_,p,[u9]),cf(g,_,null)}finally{pn()}return new oK(this.componentType,y,Tg(v,_),_,v)}}class oK extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new $Y(r),this.componentType=e}get injector(){return new Fo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const kg=new Map;class cK extends Bc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new zL(this);const i=uo(e),r=function(n){return n[p1]||null}(e);r&&rA(r),this._bootstrapComponents=Za(i.bootstrap),this._r3Injector=aw(e,t,[{provide:Bc,useValue:this},{provide:ol,useValue:this.componentFactoryResolver}],G(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Tt.THROW_IF_NOT_FOUND,i=vt.Default){return e===Tt||e===Bc||e===ku?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class xA extends class{}{constructor(e){super(),this.moduleType=e,null!==uo(e)&&function(n){const e=new Set;!function t(i){const r=uo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${G(e)} vs ${G(e.name)}`)}(s,kg.get(s),i),kg.set(s,i));const o=Za(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new cK(this.moduleType,e)}}function lv(n,e,t){const i=qr()+n,r=Ce();return r[i]===St?Fc(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function Fg(n,e,t,i){return qL(Ce(),qr(),n,e,t,i)}function cv(n,e){const t=n[e];return t===St?void 0:t}function qL(n,e,t,i,r,s){const o=e+t;return qs(n,o,r)?Fc(n,o+1,s?i.call(s,r):i(r)):cv(n,o+1)}function yn(n,e){const t=Sn();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new H("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=bc(i.type)),o=ca(E);try{const a=Op(!1),l=s();return Op(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Ce(),r,l),l}finally{ca(o)}}function wn(n,e,t){const i=n+20,r=Ce(),s=vd(r,i);return dv(r,uv(r,i)?qL(r,qr(),e,s.transform,t,s):s.transform(t))}function QL(n,e,t,i){const r=n+20,s=Ce(),o=vd(s,r);return dv(s,uv(s,r)?function(n,e,t,i,r,s,o){const a=e+t;return hf(n,a,r,s)?Fc(n,a+2,o?i.call(o,r,s):i(r,s)):cv(n,a+2)}(s,qr(),e,o.transform,t,i,o):o.transform(t,i))}function uv(n,e){return n[1].data[e].pure}function dv(n,e){return Vl.isWrapped(e)&&(e=Vl.unwrap(e),n[zs()]=St),e}function TA(n){return e=>{setTimeout(n,void 0,e)}}const Pe=class extends we{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=TA(l),a&&(a=TA(a)),c&&(c=TA(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof Ie&&e.add(d),d}};function EK(){return this._results[hg()]()}class bf{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=hg(),i=bf.prototype;i[t]||(i[t]=EK)}get changes(){return this._changes||(this._changes=new Pe)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=No(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=xw,this.reject=xw,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(I(Cf,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const fv=new _e("AppId"),rZ={provide:fv,useFactory:function(){return`${BA()}${BA()}${BA()}`},deps:[]};function BA(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const CB=new _e("Platform Initializer"),cl=new _e("Platform ID"),pv=new _e("appBootstrapListener");let Nw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Bu=new _e("LocaleId"),wB=new _e("DefaultCurrencyCode");class oZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const VA=function(n){return new xA(n)},aZ=VA,lZ=function(n){return Promise.resolve(VA(n))},EB=function(n){const e=VA(n),i=Za(uo(n).declarations).reduce((r,s)=>{const o=Wn(s);return o&&r.push(new $L(o)),r},[]);return new oZ(e,i)},cZ=EB,uZ=function(n){return Promise.resolve(EB(n))};let wf=(()=>{class n{constructor(){this.compileModuleSync=aZ,this.compileModuleAsync=lZ,this.compileModuleAndAllComponentsSync=cZ,this.compileModuleAndAllComponentsAsync=uZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const SB=new _e("compilerOptions"),hZ=(()=>Promise.resolve(0))();function jA(n){"undefined"==typeof Zone?hZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class lt{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Pe(!1),this.onMicrotaskEmpty=new Pe(!1),this.onStable=new Pe(!1),this.onError=new Pe(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=cn.requestAnimationFrame,e=cn.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(cn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,zA(n),n.isCheckStableRunning=!0,UA(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),zA(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return MB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),xB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return MB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),xB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,zA(n),UA(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!lt.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(lt.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,pZ,xw,xw);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const pZ={};function UA(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function zA(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function MB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function xB(n){n._nesting--,UA(n)}class _Z{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Pe,this.onMicrotaskEmpty=new Pe,this.onStable=new Pe,this.onError=new Pe}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let HA=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{lt.assertNotInAngularZone(),jA(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())jA(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(I(lt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),TB=(()=>{class n{constructor(){this._applications=new Map,$A.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return $A.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class yZ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let $A=new yZ,AB=!0,DB=!1;function wo(){return DB=!0,AB}let Gl;const OB=new _e("AllowMultipleToken");function IB(n,e,t=[]){const i=`Platform: ${e}`,r=new _e(i);return(s=[])=>{let o=WA();if(!o||o.injector.get(OB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Fu,useValue:"platform"});!function(n){if(Gl&&!Gl.destroyed&&!Gl.injector.get(OB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Gl=n.get(PB);const e=n.get(CB,null);e&&e.forEach(t=>t())}(Tt.create({providers:a,name:i}))}return function(n){const e=WA();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function WA(){return Gl&&!Gl.destroyed?Gl:null}let PB=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new _Z:("zone.js"===n?void 0:n)||new lt({enableLongStackTrace:wo(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:lt,useValue:a}];return a.run(()=>{const c=Tt.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Uo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{qA(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return Wy(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(Lg);return p.runInitializers(),p.donePromise.then(()=>(rA(d.injector.get(Bu,Cw)||Cw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=RB({},i);return function(n,e,t){const i=new xA(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(Yd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${G(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function RB(n,e){return Array.isArray(e)?e.reduce(RB,n):Object.assign(Object.assign({},n),e)}let Yd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new oe(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new oe(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{lt.assertNotInAngularZone(),jA(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{lt.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=ki(a,l.pipe(Vs()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof lL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Bc),a=r.create(Tt.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(HA,null),d=c&&a.injector.get(TB);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),qA(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;qA(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(pv,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(Tt),I(Uo),I(ol),I(Lg))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function qA(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const GZ=IB(null,"core",[{provide:cl,useValue:"unknown"},{provide:PB,deps:[Tt]},{provide:TB,deps:[]},{provide:Nw,deps:[]}]),KZ=[{provide:Yd,useClass:Yd,deps:[lt,Tt,Uo,ol,Lg]},{provide:iK,deps:[lt],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Lg,useClass:Lg,deps:[[new yr,Cf]]},{provide:wf,useClass:wf,deps:[]},rZ,{provide:Ag,useFactory:function(){return ZY},deps:[]},{provide:Dg,useFactory:function(){return QY},deps:[]},{provide:Bu,useFactory:function(n){return rA(n=n||"undefined"!=typeof $localize&&$localize.locale||Cw),n},deps:[[new Rd(Bu),new yr,new Xa]]},{provide:wB,useValue:"USD"}];let QZ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(I(Yd))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:KZ}),n})(),Yw=null;function Vc(){return Yw}const rt=new _e("DocumentToken");let Mf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:ZQ,token:n,providedIn:"platform"}),n})();function ZQ(){return I(a3)}let a3=(()=>{class n extends Mf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Vc().getBaseHref(this._doc)}onPopState(t){const i=Vc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Vc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){l3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){l3()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:JQ,token:n,providedIn:"platform"}),n})();function l3(){return!!window.history.pushState}function JQ(){return new a3(I(rt))}function lD(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}function c3(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function ju(n){return n&&"?"!==n[0]?"?"+n:n}let jg=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:eJ,token:n,providedIn:"root"}),n})();function eJ(n){const e=I(rt).location;return new u3(I(Mf),e&&e.origin||"")}const cD=new _e("appBaseHref");let u3=(()=>{class n extends jg{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return lD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+ju(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+ju(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+ju(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(I(Mf),I(cD,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Ug=(()=>{class n{constructor(t,i){this._subject=new Pe,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=c3(d3(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+ju(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,d3(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ju(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ju(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(I(jg),I(Mf))},n.normalizeQueryParams=ju,n.joinWithSlash=lD,n.stripTrailingSlash=c3,n.\u0275prov=ae({factory:nJ,token:n,providedIn:"root"}),n})();function nJ(){return new Ug(I(jg),I(Mf))}function d3(n){return n.replace(/\/index.html$/,"")}var Br=(()=>((Br=Br||{})[Br.Zero=0]="Zero",Br[Br.One=1]="One",Br[Br.Two=2]="Two",Br[Br.Few=3]="Few",Br[Br.Many=4]="Many",Br[Br.Other=5]="Other",Br))();const uJ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=N2(e);if(t)return t;const i=e.split("-")[0];if(t=N2(i),t)return t;if("en"===i)return D7;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[tt.PluralCase]};class rE{}let VJ=(()=>{class n extends rE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(uJ(i||this.locale)(t)){case Br.Zero:return"zero";case Br.One:return"one";case Br.Two:return"two";case Br.Few:return"few";case Br.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(I(Bu))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function b3(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}let sE=(()=>{class n{constructor(t,i,r,s){this._iterableDiffers=t,this._keyValueDiffers=i,this._ngEl=r,this._renderer=s,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(t){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&($y(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachChangedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachRemovedItem(i=>{i.previousValue&&this._toggleClass(i.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(i=>{if("string"!=typeof i.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${G(i.item)}`);this._toggleClass(i.item,!0)}),t.forEachRemovedItem(i=>this._toggleClass(i.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!0)):Object.keys(t).forEach(i=>this._toggleClass(i,!!t[i])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!1)):Object.keys(t).forEach(i=>this._toggleClass(i,!1)))}_toggleClass(t,i){(t=t.trim())&&t.split(/\s+/g).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ag),E(Dg),E(nt),E(Lc))},n.\u0275dir=he({type:n,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),n})();class UJ{constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Xl=(()=>{class n{constructor(t,i,r){this._viewContainer=t,this._template=i,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(i){throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const i=[];t.forEachOperation((r,s,o)=>{if(null==r.previousIndex){const a=this._viewContainer.createEmbeddedView(this._template,new UJ(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new C3(r,a);i.push(l)}else if(null==o)this._viewContainer.remove(null===s?void 0:s);else if(null!==s){const a=this._viewContainer.get(s);this._viewContainer.move(a,o);const l=new C3(r,a);i.push(l)}});for(let r=0;r{this._viewContainer.get(r.currentIndex).context.$implicit=r.item})}_perViewChange(t,i){t.context.$implicit=i.item}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Ag))},n.\u0275dir=he({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class C3{constructor(e,t){this.record=e,this.view=t}}let Is=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new HJ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){w3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){w3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs))},n.\u0275dir=he({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class HJ{constructor(){this.$implicit=null,this.ngIf=null}}function w3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${G(e)}'.`)}class yD{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Cv=(()=>{class n{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const i=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||i,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),i}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let i=0;i{class n{constructor(t,i,r){this.ngSwitch=r,r._addCase(),this._view=new yD(t,i)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Cv,9))},n.\u0275dir=he({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),n})(),E3=(()=>{class n{constructor(t,i,r){r._addDefault(new yD(t,i))}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Cv,9))},n.\u0275dir=he({type:n,selectors:[["","ngSwitchDefault",""]]}),n})(),M3=(()=>{class n{constructor(t,i,r){this._ngEl=t,this._differs=i,this._renderer=r,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,i){const[r,s]=t.split(".");null!=(i=null!=i&&s?`${i}${s}`:i)?this._renderer.setStyle(this._ngEl.nativeElement,r,i):this._renderer.removeStyle(this._ngEl.nativeElement,r)}_applyChanges(t){t.forEachRemovedItem(i=>this._setStyle(i.key,null)),t.forEachAddedItem(i=>this._setStyle(i.key,i.currentValue)),t.forEachChangedItem(i=>this._setStyle(i.key,i.currentValue))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Dg),E(Lc))},n.\u0275dir=he({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),n})();function Kl(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${G(n)}'`)}class WJ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class qJ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const YJ=new qJ,XJ=new WJ;let zu=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(Wy(t))return YJ;if(qN(t))return XJ;throw Kl(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(Un,16))},n.\u0275pipe=cs({name:"async",type:n,pure:!1}),n})();const tee=/#/g;let x3=(()=>{class n{constructor(t){this._localization=t}transform(t,i,r){if(null==t)return"";if("object"!=typeof i||null===i)throw Kl(n,i);return i[function(n,e,t,i){let r=`=${n}`;if(e.indexOf(r)>-1||(r=t.getPluralCategory(n,i),e.indexOf(r)>-1))return r;if(e.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${n}"`)}(t,Object.keys(i),this._localization,r)].replace(tee,t.toString())}}return n.\u0275fac=function(t){return new(t||n)(E(rE,16))},n.\u0275pipe=cs({name:"i18nPlural",type:n,pure:!0}),n})(),T3=(()=>{class n{transform(t){return JSON.stringify(t,null,2)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=cs({name:"json",type:n,pure:!1}),n})(),bn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:rE,useClass:VJ}]}),n})();const D3="browser";function xf(n){return n===D3}function wD(n){return"server"===n}class P3{}class ED extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){Yw||(Yw=n)}(new ED)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(wv=wv||document.querySelector("base"),wv?wv.getAttribute("href"):null);return null==t?null:function(n){oE=oE||document.createElement("a"),oE.setAttribute("href",n);const e=oE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){wv=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return b3(document.cookie,e)}}let oE,wv=null;const R3=new _e("TRANSITION_ID"),yee=[{provide:Cf,useFactory:function(n,e,t){return()=>{t.get(Lg).donePromise.then(()=>{const i=Vc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},cn.getAllAngularTestabilities=()=>e.getAllTestabilities(),cn.getAllAngularRootElements=()=>e.getAllRootElements(),cn.frameworkStabilizers||(cn.frameworkStabilizers=[]),cn.frameworkStabilizers.push(i=>{const r=cn.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Vc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let vee=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Ev=new _e("EventManagerPlugins");let lE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Sv=(()=>{class n extends F3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(N3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(N3))}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function N3(n){Vc().remove(n)}const xD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},TD=/%COMP%/g;function cE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let uE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new AD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Re.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new kee(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Re.ShadowDom:return new Fee(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=cE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(I(lE),I(Sv),I(fv))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class AD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(xD[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=xD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=xD[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(yo.DashCase|yo.Important)?e.style.setProperty(t,i,r&yo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&yo.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,V3(i)):this.eventManager.addEventListener(e,t,V3(i))}}class kee extends AD{constructor(e,t,i,r){super(e),this.component=i;const s=cE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(TD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(TD,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class Fee extends AD{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=cE(r.id,r.styles,[]);for(let o=0;o{class n extends MD{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const z3=["alt","control","meta","shift"],Hee={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},H3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},$ee={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Gee=(()=>{class n extends MD{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Vc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(z3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&H3.hasOwnProperty(e)&&(e=H3[e]))}return Hee[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),z3.forEach(s=>{s!=r&&$ee[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Kd=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return I(OD)},token:n,providedIn:"root"}),n})(),OD=(()=>{class n extends Kd{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case on.NONE:return i;case on.HTML:return Bo(i,"HTML")?ps(i):Y_(this._doc,String(i)).toString();case on.STYLE:return Bo(i,"Style")?ps(i):i;case on.SCRIPT:if(Bo(i,"Script"))return ps(i);throw new Error("unsafe value used in a script context");case on.URL:return Oc(i),Bo(i,"URL")?ps(i):_o(String(i));case on.RESOURCE_URL:if(Bo(i,"ResourceURL"))return ps(i);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return function(n){return new j_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new U_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Gp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new Nd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Nt(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return function(n){return new OD(n.get(rt))}(I(ku))},token:n,providedIn:"root"}),n})();const Jee=IB(GZ,"browser",[{provide:cl,useValue:D3},{provide:CB,useValue:function(){ED.makeCurrent(),SD.init()},multi:!0},{provide:rt,useFactory:function(){return function(n){di=n}(document),document},deps:[]}]),ete=[[],{provide:Fu,useValue:"root"},{provide:Uo,useFactory:function(){return new Uo},deps:[]},{provide:Ev,useClass:Nee,multi:!0,deps:[rt,lt,cl]},{provide:Ev,useClass:Gee,multi:!0,deps:[rt]},[],{provide:uE,useClass:uE,deps:[lE,Sv,fv]},{provide:_f,useExisting:uE},{provide:F3,useExisting:Sv},{provide:Sv,useClass:Sv,deps:[rt]},{provide:HA,useClass:HA,deps:[lt]},{provide:lE,useClass:lE,deps:[Ev,lt]},{provide:P3,useClass:vee,deps:[]},[]];let dE=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:fv,useValue:t.appId},{provide:R3,useExisting:fv},yee]}}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:ete,imports:[bn,QZ]}),n})();"undefined"!=typeof window&&window;class lte extends Ie{constructor(e,t){super()}schedule(e,t=0){return this}}class hE extends lte{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let G3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Zl extends G3{constructor(e,t=G3.now){super(e,()=>Zl.delegate&&Zl.delegate!==this?Zl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Zl.delegate&&Zl.delegate!==this?Zl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const dte=new class extends Zl{}(class extends hE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Ql=new oe(n=>n.complete());function fE(n){return n?function(n){return new oe(e=>n.schedule(()=>e.complete()))}(n):Ql}function st(...n){let e=n[n.length-1];return Ln(e)?(n.pop(),Ri(n,e)):Ba(n)}function zg(n,e){return new oe(e?t=>e.schedule(fte,0,{error:n,subscriber:t}):t=>t.error(n))}function fte({error:n,subscriber:e}){e.error(n)}class qo{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return st(this.value);case"E":return zg(this.error);case"C":return fE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new qo("N",e):qo.undefinedValueNotification}static createError(e){return new qo("E",void 0,e)}static createComplete(){return qo.completeNotification}}qo.completeNotification=new qo("C"),qo.undefinedValueNotification=new qo("N",void 0);class pE extends Rt{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(pE.dispatch,this.delay,new gte(e,this.destination)))}_next(e){this.scheduleMessage(qo.createNext(e))}_error(e){this.scheduleMessage(qo.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(qo.createComplete()),this.unsubscribe()}}class gte{constructor(e,t){this.notification=e,this.destination=t}}class Hg extends we{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new mte(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new Gt;if(this.isStopped||this.hasError?o=Ie.EMPTY:(this.observers.push(e),o=new oi(this,e)),r&&e.add(e=new pE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class mte{constructor(e,t){this.time=e,this.value=t}}function Ir(n,e){return"function"==typeof e?t=>t.pipe(Ir((i,r)=>li(n(i,r)).pipe(be((s,o)=>e(i,s,r,o))))):t=>t.lift(new _te(n))}class _te{constructor(e){this.project=e}call(e,t){return t.subscribe(new yte(e,this.project))}}class yte extends ei{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new $r(this),r=this.destination;r.add(i),this.innerSubscription=oo(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const gE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return gE.schedule(n,0);if(void 0===window.requestAnimationFrame)return gE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let PD;function Ate(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!PD){const t=Element.prototype;PD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&PD.call(n,e)}(n,r)||(i=s,0))),i}class Ote{constructor(e,t){this.componentFactory=t.get(ol).resolveComponentFactory(e)}create(e){return new Ite(this.componentFactory,e)}}class Ite{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new Hg(1),this.events=this.eventEmitters.pipe(Ir(i=>ki(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(lt),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=gE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=Tt.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(be(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=gE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new h_(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class Pte extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Dt(n){return null!=n&&"false"!=`${n}`}function So(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function mE(n){return Array.isArray(n)?n:[n]}function jr(n){return null==n?"":"string"==typeof n?n:`${n}px`}function Hu(n){return n instanceof nt?n.nativeElement:n}const Tf=new Zl(hE);function $g(n,e=Tf){return t=>t.lift(new Nte(n,e))}class Nte{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Lte(e,this.dueTime,this.scheduler))}}class Lte extends Rt{constructor(e,t,i){super(e),this.dueTime=t,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Bte,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function Bte(n){n.debouncedNext()}let RD=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})(),W3=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Hu(t);return new oe(r=>{const o=this._observeElement(i).subscribe(r);return()=>{o.unsubscribe(),this._unobserveElement(i)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const i=new we,r=this._mutationObserverFactory.create(s=>i.next(s));r&&r.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:r,stream:i,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:i,stream:r}=this._observedElements.get(t);i&&i.disconnect(),r.complete(),this._observedElements.delete(t)}}}return n.\u0275fac=function(t){return new(t||n)(I(RD))},n.\u0275prov=ae({factory:function(){return new n(I(RD))},token:n,providedIn:"root"}),n})(),kD=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new Pe,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=So(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe($g(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(W3),E(nt),E(lt))},n.\u0275dir=he({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),_E=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[RD]}),n})();class sr extends we{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Gt;return this._value}next(e){super.next(this._value=e)}}function Yo(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}function Qd(){}function Di(n,e,t){return function(r){return r.lift(new Kte(n,e,t))}}class Kte{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Zte(e,this.nextOrObserver,this.error,this.complete))}}class Zte extends Rt{constructor(e,t,i,r){super(e),this._tapNext=Qd,this._tapError=Qd,this._tapComplete=Qd,this._tapError=i||Qd,this._tapComplete=r||Qd,ft(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||Qd,this._tapError=t.error||Qd,this._tapComplete=t.complete||Qd)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}function Tn(n,e){return function(i){return i.lift(new Qte(n,e))}}class Qte{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new Jte(e,this.predicate,this.thisArg))}}class Jte extends Rt{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}const K3=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function _i(n){return e=>0===n?fE():e.lift(new ene(n))}class ene{constructor(e){if(this.total=e,this.total<0)throw new K3}call(e,t){return t.subscribe(new tne(e,this.total))}}class tne extends Rt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function VD(n){return e=>e.lift(new nne(n))}class nne{constructor(e){this.total=e}call(e,t){return t.subscribe(new ine(e,this.total))}}class ine extends Rt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function Xo(n,e){return t=>t.lift(new rne(n,e))}class rne{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new sne(e,this.compare,this.keySelector))}}class sne extends Rt{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}function zn(n){return e=>e.lift(new one(n))}class one{constructor(e){this.notifier=e}call(e,t){const i=new ane(e),r=oo(this.notifier,new $r(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class ane extends ei{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}let jD;try{jD="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){jD=!1}let qg,ii=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?xf(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!jD)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(I(cl))},n.\u0275prov=ae({factory:function(){return new n(I(cl))},token:n,providedIn:"root"}),n})(),Av=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const Z3=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function Q3(){if(qg)return qg;if("object"!=typeof document||!document)return qg=new Set(Z3),qg;let n=document.createElement("input");return qg=new Set(Z3.filter(e=>(n.setAttribute("type",e),n.type===e))),qg}let Dv,Af,UD;function Yg(n){return function(){if(null==Dv&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Dv=!0}))}finally{Dv=Dv||!1}return Dv}()?n:!!n.capture}function J3(){if(null==Af){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Af=!1,Af;if("scrollBehavior"in document.documentElement.style)Af=!0;else{const n=Element.prototype.scrollTo;Af=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Af}function vE(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Df(n){return n.composedPath?n.composedPath()[0]:n.target}function bE(n,e){return(n.getAttribute(e)||"").match(/\S+/g)||[]}const tV="cdk-describedby-message-container",nV="cdk-describedby-message",CE="cdk-describedby-host";let fne=0;const jc=new Map;let Ps=null,iV=(()=>{class n{constructor(t){this._document=t}describe(t,i,r){if(!this._canBeDescribed(t,i))return;const s=zD(i,r);"string"!=typeof i?(rV(i),jc.set(s,{messageElement:i,referenceCount:0})):jc.has(s)||this._createMessageElement(i,r),this._isElementDescribedByMessage(t,s)||this._addMessageReference(t,s)}removeDescription(t,i,r){if(!i||!this._isElementNode(t))return;const s=zD(i,r);if(this._isElementDescribedByMessage(t,s)&&this._removeMessageReference(t,s),"string"==typeof i){const o=jc.get(s);o&&0===o.referenceCount&&this._deleteMessageElement(s)}Ps&&0===Ps.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${CE}]`);for(let i=0;i0!=r.indexOf(nV));t.setAttribute("aria-describedby",i.join(" "))}_addMessageReference(t,i){const r=jc.get(i);(function(n,e,t){const i=bE(n,e);i.some(r=>r.trim()==t.trim())||(i.push(t.trim()),n.setAttribute(e,i.join(" ")))})(t,"aria-describedby",r.messageElement.id),t.setAttribute(CE,""),r.referenceCount++}_removeMessageReference(t,i){const r=jc.get(i);r.referenceCount--,function(n,e,t){const r=bE(n,e).filter(s=>s!=t.trim());r.length?n.setAttribute(e,r.join(" ")):n.removeAttribute(e)}(t,"aria-describedby",r.messageElement.id),t.removeAttribute(CE)}_isElementDescribedByMessage(t,i){const r=bE(t,"aria-describedby"),s=jc.get(i),o=s&&s.messageElement.id;return!!o&&-1!=r.indexOf(o)}_canBeDescribed(t,i){if(!this._isElementNode(t))return!1;if(i&&"object"==typeof i)return!0;const r=null==i?"":`${i}`.trim(),s=t.getAttribute("aria-label");return!(!r||s&&s.trim()===r)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})();function zD(n,e){return"string"==typeof n?`${e||""}/${n}`:n}function rV(n){n.id||(n.id=`${nV}-${fne++}`)}class sV{constructor(e){this._items=e,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new we,this._typeaheadSubscription=Ie.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new we,this.change=new we,e instanceof bf&&e.changes.subscribe(t=>{if(this._activeItem){const r=t.toArray().indexOf(this._activeItem);r>-1&&r!==this._activeItemIndex&&(this._activeItemIndex=r)}})}skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(Di(t=>this._pressedLetters.push(t)),$g(e),Tn(()=>this._pressedLetters.length>0),be(()=>this._pressedLetters.join(""))).subscribe(t=>{const i=this._getItemsArray();for(let r=1;r!e[s]||this._allowedModifierKeys.indexOf(s)>-1);switch(t){case 9:return void this.tabOut.next();case 40:if(this._vertical&&r){this.setNextItemActive();break}return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&r){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&r){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}return;default:return void((r||Yo(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))))}this._pressedLetters=[],e.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem}isTyping(){return this._pressedLetters.length>0}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._items.length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(e){const t=this._getItemsArray(),i="number"==typeof e?e:t.indexOf(e),r=t[i];this._activeItem=null==r?null:r,this._activeItemIndex=i}_setActiveItemByDelta(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}_setActiveInWrapMode(e){const t=this._getItemsArray();for(let i=1;i<=t.length;i++){const r=(this._activeItemIndex+e*i+t.length)%t.length;if(!this._skipPredicateFn(t[r]))return void this.setActiveItem(r)}}_setActiveInDefaultMode(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}_setActiveItemByIndex(e,t){const i=this._getItemsArray();if(i[e]){for(;this._skipPredicateFn(i[e]);)if(!i[e+=t])return;this.setActiveItem(e)}}_getItemsArray(){return this._items instanceof bf?this._items.toArray():this._items}}class oV extends sV{setActiveItem(e){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(e),this.activeItem&&this.activeItem.setActiveStyles()}}class aV extends sV{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}}let lV=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===uV(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=uV(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||cV(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(ii))},token:n,providedIn:"root"}),n})();function cV(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function uV(n){if(!cV(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class Sne{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const e=this._startAnchor,t=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),t&&(t.removeEventListener("focus",this.endAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(_i(1)).subscribe(e)}}let dV=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new Sne(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(I(lV),I(lt),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(lV),I(lt),I(rt))},token:n,providedIn:"root"}),n})();function hV(n){return 0===n.offsetX&&0===n.offsetY}function fV(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const pV=new _e("cdk-input-modality-detector-options"),Dne={ignoreKeys:[18,17,224,91,16]},Xg=Yg({passive:!0,capture:!0});let mV=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new sr(null),this._lastTouchMs=0,this._onKeydown=o=>{var a,l;(null===(l=null===(a=this._options)||void 0===a?void 0:a.ignoreKeys)||void 0===l?void 0:l.some(c=>c===o.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Df(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(hV(o)?"keyboard":"mouse"),this._mostRecentTarget=Df(o))},this._onTouchstart=o=>{fV(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Df(o))},this._options=Object.assign(Object.assign({},Dne),s),this.modalityDetected=this._modality.pipe(VD(1)),this.modalityChanged=this.modalityDetected.pipe(Xo()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,Xg),r.addEventListener("mousedown",this._onMousedown,Xg),r.addEventListener("touchstart",this._onTouchstart,Xg)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Xg),document.removeEventListener("mousedown",this._onMousedown,Xg),document.removeEventListener("touchstart",this._onTouchstart,Xg))}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt),I(rt),I(pV,8))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt),I(rt),I(pV,8))},token:n,providedIn:"root"}),n})();const _V=new _e("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),yV=new _e("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let wE=(()=>{class n{constructor(t,i,r,s){this._ngZone=i,this._defaultOptions=s,this._document=r,this._liveElement=t||this._createLiveElement()}announce(t,...i){const r=this._defaultOptions;let s,o;return 1===i.length&&"number"==typeof i[0]?o=i[0]:[s,o]=i,this.clear(),clearTimeout(this._previousTimeout),s||(s=r&&r.politeness?r.politeness:"polite"),null==o&&r&&(o=r.duration),this._liveElement.setAttribute("aria-live",s),this._ngZone.runOutsideAngular(()=>new Promise(a=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,a(),"number"==typeof o&&(this._previousTimeout=setTimeout(()=>this.clear(),o))},100)}))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement&&this._liveElement.parentNode&&(this._liveElement.parentNode.removeChild(this._liveElement),this._liveElement=null)}_createLiveElement(){const t="cdk-live-announcer-element",i=this._document.getElementsByClassName(t),r=this._document.createElement("div");for(let s=0;s{class n{constructor(t,i,r,s,o){this._ngZone=t,this._platform=i,this._inputModalityDetector=r,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new we,this._rootNodeFocusAndBlurListener=a=>{const l=Df(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let d=l;d;d=d.parentElement)c.call(this,a,d)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=Hu(t);if(!this._platform.isBrowser||1!==r.nodeType)return st(null);const s=function(n){if(function(){if(null==UD){const n="undefined"!=typeof document?document.head:null;UD=!(!n||!n.createShadowRoot&&!n.attachShadow)}return UD}()){const e=n.getRootNode?n.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}(r)||this._getDocument(),o=this._elementInfo.get(r);if(o)return i&&(o.checkChildren=!0),o.subject;const a={checkChildren:i,subject:new we,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Hu(t),r=this._elementInfo.get(i);r&&(r.subject.complete(),this._setClasses(i),this._elementInfo.delete(i),this._removeGlobalListeners(r))}focusVia(t,i,r){const s=Hu(t);s===this._getDocument().activeElement?this._getClosestElementsInfo(s).forEach(([a,l])=>this._originChanged(a,i,l)):(this._setOrigin(i),"function"==typeof s.focus&&s.focus(r))}ngOnDestroy(){this._elementInfo.forEach((t,i)=>this.stopMonitoring(i))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,i,r){r?t.classList.add(i):t.classList.remove(i)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,i){this._toggleClass(t,"cdk-focused",!!i),this._toggleClass(t,"cdk-touch-focused","touch"===i),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===i),this._toggleClass(t,"cdk-mouse-focused","mouse"===i),this._toggleClass(t,"cdk-program-focused","program"===i)}_setOrigin(t,i=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&i,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,i){const r=this._elementInfo.get(i),s=Df(t);!r||!r.checkChildren&&i!==s||this._originChanged(i,this._getFocusOrigin(s),r)}_onBlur(t,i){const r=this._elementInfo.get(i);!r||r.checkChildren&&t.relatedTarget instanceof Node&&i.contains(t.relatedTarget)||(this._setClasses(i),this._emitOrigin(r.subject,null))}_emitOrigin(t,i){this._ngZone.run(()=>t.next(i))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const i=t.rootNode,r=this._rootNodeFocusListenerCount.get(i)||0;r||this._ngZone.runOutsideAngular(()=>{i.addEventListener("focus",this._rootNodeFocusAndBlurListener,EE),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,EE)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(zn(this._stopInputModalityDetector)).subscribe(s=>{this._setOrigin(s,!0)}))}_removeGlobalListeners(t){const i=t.rootNode;if(this._rootNodeFocusListenerCount.has(i)){const r=this._rootNodeFocusListenerCount.get(i);r>1?this._rootNodeFocusListenerCount.set(i,r-1):(i.removeEventListener("focus",this._rootNodeFocusAndBlurListener,EE),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,EE),this._rootNodeFocusListenerCount.delete(i))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,i,r){this._setClasses(t,i),this._emitOrigin(r.subject,i),this._lastFocusOrigin=i}_getClosestElementsInfo(t){const i=[];return this._elementInfo.forEach((r,s)=>{(s===t||r.checkChildren&&s.contains(t))&&i.push([s,r])}),i}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(ii),I(mV),I(rt,8),I(vV,8))},n.\u0275prov=ae({factory:function(){return new n(I(lt),I(ii),I(mV),I(rt,8),I(vV,8))},token:n,providedIn:"root"}),n})();const bV="cdk-high-contrast-black-on-white",CV="cdk-high-contrast-white-on-black",HD="cdk-high-contrast-active";let wV=(()=>{class n{constructor(t,i){this._platform=t,this._document=i}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const i=this._document.defaultView||window,r=i&&i.getComputedStyle?i.getComputedStyle(t):null,s=(r&&r.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),s){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(HD),t.remove(bV),t.remove(CV),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(HD),t.add(bV)):2===i&&(t.add(HD),t.add(CV))}}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(rt))},token:n,providedIn:"root"}),n})(),Ine=(()=>{class n{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return n.\u0275fac=function(t){return new(t||n)(I(wV))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Av,_E]]}),n})();const EV=new _e("cdk-dir-doc",{providedIn:"root",factory:function(){return Ac(rt)}});let Ko=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new Pe,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(I(EV,8))},n.\u0275prov=ae({factory:function(){return new n(I(EV,8))},token:n,providedIn:"root"}),n})(),Iv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const SV=new Lu("12.2.5");class MV{}const $u="*";function Jl(n,e){return{type:7,name:n,definitions:e,options:{}}}function Mo(n,e=null){return{type:4,styles:e,timings:n}}function xV(n,e=null){return{type:2,steps:n,options:e}}function Kn(n){return{type:6,styles:n,offset:null}}function br(n,e,t){return{type:0,name:n,styles:e,options:t}}function kne(n){return{type:5,steps:n}}function Qs(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function Fne(n=null){return{type:9,options:n}}function Nne(n,e,t=null){return{type:11,selector:n,animation:e,options:t}}function TV(n){Promise.resolve(null).then(n)}class Kg{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){TV(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class AV{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,i=0,r=0;const s=this.players.length;0==s?TV(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++i==s&&this._onDestroy()}),o.onStart(()=>{++r==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(i=>{const r=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(r)})}getPosition(){const e=this.players.reduce((t,i)=>null===t||i.totalTime>t.totalTime?i:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function DV(){return"undefined"!=typeof window&&void 0!==window.document}function GD(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Jd(n){switch(n.length){case 0:return new Kg;case 1:return n[0];default:return new AV(n)}}function OV(n,e,t,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(d=>{const f=d.offset,p=f==l,g=p&&c||{};Object.keys(d).forEach(_=>{let y=_,v=d[_];if("offset"!==_)switch(y=e.normalizePropertyName(y,o),v){case"!":v=r[_];break;case $u:v=s[_];break;default:v=e.normalizeStyleValue(_,y,v,o)}g[y]=v}),p||a.push(g),c=g,l=f}),o.length){const d="\n - ";throw new Error(`Unable to animate due to the following errors:${d}${o.join(d)}`)}return a}function WD(n,e,t,i){switch(e){case"start":n.onStart(()=>i(t&&qD(t,"start",n)));break;case"done":n.onDone(()=>i(t&&qD(t,"done",n)));break;case"destroy":n.onDestroy(()=>i(t&&qD(t,"destroy",n)))}}function qD(n,e,t){const i=t.totalTime,s=YD(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,null==i?n.totalTime:i,!!t.disabled),o=n._data;return null!=o&&(s._data=o),s}function YD(n,e,t,i,r="",s=0,o){return{element:n,triggerName:e,fromState:t,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function wa(n,e,t){let i;return n instanceof Map?(i=n.get(e),i||n.set(e,i=t)):(i=n[e],i||(i=n[e]=t)),i}function IV(n){const e=n.indexOf(":");return[n.substring(1,e),n.substr(e+1)]}let XD=(n,e)=>!1,KD=(n,e)=>!1,PV=(n,e,t)=>[];const RV=GD();(RV||"undefined"!=typeof Element)&&(XD=DV()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),KD=(()=>{if(RV||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):KD}})(),PV=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{const i=t.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=n[t]}),e}let NV=(()=>{class n{validateStyleProperty(t){return ZD(t)}matchesElement(t,i){return QD(t,i)}containsElement(t,i){return JD(t,i)}query(t,i,r){return eO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new Kg(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class SE{}SE.NOOP=new NV;const tO="ng-enter",ME="ng-leave",xE="ng-trigger",TE=".ng-trigger",BV="ng-animating",nO=".ng-animating";function If(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:iO(parseFloat(e[1]),e[2])}function iO(n,e){switch(e){case"s":return 1e3*n;default:return n}}function AE(n,e,t){return n.hasOwnProperty("duration")?n:function(n,e,t){let r,s=0,o="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return e.push(`The provided timing value "${n}" is invalid.`),{duration:0,delay:0,easing:""};r=iO(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(s=iO(parseFloat(l),a[4]));const c=a[5];c&&(o=c)}else r=n;if(!t){let a=!1,l=e.length;r<0&&(e.push("Duration values below 0 are not allowed for this animation step."),a=!0),s<0&&(e.push("Delay values below 0 are not allowed for this animation step."),a=!0),a&&e.splice(l,0,`The provided timing value "${n}" is invalid.`)}return{duration:r,delay:s,easing:o}}(n,e,t)}function Zg(n,e={}){return Object.keys(n).forEach(t=>{e[t]=n[t]}),e}function eh(n,e,t={}){if(e)for(let i in n)t[i]=n[i];else Zg(n,t);return t}function jV(n,e,t){return t?e+":"+t+";":""}function UV(n){let e="";for(let t=0;t{const r=sO(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),GD()&&UV(n))}function Pf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=sO(t);n.style[i]=""}),GD()&&UV(n))}function Pv(n){return Array.isArray(n)?1==n.length?n[0]:xV(n):n}const rO=new RegExp("{{\\s*(.+?)\\s*}}","g");function zV(n){let e=[];if("string"==typeof n){let t;for(;t=rO.exec(n);)e.push(t[1]);rO.lastIndex=0}return e}function DE(n,e,t){const i=n.toString(),r=i.replace(rO,(s,o)=>{let a=e[o];return e.hasOwnProperty(o)||(t.push(`Please provide a value for the animation param ${o}`),a=""),a.toString()});return r==i?n:r}function OE(n){const e=[];let t=n.next();for(;!t.done;)e.push(t.value),t=n.next();return e}const Hne=/-+([a-z0-9])/g;function sO(n){return n.replace(Hne,(...e)=>e[1].toUpperCase())}function $ne(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function HV(n,e){return 0===n||0===e}function $V(n,e,t){const i=Object.keys(t);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(a=>{s.hasOwnProperty(a)||o.push(a),s[a]=t[a]}),o.length)for(var r=1;rfunction(n,e,t){if(":"==n[0]){const l=function(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i) *"}}(n,t);if("function"==typeof l)return void e.push(l);n=l}const i=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return t.push(`The provided transition expression "${n}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(GV(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(GV(o,r))}(i,t,e)):t.push(n),t}const PE=new Set(["true","1"]),RE=new Set(["false","0"]);function GV(n,e){const t=PE.has(n)||RE.has(n),i=PE.has(e)||RE.has(e);return(r,s)=>{let o="*"==n||n==r,a="*"==e||e==s;return!o&&t&&"boolean"==typeof r&&(o=r?PE.has(n):RE.has(n)),!a&&i&&"boolean"==typeof s&&(a=s?PE.has(e):RE.has(e)),o&&a}}const Yne=new RegExp("s*:selfs*,?","g");function aO(n,e,t){return new Xne(n).build(e,t)}class Xne{constructor(e){this._driver=e}build(e,t){const i=new Qne(t);return this._resetContextStyleTimingState(i),Ea(this,Pv(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,r=t.depCount=0;const s=[],o=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),0==a.type){const l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,s.push(this.visitState(l,t))}),l.name=c}else if(1==a.type){const l=this.visitTransition(a,t);i+=l.queryCount,r+=l.depCount,o.push(l)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:s,transitions:o,queryCount:i,depCount:r,options:null}}visitState(e,t){const i=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(i.containsDynamicStyles){const s=new Set,o=r||{};if(i.styles.forEach(a=>{if(kE(a)){const l=a;Object.keys(l).forEach(c=>{zV(l[c]).forEach(d=>{o.hasOwnProperty(d)||s.add(d)})})}}),s.size){const a=OE(s.values());t.errors.push(`state("${e.name}", ...) must define default values for all the following style substitutions: ${a.join(", ")}`)}}return{type:0,name:e.name,style:i,options:r?{params:r}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const i=Ea(this,Pv(e.animation),t);return{type:1,matchers:Gne(e.expr,t.errors),animation:i,queryCount:t.queryCount,depCount:t.depCount,options:Rf(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(i=>Ea(this,i,t)),options:Rf(e.options)}}visitGroup(e,t){const i=t.currentTime;let r=0;const s=e.steps.map(o=>{t.currentTime=i;const a=Ea(this,o,t);return r=Math.max(r,t.currentTime),a});return t.currentTime=r,{type:3,steps:s,options:Rf(e.options)}}visitAnimate(e,t){const i=function(n,e){let t=null;if(n.hasOwnProperty("duration"))t=n;else if("number"==typeof n)return lO(AE(n,e).duration,0,"");const i=n;if(i.split(/\s+/).some(s=>"{"==s.charAt(0)&&"{"==s.charAt(1))){const s=lO(0,0,"");return s.dynamic=!0,s.strValue=i,s}return t=t||AE(i,e),lO(t.duration,t.delay,t.easing)}(e.timings,t.errors);t.currentAnimateTimings=i;let r,s=e.styles?e.styles:Kn({});if(5==s.type)r=this.visitKeyframes(s,t);else{let o=e.styles,a=!1;if(!o){a=!0;const c={};i.easing&&(c.easing=i.easing),o=Kn(c)}t.currentTime+=i.duration+i.delay;const l=this.visitStyle(o,t);l.isEmptyStep=a,r=l}return t.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}}visitStyle(e,t){const i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){const i=[];Array.isArray(e.styles)?e.styles.forEach(o=>{"string"==typeof o?o==$u?i.push(o):t.errors.push(`The provided style string value ${o} is not allowed.`):i.push(o)}):i.push(e.styles);let r=!1,s=null;return i.forEach(o=>{if(kE(o)){const a=o,l=a.easing;if(l&&(s=l,delete a.easing),!r)for(let c in a)if(a[c].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:i,easing:s,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){const i=t.currentAnimateTimings;let r=t.currentTime,s=t.currentTime;i&&s>0&&(s-=i.duration+i.delay),e.styles.forEach(o=>{"string"!=typeof o&&Object.keys(o).forEach(a=>{if(!this._driver.validateStyleProperty(a))return void t.errors.push(`The provided animation property "${a}" is not a supported CSS property for animations`);const l=t.collectedStyles[t.currentQuerySelector],c=l[a];let d=!0;c&&(s!=r&&s>=c.startTime&&r<=c.endTime&&(t.errors.push(`The CSS property "${a}" that exists between the times of "${c.startTime}ms" and "${c.endTime}ms" is also being animated in a parallel animation between the times of "${s}ms" and "${r}ms"`),d=!1),s=c.startTime),d&&(l[a]={startTime:s,endTime:r}),t.options&&function(n,e,t){const i=e.params||{},r=zV(n);r.length&&r.forEach(s=>{i.hasOwnProperty(s)||t.push(`Unable to resolve the local animation param ${s} in the given list of values`)})}(o[a],t.options,t.errors)})})}visitKeyframes(e,t){const i={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),i;let s=0;const o=[];let a=!1,l=!1,c=0;const d=e.steps.map(w=>{const C=this._makeStyleAst(w,t);let x=null!=C.offset?C.offset:function(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(kE(t)&&t.hasOwnProperty("offset")){const i=t;e=parseFloat(i.offset),delete i.offset}});else if(kE(n)&&n.hasOwnProperty("offset")){const t=n;e=parseFloat(t.offset),delete t.offset}return e}(C.styles),L=0;return null!=x&&(s++,L=C.offset=x),l=l||L<0||L>1,a=a||L0&&s{const x=p>0?C==g?1:p*C:o[C],L=x*v;t.currentTime=_+y.delay+L,y.duration=L,this._validateStyleAst(w,t),w.offset=x,i.styles.push(w)}),i}visitReference(e,t){return{type:8,animation:Ea(this,Pv(e.animation),t),options:Rf(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:Rf(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:Rf(e.options)}}visitQuery(e,t){const i=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;const[s,o]=function(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(Yne,"")),[n=n.replace(/@\*/g,TE).replace(/@\w+/g,t=>TE+"-"+t.substr(1)).replace(/:animating/g,nO),e]}(e.selector);t.currentQuerySelector=i.length?i+" "+s:s,wa(t.collectedStyles,t.currentQuerySelector,{});const a=Ea(this,Pv(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:11,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:Rf(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");const i="full"===e.timings?{duration:0,delay:0,easing:"full"}:AE(e.timings,t.errors,!0);return{type:12,animation:Ea(this,Pv(e.animation),t),timings:i,options:null}}}class Qne{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function kE(n){return!Array.isArray(n)&&"object"==typeof n}function Rf(n){return n?(n=Zg(n)).params&&(n.params=function(n){return n?Zg(n):null}(n.params)):n={},n}function lO(n,e,t){return{duration:n,delay:e,easing:t}}function cO(n,e,t,i,r,s,o=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class FE{constructor(){this._map=new Map}consume(e){let t=this._map.get(e);return t?this._map.delete(e):t=[],t}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const iie=new RegExp(":enter","g"),sie=new RegExp(":leave","g");function uO(n,e,t,i,r,s={},o={},a,l,c=[]){return(new oie).buildKeyframes(n,e,t,i,r,s,o,a,l,c)}class oie{buildKeyframes(e,t,i,r,s,o,a,l,c,d=[]){c=c||new FE;const f=new dO(e,t,c,r,s,d,[]);f.options=l,f.currentTimeline.setStyles([o],null,f.errors,l),Ea(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&Object.keys(a).length){const g=p[p.length-1];g.allowOnlyTimelineStyles()||g.setStyles([a],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[cO(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const i=t.subInstructions.consume(t.element);if(i){const r=t.createSubContext(e.options),s=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,r,r.options);s!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){const i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,i){let s=t.currentTimeline.currentTime;const o=null!=i.duration?If(i.duration):null,a=null!=i.delay?If(i.delay):null;return 0!==o&&e.forEach(l=>{const c=t.appendInstructionToTimeline(l,o,a);s=Math.max(s,c.duration+c.delay)}),s}visitReference(e,t){t.updateOptions(e.options,!0),Ea(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const i=t.subContextCount;let r=t;const s=e.options;if(s&&(s.params||s.delay)&&(r=t.createSubContext(s),r.transformIntoNewTimeline(),null!=s.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=NE);const o=If(s.delay);r.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>Ea(this,o,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const i=[];let r=t.currentTimeline.currentTime;const s=e.options&&e.options.delay?If(e.options.delay):0;e.steps.forEach(o=>{const a=t.createSubContext(e.options);s&&a.delayNextStep(s),Ea(this,o,a),r=Math.max(r,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(r),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const i=e.strValue;return AE(t.params?DE(i,t.params,t.errors):i,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const i=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),r.snapshotCurrentStyles());const s=e.style;5==s.type?this.visitKeyframes(s,t):(t.incrementTime(i.duration),this.visitStyle(s,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const i=t.currentTimeline,r=t.currentAnimateTimings;!r&&i.getCurrentStyleProperties().length&&i.forwardFrame();const s=r&&r.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(s):i.setStyles(e.styles,s,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const i=t.currentAnimateTimings,r=t.currentTimeline.duration,s=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{a.forwardTime((l.offset||0)*s),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(r+s),t.previousNode=e}visitQuery(e,t){const i=t.currentTimeline.currentTime,r=e.options||{},s=r.delay?If(r.delay):0;s&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=NE);let o=i;const a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,d)=>{t.currentQueryIndex=d;const f=t.createSubContext(e.options,c);s&&f.delayNextStep(s),c===t.element&&(l=f.currentTimeline),Ea(this,e.animation,f),f.currentTimeline.applyStylesToKeyframe(),o=Math.max(o,f.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const i=t.parentContext,r=t.currentTimeline,s=e.timings,o=Math.abs(s.duration),a=o*(t.currentQueryTotal-1);let l=o*t.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime}const d=t.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;Ea(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=r.currentTime-f+(r.startTime-i.currentTimeline.startTime)}}const NE={};class dO{constructor(e,t,i,r,s,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=s,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=NE,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new LE(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const i=e;let r=this.options;null!=i.duration&&(r.duration=If(i.duration)),null!=i.delay&&(r.delay=If(i.delay));const s=i.params;if(s){let o=r.params;o||(o=this.options.params={}),Object.keys(s).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=DE(s[a],o,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const i=e.params={};Object.keys(t).forEach(r=>{i[r]=t[r]})}}return e}createSubContext(e=null,t,i){const r=t||this.element,s=new dO(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(e),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(e){return this.previousNode=NE,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){const r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=i?i:0)+e.delay,easing:""},s=new aie(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,r,s,o){let a=[];if(r&&a.push(this.element),e.length>0){e=(e=e.replace(iie,"."+this._enterClassName)).replace(sie,"."+this._leaveClassName);let c=this._driver.query(this.element,e,1!=i);0!==i&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!s&&0==a.length&&o.push(`\`query("${t}")\` returned zero elements. (Use \`query("${t}", { optional: true })\` if you wish to allow this.)`),a}}class LE{constructor(e,t,i,r){this._driver=e,this.element=t,this.startTime=i,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new LE(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||$u,this._currentKeyframe[t]=$u}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,r){t&&(this._previousKeyframe.easing=t);const s=r&&r.params||{},o=function(n,e){const t={};let i;return n.forEach(r=>{"*"===r?(i=i||Object.keys(e),i.forEach(s=>{t[s]=$u})):eh(r,!1,t)}),t}(e,this._globalTimelineStyles);Object.keys(o).forEach(a=>{const l=DE(o[a],s,i);this._pendingStyles[a]=l,this._localTimelineStyles.hasOwnProperty(a)||(this._backFill[a]=this._globalTimelineStyles.hasOwnProperty(a)?this._globalTimelineStyles[a]:$u),this._updateStyle(a,l)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(i=>{this._currentKeyframe[i]=e[i]}),Object.keys(this._localTimelineStyles).forEach(i=>{this._currentKeyframe.hasOwnProperty(i)||(this._currentKeyframe[i]=this._localTimelineStyles[i])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const i=this._styleSummary[t],r=e._styleSummary[t];(!i||r.time>i.time)&&this._updateStyle(t,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,i=1===this._keyframes.size&&0===this.duration;let r=[];this._keyframes.forEach((a,l)=>{const c=eh(a,!0);Object.keys(c).forEach(d=>{const f=c[d];"!"==f?e.add(d):f==$u&&t.add(d)}),i||(c.offset=l/this.duration),r.push(c)});const s=e.size?OE(e.values()):[],o=t.size?OE(t.values()):[];if(i){const a=r[0],l=Zg(a);a.offset=0,l.offset=1,r=[a,l]}return cO(this.element,r,s,o,this.duration,this.startTime,this.easing,!1)}}class aie extends LE{constructor(e,t,i,r,s,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:r}=this.timings;if(this._stretchStartingKeyframe&&t){const s=[],o=i+t,a=t/o,l=eh(e[0],!1);l.offset=0,s.push(l);const c=eh(e[0],!1);c.offset=YV(a),s.push(c);const d=e.length-1;for(let f=1;f<=d;f++){let p=eh(e[f],!1);p.offset=YV((t+p.offset*i)/o),s.push(p)}i=o,t=0,r="",e=s}return cO(this.element,e,this.preStyleProps,this.postStyleProps,i,t,r,!0)}}function YV(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}class hO{}class cie extends hO{normalizePropertyName(e,t){return sO(e)}normalizeStyleValue(e,t,i,r){let s="";const o=i.toString().trim();if(uie[t]&&0!==i&&"0"!==i)if("number"==typeof i)s="px";else{const a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&r.push(`Please provide a CSS unit value for ${e}:${i}`)}return o+s}}const uie=(()=>function(n){const e={};return n.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function XV(n,e,t,i,r,s,o,a,l,c,d,f,p){return{type:0,element:n,triggerName:e,isRemovalTransition:r,fromState:t,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:d,totalTime:f,errors:p}}const fO={};class KV{constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,r){return function(n,e,t,i,r){return n.some(s=>s(e,t,i,r))}(this.ast.matchers,e,t,i,r)}buildStyles(e,t,i){const r=this._stateStyles["*"],s=this._stateStyles[e],o=r?r.buildStyles(t,i):{};return s?s.buildStyles(t,i):o}build(e,t,i,r,s,o,a,l,c,d){const f=[],p=this.ast.options&&this.ast.options.params||fO,_=this.buildStyles(i,a&&a.params||fO,f),y=l&&l.params||fO,v=this.buildStyles(r,y,f),w=new Set,C=new Map,x=new Map,L="void"===r,U={params:Object.assign(Object.assign({},p),y)},$=d?[]:uO(e,t,this.ast.animation,s,o,_,v,U,c,f);let ee=0;if($.forEach(pe=>{ee=Math.max(pe.duration+pe.delay,ee)}),f.length)return XV(t,this._triggerName,i,r,L,_,v,[],[],C,x,ee,f);$.forEach(pe=>{const ve=pe.element,$e=wa(C,ve,{});pe.preStyleProps.forEach(re=>$e[re]=!0);const Xe=wa(x,ve,{});pe.postStyleProps.forEach(re=>Xe[re]=!0),ve!==t&&w.add(ve)});const fe=OE(w.values());return XV(t,this._triggerName,i,r,L,_,v,$,fe,C,x,ee)}}class fie{constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){const i={},r=Zg(this.defaultParams);return Object.keys(e).forEach(s=>{const o=e[s];null!=o&&(r[s]=o)}),this.styles.styles.forEach(s=>{if("string"!=typeof s){const o=s;Object.keys(o).forEach(a=>{let l=o[a];l.length>1&&(l=DE(l,r,t));const c=this.normalizer.normalizePropertyName(a,t);l=this.normalizer.normalizeStyleValue(a,c,l,t),i[c]=l})}}),i}}class gie{constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,this.transitionFactories=[],this.states={},t.states.forEach(r=>{this.states[r.name]=new fie(r.style,r.options&&r.options.params||{},i)}),ZV(this.states,"true","1"),ZV(this.states,"false","0"),t.transitions.forEach(r=>{this.transitionFactories.push(new KV(e,r,this.states))}),this.fallbackTransition=function(n,e,t){return new KV(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(o,a)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,r){return this.transitionFactories.find(o=>o.match(e,t,i,r))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}}function ZV(n,e,t){n.hasOwnProperty(e)?n.hasOwnProperty(t)||(n[t]=n[e]):n.hasOwnProperty(t)&&(n[e]=n[t])}const _ie=new FE;class yie{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}register(e,t){const i=[],r=aO(this._driver,t,i);if(i.length)throw new Error(`Unable to build the animation due to the following errors: ${i.join("\n")}`);this._animations[e]=r}_buildPlayer(e,t,i){const r=e.element,s=OV(0,this._normalizer,0,e.keyframes,t,i);return this._driver.animate(r,s,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){const r=[],s=this._animations[e];let o;const a=new Map;if(s?(o=uO(this._driver,t,s,tO,ME,{},{},i,_ie,r),o.forEach(d=>{const f=wa(a,d.element,{});d.postStyleProps.forEach(p=>f[p]=null)})):(r.push("The requested animation doesn't exist or has already been destroyed"),o=[]),r.length)throw new Error(`Unable to create the animation due to the following errors: ${r.join("\n")}`);a.forEach((d,f)=>{Object.keys(d).forEach(p=>{d[p]=this._driver.computeStyle(f,p,$u)})});const c=Jd(o.map(d=>{const f=a.get(d.element);return this._buildPlayer(d,{},f)}));return this._playersById[e]=c,c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw new Error(`Unable to find the timeline player referenced by ${e}`);return t}listen(e,t,i,r){const s=YD(t,"","","");return WD(this._getPlayer(e),i,s,r),()=>{}}command(e,t,i,r){if("register"==i)return void this.register(e,r[0]);if("create"==i)return void this.create(e,t,r[0]||{});const s=this._getPlayer(e);switch(i){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}}const QV="ng-animate-queued",JV="ng-animate-disabled",ej=".ng-animate-disabled",wie=[],tj={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Eie={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},fl="__ng_removed";class pO{constructor(e,t=""){this.namespaceId=t;const i=e&&e.hasOwnProperty("value");if(this.value=function(n){return null!=n?n:null}(i?e.value:e),i){const s=Zg(e);delete s.value,this.options=s}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const i=this.options.params;Object.keys(t).forEach(r=>{null==i[r]&&(i[r]=t[r])})}}}const Rv="void",gO=new pO(Rv);class Sie{constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,pl(t,this._hostClassName)}listen(e,t,i,r){if(!this._triggers.hasOwnProperty(t))throw new Error(`Unable to listen on the animation trigger event "${i}" because the animation trigger "${t}" doesn't exist!`);if(null==i||0==i.length)throw new Error(`Unable to listen on the animation trigger "${t}" because the provided event is undefined!`);if(!function(n){return"start"==n||"done"==n}(i))throw new Error(`The provided animation trigger event "${i}" for the animation trigger "${t}" is not supported!`);const s=wa(this._elementListeners,e,[]),o={name:t,phase:i,callback:r};s.push(o);const a=wa(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(pl(e,xE),pl(e,xE+"-"+t),a[t]=gO),()=>{this._engine.afterFlush(()=>{const l=s.indexOf(o);l>=0&&s.splice(l,1),this._triggers[t]||delete a[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw new Error(`The provided animation trigger "${e}" has not been registered!`);return t}trigger(e,t,i,r=!0){const s=this._getTrigger(t),o=new mO(this.id,t,e);let a=this._engine.statesByElement.get(e);a||(pl(e,xE),pl(e,xE+"-"+t),this._engine.statesByElement.set(e,a={}));let l=a[t];const c=new pO(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a[t]=c,l||(l=gO),c.value!==Rv&&l.value===c.value){if(!function(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let r=0;r{Pf(e,v),Uc(e,w)})}return}const p=wa(this._engine.playersByElement,e,[]);p.forEach(y=>{y.namespaceId==this.id&&y.triggerName==t&&y.queued&&y.destroy()});let g=s.matchTransition(l.value,c.value,e,c.params),_=!1;if(!g){if(!r)return;g=s.fallbackTransition,_=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:g,fromState:l,toState:c,player:o,isFallbackTransition:_}),_||(pl(e,QV),o.onStart(()=>{Qg(e,QV)})),o.onDone(()=>{let y=this.players.indexOf(o);y>=0&&this.players.splice(y,1);const v=this._engine.playersByElement.get(e);if(v){let w=v.indexOf(o);w>=0&&v.splice(w,1)}}),this.players.push(o),p.push(o),o}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,i)=>{delete t[e]}),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(r=>r.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const i=this._engine.driver.query(e,TE,!0);i.forEach(r=>{if(r[fl])return;const s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(o=>o.triggerLeaveAnimation(r,t,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(e,t,i,r){const s=this._engine.statesByElement.get(e);if(s){const o=[];if(Object.keys(s).forEach(a=>{if(this._triggers[a]){const l=this.trigger(e,a,Rv,r);l&&o.push(l)}}),o.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),i&&Jd(o).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){const r=new Set;t.forEach(s=>{const o=s.name;if(r.has(o))return;r.add(o);const l=this._triggers[o].fallbackTransition,c=i[o]||gO,d=new pO(Rv),f=new mO(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(e,t){const i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let r=!1;if(i.totalAnimations){const s=i.players.length?i.playersByQueriedElement.get(e):[];if(s&&s.length)r=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(e),r)i.markElementAsRemoved(this.id,e,!1,t);else{const s=e[fl];(!s||s===tj)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){pl(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(i=>{const r=i.player;if(r.destroyed)return;const s=i.element,o=this._elementListeners.get(s);o&&o.forEach(a=>{if(a.name==i.triggerName){const l=YD(s,i.triggerName,i.fromState.value,i.toState.value);l._data=e,WD(i.player,a.phase,l,a.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):t.push(i)}),this._queue=[],t.sort((i,r)=>{const s=i.transition.ast.depCount,o=r.transition.ast.depCount;return 0==s||0==o?s-o:this._engine.driver.containsElement(i.element,r.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(i=>i.element===e)||t,t}}class Mie{constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(r,s)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){const i=new Sie(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){const i=this._namespaceList.length-1;if(i>=0){let r=!1;for(let s=i;s>=0;s--)if(this.driver.containsElement(this._namespaceList[s].hostElement,t)){this._namespaceList.splice(s+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let r=this._namespaceLookup[e];r&&r.register(t,i)&&this.totalAnimations++}destroy(e,t){if(!e)return;const i=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(i.hostElement),delete this._namespaceLookup[e];const r=this._namespaceList.indexOf(i);r>=0&&this._namespaceList.splice(r,1)}),this.afterFlushAnimationsDone(()=>i.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,i=this.statesByElement.get(e);if(i){const r=Object.keys(i);for(let s=0;s=0&&this.collectedLeaveElements.splice(o,1)}if(e){const o=this._fetchNamespace(e);o&&o.insertNode(t,i)}r&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),pl(e,JV)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Qg(e,JV))}removeNode(e,t,i,r){if(BE(t)){const s=e?this._fetchNamespace(e):null;if(s?s.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r),i){const o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,r)}}else this._onRemovalComplete(t,r)}markElementAsRemoved(e,t,i,r){this.collectedLeaveElements.push(t),t[fl]={namespaceId:e,setForRemoval:r,hasAnimation:i,removedBeforeQueried:!1}}listen(e,t,i,r,s){return BE(t)?this._fetchNamespace(e).listen(t,i,r,s):()=>{}}_buildInstruction(e,t,i,r,s){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,r,e.fromState.options,e.toState.options,t,s)}destroyInnerAnimations(e){let t=this.driver.query(e,TE,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,nO,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Jd(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e[fl];if(t&&t.setForRemoval){if(e[fl]=tj,t.namespaceId){this.destroyInnerAnimations(e);const i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}this.driver.matchesElement(e,ej)&&this.markElementAsDisabled(e,!1),this.driver.query(e,ej,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,r)=>this._balanceNamespaceList(i,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],t.length?Jd(t).onDone(()=>{i.forEach(r=>r())}):i.forEach(r=>r())}}reportError(e){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${e.join("\n")}`)}_flushAnimations(e,t){const i=new FE,r=[],s=new Map,o=[],a=new Map,l=new Map,c=new Map,d=new Set;this.disabledNodes.forEach(Q=>{d.add(Q);const Ue=this.driver.query(Q,".ng-animate-queued",!0);for(let ke=0;ke{const ke=tO+y++;_.set(Ue,ke),Q.forEach(ze=>pl(ze,ke))});const v=[],w=new Set,C=new Set;for(let Q=0;Qw.add(ze)):C.add(Ue))}const x=new Map,L=rj(p,Array.from(w));L.forEach((Q,Ue)=>{const ke=ME+y++;x.set(Ue,ke),Q.forEach(ze=>pl(ze,ke))}),e.push(()=>{g.forEach((Q,Ue)=>{const ke=_.get(Ue);Q.forEach(ze=>Qg(ze,ke))}),L.forEach((Q,Ue)=>{const ke=x.get(Ue);Q.forEach(ze=>Qg(ze,ke))}),v.forEach(Q=>{this.processLeaveNode(Q)})});const U=[],$=[];for(let Q=this._namespaceList.length-1;Q>=0;Q--)this._namespaceList[Q].drainQueuedTransitions(t).forEach(ke=>{const ze=ke.player,wt=ke.element;if(U.push(ze),this.collectedEnterElements.length){const fi=wt[fl];if(fi&&fi.setForMove)return void ze.destroy()}const kn=!f||!this.driver.containsElement(f,wt),Je=x.get(wt),tr=_.get(wt),Dn=this._buildInstruction(ke,i,tr,Je,kn);if(Dn.errors&&Dn.errors.length)$.push(Dn);else{if(kn)return ze.onStart(()=>Pf(wt,Dn.fromStyles)),ze.onDestroy(()=>Uc(wt,Dn.toStyles)),void r.push(ze);if(ke.isFallbackTransition)return ze.onStart(()=>Pf(wt,Dn.fromStyles)),ze.onDestroy(()=>Uc(wt,Dn.toStyles)),void r.push(ze);Dn.timelines.forEach(fi=>fi.stretchStartingKeyframe=!0),i.append(wt,Dn.timelines),o.push({instruction:Dn,player:ze,element:wt}),Dn.queriedElements.forEach(fi=>wa(a,fi,[]).push(ze)),Dn.preStyleProps.forEach((fi,gr)=>{const ra=Object.keys(fi);if(ra.length){let Bs=l.get(gr);Bs||l.set(gr,Bs=new Set),ra.forEach(ka=>Bs.add(ka))}}),Dn.postStyleProps.forEach((fi,gr)=>{const ra=Object.keys(fi);let Bs=c.get(gr);Bs||c.set(gr,Bs=new Set),ra.forEach(ka=>Bs.add(ka))})}});if($.length){const Q=[];$.forEach(Ue=>{Q.push(`@${Ue.triggerName} has failed due to:\n`),Ue.errors.forEach(ke=>Q.push(`- ${ke}\n`))}),U.forEach(Ue=>Ue.destroy()),this.reportError(Q)}const ee=new Map,fe=new Map;o.forEach(Q=>{const Ue=Q.element;i.has(Ue)&&(fe.set(Ue,Ue),this._beforeAnimationBuild(Q.player.namespaceId,Q.instruction,ee))}),r.forEach(Q=>{const Ue=Q.element;this._getPreviousPlayers(Ue,!1,Q.namespaceId,Q.triggerName,null).forEach(ze=>{wa(ee,Ue,[]).push(ze),ze.destroy()})});const pe=v.filter(Q=>oj(Q,l,c)),ve=new Map;ij(ve,this.driver,C,c,$u).forEach(Q=>{oj(Q,l,c)&&pe.push(Q)});const Xe=new Map;g.forEach((Q,Ue)=>{ij(Xe,this.driver,new Set(Q),l,"!")}),pe.forEach(Q=>{const Ue=ve.get(Q),ke=Xe.get(Q);ve.set(Q,Object.assign(Object.assign({},Ue),ke))});const re=[],le=[],Oe={};o.forEach(Q=>{const{element:Ue,player:ke,instruction:ze}=Q;if(i.has(Ue)){if(d.has(Ue))return ke.onDestroy(()=>Uc(Ue,ze.toStyles)),ke.disabled=!0,ke.overrideTotalTime(ze.totalTime),void r.push(ke);let wt=Oe;if(fe.size>1){let Je=Ue;const tr=[];for(;Je=Je.parentNode;){const Dn=fe.get(Je);if(Dn){wt=Dn;break}tr.push(Je)}tr.forEach(Dn=>fe.set(Dn,wt))}const kn=this._buildAnimation(ke.namespaceId,ze,ee,s,Xe,ve);if(ke.setRealPlayer(kn),wt===Oe)re.push(ke);else{const Je=this.playersByElement.get(wt);Je&&Je.length&&(ke.parentPlayer=Jd(Je)),r.push(ke)}}else Pf(Ue,ze.fromStyles),ke.onDestroy(()=>Uc(Ue,ze.toStyles)),le.push(ke),d.has(Ue)&&r.push(ke)}),le.forEach(Q=>{const Ue=s.get(Q.element);if(Ue&&Ue.length){const ke=Jd(Ue);Q.setRealPlayer(ke)}}),r.forEach(Q=>{Q.parentPlayer?Q.syncPlayerEvents(Q.parentPlayer):Q.destroy()});for(let Q=0;Q!kn.destroyed);wt.length?Die(this,Ue,wt):this.processLeaveNode(Ue)}return v.length=0,re.forEach(Q=>{this.players.push(Q),Q.onDone(()=>{Q.destroy();const Ue=this.players.indexOf(Q);this.players.splice(Ue,1)}),Q.play()}),re}elementContainsData(e,t){let i=!1;const r=t[fl];return r&&r.setForRemoval&&(i=!0),this.playersByElement.has(t)&&(i=!0),this.playersByQueriedElement.has(t)&&(i=!0),this.statesByElement.has(t)&&(i=!0),this._fetchNamespace(e).elementContainsData(t)||i}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,r,s){let o=[];if(t){const a=this.playersByQueriedElement.get(e);a&&(o=a)}else{const a=this.playersByElement.get(e);if(a){const l=!s||s==Rv;a.forEach(c=>{c.queued||!l&&c.triggerName!=r||o.push(c)})}}return(i||r)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||r&&r!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){const s=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:t.triggerName;for(const l of t.timelines){const c=l.element,d=c!==s,f=wa(i,c,[]);this._getPreviousPlayers(c,d,o,a,t.toState).forEach(g=>{const _=g.getRealPlayer();_.beforeDestroy&&_.beforeDestroy(),g.destroy(),f.push(g)})}Pf(s,t.fromStyles)}_buildAnimation(e,t,i,r,s,o){const a=t.triggerName,l=t.element,c=[],d=new Set,f=new Set,p=t.timelines.map(_=>{const y=_.element;d.add(y);const v=y[fl];if(v&&v.removedBeforeQueried)return new Kg(_.duration,_.delay);const w=y!==l,C=function(n){const e=[];return sj(n,e),e}((i.get(y)||wie).map(ee=>ee.getRealPlayer())).filter(ee=>!!ee.element&&ee.element===y),x=s.get(y),L=o.get(y),U=OV(0,this._normalizer,0,_.keyframes,x,L),$=this._buildPlayer(_,U,C);if(_.subTimeline&&r&&f.add(y),w){const ee=new mO(e,a,y);ee.setRealPlayer($),c.push(ee)}return $});c.forEach(_=>{wa(this.playersByQueriedElement,_.element,[]).push(_),_.onDone(()=>function(n,e,t){let i;if(n instanceof Map){if(i=n.get(e),i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&n.delete(e)}}else if(i=n[e],i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&delete n[e]}return i}(this.playersByQueriedElement,_.element,_))}),d.forEach(_=>pl(_,BV));const g=Jd(p);return g.onDestroy(()=>{d.forEach(_=>Qg(_,BV)),Uc(l,t.toStyles)}),f.forEach(_=>{wa(r,_,[]).push(g)}),g}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new Kg(e.duration,e.delay)}}class mO{constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i,this._player=new Kg,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(i=>WD(e,t,void 0,i))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){wa(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function BE(n){return n&&1===n.nodeType}function nj(n,e){const t=n.style.display;return n.style.display=null!=e?e:"none",t}function ij(n,e,t,i,r){const s=[];t.forEach(l=>s.push(nj(l)));const o=[];i.forEach((l,c)=>{const d={};l.forEach(f=>{const p=d[f]=e.computeStyle(c,f,r);(!p||0==p.length)&&(c[fl]=Eie,o.push(c))}),n.set(c,d)});let a=0;return t.forEach(l=>nj(l,s[a++])),o}function rj(n,e){const t=new Map;if(n.forEach(a=>t.set(a,[])),0==e.length)return t;const r=new Set(e),s=new Map;function o(a){if(!a)return 1;let l=s.get(a);if(l)return l;const c=a.parentNode;return l=t.has(c)?c:r.has(c)?1:o(c),s.set(a,l),l}return e.forEach(a=>{const l=o(a);1!==l&&t.get(l).push(a)}),t}const VE="$$classes";function pl(n,e){if(n.classList)n.classList.add(e);else{let t=n[VE];t||(t=n[VE]={}),t[e]=!0}}function Qg(n,e){if(n.classList)n.classList.remove(e);else{let t=n[VE];t&&delete t[e]}}function Die(n,e,t){Jd(t).onDone(()=>n.processLeaveNode(e))}function sj(n,e){for(let t=0;tr.add(s)):e.set(n,i),t.delete(n),!0}class jE{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(r,s)=>{},this._transitionEngine=new Mie(e,t,i),this._timelineEngine=new yie(e,t,i),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(e,t,i,r,s){const o=e+"-"+r;let a=this._triggerCache[o];if(!a){const l=[],c=aO(this._driver,s,l);if(l.length)throw new Error(`The animation trigger "${r}" has failed to build due to the following errors:\n - ${l.join("\n - ")}`);a=function(n,e,t){return new gie(n,e,t)}(r,c,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,r,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,r){this._transitionEngine.insertNode(e,t,i,r)}onRemove(e,t,i,r){this._transitionEngine.removeNode(e,t,r||!1,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,r){if("@"==i.charAt(0)){const[s,o]=IV(i);this._timelineEngine.command(s,t,o,r)}else this._transitionEngine.trigger(e,t,i,r)}listen(e,t,i,r,s){if("@"==i.charAt(0)){const[o,a]=IV(i);return this._timelineEngine.listen(o,t,a,s)}return this._transitionEngine.listen(e,t,i,r,s)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function aj(n,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=_O(e[0]),e.length>1&&(i=_O(e[e.length-1]))):e&&(t=_O(e)),t||i?new Jg(n,t,i):null}class Jg{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Jg.initialStylesByElement.get(e);r||Jg.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Uc(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Uc(this._element,this._initialStyles),this._endStyles&&(Uc(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Jg.initialStylesByElement.delete(this._element),this._startStyles&&(Pf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Pf(this._element,this._endStyles),this._endStyles=null),Uc(this._element,this._initialStyles),this._state=3)}}function _O(n){let e=null;const t=Object.keys(n);for(let i=0;ithis._handleCallback(l)}apply(){(function(n,e){const t=vO(n,"").trim();let i=0;t.length&&(function(n,e){let t=0;for(let i=0;i=this._delay&&i>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),hj(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(n,e){const i=vO(n,"").split(","),r=yO(i,e);r>=0&&(i.splice(r,1),UE(n,"",i.join(",")))}(this._element,this._name))}}function uj(n,e,t){UE(n,"PlayState",t,dj(n,e))}function dj(n,e){const t=vO(n,"");return t.indexOf(",")>0?yO(t.split(","),e):yO([t],e)}function yO(n,e){for(let t=0;t=0)return t;return-1}function hj(n,e,t){t?n.removeEventListener(cj,e):n.addEventListener(cj,e)}function UE(n,e,t,i){const r=lj+e;if(null!=i){const s=n.style[r];if(s.length){const o=s.split(",");o[i]=t,t=o.join(",")}}n.style[r]=t}function vO(n,e){return n.style[lj+e]||""}class fj{constructor(e,t,i,r,s,o,a,l){this.element=e,this.keyframes=t,this.animationName=i,this._duration=r,this._delay=s,this._finalStyles=a,this._specialStyles=l,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=o||"linear",this.totalTime=r+s,this._buildStyler()}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(e=>e()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(e){this._styler.setPosition(e)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new Fie(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}beforeDestroy(){this.init();const e={};if(this.hasStarted()){const t=this._state>=3;Object.keys(this._finalStyles).forEach(i=>{"offset"!=i&&(e[i]=t?this._finalStyles[i]:oO(this.element,i))})}this.currentSnapshot=e}}class Uie extends Kg{constructor(e,t){super(),this.element=e,this._startingStyles={},this.__initialized=!1,this._styles=FV(t)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(e=>{this._startingStyles[e]=this.element.style[e]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(e=>this.element.style.setProperty(e,this._styles[e])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(e=>{const t=this._startingStyles[e];t?this.element.style.setProperty(e,t):this.element.style.removeProperty(e)}),this._startingStyles=null,super.destroy())}}class gj{constructor(){this._count=0}validateStyleProperty(e){return ZD(e)}matchesElement(e,t){return QD(e,t)}containsElement(e,t){return JD(e,t)}query(e,t,i){return eO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}buildKeyframeElement(e,t,i){i=i.map(a=>FV(a));let r=`@keyframes ${t} {\n`,s="";i.forEach(a=>{s=" ";const l=parseFloat(a.offset);r+=`${s}${100*l}% {\n`,s+=" ",Object.keys(a).forEach(c=>{const d=a[c];switch(c){case"offset":return;case"easing":return void(d&&(r+=`${s}animation-timing-function: ${d};\n`));default:return void(r+=`${s}${c}: ${d};\n`)}}),r+=`${s}}\n`}),r+="}\n";const o=document.createElement("style");return o.textContent=r,o}animate(e,t,i,r,s,o=[],a){const l=o.filter(v=>v instanceof fj),c={};HV(i,r)&&l.forEach(v=>{let w=v.currentSnapshot;Object.keys(w).forEach(C=>c[C]=w[C])});const d=function(n){let e={};return n&&(Array.isArray(n)?n:[n]).forEach(i=>{Object.keys(i).forEach(r=>{"offset"==r||"easing"==r||(e[r]=i[r])})}),e}(t=$V(e,t,c));if(0==i)return new Uie(e,d);const f="gen_css_kf_"+this._count++,p=this.buildKeyframeElement(e,f,t);(function(n){var e;const t=null===(e=n.getRootNode)||void 0===e?void 0:e.call(n);return"undefined"!=typeof ShadowRoot&&t instanceof ShadowRoot?t:document.head})(e).appendChild(p);const _=aj(e,t),y=new fj(e,t,f,i,r,s,d,_);return y.onDestroy(()=>function(n){n.parentNode.removeChild(n)}(p)),y}}class _j{constructor(e,t,i,r){this.element=e,this.keyframes=t,this.options=i,this._specialStyles=r,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,i){return e.animate(t,i)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(t=>{"offset"!=t&&(e[t]=this._finished?this._finalKeyframe[t]:oO(this.element,t))}),this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class Wie{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(yj().toString()),this._cssKeyframesDriver=new gj}validateStyleProperty(e){return ZD(e)}matchesElement(e,t){return QD(e,t)}containsElement(e,t){return JD(e,t)}query(e,t,i){return eO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}overrideWebAnimationsSupport(e){this._isNativeImpl=e}animate(e,t,i,r,s,o=[],a){if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,i,r,s,o);const d={duration:i,delay:r,fill:0==r?"both":"forwards"};s&&(d.easing=s);const f={},p=o.filter(_=>_ instanceof _j);HV(i,r)&&p.forEach(_=>{let y=_.currentSnapshot;Object.keys(y).forEach(v=>f[v]=y[v])});const g=aj(e,t=$V(e,t=t.map(_=>eh(_,!1)),f));return new _j(e,t,d,g)}}function yj(){return DV()&&Element.prototype.animate||{}}let Yie=(()=>{class n extends MV{constructor(t,i){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(i.body,{id:"0",encapsulation:Re.None,styles:[],data:{animation:[]}})}build(t){const i=this._nextAnimationId.toString();this._nextAnimationId++;const r=Array.isArray(t)?xV(t):t;return vj(this._renderer,null,i,"register",[r]),new Xie(i,this._renderer)}}return n.\u0275fac=function(t){return new(t||n)(I(_f),I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Xie extends class{}{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new Kie(this._id,e,t||{},this._renderer)}}class Kie{constructor(e,t,i,r){this.id=e,this.element=t,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return vj(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function vj(n,e,t,i,r){return n.setProperty(e,`@@${t}:${i}`,r)}const bj="@.disabled";let Zie=(()=>{class n{constructor(t,i,r){this.delegate=t,this.engine=i,this._zone=r,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),i.onRemovalComplete=(s,o)=>{o&&o.parentNode(s)&&o.removeChild(s.parentNode,s)}}createRenderer(t,i){const s=this.delegate.createRenderer(t,i);if(!(t&&i&&i.data&&i.data.animation)){let d=this._rendererCache.get(s);return d||(d=new Cj("",s,this.engine),this._rendererCache.set(s,d)),d}const o=i.id,a=i.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const l=d=>{Array.isArray(d)?d.forEach(l):this.engine.registerTrigger(o,a,t,d.name,d)};return i.data.animation.forEach(l),new Qie(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,i,r){t>=0&&ti(r)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(s=>{const[o,a]=s;o(a)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([i,r]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return n.\u0275fac=function(t){return new(t||n)(I(_f),I(jE),I(lt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Cj{constructor(e,t,i){this.namespaceId=e,this.delegate=t,this.engine=i,this.destroyNode=this.delegate.destroyNode?r=>t.destroyNode(r):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,r=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,r)}removeChild(e,t,i){this.engine.onRemove(this.namespaceId,t,this.delegate,i)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,r){this.delegate.setAttribute(e,t,i,r)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,r){this.delegate.setStyle(e,t,i,r)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){"@"==t.charAt(0)&&t==bj?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i){return this.delegate.listen(e,t,i)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class Qie extends Cj{constructor(e,t,i,r){super(t,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){"@"==t.charAt(0)?"."==t.charAt(1)&&t==bj?this.disableAnimations(e,i=void 0===i||!!i):this.engine.process(this.namespaceId,e,t.substr(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i){if("@"==t.charAt(0)){const r=function(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let s=t.substr(1),o="";return"@"!=s.charAt(0)&&([s,o]=function(n){const e=n.indexOf(".");return[n.substring(0,e),n.substr(e+1)]}(s)),this.engine.listen(this.namespaceId,r,s,o,a=>{this.factory.scheduleListenerCallback(a._data||-1,i,a)})}return this.delegate.listen(e,t,i)}}let tre=(()=>{class n extends jE{constructor(t,i,r){super(t.body,i,r)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(SE),I(hO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Zo=new _e("AnimationModuleType"),wj=[{provide:MV,useClass:Yie},{provide:hO,useFactory:function(){return new cie}},{provide:jE,useClass:tre},{provide:_f,useFactory:function(n,e,t){return new Zie(n,e,t)},deps:[uE,jE,lt]}],Ej=[{provide:SE,useFactory:function(){return"function"==typeof yj()?new Wie:new gj}},{provide:Zo,useValue:"BrowserAnimations"},...wj],Sj=[{provide:SE,useClass:NV},{provide:Zo,useValue:"NoopAnimations"},...wj];let bO=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?Sj:Ej}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:Ej,imports:[dE]}),n})();function are(n,e){if(1&n&&et(0,"mat-pseudo-checkbox",4),2&n){const t=bt();ie("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function lre(n,e){if(1&n&&(F(0,"span",5),Te(1),N()),2&n){const t=bt();Y(1),Os("(",t.group.label,")")}}const cre=["*"],Mj=new Lu("12.2.5"),dre=new _e("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let Lf,Nn=(()=>{class n{constructor(t,i,r){this._hasDoneGlobalChecks=!1,this._document=r,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=i,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!wo()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const i=getComputedStyle(t);i&&"none"!==i.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&Mj.full!==SV.full&&console.warn("The Angular Material version ("+Mj.full+") does not match the Angular CDK version ("+SV.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(I(wV),I(dre,8),I(rt))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Iv],Iv]}),n})();function em(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=Dt(e)}}}function kf(n,e){return class extends n{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const i=t||this.defaultColor;i!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),i&&this._elementRef.nativeElement.classList.add(`mat-${i}`),this._color=i)}}}function Ff(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=Dt(e)}}}function Nf(n,e=0){return class extends n{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?So(t):this.defaultTabIndex}}}function CO(n){return class extends n{constructor(...e){super(...e),this.stateChanges=new we,this.errorState=!1}updateErrorState(){const e=this.errorState,s=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);s!==e&&(this.errorState=s,this.stateChanges.next())}}}try{Lf="undefined"!=typeof Intl}catch(n){Lf=!1}let kv=(()=>{class n{isErrorState(t,i){return!!(t&&t.invalid&&(t.touched||i&&i.submitted))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})();class Ere{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const Tj={enterDuration:225,exitDuration:150},wO=Yg({passive:!0}),Aj=["mousedown","touchstart"],Dj=["mouseup","mouseleave","touchend","touchcancel"];class Oj{constructor(e,t,i,r){this._target=e,this._ngZone=t,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=Hu(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},Tj),i.animation);i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);const o=i.radius||function(n,e,t){const i=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),r=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),a=e-r.left,l=t-r.top,c=s.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=a-o+"px",d.style.top=l-o+"px",d.style.height=2*o+"px",d.style.width=2*o+"px",null!=i.color&&(d.style.backgroundColor=i.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(d),d.style.transform="scale(1)";const f=new Ere(this,d,i);return f.state=0,this._activeRipples.add(f),i.persistent||(this._mostRecentTransientRipple=f),this._runTimeoutOutsideZone(()=>{const p=f===this._mostRecentTransientRipple;f.state=1,!i.persistent&&(!p||!this._isPointerDown)&&f.fadeOut()},c),f}fadeOutRipple(e){const t=this._activeRipples.delete(e);if(e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!t)return;const i=e.element,r=Object.assign(Object.assign({},Tj),e.config.animation);i.style.transitionDuration=`${r.exitDuration}ms`,i.style.opacity="0",e.state=2,this._runTimeoutOutsideZone(()=>{e.state=3,i.parentNode.removeChild(i)},r.exitDuration)}fadeOutAll(){this._activeRipples.forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Hu(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(Aj))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(Dj),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=hV(e),i=this._lastTouchStartEvent&&Date.now(){!e.config.persistent&&(1===e.state||e.config.terminateOnPointerUp&&0===e.state)&&e.fadeOut()}))}_runTimeoutOutsideZone(e,t=0){this._ngZone.runOutsideAngular(()=>setTimeout(e,t))}_registerEvents(e){this._ngZone.runOutsideAngular(()=>{e.forEach(t=>{this._triggerElement.addEventListener(t,this,wO)})})}_removeTriggerEvents(){this._triggerElement&&(Aj.forEach(e=>{this._triggerElement.removeEventListener(e,this,wO)}),this._pointerUpEventsRegistered&&Dj.forEach(e=>{this._triggerElement.removeEventListener(e,this,wO)}))}}const Ij=new _e("mat-ripple-global-options");let Qo=(()=>{class n{constructor(t,i,r,s,o){this._elementRef=t,this._animationMode=o,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=s||{},this._rippleRenderer=new Oj(this,i,t,r)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,i=0,r){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,i,Object.assign(Object.assign({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(lt),E(ii),E(Ij,8),E(Zo,8))},n.\u0275dir=he({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&at("mat-ripple-unbounded",i.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),n})(),ec=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn,Av],Nn]}),n})(),Tre=(()=>{class n{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return n.\u0275fac=function(t){return new(t||n)(E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,i){2&t&&at("mat-pseudo-checkbox-indeterminate","indeterminate"===i.state)("mat-pseudo-checkbox-checked","checked"===i.state)("mat-pseudo-checkbox-disabled",i.disabled)("_mat-animation-noopable","NoopAnimations"===i._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,i){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),n})(),Are=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn]]}),n})();const $E=new _e("MAT_OPTION_PARENT_COMPONENT"),Dre=em(class{});let Ore=0,Pj=(()=>{class n extends Dre{constructor(t){var i;super(),this._labelId="mat-optgroup-label-"+Ore++,this._inert=null!==(i=null==t?void 0:t.inertGroups)&&void 0!==i&&i}}return n.\u0275fac=function(t){return new(t||n)(E($E,8))},n.\u0275dir=he({type:n,inputs:{label:"label"},features:[ht]}),n})();const GE=new _e("MatOptgroup");let Ire=0;class Rj{constructor(e,t=!1){this.source=e,this.isUserInput=t}}let Pre=(()=>{class n{constructor(t,i,r,s){this._element=t,this._changeDetectorRef=i,this._parent=r,this.group=s,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+Ire++,this.onSelectionChange=new Pe,this._stateChanges=new we}get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(t){this._disabled=Dt(t)}get disableRipple(){return this._parent&&this._parent.disableRipple}get active(){return this._active}get viewValue(){return(this._getHostElement().textContent||"").trim()}select(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}deselect(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}focus(t,i){const r=this._getHostElement();"function"==typeof r.focus&&r.focus(i)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!Yo(t)&&(this._selectViaInteraction(),t.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getAriaSelected(){return this.selected||!this.multiple&&null}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){const t=this.viewValue;t!==this._mostRecentViewValue&&(this._mostRecentViewValue=t,this._stateChanges.next())}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(t=!1){this.onSelectionChange.emit(new Rj(this,t))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(void 0),E(Pj))},n.\u0275dir=he({type:n,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),n})(),WE=(()=>{class n extends Pre{constructor(t,i,r,s){super(t,i,r,s)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E($E,8),E(GE,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,i){1&t&&ye("click",function(){return i._selectViaInteraction()})("keydown",function(s){return i._handleKeydown(s)}),2&t&&(sl("id",i.id),en("tabindex",i._getTabIndex())("aria-selected",i._getAriaSelected())("aria-disabled",i.disabled.toString()),at("mat-selected",i.selected)("mat-option-multiple",i.multiple)("mat-active",i.active)("mat-option-disabled",i.disabled))},exportAs:["matOption"],features:[ht],ngContentSelectors:cre,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(t,i){1&t&&(Dr(),Ct(0,are,1,2,"mat-pseudo-checkbox",0),F(1,"span",1),In(2),N(),Ct(3,lre,2,1,"span",2),et(4,"div",3)),2&t&&(ie("ngIf",i.multiple),Y(3),ie("ngIf",i.group&&i.group._inert),Y(1),ie("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},directives:[Is,Qo,Tre],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),n})();function EO(n,e,t){if(t.length){let i=e.toArray(),r=t.toArray(),s=0;for(let o=0;o{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,bn,Nn,Are]]}),n})();function zc(n,e,t,i){return ft(t)&&(i=t,t=void 0),i?zc(n,e,t).pipe(be(r=>Fe(r)?i(...r):i(r))):new oe(r=>{Fj(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function Fj(n,e,t,i,r){let s;if(function(n){return n&&"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener}(n)){const o=n;n.addEventListener(e,t,r),s=()=>o.removeEventListener(e,t,r)}else if(function(n){return n&&"function"==typeof n.on&&"function"==typeof n.off}(n)){const o=n;n.on(e,t),s=()=>o.off(e,t)}else if(function(n){return n&&"function"==typeof n.addListener&&"function"==typeof n.removeListener}(n)){const o=n;n.addListener(e,t),s=()=>o.removeListener(e,t)}else{if(!n||!n.length)throw new TypeError("Invalid event target");for(let o=0,a=n.length;oYE(n,t,e)):t=>YE(n,t)}const Lre=["underline"],Bre=["connectionContainer"],Vre=["inputContainer"],jre=["label"];function Ure(n,e){1&n&&(ff(0),F(1,"div",14),et(2,"div",15),et(3,"div",16),et(4,"div",17),N(),F(5,"div",18),et(6,"div",15),et(7,"div",16),et(8,"div",17),N(),pf())}function zre(n,e){1&n&&(F(0,"div",19),In(1,1),N())}function Hre(n,e){if(1&n&&(ff(0),In(1,2),F(2,"span"),Te(3),N(),pf()),2&n){const t=bt(2);Y(3),Ai(t._control.placeholder)}}function $re(n,e){1&n&&In(0,3,["*ngSwitchCase","true"])}function Gre(n,e){1&n&&(F(0,"span",23),Te(1," *"),N())}function Wre(n,e){if(1&n){const t=Lr();F(0,"label",20,21),ye("cdkObserveContent",function(){return Vn(t),bt().updateOutlineGap()}),Ct(2,Hre,4,1,"ng-container",12),Ct(3,$re,1,0,"ng-content",12),Ct(4,Gre,2,0,"span",22),N()}if(2&n){const t=bt();at("mat-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-form-field-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-accent","accent"==t.color)("mat-warn","warn"==t.color),ie("cdkObserveContentDisabled","outline"!=t.appearance)("id",t._labelId)("ngSwitch",t._hasLabel()),en("for",t._control.id)("aria-owns",t._control.id),Y(2),ie("ngSwitchCase",!1),Y(1),ie("ngSwitchCase",!0),Y(1),ie("ngIf",!t.hideRequiredMarker&&t._control.required&&!t._control.disabled)}}function qre(n,e){1&n&&(F(0,"div",24),In(1,4),N())}function Yre(n,e){if(1&n&&(F(0,"div",25,26),et(2,"span",27),N()),2&n){const t=bt();Y(2),at("mat-accent","accent"==t.color)("mat-warn","warn"==t.color)}}function Xre(n,e){1&n&&(F(0,"div"),In(1,5),N()),2&n&&ie("@transitionMessages",bt()._subscriptAnimationState)}function Kre(n,e){if(1&n&&(F(0,"div",31),Te(1),N()),2&n){const t=bt(2);ie("id",t._hintLabelId),Y(1),Ai(t.hintLabel)}}function Zre(n,e){if(1&n&&(F(0,"div",28),Ct(1,Kre,2,2,"div",29),In(2,6),et(3,"div",30),In(4,7),N()),2&n){const t=bt();ie("@transitionMessages",t._subscriptAnimationState),Y(1),ie("ngIf",t.hintLabel)}}const Qre=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Jre=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],Nj=new _e("MatError"),tse={transitionMessages:Jl("transitionMessages",[br("enter",Kn({opacity:1,transform:"translateY(0%)"})),Qs("void => enter",[Kn({opacity:0,transform:"translateY(-5px)"}),Mo("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let Nv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n}),n})();const Lj=new _e("MatHint");let Bf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-label"]]}),n})(),ise=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-placeholder"]]}),n})();const Bj=new _e("MatPrefix"),Vj=new _e("MatSuffix");let SO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["","matSuffix",""]],features:[At([{provide:Vj,useExisting:n}])]}),n})(),jj=0;const ose=kf(class{constructor(n){this._elementRef=n}},"primary"),zj=new _e("MAT_FORM_FIELD_DEFAULT_OPTIONS"),XE=new _e("MatFormField");let tm=(()=>{class n extends ose{constructor(t,i,r,s,o,a,l,c){super(t),this._changeDetectorRef=i,this._dir=s,this._defaults=o,this._platform=a,this._ngZone=l,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new we,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+jj++,this._labelId="mat-form-field-label-"+jj++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==c,this.appearance=o&&o.appearance?o.appearance:"legacy",this._hideRequiredMarker=!(!o||null==o.hideRequiredMarker)&&o.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const i=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&i!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Dt(t)}_shouldAlwaysFloat(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}_canLabelFloat(){return"never"!==this.floatLabel}get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}get floatLabel(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}get _control(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic}set _control(t){this._explicitFormFieldControl=t}getLabelId(){return this._hasFloatingLabel()?this._labelId:null}getConnectedOverlayOrigin(){return this._connectionContainerRef||this._elementRef}ngAfterContentInit(){this._validateControlChild();const t=this._control;t.controlType&&this._elementRef.nativeElement.classList.add(`mat-form-field-type-${t.controlType}`),t.stateChanges.pipe(ns(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(zn(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(zn(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),ki(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(ns(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(ns(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(zn(this._destroyed)).subscribe(()=>{"function"==typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this.updateOutlineGap())}):this.updateOutlineGap()})}ngAfterContentChecked(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}ngAfterViewInit(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_shouldForward(t){const i=this._control?this._control.ngControl:null;return i&&i[t]}_hasPlaceholder(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}_hasLabel(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}_shouldLabelFloat(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_hideControlPlaceholder(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}_hasFloatingLabel(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_animateAndLockLabel(){this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,zc(this._label.nativeElement,"transitionend").pipe(_i(1)).subscribe(()=>{this._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}_validatePlaceholders(){}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_getDefaultFloatLabelState(){return this._defaults&&this._defaults.floatLabel||"auto"}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&t.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const i=this._hintChildren?this._hintChildren.find(s=>"start"===s.align):null,r=this._hintChildren?this._hintChildren.find(s=>"end"===s.align):null;i?t.push(i.id):this._hintLabel&&t.push(this._hintLabelId),r&&t.push(r.id)}else this._errorChildren&&t.push(...this._errorChildren.map(i=>i.id));this._control.setDescribedByIds(t)}}_validateControlChild(){}updateOutlineGap(){const t=this._label?this._label.nativeElement:null;if(!("outline"===this.appearance&&t&&t.children.length&&t.textContent.trim()&&this._platform.isBrowser))return;if(!this._isAttachedToDOM())return void(this._outlineGapCalculationNeededImmediately=!0);let i=0,r=0;const s=this._connectionContainerRef.nativeElement,o=s.querySelectorAll(".mat-form-field-outline-start"),a=s.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const l=s.getBoundingClientRect();if(0===l.width&&0===l.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const c=this._getStartEnd(l),d=t.children,f=this._getStartEnd(d[0].getBoundingClientRect());let p=0;for(let g=0;g0?.75*p+10:0}for(let l=0;l{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn,_E],Nn]}),n})();function Bv(...n){if(1===n.length){const e=n[0];if(Fe(e))return KE(e,null);if(je(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return KE(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return KE(n=1===n.length&&Fe(n[0])?n[0]:n,null).pipe(be(t=>e(...t)))}return KE(n,null)}function KE(n,e){return new oe(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function Sa(n){return function(t){const i=new ase(n),r=t.lift(i);return i.caught=r}}class ase{constructor(e){this.selector=e}call(e,t){return t.subscribe(new lse(e,this.selector,this.caught))}}class lse extends ei{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new $r(this);this.add(i);const r=oo(t,i);r!==i&&this.add(r)}}}class cse{constructor(e){this.callback=e}call(e,t){return t.subscribe(new use(e,this.callback))}}class use extends Rt{constructor(e,t){super(e),this.add(new Ie(t))}}class $j{}class Gj{}class Gu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof Gu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new Gu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof Gu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class dse{encodeKey(e){return Wj(e)}encodeValue(e){return Wj(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const fse=/%(\d[a-f0-9])/gi,pse={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Wj(n){return encodeURIComponent(n).replace(fse,(e,t)=>{var i;return null!==(i=pse[t])&&void 0!==i?i:e})}function qj(n){return`${n}`}class th{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new dse,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new th({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(qj(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(qj(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class gse{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function Yj(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function Xj(n){return"undefined"!=typeof Blob&&n instanceof Blob}function Kj(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Vv{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==i?i:null,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new Gu),this.context||(this.context=new gse),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(d=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),d)),new Vv(i,r,o,{params:d,headers:c,context:f,reportProgress:l,responseType:s,withCredentials:a})}}var Ur=(()=>((Ur=Ur||{})[Ur.Sent=0]="Sent",Ur[Ur.UploadProgress=1]="UploadProgress",Ur[Ur.ResponseHeader=2]="ResponseHeader",Ur[Ur.DownloadProgress=3]="DownloadProgress",Ur[Ur.Response=4]="Response",Ur[Ur.User=5]="User",Ur))();class MO{constructor(e,t=200,i="OK"){this.headers=e.headers||new Gu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class xO extends MO{constructor(e={}){super(e),this.type=Ur.ResponseHeader}clone(e={}){return new xO({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class ZE extends MO{constructor(e={}){super(e),this.type=Ur.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new ZE({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class Zj extends MO{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function TO(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let im=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Vv)s=t;else{let l,c;l=r.headers instanceof Gu?r.headers:new Gu(r.headers),r.params&&(c=r.params instanceof th?r.params:new th({fromObject:r.params})),s=new Vv(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=st(s).pipe(function(n,e){return ci(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Vv||"events"===r.observe)return o;const a=o.pipe(Tn(l=>l instanceof ZE));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(be(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(be(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(be(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(be(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new th).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,TO(r,i))}post(t,i,r={}){return this.request("POST",t,TO(r,i))}put(t,i,r={}){return this.request("PUT",t,TO(r,i))}}return n.\u0275fac=function(t){return new(t||n)(I($j))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Qj{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const Jj=new _e("HTTP_INTERCEPTORS");let yse=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const vse=/^\)\]\}',?\n/;let eU=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new oe(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,_)=>r.setRequestHeader(g,_.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,_=r.statusText||"OK",y=new Gu(r.getAllResponseHeaders()),v=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new xO({headers:y,status:g,statusText:_,url:v}),o},l=()=>{let{headers:g,status:_,statusText:y,url:v}=a(),w=null;204!==_&&(w=void 0===r.response?r.responseText:r.response),0===_&&(_=w?200:0);let C=_>=200&&_<300;if("json"===t.responseType&&"string"==typeof w){const x=w;w=w.replace(vse,"");try{w=""!==w?JSON.parse(w):null}catch(L){w=x,C&&(C=!1,w={error:L,text:w})}}C?(i.next(new ZE({body:w,headers:g,status:_,statusText:y,url:v||void 0})),i.complete()):i.error(new Zj({error:w,headers:g,status:_,statusText:y,url:v||void 0}))},c=g=>{const{url:_}=a(),y=new Zj({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:_||void 0});i.error(y)};let d=!1;const f=g=>{d||(i.next(a()),d=!0);let _={type:Ur.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),"text"===t.responseType&&!!r.responseText&&(_.partialText=r.responseText),i.next(_)},p=g=>{let _={type:Ur.UploadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),i.next(_)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",f),null!==s&&r.upload&&r.upload.addEventListener("progress",p)),r.send(s),i.next({type:Ur.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",f),null!==s&&r.upload&&r.upload.removeEventListener("progress",p)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(I(P3))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const AO=new _e("XSRF_COOKIE_NAME"),DO=new _e("XSRF_HEADER_NAME");class tU{}let Cse=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=b3(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(cl),I(AO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),OO=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(tU),I(DO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),wse=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(Jj,[]);this.chain=i.reduceRight((r,s)=>new Qj(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Gj),I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Ese=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:OO,useClass:yse}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:AO,useValue:t.cookieName}:[],t.headerName?{provide:DO,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[OO,{provide:Jj,useExisting:OO,multi:!0},{provide:tU,useClass:Cse},{provide:AO,useValue:"XSRF-TOKEN"},{provide:DO,useValue:"X-XSRF-TOKEN"}]}),n})(),nU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[im,{provide:$j,useClass:wse},eU,{provide:Gj,useExisting:eU}],imports:[[Ese.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const Sse=["*"];function iU(n){return Error(`Unable to find icon with the name "${n}"`)}function rU(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function sU(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class Vf{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let jv=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new Vf(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(on.HTML,r);if(!o)throw sU(r);return this._addSvgIconConfig(t,i,new Vf("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new Vf(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(on.HTML,i);if(!s)throw sU(i);return this._addSvgIconSetConfig(t,new Vf("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(on.RESOURCE_URL,t);if(!i)throw rU(t);const r=this._cachedIconsByUrl.get(i);return r?st(QE(r)):this._loadSvgIconFromConfig(new Vf(t,null)).pipe(Di(s=>this._cachedIconsByUrl.set(i,s)),be(s=>QE(s)))}getNamedSvgIcon(t,i=""){const r=oU(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):zg(iU(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?st(QE(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(be(i=>QE(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?st(r):Bv(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(Sa(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(on.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),st(null)})))).pipe(be(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw iU(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Di(i=>t.svgText=i),be(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?st(null):this._fetchIcon(t).pipe(Di(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new cse(n))}(()=>this._inProgressUrlFetches.delete(a)),Vs());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(oU(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),aU=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Pse=aU.map(n=>`[${n}]`).join(", "),Rse=/^url\(['"]?#(.*?)['"]?\)$/;let Rs=(()=>{class n extends Ase{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=Ie.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=Dt(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){const i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(Pse),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(Rse):null;if(c){let d=r.get(a);d||(d=[],r.set(a,d)),d.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(_i(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(jv),fs("aria-hidden"),E(Dse),E(Uo))},n.\u0275cmp=Le({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(en("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),at("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[ht],ngContentSelectors:Sse,decls:1,vars:0,template:function(t,i){1&t&&(Dr(),In(0))},styles:[".mat-icon{background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],encapsulation:2,changeDetection:0}),n})(),Pr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn],Nn]}),n})();new class extends Zl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let Lse=1;const Bse=Promise.resolve(),JE={};function lU(n){return n in JE&&(delete JE[n],!0)}const cU={setImmediate(n){const e=Lse++;return JE[e]=!0,Bse.then(()=>lU(e)&&n()),e},clearImmediate(n){lU(n)}};new class extends Zl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=cU.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cU.clearImmediate(t),e.scheduled=void 0)}});function Uv(n){return!!n&&(n instanceof oe||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class Hse{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new $se(e,this.durationSelector))}}class $se extends ei{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=oo(t,new $r(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function IO(n){return!Fe(n)&&n-parseFloat(n)+1>=0}function Wse(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function eS(n,e=Tf){return function(n){return function(t){return t.lift(new Hse(n))}}(()=>function(n=0,e,t){let i=-1;return IO(e)?i=Number(e)<1?1:Number(e):Ln(e)&&(t=e),Ln(t)||(t=Tf),new oe(r=>{const s=IO(n)?n:+n-t.now();return t.schedule(Wse,s,{index:0,period:i,subscriber:r})})}(n,e))}function Hc(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new Hg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}class uU{constructor(e=!1,t,i=!0){this._multiple=e,this._emitChanges=i,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new we,t&&t.length&&(e?t.forEach(r=>this._markSelected(r)):this._markSelected(t[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...e){this._verifyValueAssignment(e),e.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...e){this._verifyValueAssignment(e),e.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(e){this.isSelected(e)?this.deselect(e):this.select(e)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(e){return this._selection.has(e)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(e){this._multiple&&this.selected&&this._selected.sort(e)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(e){this.isSelected(e)||(this._multiple||this._unmarkAll(),this._selection.add(e),this._emitChanges&&this._selectedToEmit.push(e))}_unmarkSelected(e){this.isSelected(e)&&(this._selection.delete(e),this._emitChanges&&this._deselectedToEmit.push(e))}_unmarkAll(){this.isEmpty()||this._selection.forEach(e=>this._unmarkSelected(e))}_verifyValueAssignment(e){}}let tS=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})(),rm=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new we,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new oe(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(eS(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):st()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Tn(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=Hu(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>zc(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(ii),I(rt,8))},n.\u0275prov=ae({factory:function(){return new n(I(lt),I(ii),I(rt,8))},token:n,providedIn:"root"}),n})(),jf=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new we,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){const t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){const t=this.getViewportScrollPosition(),{width:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(eS(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt),I(rt,8))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt),I(rt,8))},token:n,providedIn:"root"}),n})(),zv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),gU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Iv,Av,zv],Iv,zv]}),n})();class PO{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class sm extends PO{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Uf extends PO{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class uoe extends PO{constructor(e){super(),this.element=e instanceof nt?e.nativeElement:e}}class nS{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof sm?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Uf?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof uoe?(this._attachedPortal=e,this.attachDomPortal(e)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class doe extends nS{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let zf=(()=>{class n extends nS{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new Pe,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedPortal=null,this._attachedRef=null}attachComponentPortal(t){t.setAttachedHost(this);const i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(E(ol),E(es),E(rt))},n.\u0275dir=he({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ht]}),n})(),iS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function _U(n,e=!1){return t=>t.lift(new hoe(n,e))}class hoe{constructor(e,t){this.predicate=e,this.inclusive=t}call(e,t){return t.subscribe(new foe(e,this.predicate,this.inclusive))}}class foe extends Rt{constructor(e,t,i){super(e),this.predicate=t,this.inclusive=i,this.index=0}_next(e){const t=this.destination;let i;try{i=this.predicate(e,this.index++)}catch(r){return void t.error(r)}this.nextOrComplete(e,i)}nextOrComplete(e,t){const i=this.destination;Boolean(t)?i.next(e):(this.inclusive&&i.next(e),i.complete())}}const yU=J3();class poe{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=jr(-this._previousScrollPosition.left),e.style.top=jr(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),yU&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),yU&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class goe{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class vU{enable(){}disable(){}attach(){}}function RO(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function bU(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class moe{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:r}=this._viewportRuler.getViewportSize();RO(t,[{width:i,height:r,bottom:r,right:i,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let _oe=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new vU,this.close=o=>new goe(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new poe(this._viewportRuler,this._document),this.reposition=o=>new moe(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(I(rm),I(jf),I(lt),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rm),I(jf),I(lt),I(rt))},token:n,providedIn:"root"}),n})();class Hv{constructor(e){if(this.scrollStrategy=new vU,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class yoe{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class voe{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let CU=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})(),boe=(()=>{class n extends CU{constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);break}}}add(t){super.add(t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})(),Coe=(()=>{class n extends CU{constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Df(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(rt),I(ii))},token:n,providedIn:"root"}),n})();const nh="undefined"!=typeof window?window:{},wU=void 0!==nh.__karma__&&!!nh.__karma__||void 0!==nh.jasmine&&!!nh.jasmine||void 0!==nh.jest&&!!nh.jest||void 0!==nh.Mocha&&!!nh.Mocha;let om=(()=>{class n{constructor(t,i){this._platform=i,this._document=t}ngOnDestroy(){const t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||wU){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(d),this._keydownEvents=new we,this._outsidePointerEvents=new we,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this.hasAttached()&&this.updatePosition()}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,e&&this._detachments.next(),this._detachments.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=jr(this._config.width),e.height=jr(this._config.height),e.minWidth=jr(this._config.minWidth),e.minHeight=jr(this._config.minHeight),e.maxWidth=jr(this._config.maxWidth),e.maxHeight=jr(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;mE(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(zn(ki(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._previousHostParent.removeChild(this._host)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const EU="cdk-overlay-connected-position-bounding-box",Eoe=/([A-Za-z%]+)$/;class SU{constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new we,this._resizeSubscription=Ie.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(EU),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();const e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Hf(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(EU),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();const e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=xU(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,_=this._subtractOverflows(s.width,0-o,o+s.width-i.width),y=this._subtractOverflows(s.height,p,g),v=_*y;return{visibleArea:v,isCompletelyWithinViewport:s.width*s.height===v,fitsInViewportVertically:y===s.height,fitsInViewportHorizontally:_==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=MU(this._overlayRef.getConfig().minHeight),a=MU(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=xU(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let d=0,f=0;return d=r.width<=s.width?c||-o:e.x_&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-_/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,d=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)f=e.x,d=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),_=this._lastBoundingBoxSize.width;d=2*g,f=e.x-g,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(f=e.x-_/2)}return{top:o,left:f,bottom:a,right:p,width:d,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=jr(i.height),r.top=jr(i.top),r.bottom=jr(i.bottom),r.width=jr(i.width),r.left=jr(i.left),r.right=jr(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=jr(s)),o&&(r.maxWidth=jr(o))}this._lastBoundingBoxSize=i,Hf(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Hf(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Hf(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const d=this._viewportRuler.getViewportScrollPosition();Hf(i,this._getExactOverlayY(t,e,d)),Hf(i,this._getExactOverlayX(t,e,d))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=jr(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=jr(o.maxWidth):s&&(i.maxWidth="")),Hf(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=jr(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=jr(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:bU(e,i),isOriginOutsideView:RO(e,i),isOverlayClipped:bU(t,i),isOverlayOutsideView:RO(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&mE(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof nt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function Hf(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function MU(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(Eoe);return t&&"px"!==t?null:parseFloat(e)}return n||null}function xU(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class Soe{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new SU(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new yoe(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const TU="cdk-global-overlay-wrapper";class Moe{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(TU),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?t.justifyContent="flex-start":"center"===this._justifyContent?t.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?t.justifyContent="flex-end":"flex-end"===this._justifyContent&&(t.justifyContent="flex-start"):t.justifyContent=this._justifyContent,t.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(TU),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let xoe=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new Moe}connectedTo(t,i,r){return new Soe(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new SU(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(I(jf),I(rt),I(ii),I(om))},n.\u0275prov=ae({factory:function(){return new n(I(jf),I(rt),I(ii),I(om))},token:n,providedIn:"root"}),n})(),Toe=0,Jo=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=d,this._location=f,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new Hv(t);return o.direction=o.direction||this._directionality.value,new woe(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+Toe++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Yd)),new doe(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(I(_oe),I(om),I(ol),I(xoe),I(boe),I(Tt),I(lt),I(rt),I(Ko),I(Ug),I(Coe))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Aoe=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],AU=new _e("cdk-connected-overlay-scroll-strategy");let Doe=(()=>{class n{constructor(t){this.elementRef=t}}return n.\u0275fac=function(t){return new(t||n)(E(nt))},n.\u0275dir=he({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),n})(),DU=(()=>{class n{constructor(t,i,r,s,o){this._overlay=t,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=Ie.EMPTY,this._attachSubscription=Ie.EMPTY,this._detachSubscription=Ie.EMPTY,this._positionSubscription=Ie.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Pe,this.positionChange=new Pe,this.attach=new Pe,this.detach=new Pe,this.overlayKeydown=new Pe,this.overlayOutsideClick=new Pe,this._templatePortal=new Uf(i,r),this._scrollStrategyFactory=s,this.scrollStrategy=this._scrollStrategyFactory()}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}get hasBackdrop(){return this._hasBackdrop}set hasBackdrop(t){this._hasBackdrop=Dt(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=Dt(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=Dt(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=Dt(t)}get push(){return this._push}set push(t){this._push=Dt(t)}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this._attachOverlay():this._detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Aoe);const t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=t.detachments().subscribe(()=>this.detach.emit()),t.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),27===i.keyCode&&!this.disableClose&&!Yo(i)&&(i.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{this.overlayOutsideClick.next(i)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),i=new Hv({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(i.width=this.width),(this.height||0===this.height)&&(i.height=this.height),(this.minWidth||0===this.minWidth)&&(i.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(t){const i=this.positions.map(r=>({originX:r.originX,originY:r.originY,overlayX:r.overlayX,overlayY:r.overlayY,offsetX:r.offsetX||this.offsetX,offsetY:r.offsetY||this.offsetY,panelClass:r.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const t=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(t),t}_attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(t=>{this.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(_U(()=>this.positionChange.observers.length>0)).subscribe(t=>{this.positionChange.emit(t),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()}))}_detachOverlay(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Xs),E(es),E(AU),E(Ko,8))},n.\u0275dir=he({type:n,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[qn]}),n})();const Ioe={provide:AU,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};let $v=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[Jo,Ioe],imports:[[Iv,iS,gU],gU]}),n})();const OU=["mat-button",""],IU=["*"],Roe=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],koe=kf(em(Ff(class{constructor(n){this._elementRef=n}})));let $f=(()=>{class n extends koe{constructor(t,i,r){super(t),this._focusMonitor=i,this._animationMode=r,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const s of Roe)this._hasHostAttributes(s)&&this._getHostElement().classList.add(s);t.nativeElement.classList.add("mat-button-base"),this.isRoundButton&&(this.color="accent")}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}focus(t,i){t?this._focusMonitor.focusVia(this._getHostElement(),t,i):this._getHostElement().focus(i)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(i=>this._getHostElement().hasAttribute(i))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-icon-button",""],["button","mat-fab",""],["button","mat-mini-fab",""],["button","mat-stroked-button",""],["button","mat-flat-button",""]],viewQuery:function(t,i){if(1&t&&ni(Qo,5),2&t){let r;Mt(r=xt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,i){2&t&&(en("disabled",i.disabled||null),at("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-button-disabled",i.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[ht],attrs:OU,ngContentSelectors:IU,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,i){1&t&&(Dr(),F(0,"span",0),In(1),N(),et(2,"span",1),et(3,"span",2)),2&t&&(Y(2),at("mat-button-ripple-round",i.isRoundButton||i.isIconButton),ie("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",i.isIconButton)("matRippleTrigger",i._getHostElement()))},directives:[Qo],styles:[".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:.04}@media(hover: none){.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-icon-button,.mat-stroked-button,.mat-flat-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-button.mat-button-disabled,.mat-icon-button.mat-button-disabled,.mat-stroked-button.mat-button-disabled,.mat-flat-button.mat-button-disabled{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button.mat-button-disabled{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}._mat-animation-noopable.mat-raised-button{transition:none;animation:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-ripple.mat-ripple,.mat-stroked-button .mat-button-focus-overlay{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab.mat-button-disabled{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-fab{transition:none;animation:none}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab.mat-button-disabled{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-mini-fab{transition:none;animation:none}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button i,.mat-icon-button .mat-icon{line-height:24px}.mat-button-ripple.mat-ripple,.mat-button-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1),background-color 200ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n"],encapsulation:2,changeDetection:0}),n})(),Gf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn],Nn]}),n})();class RU extends Rt{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class Foe extends Rt{constructor(e,t,i){super(),this.parent=e,this.outerValue=t,this.outerIndex=i,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function kU(n,e,t,i,r=new Foe(n,t,i)){if(!r.closed)return e instanceof oe?e.subscribe(r):Pi(e)(r)}const FU={};function or(...n){let e,t;return Ln(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&Fe(n[0])&&(n=n[0]),Ba(n,t).lift(new NU(e))}class NU{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Noe(e,this.resultSelector))}}class Noe extends RU{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(FU),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i{class n{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):Boe}matchMedia(t){return this._platform.WEBKIT&&function(n){if(!LU.has(n))try{am||(am=document.createElement("style"),am.setAttribute("type","text/css"),document.head.appendChild(am)),am.sheet&&(am.sheet.insertRule(`@media ${n} {.fx-query-test{ }}`,0),LU.add(n))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return n.\u0275fac=function(t){return new(t||n)(I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(ii))},token:n,providedIn:"root"}),n})();function Boe(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let kO=(()=>{class n{constructor(t,i){this._mediaMatcher=t,this._zone=i,this._queries=new Map,this._destroySubject=new we}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return VU(mE(t)).some(r=>this._registerQuery(r).mql.matches)}observe(t){let s=or(VU(mE(t)).map(o=>this._registerQuery(o).observable));return s=YE(s.pipe(_i(1)),s.pipe(VD(1),$g(0))),s.pipe(be(o=>{const a={matches:!1,breakpoints:{}};return o.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const i=this._mediaMatcher.matchMedia(t),s={observable:new oe(o=>{const a=l=>this._zone.run(()=>o.next(l));return i.addListener(a),()=>{i.removeListener(a)}}).pipe(ns(i),be(({matches:o})=>({query:t,matches:o})),zn(this._destroySubject)),mql:i};return this._queries.set(t,s),s}}return n.\u0275fac=function(t){return new(t||n)(I(BU),I(lt))},n.\u0275prov=ae({factory:function(){return new n(I(BU),I(lt))},token:n,providedIn:"root"}),n})();function VU(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}function Voe(n,e){if(1&n){const t=Lr();F(0,"div",1),F(1,"button",2),ye("click",function(){return Vn(t),bt().action()}),Te(2),N(),N()}if(2&n){const t=bt();Y(2),Ai(t.data.action)}}function joe(n,e){}const FO=new _e("MatSnackBarData");class rS{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const Uoe=Math.pow(2,31)-1;class NO{constructor(e,t){this._overlayRef=t,this._afterDismissed=new we,this._afterOpened=new we,this._onAction=new we,this._dismissedByAction=!1,this.containerInstance=e,this.onAction().subscribe(()=>this.dismiss()),e._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,Uoe))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}let zoe=(()=>{class n{constructor(t,i){this.snackBarRef=t,this.data=i}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return n.\u0275fac=function(t){return new(t||n)(E(NO),E(FO))},n.\u0275cmp=Le({type:n,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-simple-snackbar"],decls:3,vars:2,consts:[["class","mat-simple-snackbar-action",4,"ngIf"],[1,"mat-simple-snackbar-action"],["mat-button","",3,"click"]],template:function(t,i){1&t&&(F(0,"span"),Te(1),N(),Ct(2,Voe,3,1,"div",0)),2&t&&(Y(1),Ai(i.data.message),Y(1),ie("ngIf",i.hasAction))},directives:[Is,$f],styles:[".mat-simple-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.mat-simple-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.mat-simple-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .mat-simple-snackbar-action{margin-left:-8px;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),n})();const Hoe={snackBarState:Jl("state",[br("void, hidden",Kn({transform:"scale(0.8)",opacity:0})),br("visible",Kn({transform:"scale(1)",opacity:1})),Qs("* => visible",Mo("150ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void, * => hidden",Mo("75ms cubic-bezier(0.4, 0.0, 1, 1)",Kn({opacity:0})))])};let $oe=(()=>{class n extends nS{constructor(t,i,r,s,o){super(),this._ngZone=t,this._elementRef=i,this._changeDetectorRef=r,this._platform=s,this.snackBarConfig=o,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new we,this._onExit=new we,this._onEnter=new we,this._animationState="void",this.attachDomPortal=a=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(a)),this._live="assertive"!==o.politeness||o.announcementMessage?"off"===o.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(t)}onAnimationEnd(t){const{fromState:i,toState:r}=t;if(("void"===r&&"void"!==i||"hidden"===r)&&this._completeExit(),"visible"===r){const s=this._onEnter;this._ngZone.run(()=>{s.next(),s.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}ngOnDestroy(){this._destroyed=!0,this._completeExit()}_completeExit(){this._ngZone.onMicrotaskEmpty.pipe(_i(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(r=>t.classList.add(r)):t.classList.add(i)),"center"===this.snackBarConfig.horizontalPosition&&t.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&t.classList.add("mat-snack-bar-top")}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),i=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&i){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(r=document.activeElement),t.removeAttribute("aria-hidden"),i.appendChild(t),null==r||r.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return n.\u0275fac=function(t){return new(t||n)(E(lt),E(nt),E(Un),E(ii),E(rS))},n.\u0275cmp=Le({type:n,selectors:[["snack-bar-container"]],viewQuery:function(t,i){if(1&t&&ni(zf,7),2&t){let r;Mt(r=xt())&&(i._portalOutlet=r.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,i){1&t&&qy("@state.done",function(s){return i.onAnimationEnd(s)}),2&t&&Sg("@state",i._animationState)},features:[ht],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,i){1&t&&(F(0,"div",0),Ct(1,joe,0,0,"ng-template",1),N(),et(2,"div")),2&t&&(Y(2),en("aria-live",i._live)("role",i._role))},directives:[zf],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[Hoe.snackBarState]}}),n})(),UU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[$v,iS,bn,Gf,Nn],Nn]}),n})();const zU=new _e("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new rS}});let Woe=(()=>{class n{constructor(t,i,r,s,o,a){this._overlay=t,this._live=i,this._injector=r,this._breakpointObserver=s,this._parentSnackBar=o,this._defaultConfig=a,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=zoe,this.snackBarContainerComponent=$oe,this.handsetCssClass="mat-snack-bar-handset"}get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}openFromComponent(t,i){return this._attach(t,i)}openFromTemplate(t,i){return this._attach(t,i)}open(t,i="",r){const s=Object.assign(Object.assign({},this._defaultConfig),r);return s.data={message:t,action:i},s.announcementMessage===t&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,i){const s=Tt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:rS,useValue:i}]}),o=new sm(this.snackBarContainerComponent,i.viewContainerRef,s),a=t.attach(o);return a.instance.snackBarConfig=i,a.instance}_attach(t,i){const r=Object.assign(Object.assign(Object.assign({},new rS),this._defaultConfig),i),s=this._createOverlay(r),o=this._attachSnackBarContainer(s,r),a=new NO(o,s);if(t instanceof Xs){const l=new Uf(t,null,{$implicit:r.data,snackBarRef:a});a.instance=o.attachTemplatePortal(l)}else{const l=this._createInjector(r,a),c=new sm(t,void 0,l),d=o.attachComponentPortal(c);a.instance=d.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(zn(s.detachments())).subscribe(l=>{const c=s.overlayElement.classList;l.matches?c.add(this.handsetCssClass):c.remove(this.handsetCssClass)}),r.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(a,r),this._openedSnackBarRef=a,this._openedSnackBarRef}_animateSnackBar(t,i){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),i.duration&&i.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(i.duration))}_createOverlay(t){const i=new Hv;i.direction=t.direction;let r=this._overlay.position().global();const s="rtl"===t.direction,o="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!s||"end"===t.horizontalPosition&&s,a=!o&&"center"!==t.horizontalPosition;return o?r.left("0"):a?r.right("0"):r.centerHorizontally(),"top"===t.verticalPosition?r.top("0"):r.bottom("0"),i.positionStrategy=r,this._overlay.create(i)}_createInjector(t,i){return Tt.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:NO,useValue:i},{provide:FO,useValue:t.data}]})}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(wE),I(Tt),I(kO),I(n,12),I(zU))},n.\u0275prov=ae({factory:function(){return new n(I(Jo),I(wE),I(ku),I(kO),I(n,12),I(zU))},token:n,providedIn:UU}),n})();function De(n,e,t,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function bs(n,e){return function(t,i){e(t,i,n)}}function Ge(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function gl(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function WU(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function BO(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||WU()}const qU="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",oS=BO();class Koe{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function VO(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const YU={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function XU(n){return"string"==typeof n?YU[n.toUpperCase()]||YU.WHITE:n}function aS(n,e){if(!n)throw new Error(e||"Assertion failed")}const tc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},Gv=tc.window||tc.self||tc.global,KU=tc.process||{};function lm(){let n;if(oS&&Gv.performance)n=Gv.performance.now();else if(KU.hrtime){const e=KU.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const cm={debug:oS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},iae={enabled:!0,level:0};function ml(){}const ZU={},QU={once:!0};function rae(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let jO=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=qU,this._startTs=lm(),this._deltaTs=lm(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Koe("__probe-".concat(this.id,"__"),iae),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((lm()-this._startTs).toPrecision(10))}getDelta(){return Number((lm()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){aS(t,i)}warn(t){return this._getLogFunction(0,t,cm.warn,arguments,QU)}error(t){return this._getLogFunction(0,t,cm.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,cm.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,cm.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,cm.debug||cm.info,arguments,QU)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||ml,r&&[r],{tag:rae(i)}):ml}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?oS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=VO(r,e,t);console.log(...s)},r.src=n,ml}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...VO(n,e,t)),ml;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...VO(r,e,t)),r.src=n.toDataURL(),ml}return ml}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=Ve(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):ml}({image:r,message:s,scale:o}):ml}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||ml)}group(t,i,r={collapsed:!1}){r=ez({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ml)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=JU(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=ez({logLevel:t,message:i,args:s,opts:o}),aS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=lm();const a=o.tag||o.message;if(o.once){if(ZU[a])return ml;ZU[a]=lm()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!oS&&"string"==typeof n&&(e&&(e=XU(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=XU(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return ml}}return n.VERSION=qU,n})();function JU(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return aS(Number.isFinite(e)&&e>=0),e}function ez(n){const{logLevel:e,message:t}=n;n.logLevel=JU(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return aS("string"===r||"object"===r),Object.assign(n,n.opts)}const Zn=new jO({id:"deck"}),Hn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Hn,"IDENTITY",{get:()=>Zn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const $c={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},tz={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},ct=new jO({id:"luma.gl"});function xo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function lS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Mn(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function cS(n){return xo(lS(n),"Invalid WebGLRenderingContext"),n}function To(n){return xo(Mn(n),"Requires WebGL2"),n}var Zi=Ve(761);const Wv={};const qv=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Zi.CO.console&&Zi.CO.console.log&&Zi.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Wf.prototype.VERTEX_ARRAY_BINDING_OES=34229,Wf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iMn(n)?void 0:0,Mae={3074:n=>Mn(n)?void 0:36064,35723:n=>Mn(n)?void 0:4352,35977:Li,32937:Li,36795:(n,e)=>{const t=Mn(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(rz);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(rz);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:Li,35071:Li,37447:Li,36063:(n,e)=>{if(!Mn(n)){const t=n.getExtension(iz);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Li,35374:Li,35377:Li,34852:n=>{if(!Mn(n)){const e=n.getExtension(iz);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(nz)?2147483647:65535,33001:n=>n.getExtension(nz)?16777216:65535,33e3:n=>16777216,37157:Li,35373:Li,35657:Li,36183:Li,37137:Li,34045:Li,35978:Li,35979:Li,35968:Li,35376:Li,35375:Li,35659:Li,37154:Li,35371:Li,35658:Li,35076:Li,35077:Li,35380:Li},sz="ANGLE_instanced_arrays",oz={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{xo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[sz]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){xo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{xo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{xo(!1)},deleteQuery:()=>{xo(!1)},beginQuery:()=>{xo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},UO={readBuffer:(n,e,t)=>{Mn(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Mn(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!Mn(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Mn(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=Mae[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function Bae(n,{extension:e,target:t,target2:i}){const r=oz[e];xo(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new Wf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&Bae(n,{extension:t,target:n.luma,target2:n})}(n,oz),function(n,{target:e,target2:t}){Object.keys(UO).forEach(i=>{if("function"==typeof UO[i]){const r=n[i]?n[i].bind(n):()=>{},s=UO[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const zO={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ih=(n,e,t)=>e?n.enable(t):n.disable(t),az=(n,e,t)=>n.hint(t,e),Ma=(n,e,t)=>n.pixelStorei(t,e);function Yv(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Uae={3042:ih,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:ih,2885:(n,e)=>n.cullFace(e),2929:ih,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:ih,35723:az,36006:(n,e)=>{const t=Mn(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:az,2849:(n,e)=>n.lineWidth(e),32823:ih,32824:"polygonOffset",10752:"polygonOffset",35977:ih,32938:"sampleCoverage",32939:"sampleCoverage",3089:ih,3088:(n,e)=>n.scissor(...e),2960:ih,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:Ma,3317:Ma,37440:Ma,37441:Ma,37443:Ma,3330:Ma,3332:Ma,3331:Ma,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Ma,32878:Ma,3316:Ma,3315:Ma,32877:Ma,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=Yv(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Yv(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=Yv(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Yv(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=Yv(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Cr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const zae={blendEquation:(n,e,t)=>n.blendEquationSeparate(Cr(32777,e,t),Cr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Cr(32969,e,t),Cr(32968,e,t),Cr(32971,e,t),Cr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Cr(32824,e,t),Cr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Cr(32938,e,t),Cr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Cr(2962,e,t),Cr(2967,e,t),Cr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Cr(34816,e,t),Cr(36003,e,t),Cr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Cr(2964,e,t),Cr(2965,e,t),Cr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Cr(34817,e,t),Cr(34818,e,t),Cr(34819,e,t))},lz={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Gc=(n,e)=>n.isEnabled(e),cz={3042:Gc,2884:Gc,2929:Gc,3024:Gc,32823:Gc,32926:Gc,32928:Gc,3089:Gc,2960:Gc,35977:Gc};function uz(n){for(const e in n)return!1;return!0}function Hae(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||zO)){const r=e,s=cz[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=cz[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},zO),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){xo(this.stateStack.length>0),Wu(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){xo(void 0!==s);const o=e[s],a=this.cache[s];Hae(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function hz(n,e={}){const{enable:t=!0,copyState:i}=e;if(xo(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new Wae(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in lz)$ae(n,o,lz[o]);dz(n,"getParameter"),dz(n,"isEnabled")}return n.state.enable=t,n}function fz(n){xo(n.state),n.state.pop()}function Wu(n,e){if(xo(lS(n),"setParameters requires a WebGL context"),uz(e))return;const t={};for(const r in e){const s=Number(r),o=Uae[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)zae[r](n,e,i)}function nc(n,e,t){if(uz(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||hz(n,{copyState:!1}),n.state.push()}(n),Wu(n,e),i)r=t(n),fz(n);else try{r=t(n)}finally{fz(n)}return r}function um(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function HO(n,e,t=!0){return function(n,e,t,i,r){const s=pz(n[0],e,t);let o=gz(n[1],e,i,r),a=pz(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=gz(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,um(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function pz(n,e,t){return Math.min(Math.round(n*e),t-1)}function gz(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const $O=(0,Zi.jU)(),Qae=$O&&"undefined"!=typeof document,mz={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function _z(n={}){xo($O,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},mz,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(Qae&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=GO(r,n),function(n){const e=Mn(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);ct.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function GO(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},mz,e);const{manageState:t,debug:i}=e;return t&&hz(n,{copyState:!1,log:(...r)=>ct.log(1,...r)()}),$O&&i&&(Zi.CO.makeDebugContext?(n=Zi.CO.makeDebugContext(n,e),ct.level=Math.max(ct.level,1)):ct.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function yz(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class vz{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=yz(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(yz()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class WO{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof vz?e:new vz(t,i)),this.stats[t]}}const Xv="8.5.7",qf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new WO({id:e})),this.stats.get(e)}};if(Zi.CO.luma&&Zi.CO.luma.VERSION!==Xv)throw new Error(`luma.gl - multiple VERSIONs detected: ${Zi.CO.luma.VERSION} vs 8.5.7`);function Qe(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function qO(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return Qe(void 0!==i,`Accessing undefined constant GL.${e}`),i}function rh(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Zi.CO.luma||((0,Zi.jU)()&&ct.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Zi.CO.luma=Zi.CO.luma||{VERSION:Xv,version:Xv,log:ct,stats:qf,globals:{modules:{},nodeIO:{}}});const YO={};function Wc(n="id"){return YO[n]=YO[n]||1,`${n}-${YO[n]++}`}function bz(n){return Qe("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function dm(n){let e=!0;for(const t in n){e=!1;break}return e}function Cz(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw ct.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const hm="Resource subclass must define virtual methods";class qu{constructor(e,t={}){cS(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||Wc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){Qe(e=qO(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Mn(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=Mn(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?rh(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=rh(this.gl,o[f]))}}return o}setParameter(e,t){Qe(e=qO(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Mn(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=qO(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return Cz(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(hm)}_deleteHandle(){throw new Error(hm)}_bindHandle(e){throw new Error(hm)}_getOptsFromHandle(){throw new Error(hm)}_getParameter(e,t){throw new Error(hm)}_setParameter(e,t){throw new Error(hm)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=qf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;qf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=qf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=qf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function XO(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Kv(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function ule({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return ea.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ea.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=KO("Accessor",e,hle)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const Ez={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},fle={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Ez},ple={removedProps:Ez};class Si extends qu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/ea.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ea.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=KO("Buffer",e,fle),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=KO("Buffer",e,ple))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ea(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;Qe(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(To(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return To(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){To(this.gl);const s=Kv(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return Qe((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(Qe(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){Qe(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=XO(e);return Qe(s),this.setAccessor(new ea(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){Qe(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/Kv(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ea(this.accessor,{type:XO(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return ct.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return ct.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return ct.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return ct.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ea(this.accessor,e),this}}const ZO={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},Sz={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},Mz={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},_le=[9729,9728],xz=Zi.CO.WebGLBuffer||function(){};class fm extends qu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=ZO[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Mn(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=ZO[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=Wc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(C=>this.initialize(Object.assign({},e,{pixels:C,data:C}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:y=!1,mipmaps:v=!0}=e;const{depth:w=0}=e;return({width:f,height:p,compressed:y,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:y,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=w,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),v&&this._isNPOT()&&(ct.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),v=!1,this._updateForNPOT(l)),this.mipmaps=v,this.setImageData({data:t,width:f,height:p,depth:w,format:s,type:_,dataFormat:g,border:o,mipmaps:v,parameters:c,compressed:y}),v&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:y}=this;y.bindTexture(this.target,this.handle);let w,v=null;return({data:c,dataType:v}=this._getDataType({data:c,compressed:_})),nc(this.gl,l,()=>{switch(v){case"null":y.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":y.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":w=To(y),w.bindBuffer(35052,c.handle||c),w.texImage2D(t,r,s,f,p,o,g,d,a),w.bindBuffer(35052,null);break;case"browser-object":Mn(y)?y.texImage2D(t,r,s,f,p,o,g,d,c):y.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[C,x]of c.entries())y.compressedTexImage2D(t,C,x.format,x.width,x.height,o,x.data);break;default:Qe(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(Sz[this.dataFormat]||4)*(Mz[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:y={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),Qe(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const v=i;i=v.data,o=v.shape[0],a=v.shape[1]}i instanceof Si&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),nc(this.gl,y,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof xz){const v=To(this.gl);v.bindBuffer(35052,i),v.texSubImage2D(e,l,r,s,o,a,f,d,g),v.bindBuffer(35052,null)}else Mn(this.gl)?To(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return ct.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof Si?{data:e.handle,dataType:"buffer"}:e instanceof xz?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=ZO[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},Qe(r,"Could not deduced texture size"),Qe(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),Qe(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Qe(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Mn(this.gl)||!this.width||!this.height||bz(this.width)&&bz(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===_le.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function yle(n,e){return Qe("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class xa extends fm{static isSupported(e,t){return fm.isSupported(e,t)}constructor(e,t={}){cS(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:yle(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Yf="EXT_color_buffer_float",Tz={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:Yf,bpp:2},33327:{gl2:Yf,bpp:4},34842:{gl2:Yf,bpp:8},33326:{gl2:Yf,bpp:4},33328:{gl2:Yf,bpp:8},34836:{gl2:Yf,bpp:16},35898:{gl2:Yf,bpp:4}};class pm extends qu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Mn(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,Tz)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return Qe(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Mn(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Tz[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const Pz="clear: bad arguments";function JO(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),Qe(0!==o,Pz),nc(n,s,()=>{n.clear(o)})}function Rz(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function un(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){Rz(s,i,r,o,a,"next",l)}function a(l){Rz(s,i,r,o,a,"throw",l)}o(void 0)})}}const eI=[34069,34070,34071,34072,34073,34074];let Mle=(()=>{class n extends fm{constructor(t,i={}){cS(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return un(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(eI.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),eI.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&ct.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((y,v)=>{t&&i?d.texImage2D(g,v,a,t,i,o,a,l,y):d.texImage2D(g,v,a,a,l,y)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=eI,n})();class xle extends fm{static isSupported(e){return Mn(e)}constructor(e,t={}){To(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),nc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof Si&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(Sz[this.dataFormat]||4)*(Mz[this.type]||1),"Texture"),this.loaded=!0,this}}function Ale(n,e){const{gl:t,width:i,height:r,id:s}=n;return new is(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function uS(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof is?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Ale(n),deleteFramebuffer:!0}}(n);Qe(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),Qe(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(Kv(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Qe(!1),0}}(t))}(o,c,r,a,l),c=c||XO(o);const y=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,y||null),f&&d.delete(),o}function tI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=uS(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=ule({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return Qe(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&ct.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){Qe(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof pm)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(is.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&JO(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){To(n),nc(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:Qe(!1,Pz)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return ct.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return ct.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return ct.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return ct.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return ct.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return ct.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=To(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=rh(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?rh(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?rh(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(tI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>ct.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=tI(this,{targetMaxHeight:100});return ct.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new xa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new pm(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new pm(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&Qe(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof pm?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:To(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:Qe(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return Mn(n)?n:null}(this.gl);t?t.readBuffer(e):Qe(36064===e||1029===e,kz),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=To(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):Qe(1===e.length&&(36064===e[0]||1029===e[0]),kz)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in Fz)void 0===n.luma.caps[e]&&(n.luma.caps[e]=Lz(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}is.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const Fz={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new xa(n,{format:6408,type:5126,dataFormat:6408}),t=new is(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function nI(n,e){return Nz(n,e)}function Nz(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>Lz(n,t))}function Lz(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=Fz[e];let i;Qe(t,e);const r=Mn(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:Qe(!1);return i}(n,e)),n.luma.caps[e]||ct.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class iI{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},jle=(Math,1/180*Math.PI),Qi={};function zle(n,{precision:e=Qi.precision||4}={}){return n=function(n){return Math.round(n/Qi.EPSILON)*Qi.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function sh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Yu(n,e,t){if(sh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*jle,void 0)}(n)}function Xf(n,e,t){return Yu(n,i=>Math.max(e,Math.min(t,i)))}function dS(n,e,t){return sh(n)?n.map((i,r)=>dS(i,e[r],t)):t*e+(1-t)*n}function eb(n,e,t){const i=Qi.EPSILON;t&&(Qi.EPSILON=t);try{if(n===e)return!0;if(sh(n)&&sh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+zle(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(Yz.length=n.length,i=Yz):i=qz,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function Kz(n){return n&&n[Symbol.asyncIterator]}function lI(n,e=(()=>!0)){return Array.isArray(n)?Zz(n,e,[]):e(n)?[n]:[]}function Zz(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function Qz(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",J(J(J({},Mce[n.type]),e),n)):null}function Jz(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function e4(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function t4(n){n.push(n.shift())}function uI(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function n4({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=uI(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const w=s;s=(C,x)=>t._normalizeConstant(w(C,x))}const _=p?(w,C)=>s(g,C):(w,C)=>s(g.subarray(w,w+a),C),y=n.getData({length:i}),v=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return cI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===gS||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=gS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wce}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==gS}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const v=f*a+l;for(let w=0;wd?c.set(x,y):(e._normalizeValue(x,w.target,0),Cce({target:c,source:w.target,start:y,count:L}));y+=L*d}else e._normalizeValue(x,c,y),y+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let hI={};function eo(n){Zn.level>0&&hI[n]&&hI[n].call(...arguments)}function Ta(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const i4="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Ace=`#version 300 es\n${i4}`;function r4(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function s4(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Ace:e>300?`#version ${e}\n${i4}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Ta(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class o4 extends qu{static isSupported(e){return Mn(e)}constructor(e,t={}){To(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,dm(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,ct.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof Si?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Pce{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof Si?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Qe(Mn(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new o4(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],Qe(i[s]instanceof Si)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new Si(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function a4(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const ib="vs",Fce={[ib]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},mS="__LUMA_INJECT_DECLARATIONS__",l4=/void\s+main\s*\([^)]*\)\s*\{\n?/,c4=/}\n?[^{}]*$/,pI=[];function u4(n,e,t,i=!1){const r=e===ib;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),pI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(c4,l=>a+l));break;case"fs:#decl":r||(n=n.replace(mS,a));break;case"fs:#main-start":r||(n=n.replace(l4,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(c4,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(mS,""),i&&(n=n.replace(/\}\s*$/,s=>s+Fce[e])),n}function gI(n){const e={};return Ta(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const Nce={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},_S="transform_uSize_",d4="transform_position";const $ce={10241:9728,10240:9728,10242:33071,10243:33071};class Wce{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${_S}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${_S}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=uS(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Ta(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new Si(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new is(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters($ce)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){Qe(n instanceof xa||n instanceof Mle||n instanceof xle);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const y=function(n,e){const t={},i=function(n){return r4(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${_S}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Ta(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(y){const{updatedLine:v,inject:w}=y;f[g]=v,c=gI([c,w]),Object.assign(a,y.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=r4(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){Qe(i);const p=`${_S}${t}`;c=gI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${d4} = transform_getPos(${p});\n gl_Position = vec4(${d4}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=gI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||s4({version:a4(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Nce].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const mI={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function Yce(n){let e=h4(n);return"object"===e?n?"type"in n?Object.assign({},n,mI[n.type]):"value"in n?(e=h4(n.value),Object.assign({type:e},n,mI[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},mI[e])}function h4(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class _I{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Ta("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=Yce(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Ta(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Ta(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Qce(n){return function(n){const e={},t={};return yI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(p4(n))}function yI({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof _I||(Ta("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ta(t.name,"shader module has no name"),(t=new _I(t)).dependencies=p4(t.dependencies)),t))}const vI={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},Kf={};function oue(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(vI).forEach(n=>{Kf[n]=n});const bI={};function g4(n,e,t={}){const i=vI[e];if(Ta(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in bI)return bI[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),bI[e]=l,l}function yS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=vI[e];Ta(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Ta(!1===r||!0===r),r}(n,t))}function mm(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const m4=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],uue=[...m4,[mm("attribute"),"in $1"],[mm("varying"),"out $1"]],due=[...m4,[mm("varying"),"in $1"]],_4=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],hue=[..._4,[mm("in"),"attribute $1"],[mm("out"),"varying $1"]],fue=[..._4,[mm("in"),"varying $1"]],CI="gl_FragColor",wI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,pue=/void\s+main\s*\([^)]*\)\s*\{\n?/;function vS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const yue=`\n\n${mS}\n\n`,y4={[ib]:"vertex",fs:"fragment"};function v4(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Ta("string"==typeof t,"shader source must be a string");const f=i===ib,p=t.split("\n");let g=100,_="",y=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],y=p.slice(1).join("\n")):_=`#version ${g}`;const v={};r.forEach($=>{Object.assign(v,$.getDefines())}),Object.assign(v,s);let w=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${y4[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${y4[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:oue(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return yS(n,Kf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),yS(n,Kf.GLSL_DERIVATIVES)&&g4(n,Kf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),yS(n,Kf.GLSL_FRAG_DATA)&&g4(n,Kf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),yS(n,Kf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(v)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const C=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),x={},L={},U={};for(const $ in a){const ee="string"==typeof a[$]?{injection:a[$],order:0}:a[$],fe=$.match(/^(v|f)s:(#)?([\w-]+)$/);if(fe){const ve=fe[3];fe[2]?"decl"===ve?L[$]=[ee]:U[$]=[ee]:x[$]=[ee]}else U[$]=[ee]}for(const $ of r){d&&$.checkDeprecations(y,d),w+=$.getModuleSource(i,g);const fe=$.injections[i];for(const pe in fe){const ve=pe.match(/^(v|f)s:#([\w-]+)$/);if(ve){const Xe="decl"===ve[2]?L:U;Xe[pe]=Xe[pe]||[],Xe[pe].push(fe[pe])}else x[pe]=x[pe]||[],x[pe].push(fe[pe])}}return w+=yue,w=u4(w,i,L),w+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(C[i],x),w+=y,w=u4(w,i,U),w=function(n,e,t){switch(e){case 300:return t?vS(n,uue):function(n){const e=(n=vS(n,due)).match(wI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${CI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(pue,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${CI}\\b`,"g"),t)}return n}(n);case 100:return t?vS(n,hue):function(n){const e=(n=vS(n,fue)).match(wI);if(e){const t=e[1];n=n.replace(wI,"").replace(new RegExp(`\\b${t}\\b`,"g"),CI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(w,l?100:g,f),w}function Cue(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Tue={5126:Ji.bind(null,"uniform1fv",Aa,1,to),35664:Ji.bind(null,"uniform2fv",Aa,2,to),35665:Ji.bind(null,"uniform3fv",Aa,3,to),35666:Ji.bind(null,"uniform4fv",Aa,4,to),5124:Ji.bind(null,"uniform1iv",oh,1,to),35667:Ji.bind(null,"uniform2iv",oh,2,to),35668:Ji.bind(null,"uniform3iv",oh,3,to),35669:Ji.bind(null,"uniform4iv",oh,4,to),35670:Ji.bind(null,"uniform1iv",oh,1,to),35671:Ji.bind(null,"uniform2iv",oh,2,to),35672:Ji.bind(null,"uniform3iv",oh,3,to),35673:Ji.bind(null,"uniform4iv",oh,4,to),35674:Ji.bind(null,"uniformMatrix2fv",Aa,4,Ku),35675:Ji.bind(null,"uniformMatrix3fv",Aa,9,Ku),35676:Ji.bind(null,"uniformMatrix4fv",Aa,16,Ku),35678:Fs,35680:Fs,5125:Ji.bind(null,"uniform1uiv",bS,1,to),36294:Ji.bind(null,"uniform2uiv",bS,2,to),36295:Ji.bind(null,"uniform3uiv",bS,3,to),36296:Ji.bind(null,"uniform4uiv",bS,4,to),35685:Ji.bind(null,"uniformMatrix2x3fv",Aa,6,Ku),35686:Ji.bind(null,"uniformMatrix2x4fv",Aa,8,Ku),35687:Ji.bind(null,"uniformMatrix3x2fv",Aa,6,Ku),35688:Ji.bind(null,"uniformMatrix3x4fv",Aa,12,Ku),35689:Ji.bind(null,"uniformMatrix4x2fv",Aa,8,Ku),35690:Ji.bind(null,"uniformMatrix4x3fv",Aa,12,Ku),35678:Fs,35680:Fs,35679:Fs,35682:Fs,36289:Fs,36292:Fs,36293:Fs,36298:Fs,36299:Fs,36300:Fs,36303:Fs,36306:Fs,36307:Fs,36308:Fs,36311:Fs},Aue={},Due={},Oue={},b4=[0];function EI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(b4[0]=n,n=b4);const r=n.length;if(r%e&&ct.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Ji(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{Qe(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return S4(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:E4(s,c),warnings:E4(o,c)}}(i,this.source,this.shaderType,this.id);throw ct.error(`GLSL compilation errors in ${r}\n${s}`)(),ct.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class SI extends rb{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class MI extends rb{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const rs=5126,sb=5124,ob=5125,xI={[rs]:[rs,1,"float"],35664:[rs,2,"vec2"],35665:[rs,3,"vec3"],35666:[rs,4,"vec4"],[sb]:[sb,1,"int"],35667:[sb,2,"ivec2"],35668:[sb,3,"ivec3"],35669:[sb,4,"ivec4"],[ob]:[ob,1,"uint"],36294:[ob,2,"uvec2"],36295:[ob,3,"uvec3"],36296:[ob,4,"uvec4"],35670:[rs,1,"bool"],35671:[rs,2,"bvec2"],35672:[rs,3,"bvec3"],35673:[rs,4,"bvec4"],35674:[rs,8,"mat2"],35685:[rs,8,"mat2x3"],35686:[rs,8,"mat2x4"],35675:[rs,12,"mat3"],35687:[rs,12,"mat3x2"],35688:[rs,12,"mat3x4"],35676:[rs,16,"mat4"],35689:[rs,16,"mat4x2"],35690:[rs,16,"mat4x3"]};function O4(n){const e=xI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function I4(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=rs}for(const t in xI){const[i,r,s]=xI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class pde{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!Mn(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=O4(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ea(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=O4(i),l={location:e,name:t,accessor:new ea({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const gde=35981,mde=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class R4 extends qu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",mde),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=gde}=e;return this.hash=t||"",this.vs="string"==typeof i?new SI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new MI(this.gl,{id:`${e.id}-fs`,source:r}):r,Qe(this.vs instanceof SI),Qe(this.fs instanceof MI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(To(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new pde(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:y,samplers:v}){if((y||v)&&(ct.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(y||{})),ct.priority>=e){const w=g?g.id:"default",C=`mode=${rh(this.gl,t)} verts=${i} instances=${c} indexType=${rh(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${w}`;ct.log(e,C)()}return Qe(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const w=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Qe(!1),0}}(t);p.begin(w)}this._bindTextures(),nc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Mn(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){ct.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Rue(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof is&&(s=s.texture),s instanceof fm)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&kue(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new SI({handle:r});break;case 35632:i.fs=new MI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=Wc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),ct.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),ct.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||ct.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(x=>this._getHash(x.name)).sort(),g=o.map(x=>this._getHash(x)),_=Object.keys(r).sort(),y=Object.keys(s).sort(),v=[],w=[];for(const x of _)v.push(this._getHash(x)),v.push(this._getHash(r[x]));for(const x of y)w.push(this._getHash(x)),w.push(this._getHash(s[x]));const C=`${d}/${f}D${v.join("/")}M${p.join("/")}I${w.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[C]){const x=function(n,e){const{vs:t,fs:i}=e,r=Qce(e.modules||[]);return{gl:n,vs:v4(n,Object.assign({},e,{source:t,type:ib,modules:r})),fs:v4(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Cue(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[C]=new R4(this.gl,{hash:C,vs:x.vs,fs:x.fs,varyings:o,bufferMode:a}),this._getUniforms[C]=x.getUniforms||(L=>{}),this._useCounts[C]=0}return this._useCounts[C]++,this._programCache[C]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":Gv.chrome?"Chrome":Gv.safari?"Safari":Gv.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Da(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Da.MAX_ATTRIBUTES=Da.MAX_ATTRIBUTES||e.getParameter(34921),Da.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Da._setConstantFloatArray(e,t,i);break;case Int32Array:Da._setConstantIntArray(e,t,i);break;case Uint32Array:Da._setConstantUintArray(e,t,i);break;default:Qe(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Da.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return Qe(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(Qe(Mn(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Da.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new Si(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!ES||ES.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Ede=/^(.+)__LOCATION_([0-9]+)$/,Sde=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Mde{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Da(e),Cz(this,"VertexArray","v6.0",Sde),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new Si(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,ct.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ea.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return Qe(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Ede.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof Si)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof Si)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof Si))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof Si){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return ct.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function lb(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=lb(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function k4(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof Si){const p=e,{data:g,changed:_}=p.getDebugData();let y;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?y=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${rh(r,s)})`:(c=!0,y=`${l} bytes`),{[i]:`${d}${lb(f,{size:o,isInteger:c})}`,"Format ":y}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${lb(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Ade(n,e){const{type:t,size:i}=e,r=I4(t,i);return r?`${n} (${r.name})`:n}function F4({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){Qe(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:lb(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function TI({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?lb(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function N4(n){const{type:e,size:t}=n.accessor,i=I4(e,t);return i?`${i.name} ${n.name}`:n.name}const Ide={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rde(n,e){const{attributeMap:t=Ide}=e||{};return t&&t[n]||n}function kde(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Qe(Number.isFinite(e.size),`attribute ${n} needs size`)}const L4=()=>{},Lde={};class SS{constructor(e,t={}){const{id:i=Wc("model")}=t;Qe(lS(e)),this.id=i,this.gl=e,this.id=t.id||Wc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||ab.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},Qe(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return Qe(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return Qe(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Rde(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=J({},o);delete c.value,i[a]=[new Si(n,l),c],kde(s,c)}}if(r){const s=r.value||r;Qe(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new Si(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(dm(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return JO(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),ct.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&ct.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:y,instanceCount:v}=this,{onBeforeRender:w=L4,onAfterRender:C=L4}=this.props;w(),this.program.setUniforms(this.uniforms);const x=this.program.draw(Object.assign(Lde,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:y,instanceCount:v,offset:f?g:0}));return C(),ct.priority>=2&&this._logDrawCallEnd(c,l,i),x}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return ct.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Qe(t instanceof R4,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new Mde(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof Si&&t.delete()}}_setAnimationProps(e){this.animated&&Qe(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(dm(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new o4(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:ct.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=k4(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Ade(s.name,a)}`),t[o]=k4(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=F4({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=F4({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&ct.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&ct.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${N4(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${N4(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);ct.table(e,s)(),ct.table(e,o)(),ct.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),ct.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class AI{static isSupported(e){return Mn(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();Qe(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new SS(t,Object.assign({},e,{fs:e.fs||s4({version:a4(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(dm(n.feedbackBuffers)&&dm(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Pce(e,t)),function(n){return!(dm(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new Wce(e,t)),Qe(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function MS(){}const jde={onStart:MS,onUpdate:MS,onInterrupt:MS,onEnd:MS};class cb{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=J(J({},jde),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const Yde={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new cb(i),this.attribute=t,this.attributeInTransition=new dI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=e4(e.size);return new AI(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new Si(e,r),new Si(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;t4(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)n4(J({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=uI(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:Jz(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new cb(i),this.attribute=t,this.attributeInTransition=new dI(e,an(J({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new xa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new is(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=e4(e.size);return new AI(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new Si(e,r),new Si(e,r),new Si(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)n4(J({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=uI(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:Jz(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),t4(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),uS(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class Xde{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=AI.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Zn.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=Yde[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Zn.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const B4="attributeManager.invalidate";class the{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new Xde(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;eo("attribute.updateStart",t),t.allocate(i)&&eo("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,eo("attribute.updateEnd",t,i))}}function j4(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function U4(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=Qz(r)))return;const o=she[r.type];if(!o)return void Zn.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(an(J({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const xS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:ahe}=xS;function uhe(n,e){if(!n.transitions)return null;const t={},i=OI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&DI(n[r],e[r],s)&&(t[r]=!0)}return t}function z4({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=DI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=DI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function DI(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function fhe(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!vhe(i[r],e[r])){t=n(i),e=i;break}return t}}function bhe(n,e){if(!e)return n;const t=J(J({},n),e);if("defines"in e&&(t.defines=J(J({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=J({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function AS(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],y=e[13],v=e[14],w=e[15],C=t*a-i*o,x=t*l-r*o,L=t*c-s*o,U=i*l-r*a,$=i*c-s*a,ee=r*c-s*l,fe=d*y-f*_,pe=d*v-p*_,ve=d*w-g*_,$e=f*v-p*y,Xe=f*w-g*y,re=p*w-g*v,le=C*re-x*Xe+L*$e+U*ve-$*pe+ee*fe;return le?(n[0]=(a*re-l*Xe+c*$e)*(le=1/le),n[1]=(r*Xe-i*re-s*$e)*le,n[2]=(y*ee-v*$+w*U)*le,n[3]=(p*$-f*ee-g*U)*le,n[4]=(l*ve-o*re-c*pe)*le,n[5]=(t*re-r*ve+s*pe)*le,n[6]=(v*L-_*ee-w*x)*le,n[7]=(d*ee-p*L+g*x)*le,n[8]=(o*Xe-a*ve+c*fe)*le,n[9]=(i*ve-t*Xe-s*fe)*le,n[10]=(_*$-y*L+w*C)*le,n[11]=(f*L-d*$-g*C)*le,n[12]=(a*pe-o*$e-l*fe)*le,n[13]=(t*$e-i*pe+r*fe)*le,n[14]=(y*x-_*U-v*C)*le,n[15]=(d*U-f*x+p*C)*le,n):null}function qc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],y=e[12],v=e[13],w=e[14],C=e[15],x=t[0],L=t[1],U=t[2],$=t[3];return n[0]=x*i+L*a+U*f+$*y,n[1]=x*r+L*l+U*p+$*v,n[2]=x*s+L*c+U*g+$*w,n[3]=x*o+L*d+U*_+$*C,n[4]=(x=t[4])*i+(L=t[5])*a+(U=t[6])*f+($=t[7])*y,n[5]=x*r+L*l+U*p+$*v,n[6]=x*s+L*c+U*g+$*w,n[7]=x*o+L*d+U*_+$*C,n[8]=(x=t[8])*i+(L=t[9])*a+(U=t[10])*f+($=t[11])*y,n[9]=x*r+L*l+U*p+$*v,n[10]=x*s+L*c+U*g+$*w,n[11]=x*o+L*d+U*_+$*C,n[12]=(x=t[12])*i+(L=t[13])*a+(U=t[14])*f+($=t[15])*y,n[13]=x*r+L*l+U*p+$*v,n[14]=x*s+L*c+U*g+$*w,n[15]=x*o+L*d+U*_+$*C,n}function ub(n,e,t){var o,a,l,c,d,f,p,g,_,y,v,w,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],y=e[9],v=e[10],w=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=y,n[10]=v,n[11]=w,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+y*s+e[13],n[14]=l*i+p*r+v*s+e[14],n[15]=c*i+g*r+w*s+e[15]),n}function db(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function $4(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function G4(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function W4(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function q4(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],y=n[13],v=n[14],w=n[15],C=e[0],x=e[1],L=e[2],U=e[3],$=e[4],ee=e[5],fe=e[6],pe=e[7],ve=e[8],$e=e[9],Xe=e[10],re=e[11],le=e[12],Oe=e[13],Q=e[14],Ue=e[15];return Math.abs(t-C)<=Vi*Math.max(1,Math.abs(t),Math.abs(C))&&Math.abs(i-x)<=Vi*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(r-L)<=Vi*Math.max(1,Math.abs(r),Math.abs(L))&&Math.abs(s-U)<=Vi*Math.max(1,Math.abs(s),Math.abs(U))&&Math.abs(o-$)<=Vi*Math.max(1,Math.abs(o),Math.abs($))&&Math.abs(a-ee)<=Vi*Math.max(1,Math.abs(a),Math.abs(ee))&&Math.abs(l-fe)<=Vi*Math.max(1,Math.abs(l),Math.abs(fe))&&Math.abs(c-pe)<=Vi*Math.max(1,Math.abs(c),Math.abs(pe))&&Math.abs(d-ve)<=Vi*Math.max(1,Math.abs(d),Math.abs(ve))&&Math.abs(f-$e)<=Vi*Math.max(1,Math.abs(f),Math.abs($e))&&Math.abs(p-Xe)<=Vi*Math.max(1,Math.abs(p),Math.abs(Xe))&&Math.abs(g-re)<=Vi*Math.max(1,Math.abs(g),Math.abs(re))&&Math.abs(_-le)<=Vi*Math.max(1,Math.abs(_),Math.abs(le))&&Math.abs(y-Oe)<=Vi*Math.max(1,Math.abs(y),Math.abs(Oe))&&Math.abs(v-Q)<=Vi*Math.max(1,Math.abs(v),Math.abs(Q))&&Math.abs(w-Ue)<=Vi*Math.max(1,Math.abs(w),Math.abs(Ue))}function Y4(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function DS(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new ta(4);ta!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const X4=[0,0,0,0],Whe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],qhe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Yhe=[0,0,0],Xhe=[0,0,0],Khe=TS(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=X4,l=X4,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=K4(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=DS([],l,o),s=i||s,o=qc([],r,s),o=qc([],o,Whe)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:Yhe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Hn.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Hn.LNGLAT:case Hn.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Hn.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function K4(n,e,t=Xhe){let r,i=t,s=!0;switch(r=e===Hn.LNGLAT_OFFSETS||e===Hn.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case $c.WEB_MERCATOR:(e===Hn.LNGLAT||e===Hn.CARTESIAN)&&(s=!1);break;case $c.WEB_MERCATOR_AUTO_OFFSET:e===Hn.LNGLAT?i=r:e===Hn.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case $c.IDENTITY:i=n.position.map(Math.fround);break;case $c.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class efe extends rI{get ELEMENTS(){return Xu(!1),0}get RANK(){return Xu(!1),0}toString(){let e="[";if(Qi.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new Lt).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return W4(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],y=n[14],v=n[15];return(e*o-t*s)*(f*v-p*y)-(e*a-i*s)*(d*v-p*_)+(e*l-r*s)*(d*y-f*_)+(t*a-i*o)*(c*v-p*g)-(t*l-r*o)*(c*y-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return AS(this,this),this.check()}multiplyLeft(e){return qc(this,e,this),this.check()}multiplyRight(e){return qc(this,this,e),this.check()}rotateX(e){return $4(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return G4(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,y,v,w,C,x,L,U,$,ee,fe,pe,ve,$e,Xe,re,le,Oe,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*sc+rc)/(2*rc),512*(rc+Math.log(Math.tan(e5+e*sc*.5)))/(2*rc)]}function ah([n,e]){const t=n/512*(2*rc)-rc,i=2*(Math.atan(Math.exp(e/512*(2*rc)-rc))-e5);return[t*RI,i*RI]}function IS({latitude:n,longitude:e,highPrecision:t=!1}){Zu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*sc),o=512/360,a=o/s,l=512/kI/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=sc*Math.tan(n*sc)/s,f=512/kI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function n5(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=IS({longitude:t,latitude:i,highPrecision:!0}),d=Sm(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=ah(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function i5({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return ub(o,o,[0,0,-i]),$4(o,o,-e*sc),G4(o,o,t*sc),db(o,o,[r/=n,r,r]),s&&ub(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function r5({width:n,height:e,fovy:t=PS(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=PS(i));const a=.5*t*sc,l=s5(t),c=r*sc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function PS(n){return 2*Math.atan(.5/n)*RI}function s5(n){return.5/Math.tan(.5*n*sc)}function FI(n,e){const[t,i,r=0]=n;return Zu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Em(e,[t,i,r,1])}function Zf(n,e,t=0){const[i,r,s]=n;if(Zu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Em(e,[i,r,s,1]);const o=Em(e,[i,r,0,1]),a=Em(e,[i,r,1,1]),l=o[2],c=a[2];return Z4([],o,a,l===c?0:((t||0)-l)/(c-l))}function o5({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Zu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new RS({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],y=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Zu(y[0]>0&&y[1]>0);const v=y[0]/_[0],w=y[1]/_[1],U=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/v,(g[1]+p[1])/2+(s.bottom-s.top)/2/w]),$=Math.min(r,f.zoom+PI(Math.abs(Math.min(v,w))));return Zu(Number.isFinite($)),{longitude:U[0],latitude:U[1],zoom:$}}const a5=Math.PI/180;function l5(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*a5:Math.atan(.5/n.altitude))>(90-n.pitch)*a5-.01?(l=c5(n,0,e),c=c5(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function c5(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Em(i,[e,0,1,1]),s=Em(i,[e,n.height,1,1]),c=ah(Z4([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class RS{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=PS(l=1.5):null===c?c=PS(l):null===l&&(l=s5(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=IS({longitude:r,latitude:i}),y=Sm([r,i]);y[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(y,y,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=r5({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return W4([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=i5({height:t,scale:g,center:y,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=y,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];qc(s,s,i),qc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];db(o,o,[e/2,-t/2,1]),ub(o,o,[1,-1,0]),qc(o,o,s);const a=AS([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof RS&&e.width===this.width&&e.height===this.height&&q4(e.projectionMatrix,this.projectionMatrix)&&q4(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=FI(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=Zf([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Sm(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=ah(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Sm(e)}unprojectFlat(e){return ah(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=Zf(t,this.pixelUnprojectionMatrix),s=Cm([],Sm(e),II([],i));return ah(Cm([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=o5(Object.assign({width:i,height:r,bounds:e},t));return new RS({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return l5(this,e.z||0)}}const hfe=Math.PI/180,ffe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],NI=[0,0,0],gfe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Mm=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?$c.WEB_MERCATOR:$c.WEB_MERCATOR_AUTO_OFFSET:$c.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&eb(t.projectionMatrix,this.projectionMatrix)&&eb(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=FI(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=Zf([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Sm(t):t}unprojectFlat(t){return this.isGeospatial?ah(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?IS({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends Mm{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:y=1.5}=t;const v=Math.pow(2,s);g=g||1,_=_||1,y=Math.max(.75,y);const{fov:w,aspect:C,focalDistance:x,near:L,far:U}=r5({width:g,height:_,pitch:o,altitude:y,nearZMultiplier:l,farZMultiplier:c});let $=i5({height:_,pitch:o,bearing:a,scale:v,altitude:y});p&&($=(new Lt).translate([512*p,0,0]).multiplyLeft($)),super(an(J({},t),{width:g,height:_,viewMatrix:$,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:w,aspect:C,focalDistance:x,near:L,far:U})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=y,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(an(J({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return n5(t,i)}panByPosition(t,i){const r=Zf(i,this.pixelUnprojectionMatrix),o=Cm([],this.projectFlat(t),II([],r)),a=Cm([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=l5(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=o5(J({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function LI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof p5){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function g5(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=DS([],[o,a,l,1],t)),i){case Hn.LNGLAT:return LI([o,a,l],e,s);case Hn.LNGLAT_OFFSETS:return LI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Hn.METER_OFFSETS:return LI(n5(r,[o,a,l]),e,s);case Hn.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const yfe={10241:9987,10240:9729,10242:33071,10243:33071},BI={},Cfe={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||pb(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>VI(n,e)},accessor:{validate(n,e){const t=kS(n);return"function"===t||t===kS(e.value)},equal:(n,e,t)=>"function"==typeof e||VI(n,e)},array:{validate:(n,e)=>e.optional&&!n||pb(n),equal:(n,e,t)=>t.compare?VI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof xa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new xa(t,an(J({},e),{parameters:J(J(J({},yfe),i),n.props.textureParameters)}));return BI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof xa)||BI[n.id]&&(n.delete(),delete BI[n.id])}(n)}}};function VI(n,e){if(n===e)return!0;if(!pb(n)||!pb(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=kfe,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Pfe]||{},i=e[Ife]||e,r=e[Rfe]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(Kz(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return un(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=UI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const v=_,{dataTransform:w}=i.component?i.component.props:{};a=w?w(v,a):a.concat(v),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(v){d=!0,f=v}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const y=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;y&&y(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:v5,ASYNC_RESOLVED:b5,ASYNC_DEFAULTS:Ffe}=xS,Nfe={};let Lfe=0,Bfe=(()=>{class n{constructor(){this.props=Sfe.apply(this,arguments),this.id=this.props.id,this.count=Lfe++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[Ffe])s in i[b5]?r[s]=i[b5][s]:s in i[v5]&&(r[s]=i[v5][s]);return new this.constructor(J(J(J({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new y5({})}}return n.componentName="Component",n.defaultProps=Nfe,n})();class Vfe extends y5{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const oc=n=>"function"==typeof n,lh=n=>null!==n&&"object"==typeof n,w5=n=>lh(n)&&n.constructor==={}.constructor,jfe=n=>n&&"function"==typeof n[Symbol.iterator],Ufe=n=>n&&"function"==typeof n[Symbol.asyncIterator],mb=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,xm=n=>"undefined"!=typeof Blob&&n instanceof Blob,E5=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||lh(n)&&oc(n.tee)&&oc(n.cancel)&&oc(n.getReader))(n)||(n=>lh(n)&&oc(n.read)&&oc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Qf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function zI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function HI(n){var e,t;let i;return Qf(n,"null loader"),Qf(zI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=an(J({},n=n[0]),{options:J(J({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Yc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},$I=Yc.global||Yc.self||Yc.window||{},qfe="object"!=typeof process||"[object process]"!==String(process)||process.browser,S5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);S5&&parseFloat(S5[1]);const WI={};function Yfe(n){for(const e in WI)n.startsWith(e)&&(n=n.replace(e,WI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const Xfe=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Kfe=/^([-\w.]+\/[-\w.+]+)/;function Zfe(n){const e=Kfe.exec(n);return e?e[1]:n}function M5(n){const e=Xfe.exec(n);return e?e[1]:""}const Qfe=/\?.*/;function BS(n){if(mb(n)){const e=qI(n.url||"");return{url:e,type:Zfe(n.headers.get("content-type")||"")||M5(e)}}return xm(n)?{url:qI(n.name||""),type:n.type||""}:"string"==typeof n?{url:qI(n),type:M5(n)}:{url:"",type:""}}function Jfe(n){return mb(n)?n.headers["content-length"]||-1:xm(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function qI(n){return n.replace(Qfe,"")}function x5(n){return YI.apply(this,arguments)}function YI(){return(YI=un(function*(n){if(mb(n))return n;const e={},t=Jfe(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=BS(n);r&&(e["content-type"]=r);const s=yield npe(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function epe(n){return XI.apply(this,arguments)}function XI(){return(XI=un(function*(n){if(!n.ok){const e=yield tpe(n);throw new Error(e)}})).apply(this,arguments)}function tpe(n){return KI.apply(this,arguments)}function KI(){return(KI=un(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function npe(n){return ZI.apply(this,arguments)}function ZI(){return(ZI=un(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${ipe(n.slice(0,5))}`:null})).apply(this,arguments)}function ipe(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const D5={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Yt(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},ope={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function JI(){$I.loaders=$I.loaders||{};const{loaders:n}=$I;return n._state=n._state||{},n._state}const eP=()=>{const n=JI();return n.globalOptions=n.globalOptions||J({},D5),n.globalOptions};function ape(n,e,t,i){return t=t||[],function(n,e){I5(n,null,D5,ope,e);for(const t of e)I5(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=J({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new rpe),R5(r,eP()),R5(r,e),r}(e,n,i)}function O5(n,e){const t=eP(),i=n||t;return"function"==typeof i.fetch?i.fetch:lh(i.fetch)?r=>T5(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:T5}function I5(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&lh(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)A5.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=cpe(a,r);A5.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function cpe(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function R5(n,e){for(const t in e)t in e&&(n[t]=w5(e[t])&&w5(n[t])?J(J({},n[t]),e[t]):e[t])}function Xc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function hpe(n,e="3.0.12"){return Xc(n,"no worker provided"),!(!e||!n.version)}const Kc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},fpe=Kc.global||Kc.self||Kc.window||{},tP="object"!=typeof process||"[object process]"!==String(process)||process.browser,nP="function"==typeof importScripts,ppe="undefined"!=typeof window&&void 0!==window.orientation,k5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),iP=(k5&&parseFloat(k5[1]),new Map);function F5(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function N5(n,e=!0,t){const i=t||new Set;if(n)if(L5(n))i.add(n);else if(L5(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)N5(n[r],e,i);return void 0===t?Array.from(i):[]}function L5(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const rP=()=>{};class B5{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Yt(this,"name",void 0),Yt(this,"source",void 0),Yt(this,"url",void 0),Yt(this,"terminated",!1),Yt(this,"worker",void 0),Yt(this,"onMessage",void 0),Yt(this,"onError",void 0),Yt(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Xc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=rP,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=rP,this.onError=rP,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||N5(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){Xc(n.source&&!n.url||!n.source&&n.url);let e=iP.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?F5(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),iP.set(n.url,e)),n.source&&(e=F5(n.source),iP.set(n.source,e))),Xc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class ype{constructor(e,t){Yt(this,"name",void 0),Yt(this,"workerThread",void 0),Yt(this,"isRunning",void 0),Yt(this,"result",void 0),Yt(this,"_resolve",void 0),Yt(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Xc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Xc(this.isRunning),this.isRunning=!1,this._reject(e)}}class vpe{constructor(e){Yt(this,"name","unnamed"),Yt(this,"source",void 0),Yt(this,"url",void 0),Yt(this,"maxConcurrency",1),Yt(this,"maxMobileConcurrency",1),Yt(this,"onDebug",()=>{}),Yt(this,"reuseWorkers",!0),Yt(this,"props",{}),Yt(this,"jobQueue",[]),Yt(this,"idleQueue",[]),Yt(this,"count",0),Yt(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=J(J({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return un(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return un(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new ype(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class Qu{static isSupported(){return B5.isSupported()}static getWorkerFarm(e={}){return Qu._workerFarm=Qu._workerFarm||new Qu({}),Qu._workerFarm.setProps(e),Qu._workerFarm}constructor(e){Yt(this,"props",void 0),Yt(this,"workerPools",new Map),this.props=J({},bpe),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=J(J({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new vpe({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function wpe(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return Xc(r),r}function Epe(n,e){return!!Qu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Spe(n,e,t,i,r){return sP.apply(this,arguments)}function sP(){return(sP=un(function*(n,e,t,i,r){const s=n.id,o=wpe(n,t),l=Qu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Mpe.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Mpe(n,e,t,i){return oP.apply(this,arguments)}function oP(){return(oP=un(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}Yt(Qu,"_workerFarm",void 0);var j5=Ve(521);function U5(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return j5.toArrayBuffer?j5.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Dpe(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function z5(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Ope(n){return lP.apply(this,arguments)}function lP(){return(lP=un(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=UI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Dpe(...e)})).apply(this,arguments)}const Rpe=262144;function H5(n){this.wrapped=n}function _b(n){return new H5(n)}function yb(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof H5;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function uP(n){return function(){return new yb(n.apply(this,arguments))}}function dP(){return(dP=uP(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(pP)}function Upe(n,e,t){return gP.apply(this,arguments)}function gP(){return(gP=un(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return jpe(n,e);if(xm(n)&&(n=yield x5(n)),mb(n)){const r=n;return yield epe(r),e.binary?yield r.arrayBuffer():yield r.text()}if(E5(n)&&(n=Vpe(n,t)),jfe(n)||Ufe(n))return Ope(n);throw new Error(pP)})).apply(this,arguments)}function Hpe(n,e,t=null){if(t)return t;const i=J({fetch:O5(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function $pe(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const G5=()=>{const n=JI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function W5(n){const e=G5();n=Array.isArray(n)?n:[n];for(const t of n){const i=HI(t);e.find(r=>i===r)||e.unshift(i)}}const Wpe=/\.([^.]+)$/;function qpe(n){return yP.apply(this,arguments)}function yP(){return(yP=un(function*(n,e=[],t,i){if(!Y5(n))return null;let r=q5(n,e,an(J({},t),{nothrow:!0}),i);if(r)return r;if(xm(n)&&(r=q5(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(X5(n));return r})).apply(this,arguments)}function q5(n,e=[],t,i){if(!Y5(n))return null;if(e&&!Array.isArray(e))return HI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...G5()),function(n){for(const e of n)HI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=BS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=vP(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&Wpe.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||vP(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Jpe(e,t))return t}else if(ArrayBuffer.isView(e)){if(K5(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&K5(e,0,t))return t;return null}(e,n),a=a||vP(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(X5(n));return s}function Y5(n){return!(n instanceof Response&&204===n.status)}function X5(n){const{url:e,type:t}=BS(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?bP(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?bP(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function vP(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Jpe(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function K5(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Zc=new Uint8ClampedArray(0);const uge={data:{type:"data",value:lge,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=an(J({},r),{fetch:an(J({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:jS(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):jS(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Hn.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let SP=(()=>{class n extends Bfe{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=g5(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=FI(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=J({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Hn.DEFAULT&&(t=i.isGeospatial?Hn.LNGLAT:Hn.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=K4(t,i,r),f=g5(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Hn.DEFAULT||t===Hn.LNGLAT||t===Hn.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){ic(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=bhe(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!cge({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Zc.length/3);if(this.internalState.usesPickingColorCache=!0,rZ5&&Zn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Zc=Qv.allocate(Zc,i,{size:3,copy:!0,maxCount:Math.max(i,Z5)});const s=Math.floor(Zc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&eo("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=z4({newProps:n,oldProps:e,propTypes:OI(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&H4(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&H4(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:fhe(n,e),transitionsChanged:uhe(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=OI(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new the(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){ic(!this.internalState&&!this.state),ic(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Vfe({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Zn.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ohe(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){eo("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=uge,n})(),hge=(()=>{class n extends SP{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:w,_subLayerProps:C}=this.props,x={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:w},L=C&&C[t.id],U=L&&L.updateTriggers,$=t.id||"sublayer";if(L){const ee=this.constructor._propTypes,fe=t.type?t.type._propTypes:{};for(const pe in L){const ve=fe[pe]||ee[pe];ve&&"accessor"===ve.type&&(L[pe]=this.getSubLayerAccessor(L[pe]))}}Object.assign(x,t,L),x.id="".concat(this.props.id,"-").concat($),x.updateTriggers=J(J({all:this.props.updateTriggers.all},t.updateTriggers),U);for(const ee of v){const fe=ee.getSubLayerProps.call(this,ee);fe&&Object.assign(x,fe,{updateTriggers:Object.assign(x.updateTriggers,fe.updateTriggers)})}return x}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=lI(t,Boolean),this.internalState.subLayers=t),eo("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const fge=/([0-9]+\.?[0-9]*)(%|px)/;function US(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(fge);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function zS(n,e){return n.relative?Math.round(n.position*e):n.position}function vb(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&vb(i,r)))return!1}return!0}class MP{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=Mm}=e;ic(!p||p instanceof Mm),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=an(J({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):vb(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=J({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:zS(this._x,e),y:zS(this._y,t),width:zS(this._width,e),height:zS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),J(J({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(J(J(J({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=US(e),this._y=US(t),this._width=US(i),this._height=US(r)}}const bb=()=>{},Q5={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:bb,onTransitionInterrupt:bb,onTransitionEnd:bb};class pge{constructor(e,t={}){this.ControllerState=e,this.props=J(J({},Q5),t),this.propsInTransition=null,this.transition=new cb(t.timeline),this.onViewStateChange=t.onViewStateChange||bb,this.onStateChange=t.onStateChange||bb,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=J(J({},Q5),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=J(J({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(J(J({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const J5=["longitude","latitude","zoom","bearing","pitch"],mge=["longitude","latitude","zoom"];class eH extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!eb(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];ic(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:J5,extract:J5,required:mge}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=dS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(J(J({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,dS(e.around,t.around,i)))}return r}}const ch={transitionDuration:0},_ge={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},$S=n=>1-(1-n)*(1-n),Tm_WHEEL=["wheel"],Tm_PAN=["panstart","panmove","panend"],Tm_PINCH=["pinchstart","pinchmove","pinchend"],Tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Tm_DOUBLE_TAP=["doubletap"],Tm_KEYBOARD=["keydown"];class xP{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new pge(e,an(J({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&an(J({},_ge),{transitionInterpolator:new eH({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(J(J({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Tm_WHEEL,d&&i),this.toggleEvents(Tm_PAN,d&&(r||s)),this.toggleEvents(Tm_PINCH,d&&(a||l)),this.toggleEvents(Tm_TRIPLE_PAN,d&&l),this.toggleEvents(Tm_DOUBLE_TAP,d&&o),this.toggleEvents(Tm_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=J(J({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,ch,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,an(J({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,ch,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,ch,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,ch,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,an(J({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?an(J({},t),{transitionInterpolator:new eH(an(J({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:ch}}class tH{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const uh_target=[0,0,0];class GS extends tH{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=uh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:w}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:w},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=J({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(an(J({},this._viewportProps),{zoom:a}));return this._getUpdatedState(J({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),Xf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new GS(J(J(J({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Xf(r,i,t),e.rotationX=Xf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class vge extends xP{constructor(e){super(GS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class bge extends xP{constructor(e){e.dragMode=e.dragMode||"pan",super(GS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Cge=(new Lt).lookAt({eye:[0,0,1]});function wge({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new Lt).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Ege extends Mm{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(an(J({},e),{longitude:null,position:a,viewMatrix:Cge.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:wge({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Cm([],e,II([],Zf(t,this.pixelUnprojectionMatrix)));return{target:Cm([],this.center,r)}}}let Sge=(()=>{class n extends MP{constructor(t){super(an(J({},t),{type:Ege}))}get controller(){return this._getControllerProps({type:bge})}}return n.displayName="OrthographicView",n})();const WS=Math.PI/180;function Mge({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*WS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new Lt).lookAt({eye:l,up:a});c.rotateX(i*WS),"Z"===t?c.rotateZ(r*WS):c.rotateY(r*WS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class xge extends Mm{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(an(J({},e),{longitude:null,viewMatrix:Mge({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=Zf([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let Tge=(()=>{class n extends MP{constructor(t={}){const{orbitAxis:i="Z"}=t;super(an(J({},t),{orbitAxis:i,type:xge}))}get controller(){return this._getControllerProps({type:vge})}}return n.displayName="OrbitView",n})();const Age=[255,255,255],Dge=1;let Oge=0;class nH{constructor(e={}){const{color:t=Age}=e,{intensity:i=Dge}=e;this.id=e.id||"ambient-".concat(Oge++),this.color=t,this.intensity=i,this.type="ambient"}}const Ige=[255,255,255],Pge=1,Rge=[0,0,-1];let kge=0;class iH{constructor(e={}){const{color:t=Ige}=e,{intensity:i=Pge}=e,{direction:r=Rge}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(kge++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Js(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class rH{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=J({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class TP extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=J({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Wu(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Wu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=sH(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dJO(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Wu(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||sH(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class Bge extends TP{constructor(e,t){super(e,t),this.shadowMap=new xa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new pm(e,{format:33189,width:1,height:1}),this.fbo=new is(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;nc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=um(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(an(J({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const jge=Object.keys(Hn).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Hn[n],";")).join(""),Uge=Object.keys($c).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat($c[n],";")).join(""),zge="".concat(jge,"\n").concat(Uge,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),Hge={},AP={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:zge,getUniforms:function(n=Hge){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Hn.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Hn.DEFAULT&&(i=n.isGeospatial?Hn.LNGLAT:Hn.CARTESIAN);const o=Khe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||qhe,o}(n):{}}},qge=TS(function({viewport:n,center:e}){return new Lt(n.viewProjectionMatrix).invert().transform(e)}),Yge=TS(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=Zf([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new Js(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new Lt).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),Xge=[0,0,0,1],Kge=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],DP={name:"shadow",dependencies:[AP],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||Xge,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=qge({viewport:n.viewport,center:e.project_uCenter}),r=[],s=Yge({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},tme={color:[255,255,255],intensity:1},oH=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],nme=[0,0,0,200/255];class OP extends rH{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=nme,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=ab.getDefaultProgramManager(e),DP&&this.programManager.addDefaultModule(DP)),this.dummyShadowMap||(this.dummyShadowMap=new xa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(DP),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new Lt).lookAt({eye:new Js(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=rme++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class sme{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=jS(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class ome{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new sme(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const ame=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},AP],lme=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function cme(n){const e=ab.getDefaultProgramManager(n);for(const t of ame)e.addDefaultModule(t);for(const t of lme)e.addShaderHook(t);return e}const hme=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class fme{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new ome({gl:e,protocol:"deck://"}),this.context=an(J({},hme),{layerManager:this,gl:e,deck:t,programManager:e&&cme(e),stats:i||new WO({id:"deck.gl"}),viewport:r||new Mm({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new aH,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){eo("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=lI(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return eo("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Zn.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Zn.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class pme{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=lI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!vb(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Zn.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(J({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=an(J(J(J({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class mme extends tH{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:w,startPitch:C,startZoom:x,normalize:L}={}){ic(Number.isFinite(s)),ic(Number.isFinite(r)),ic(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:L}),this._state={startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:w,startPitch:C,startZoom:x},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(an(J({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(an(J({},this._viewportProps),{zoom:o}));return this._getUpdatedState(J({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=J({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(J(J(J({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Xf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Xf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=J4(t+180,360)-180),(o<-180||o>180)&&(o=J4(o+180,360)-180);const a=PI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=ah([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Xf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Xf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class _me extends xP{constructor(e){e.dragMode=e.dragMode||"pan",super(mme,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(J(J({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let yme=(()=>{class n extends MP{constructor(t){super(an(J({},t),{type:p5}))}get controller(){return this._getControllerProps({type:_me})}}return n.displayName="MapView",n})();const vme=new OP;class bme{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!vb(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof OP)||this._internalEffects.push(vme)}}class Cme extends TP{}const cH={blendFunc:[1,0,32771,0],blendEquation:32774};class uH extends TP{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,nc(_,an(J({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},cH),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:an(J({},cH),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return J(J({},e.props.parameters),i)}}class Eme{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Cme(e),this.pickLayersPass=new uH(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||is.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(an(J({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,eo("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new is(this.gl),new is(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const Sme={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Mme({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let v=0;v=0){const C=v+o-t,x=C*C+y;x<=d&&(d=x,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),y=e[g];if(y){const v=y.decodePickingColor(_),w=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:y,pickedObjectIndex:v,pickedX:o+(f/4-w*l),pickedY:a+w}}Zn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Sme}function dH({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Tme(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(y=>y.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=dH(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=J({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=hH({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function hH({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Dme{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new uH(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?J(J({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new is(e),is.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new is(e),this.depthFBO.attach({36064:new xa(e,{format:Mn(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Zn.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:dH({viewports:i,x:r,y:s})};this._resizeBuffer();const f=um(this.gl),p=HO(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:y,height:v}=this.pickingFBO,w=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:y,deviceHeight:v});let C;const x=[],L={};for(let U=0;U=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Zn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:w,width:y.x+y.width-g,height:_-w},pass:"picking:".concat(l),redrawReason:l}),layers:e}),U=new Map,$=Number.isFinite(c);for(let ee=0;ee=c);ee++){const fe=L[ee];let pe={color:fe.pickedColor,layer:null,index:fe.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};pe=hH({layer:fe.pickedLayer,info:pe,mode:l}),U.has(pe.object)||U.set(pe.object,pe)}return Array.from(U.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return uS(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Ome={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Ime{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Ome),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function fH(n,e){if(!n)throw new Error(e)}const Qc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},pH=Qc.global||Qc.self||Qc.window,Rme="object"!=typeof process||"[object process]"!==String(process)||process.browser,gH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:kme}=(gH&&parseFloat(gH[1]),pH),IP="undefined"!=typeof Image,PP="undefined"!=typeof ImageBitmap,Fme=Boolean(kme),RP=!!Rme||Fme;function mH(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function _H(n){switch(mH(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const Bme=/^data:image\/svg\+xml/,Vme=/\.svg((\?|#).*)?$/;function kP(n){return n&&(Bme.test(n)||Vme.test(n))}function jme(n,e){if(kP(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return vH(n,e)}function vH(n,e){if(kP(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function bH(n,e,t){return FP.apply(this,arguments)}function FP(){return(FP=un(function*(n,e,t){const i=jme(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield Ume(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function Ume(n,e){return NP.apply(this,arguments)}function NP(){return(NP=un(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const zme={};let CH=!0;function Hme(n,e,t){return LP.apply(this,arguments)}function LP(){return(LP=un(function*(n,e,t){let i;i=kP(t)?yield bH(n,e,t):vH(n,t);const r=e&&e.imagebitmap;return yield $me(i,r)})).apply(this,arguments)}function $me(n){return BP.apply(this,arguments)}function BP(){return(BP=un(function*(n,e=null){if((Gme(e)||!CH)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),CH=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function Gme(n){for(const e in n||zme)return!1;return!0}const Jc=!1,Cb=!0;function VP(n){const e=wb(n);return function(n){const e=wb(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Jc)?{mimeType:"image/png",width:e.getUint32(16,Jc),height:e.getUint32(20,Jc)}:null}(e)||function(n){const e=wb(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Jc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Jc)?{mimeType:"image/gif",width:e.getUint16(6,Cb),height:e.getUint16(8,Cb)}:null}(e)||function(n){const e=wb(n);return e.byteLength>=14&&16973===e.getUint16(0,Jc)&&e.getUint32(2,Cb)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Cb),height:e.getUint32(22,Cb)}:null}(e)}function wb(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function Zme(n,e){const{mimeType:t}=VP(n)||{},{_parseImageNode:i}=pH;return fH(i),i(n,t,e)}function jP(){return(jP=un(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(Jme(r)){case"imagebitmap":a=yield Hme(n,e,s);break;case"image":a=yield bH(n,e,s);break;case"data":a=yield Zme(n,e);break;default:fH(!1)}return"data"===r&&(a=_H(a)),a})).apply(this,arguments)}function Jme(n){switch(n){case"auto":case"data":return function(){if(PP)return"imagebitmap";if(IP)return"image";if(RP)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return PP||IP||RP;case"imagebitmap":return PP;case"image":return IP;case"data":return RP;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const wH={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return jP.apply(this,arguments)},tests:[n=>Boolean(VP(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},t_e={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},Eb="8.5.8",qS=Zi.CO.deck&&Zi.CO.deck.VERSION;if(qS&&qS!==Eb)throw new Error("deck.gl - multiple versions detected: ".concat(qS," vs ").concat(Eb));qS||(Zn.log(1,"deck.gl ".concat(Eb))(),Zi.CO.deck=Object.assign(Zi.CO.deck||{},{VERSION:Eb,version:Eb,log:Zn,_registerLoggers:function(n){hI=n}}),W5([t_e,[wH,{imagebitmap:{premultiplyAlpha:"none"}}]]));const n_e=Zi.CO.deck;class YS extends qu{static isSupported(e,t=[]){const i=Mn(e),r=Nz(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:Qe(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return YS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const EH=(0,Zi.jU)()&&"undefined"!=typeof document;let h_e=0;class f_e{constructor(e={}){const{onCreateContext:t=(v=>_z(v)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=qf.get("animation-loop-"+h_e++)}=e;let{useDevicePixels:y=!0}=e;"useDevicePixelRatio"in e&&(ct.deprecated("useDevicePixelRatio","useDevicePixels")(),y=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:y}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return Qe("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=YS.isSupported(this.gl,["timers"])?new YS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return un(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return ct.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=EH?new Promise((e,t)=>{EH&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?GO(this.props.gl,e):this.onCreateContext(e),!lS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Wu(n,zO)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(ct.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(ct.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new is(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var p_e=Ve(524),XS=Ve.n(p_e);const g_e={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(XS().MouseInput);const v_e=XS().Manager,eu=XS(),b_e=eu?[[eu.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[eu.Rotate,{enable:!1}],[eu.Pinch,{enable:!1}],[eu.Swipe,{enable:!1}],[eu.Pan,{threshold:0,enable:!1}],[eu.Press,{enable:!1}],[eu.Tap,{event:"doubletap",taps:2,enable:!1}],[eu.Tap,{event:"anytap",enable:!1}],[eu.Tap,{enable:!1}]]:null,xH={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},C_e={doubletap:["tap"]},w_e={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},zP={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},E_e={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},TH={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},S_e="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",Am="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let AH=!1;try{const n={get passive(){return AH=!0,!0}};Am.addEventListener("test",n,n),Am.removeEventListener("test",n,n)}catch(n){}const M_e=-1!==S_e.indexOf("firefox"),{WHEEL_EVENTS:x_e}=zP,OH=4.000244140625;class D_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=x_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!AH&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;Am.WheelEvent&&(M_e&&e.deltaMode===Am.WheelEvent.DOM_DELTA_PIXEL&&(t/=Am.devicePixelRatio),e.deltaMode===Am.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%OH==0&&(t=Math.floor(t/OH)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:O_e}=zP,IH="pointermove",PH="pointerover",RH="pointerout",kH="pointerleave";class I_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=O_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===IH&&(this.enableMoveEvent=t),e===PH&&(this.enableOverEvent=t),e===RH&&(this.enableOutEvent=t),e===kH&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:PH,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:RH,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:kH,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:IH,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:P_e}=zP,FH="keydown";class R_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=P_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===FH&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:FH,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const LH="contextmenu";class k_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===LH&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:LH,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const F_e={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},BH={srcElement:"root",priority:0};class q_e{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},BH,i):BH;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&xH[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new D_e(e,this._onOtherEvent,{enable:!1}),this.moveInput=new I_e(e,this._onOtherEvent,{enable:!1}),this.keyInput=new R_e(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new k_e(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=C_e[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=TH[e]||e;let c=a.get(l);c||(c=new q_e(this),a.set(l,c),c.recognizerName=E_e[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(TH[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=w_e[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function ep(){}const VH={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:ep,onResize:ep,onViewStateChange:ep,onInteractionStateChange:ep,onBeforeRender:ep,onAfterRender:ep,onLoad:ep,onError:(n,e)=>Zn.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class ZS{constructor(e){e=J(J({},VH),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Zn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Zi.qs)()&&Zn.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new WO({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Qv.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Zn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Zn.removed("onLayerClick","onClick")(),e.initialViewState&&!vb(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](J({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),ic(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new f_e({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>_z(an(J(J({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new yme({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,GO(e,{enable:!0,copyState:!0})),this.tooltip=new Ime(this.canvas),Wu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new aH;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new X_e(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in tz)this.eventManager.on(r,this._onEvent);this.viewManager=new pme({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new fme(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new bme,this.deckRenderer=new Eme(e),this.deckPicker=new Dme(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Wu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(J({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Zn.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=an(J({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=tz[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=qf.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}ZS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(rH)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},ZS.defaultProps=VH,ZS.VERSION=n_e.VERSION;const jH={name:"project32",dependencies:[AP],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},UH="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",Q_e={lightSources:{}};function GP({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const WP={name:"lights",vs:UH,fs:UH,getUniforms:function zH(n=Q_e){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?GP(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=GP(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=GP(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return zH({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},eye={};const nye={name:"phong-lighting",dependencies:[WP],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=eye){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},rye={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},GH=J({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=rye){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),WH={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class QS{static get DRAW_MODE(){return WH}constructor(e={}){const{id:t=Wc("geometry"),drawMode:i=WH.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?J({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,Qe(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(Qe(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return Qe(Number.isFinite(i)),i}}const qP=Math.PI/180,JS=new Float32Array(16),qH=new Float32Array(12);function YH(n,e,t){const i=e[0]*qP,r=e[1]*qP,s=e[2]*qP,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function XH(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const KH={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let y;g?(JS.set(a),y=XH(JS)):(y=qH,YH(y,r,s),y.set(o,9)),n.value=new Float32Array(y)}else{let y=e*n.size;const{iterable:v,objectInfo:w}=Xz(i,e,t);for(const C of v){let x;w.index++,g?(JS.set(c?a:a(C,w)),x=XH(JS)):(x=qH,YH(x,f?r:r(C,w),d?s:s(C,w)),x.set(p?o:o(C,w),9)),_[y++]=x[0],_[y++]=x[1],_[y++]=x[2],_[y++]=x[3],_[y++]=x[4],_[y++]=x[5],_[y++]=x[6],_[y++]=x[7],_[y++]=x[8],_[y++]=x[9],_[y++]=x[10],_[y++]=x[11]}}}};function ZH(n,e){return e===Hn.CARTESIAN||e===Hn.METER_OFFSETS||e===Hn.DEFAULT&&!n.isGeospatial}function QH(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Zn.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function lye(n,e){if(n.attributes)return QH(n.attributes,e),n instanceof QS?n:new QS(n);if(n.positions||n.POSITION)return QH(n,e),new QS({attributes:n});throw Error("Invalid mesh")}const cye={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let uye=(()=>{class n extends SP{getShaders(){const t=!Mn(this.context.gl),i={};return nI(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[jH,nye,GH],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:KH}),this.setState({emptyTexture:new xa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||ZH(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new SS(this.context.gl,an(J({},this.getShaders()),{id:this.props.id,geometry:lye(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=cye,n})();const JH={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[WP]};class Dm{constructor(e={}){const{id:t}=e;this.id=t||Wc(this.constructor.name),this.display=!0,this.position=new Js,this.rotation=new Js,this.scale=new Js(1,1,1),this.matrix=new Lt,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return Qe(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return Qe(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return Qe(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){Qe(e),t=t||this.matrix;const i=new Lt(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class Sb extends Dm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;ct.assert(t.every(i=>i instanceof Dm),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new Lt}={}){const i=new Lt(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Sb?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function e8(){var n=new ta(4);return ta!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function t8(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function n8(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var r8=Y4,Mye=function(){var n=Vz(),e=jz(1,0,0),t=jz(0,1,0);return function(i,r,s){var o=Uz(r,s);return o<-.999999?(fS(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&fS(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),t8(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(fS(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();e8(),e8(),function(){var n=new ta(9);ta!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const xye=[0,0,0,1],Aye={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Dye={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function a8(n){if(!n._animation){const e=Dye[n.componentType],t=Aye[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return t8(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=ks(e)}get y(){return this[1]}set y(e){this[1]=ks(e)}get z(){return this[2]}set z(e){this[2]=ks(e)}get w(){return this[3]}set w(e){this[3]=ks(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return Mye(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Xu(!t),n8(this,this,e),this.check()}multiplyLeft(e,t){return Xu(!t),n8(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return r8(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=xye,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,y,v,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>Vi?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-i)*p)/_,v=Math.sin(i*p)/_):(y=1-i,v=i),n[0]=y*r+v*l,n[1]=y*s+v*c,n[2]=y*o+v*d,n[3]=y*a+v*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),hS(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class Nye{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:ct.warn(`Bad animation path ${s}`)()}Qe(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){YP.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:a8(e.accessors[a]),interpolation:l,output:a8(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Nye({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Bye extends Dm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof SS?(this.model=e,this._setModelNodeProps(t)):this.model=new SS(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class Vye{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},nI(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new xa(this.gl,J({id:e.name||e.id,parameters:J(J({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(ct.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function l8(n,e){return Mn(n)?`#version 300 es\n${e}`:e}const Hye={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$ye={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Gye{constructor(e,t={}){this.gl=e,this.options=Object.assign({},$ye,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Lye(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Sb({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new Sb({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new Lt).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new Sb({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){ct.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new Vye(n,e);ct.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new Bye(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[JH],defines:a.defines,parameters:a.parameters,vs:l8(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:l8(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),ct.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new Si(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ea({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Hye[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function c8(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new Om(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Om(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Om){const o=e;t=o.fields,i=f8(f8(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new Om(s,i)}}function f8(n,e){return new Map([...n||new Map,...e||new Map])}let ar,p8,g8,m8,_8,y8,v8,b8;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(ar||(ar={}));class XP{static isNull(e){return e&&e.typeId===ar.Null}static isInt(e){return e&&e.typeId===ar.Int}static isFloat(e){return e&&e.typeId===ar.Float}static isBinary(e){return e&&e.typeId===ar.Binary}static isUtf8(e){return e&&e.typeId===ar.Utf8}static isBool(e){return e&&e.typeId===ar.Bool}static isDecimal(e){return e&&e.typeId===ar.Decimal}static isDate(e){return e&&e.typeId===ar.Date}static isTime(e){return e&&e.typeId===ar.Time}static isTimestamp(e){return e&&e.typeId===ar.Timestamp}static isInterval(e){return e&&e.typeId===ar.Interval}static isList(e){return e&&e.typeId===ar.List}static isStruct(e){return e&&e.typeId===ar.Struct}static isUnion(e){return e&&e.typeId===ar.Union}static isFixedSizeBinary(e){return e&&e.typeId===ar.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===ar.FixedSizeList}static isMap(e){return e&&e.typeId===ar.Map}static isDictionary(e){return e&&e.typeId===ar.Dictionary}get typeId(){return ar.NONE}compareTo(e){return this===e}}Symbol,Symbol,p8=Symbol.toStringTag;class Im extends XP{constructor(e,t){super(),Yt(this,"isSigned",void 0),Yt(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return ar.Int}get[p8](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class tve extends Im{constructor(){super(!0,8)}}class nve extends Im{constructor(){super(!0,16)}}class ive extends Im{constructor(){super(!0,32)}}class rve extends Im{constructor(){super(!1,8)}}class sve extends Im{constructor(){super(!1,16)}}class ove extends Im{constructor(){super(!1,32)}}g8=Symbol.toStringTag;class C8 extends XP{constructor(e){super(),Yt(this,"precision",void 0),this.precision=e}get typeId(){return ar.Float}get[g8](){return"Float"}toString(){return`Float${this.precision}`}}class ave extends C8{constructor(){super(32)}}class lve extends C8{constructor(){super(64)}}Symbol,Symbol,m8=Symbol.toStringTag,_8=Symbol.toStringTag,y8=Symbol.toStringTag,v8=Symbol.toStringTag,b8=Symbol.toStringTag;class cve extends XP{constructor(e,t){super(),Yt(this,"listSize",void 0),Yt(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return ar.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[b8](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class tM{constructor(e,t,i=!1,r=new Map){Yt(this,"name",void 0),Yt(this,"type",void 0),Yt(this,"nullable",void 0),Yt(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new tM(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function w8(n,e,t){const i=t?E8(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new tve;case Uint8Array:return new rve;case Int16Array:return new nve;case Uint16Array:return new sve;case Int32Array:return new ive;case Uint32Array:return new ove;case Float32Array:return new ave;case Float64Array:return new lve;default:throw new Error("array type not supported")}}(e.value);return new tM(n,new cve(e.size,new tM("value",r)),!1,i)}function E8(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const S8={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},fve={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class gve{constructor(e){Yt(this,"draco",void 0),Yt(this,"decoder",void 0),Yt(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=E8(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=w8(o,n[o],s[o]);r.push(l)}if(t){const o=w8("indices",t);r.push(o)}return new Om(r,i)}(l.attributes,a,l.indices);return an(J({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var nM=Ve(125);const JP={};function eR(n){return tR.apply(this,arguments)}function tR(){return(tR=un(function*(n,e=null,t={}){return e&&(n=bve(n,e,t)),JP[n]=JP[n]||Cve(n),yield JP[n]})).apply(this,arguments)}function bve(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:tP?t.CDN?(Xc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):nP?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Cve(n){return nR.apply(this,arguments)}function nR(){return(nR=un(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():tP?nP?importScripts(n):wve(yield(yield fetch(n)).text(),n):nM.requireFromFile&&(yield nM.requireFromFile(n))})).apply(this,arguments)}function wve(n,e){if(!tP)return nM.requireFromString&&nM.requireFromString(n,e);if(nP)return eval.call(fpe,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Eve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Sve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Mve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Mb;function Tve(n){return iR.apply(this,arguments)}function iR(){return(iR=un(function*(n){const e=n.modules||{};return Mb=e.draco3d?Mb||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Mb||Ave(n),yield Mb})).apply(this,arguments)}function Ave(n){return sR.apply(this,arguments)}function sR(){return(sR=un(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield eR(Eve,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield eR(Sve,"draco",n),yield eR(Mve,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Dve(e,t)})).apply(this,arguments)}function Dve(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(an(J({},t),{onModuleLoaded:r=>i({draco:r})}))})}const aR=an(J({},h8),{parse:function(n,e){return lR.apply(this,arguments)}});function lR(){return(lR=un(function*(n,e){const{draco:t}=yield Tve(e),i=new gve(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Tb(n,e){return Qf(n>=0),Qf(e>0),n+(e-1)&~(e-1)}function Pve(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+Tb(i.byteLength,4)}const M8=["SCALAR","VEC2","VEC3","VEC4"],Rve=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],kve=new Map(Rve),Fve={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nve={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lve={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function x8(n){return M8[n-1]||M8[0]}function T8(n){const e=kve.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function A8(n,e){const t=Lve[n.componentType],i=Fve[n.type],s=n.count*i,o=n.count*i*Nve[n.componentType];return Oa(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const Bve={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class hh{constructor(e){Yt(this,"gltf",void 0),Yt(this,"sourceBuffers",void 0),Yt(this,"byteLength",void 0),this.gltf=e||{json:J({},Bve),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return Oa(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=A8(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return Oa(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Oa(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=VP(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Oa(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Tb(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:x8(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:T8(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Pve(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Xve(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function Kve(n){return dR.apply(this,arguments)}function dR(){return(dR=un(function*(n){const e=new hh(n),{json:t}=e;e.removeExtension(rM);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,rM)})).apply(this,arguments)}function Zve(n){const e=new hh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,rM,{}),e.addExtension(rM))}function Qve(n){return hR.apply(this,arguments)}function hR(){return(hR=un(function*(n){const e=new hh(n),{json:t}=e,i=e.getExtension(Pm);i&&(e.json.lights=i.lights,e.removeExtension(Pm));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Pm);s&&(r.light=s.light),e.removeObjectExtension(r,Pm)}})).apply(this,arguments)}function Jve(n){return fR.apply(this,arguments)}function fR(){return(fR=un(function*(n){const e=new hh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Pm);Oa(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Pm,i);delete e.json.lights}})).apply(this,arguments)}function ebe(n){return pR.apply(this,arguments)}function pR(){return(pR=un(function*(n){const e=new hh(n),{json:t}=e,i=e.getExtension(sM);if(i){const r=nbe(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,sM);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=ibe(s.technique,e)),e.removeObjectExtension(s,sM)}e.removeExtension(sM)}})).apply(this,arguments)}function tbe(n,e){return gR.apply(this,arguments)}function gR(){return(gR=un(function*(n,e){})).apply(this,arguments)}function nbe(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function ibe(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const I8={KHR_draco_mesh_compression:_t,KHR_materials_unlit:k,KHR_lights_punctual:It,KHR_techniques_webgl:Pt};function rbe(n){return mR.apply(this,arguments)}function mR(){return(mR=un(function*(n,e={},t){for(const r in I8){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield I8[r].decode(n,e,t))}})).apply(this,arguments)}const P8={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},obe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class abe{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new hh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,D8);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(D8)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in P8)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in P8)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=obe[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function lbe(n,e={}){return(new abe).normalize(n,e)}const cbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ube={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_l={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},dbe={magFilter:_l.TEXTURE_MAG_FILTER,minFilter:_l.TEXTURE_MIN_FILTER,wrapS:_l.TEXTURE_WRAP_S,wrapT:_l.TEXTURE_WRAP_T},hbe={[_l.TEXTURE_MAG_FILTER]:_l.LINEAR,[_l.TEXTURE_MIN_FILTER]:_l.NEAREST_MIPMAP_LINEAR,[_l.TEXTURE_WRAP_S]:_l.REPEAT,[_l.TEXTURE_WRAP_]:_l.REPEAT};class gbe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Oa(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=J({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=J({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=J({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=J({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=J({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=J({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=J({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return ube[n]}(e.componentType),e.components=function(n){return cbe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=A8(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):hbe,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return dbe[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function mbe(n,e){return(new gbe).postProcess(n,e)}const R8=1735152710,Rm=!0;function yR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Tb(i,4)}function vR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Tb(i,4)}function Abe(n,e){return bR.apply(this,arguments)}function bR(){return(bR=un(function*(n,e,t=0,i,r){var s,o,a,l;Dbe(n,e,t,i),lbe(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Obe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Ibe(n,i,r);c.push(f)}const d=rbe(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?mbe(n,i):n})).apply(this,arguments)}function Dbe(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=R8}=t,s=i.getUint32(e,!1);return s===r||s===R8}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?c8(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?c8(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,Rm),a=r.getUint32(t+8,Rm);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){Qf(n.header.byteLength>20);const i=e.getUint32(t+0,Rm),r=e.getUint32(t+4,Rm);return t+=8,Qf(0===r),yR(n,e,t,i),(t+=i)+vR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Qf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,Rm),s=e.getUint32(t+4,Rm);switch(t+=8,s){case 1313821514:yR(n,e,t,r);break;case 5130562:vR(n,e,t,r);break;case 0:i.strict||yR(n,e,t,r);break;case 1:i.strict||vR(n,e,t,r)}t+=Tb(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),Oa("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Oa(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Obe(n,e,t){return CR.apply(this,arguments)}function CR(){return(CR=un(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield Fbe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function Fbe(n){return xR.apply(this,arguments)}function xR(){return(xR=un(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const k8=[255,255,255,255],Bbe={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:k8},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[km]};let Vbe=(()=>{class n extends SP{getShaders(){const t=[jH,GH];return"pbr"===this.props._lighting&&t.push(JH),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:k8,transition:!0},instanceModelMatrix:KH})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Dm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Gye(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=J({gltf:l},c),function(n){return MR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Zn.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Dm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Zn.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Zn.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Dm&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:J({isInstanced:!0,transpileToGLSL100:!Mn(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:ZH(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=Bbe,n})();const jbe=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Ube=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),zbe=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Hbe=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),$be={POSITION:{size:3,value:new Float32Array(Ube)},NORMAL:{size:3,value:new Float32Array(zbe)},TEXCOORD_0:{size:2,value:new Float32Array(Hbe)}};class Gbe extends QS{constructor(e={}){const{id:t=Wc("cube-geometry")}=e;super(an(J({},e),{id:t,indices:{size:1,value:new Uint16Array(jbe)},attributes:J(J({},$be),e.attributes)}))}}class tu{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new S){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new S){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new S){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new S){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new S){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new S){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new S){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=qbe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=Ybe;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(F8),F8.almostEquals(e,t)}clone(){return new S(this.x,this.y,this.z)}}S.ZERO=void 0,S.UNIT_X=void 0,S.UNIT_Y=void 0,S.UNIT_Z=void 0,S.ZERO=new S(0,0,0),S.UNIT_X=new S(1,0,0),S.UNIT_Y=new S(0,1,0),S.UNIT_Z=new S(0,0,1);const qbe=new S,Ybe=new S,F8=new S;class Mi{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new S,this.upperBound=new S,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=L8;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=L8;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const N8=new S,L8=[new S,new S,new S,new S,new S,new S,new S,new S];class Rr{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new S){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=Kbe;e.tangents(i,Zbe),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(zi(e.length(),2)*zi(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new Rr){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new Rr){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new Rr){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new S){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new Rr(this.x,this.y,this.z,this.w)}slerp(e,t,i=new Rr){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,y,v,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-t)*p)/_,v=Math.sin(t*p)/_):(y=1-t,v=t),i.x=y*r+v*l,i.y=y*s+v*c,i.z=y*o+v*d,i.w=y*a+v*f,i}integrate(e,t,i,r=new Rr){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const Kbe=new S,Zbe=new S,Qbe={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let ut=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=Qbe,n})();class Qn{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new S,this.quaternion=new Rr,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Qn.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Qn.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new S){return i.vsub(e,r),t.conjugate(V8),V8.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new S){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new S){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new S){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const V8=new Rr;class tp extends ut{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:ut.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new S;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=y,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new S,d=new S,f=new S,p=new S,g=new S,_=new S;let y=Number.MAX_VALUE;const v=this;if(v.uniqueAxes)for(let w=0;w!==v.uniqueAxes.length;w++){i.vmult(v.uniqueAxes[w],c);const C=v.testSepAxis(c,e,t,i,r,s);if(!1===C)return!1;C0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){tp.project(this,e,i,r,TR),tp.project(t,e,s,o,AR);const l=TR[0],c=TR[1],d=AR[0],f=AR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?dt.STATIC:dt.DYNAMIC,typeof e.type==typeof dt.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=dt.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new S,this.quaternion=new Rr,this.initQuaternion=new Rr,this.previousQuaternion=new Rr,this.interpolatedQuaternion=new Rr,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new S,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new S,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new S,this.invInertia=new S,this.invInertiaWorld=new tu,this.invMassSolve=0,this.invInertiaSolve=new S,this.invInertiaWorldSolve=new tu,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new S(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new S(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new Mi,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new S,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=dt.AWAKE,this.wakeUpAfterNarrowphase=!1,e===dt.SLEEPING&&this.dispatchEvent(dt.wakeupEvent)}sleep(){this.sleepState=dt.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=zi(this.sleepSpeedLimit,2);t===dt.AWAKE&&ir?this.wakeUp():t===dt.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(dt.sleepEvent))}}updateSolveMassProperties(){this.sleepState===dt.SLEEPING||this.type===dt.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new S){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new S){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new S,s=new Rr;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=t0e,o=n0e,a=this.quaternion,l=this.aabb,c=i0e;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=r0e,r=s0e;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new S){if(this.type!==dt.DYNAMIC)return;this.sleepState===dt.SLEEPING&&this.wakeUp();const i=o0e;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new S){if(this.type!==dt.DYNAMIC)return;const i=a0e,r=l0e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===dt.DYNAMIC&&(this.sleepState===dt.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new S){if(this.type!==dt.DYNAMIC)return;this.sleepState===dt.SLEEPING&&this.wakeUp();const i=t,r=c0e;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=u0e;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new S){if(this.type!==dt.DYNAMIC)return;const i=d0e,r=h0e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=f0e;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),aM.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new S;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==dt.DYNAMIC&&this.type!==dt.KINEMATIC||this.sleepState===dt.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,y=this.angularFactor,v=l.x*y.x,w=l.y*y.y,C=l.z*y.z;s.x+=e*(_[0]*v+_[1]*w+_[2]*C),s.y+=e*(_[3]*v+_[4]*w+_[5]*C),s.z+=e*(_[6]*v+_[7]*w+_[8]*C),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}dt.idCounter=0,dt.COLLIDE_EVENT_NAME="collide",dt.DYNAMIC=1,dt.STATIC=2,dt.KINEMATIC=4,dt.AWAKE=0,dt.SLEEPY=1,dt.SLEEPING=2,dt.wakeupEvent={type:"wakeup"},dt.sleepyEvent={type:"sleepy"},dt.sleepEvent={type:"sleep"};const t0e=new S,n0e=new Rr,i0e=new Mi,r0e=new tu,s0e=new tu,o0e=new S,a0e=new S,l0e=new S,c0e=new S,u0e=new S,d0e=new S,h0e=new S,f0e=new S;new S,new S;class lM{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new S,this.rayToWorld=new S,this.hitNormalWorld=new S,this.hitPointWorld=new S,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let j8,U8,z8,H8,$8,G8,W8;j8=ut.types.SPHERE,U8=ut.types.PLANE,z8=ut.types.BOX,H8=ut.types.CYLINDER,$8=ut.types.CONVEXPOLYHEDRON,G8=ut.types.HEIGHTFIELD,W8=ut.types.TRIMESH;class zr{get[j8](){return this._intersectSphere}get[U8](){return this._intersectPlane}get[z8](){return this._intersectBox}get[H8](){return this._intersectConvex}get[$8](){return this._intersectConvex}get[G8](){return this._intersectHeightfield}get[W8](){return this._intersectTrimesh}constructor(e=new S,t=new S){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new S,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=zr.ANY,this.result=new lM,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||zr.ANY,this.result=t.result||new lM,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(q8),PR.length=0,e.broadphase.aabbQuery(e,q8,PR),this.intersectBodies(PR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=b0e,s=C0e;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new S(0,0,1);t.vmult(c,c);const d=new S;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&y<=1&&(o.lerp(a,y,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=x0e,l=X8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,v=_.distanceTo(this.to),w=c?c.length:d.length,C=this.result;for(let x=0;!C.shouldStop&&xv||this.reportIntersection(a,na,s,r,L)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=T0e,l=R0e,c=k0e,d=X8,f=A0e,p=D0e,g=O0e,_=P0e,y=I0e,v=e.indices,w=this.from,C=this.to,x=this.direction;c.position.copy(i),c.quaternion.copy(t),Qn.vectorToLocalFrame(i,t,x,f),Qn.pointToLocalFrame(i,t,w,p),Qn.pointToLocalFrame(i,t,C,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const L=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let U=0,$=l.length;!this.result.shouldStop&&U!==$;U++){const ee=l[U];e.getNormal(ee,a),e.getVertex(v[3*ee],ac),ac.vsub(p,d);const fe=f.dot(a),pe=a.dot(d)/fe;if(pe<0)continue;f.scale(pe,na),na.vadd(p,na),e.getVertex(v[3*ee+1],iu),e.getVertex(v[3*ee+2],ru);const ve=na.distanceSquared(p);!zr.pointInTriangle(na,iu,ac,ru)&&!zr.pointInTriangle(na,ac,iu,ru)||ve>L||(Qn.vectorToWorldFrame(t,a,y),Qn.pointToWorldFrame(i,t,na,_),this.reportIntersection(y,_,s,r,ee))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case zr.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case zr.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var su=Ve(517);function Bm(n,e,t){e||(e=new Lt(Lt.IDENTITY));const i=new Lt(Lt.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new Lt(Lt.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new Lt(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===Bm(s,r,t))return!1;return!0}function j6(){W5([h8,km])}function U6(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||Bm(r,new Lt(Lt.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function NR(n,e){return gl(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield VS(i,km,{DracoLoader:aR,gltf:{decompressMeshes:!0,postProcess:!0}});return U6(n.scenegraphNode,r)})}function FEe(n,e){return gl(this,void 0,void 0,function*(){return U6(n,yield e)})}function LR(n,e,t){if(e&&0!==e.length)return new uye(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Hn.CARTESIAN,data:e,mesh:new Gbe,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let LEe=(()=>{class n extends hge{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),j6()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){gl(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new Lt(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new Mi({lowerBound:new S(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new S(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield jS(o.scenegraph,km,{DracoLoader:aR,decompress:!0,postProcess:!0});for(const l of a.scenes)Bm(l,new Lt(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new Mi({lowerBound:new S(...p.map((_,y)=>Math.min(_,g[y]))),upperBound:new S(...g.map((_,y)=>Math.max(_,p[y])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=NR({scenegraph:l.scenegraph},n.gltfCache));return[LR("cubes",i,{wireframe:!1,pickable:!1}),LR("pickableCubes",r,{wireframe:!1,pickable:!0}),LR("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new Vbe({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Hn.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?FEe(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function z6(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),z6(t,e);return e}let VEe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new LEe({}),this.nodeClickSubject=new we,this.nodeHoverStartSubject=new we,this.nodeHoverStopSubject=new we,this.sceneRotationSubject=new sr([0,0]),this.nodeDragStartSubject=new we,this.nodeDragSubject=new we,this.nodeDragEndSubject=new we,this.nodeClick$=this.nodeClickSubject.pipe(Vs()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Vs()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Vs()),this.sceneRotation$=this.sceneRotationSubject.pipe(Vs()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Vs()),this.nodeDrag$=this.nodeDragSubject.pipe(Vs()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Vs());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Sge({flipY:!1,near:-1e3}):new Tge({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new OP({ambientLight:new nH({color:[255,255,255],intensity:10})})]),this.deck=new ZS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return gl(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new Lt([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return gl(this,void 0,void 0,function*(){j6();const i=yield NR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)Bm(o,e=new Lt(e||Lt.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new Lt(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new Lt(e||Lt.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new Mi({lowerBound:new S(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new S(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of z6(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new S(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new Lt(Lt.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new Lt(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return De([su.ZP],n.prototype,"_onHover",null),De([su.ZP],n.prototype,"_onClick",null),De([su.ZP],n.prototype,"_onViewStateChange",null),De([su.ZP],n.prototype,"_onDragStart",null),De([su.ZP],n.prototype,"_onDrag",null),De([su.ZP],n.prototype,"_onDragEnd",null),n})();function jEe(n,e){return n===e}function UEe(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let BR=(()=>{class n{constructor(){this.bootstrap$=new Hg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const VR=new _e("INITIAL_STATE_TOKEN");let $Ee=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const $6=new _e("Internals.StateContextFactory"),G6=new _e("Internals.StateFactory");function W6(n,e){return e?t=>t.pipe(W6((i,r)=>li(n(i,r)).pipe(be((s,o)=>e(i,s,r,o))))):t=>t.lift(new GEe(n))}class GEe{constructor(e){this.project=e}call(e,t){return t.subscribe(new WEe(e,this.project))}}class WEe extends ei{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new $r(this),i=this.destination;i.add(t);const r=oo(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function _M(n=null){return e=>e.lift(new qEe(n))}class qEe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new YEe(e,this.defaultValue))}}class YEe extends Rt{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}const Ia={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let q6=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return wD(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return lt.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return lt.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof lt||console.warn(Ia.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(cl))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Y6=new _e("ROOT_STATE_TOKEN"),X6=new _e("FEATURE_STATE_TOKEN"),jR=new _e("NGXS_PLUGINS"),K6=new _e("NG_TEST_MODE"),Z6=new _e("NG_DEV_MODE"),sd="NGXS_META",Q6="NGXS_OPTIONS_META",UR="NGXS_SELECTOR_META";let op=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=q6}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class XEe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const J6=new _e("NGXS_EXECUTION_STRATEGY");function ap(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const zR=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},Vm=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),HR=n=>n&&"object"==typeof n&&!Array.isArray(n),$R=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(HR(n)&&HR(t))for(const i in t)HR(t[i])?(n[i]||Object.assign(n,{[i]:{}}),$R(n[i],t[i])):Object.assign(n,{[i]:t[i]});return $R(n,...e)};function Fb(n){return n[sd]}function qR(n){return n[UR]}function t$(n,e){const t=Vm(e.currentAppState,n.path),i=Vm(e.newAppState,n.path);return new XEe(t,i,!n.isInitialised)}function rSe(...n){return function(n,e,t=aSe){const i=function(n){return n.reduce((e,t)=>(e[ap(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Tn(t=>{const i=ap(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function aSe(){return be(n=>n.action)}function yM(n){return e=>new oe(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let vM=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(I(J6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class uSe extends we{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let bM=(()=>{class n extends uSe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),dSe=(()=>{class n extends oe{constructor(t,i){super(r=>{const s=t.pipe(yM(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(I(bM),I(vM))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const n$=n=>(...e)=>n.shift()(...e,(...i)=>n$(n)(...i));let CM=(()=>{class n extends sr{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),YR=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(I(n,12),I(jR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),XR=(()=>{class n extends we{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),i$=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Uo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(yM(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?st(this._stateStream.getValue()):Bv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!ap(t))return zg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return n$([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(Hc())}getActionResultStream(t){return this._actionResults.pipe(Tn(i=>i.action===t&&"DISPATCHED"!==i.status),_i(1),Hc())}createDispatchObservable(t){return t.pipe(W6(i=>{switch(i.status){case"SUCCESSFUL":return st(this._stateStream.getValue());case"ERRORED":return zg(i.error);default:return Ql}})).pipe(Hc())}}return n.\u0275fac=function(t){return new(t||n)(I(Tt),I(bM),I(XR),I(YR),I(CM),I(vM))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const r$=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&r$(n[i])}),n};let s$=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(I(Z6),I(K6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),o$=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Ia.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ia.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(I(s$),I(op))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Um=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=r$(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(I(CM),I(i$),I(op),I(o$))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),wM=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Vm(l,t.path)}function s(l,c){const d=zR(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=t$(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Ia.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ia.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(I(Um))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class EM{static stateNameErrorMessage(e){return Ia.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ia.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Ia.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=Fb(e);if(!t)throw new Error(Ia.STATE_DECORATOR());return t}}EM.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let zm=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=H6(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(EM.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[sd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[sd];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[sd].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[sd];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>zR(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Tn(t=>"DISPATCHED"===t.status),ci(({action:t})=>this.invokeActions(this._actions,t).pipe(be(()=>({action:t,status:"SUCCESSFUL"})),_M({action:t,status:"CANCELED"}),Sa(i=>st({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=ap(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=li(d)),d instanceof oe?(d=d.pipe(_M({})),l.options.cancelUncompleted&&(d=d.pipe(zn(t.pipe(rSe(i)))))):d=st({}).pipe(Hc()),s.push(d)}catch(d){s.push(zg(d))}}}return s.length||s.push(st({})),Bv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=EM.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==Vm(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(I(Tt),I(op),I(n,12),I(bM),I(XR),I(wM),I(VR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),KR=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Tn(()=>!!i),Di(()=>this.invokeInit(i.states)),ci(()=>this.bootstrapper.appBootstrapped$),Tn(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=t$(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Um),I(wM),I(BR))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();let ph=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(be(i),Sa(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?st(void 0):zg(r)}),Xo(),yM(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(_i(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(yM(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=qR(n)||Fb(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(I(CM),I(Um),I(op),I(vM),I(zm),I(VR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Nb=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(I(ph),I(op))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class c${static get type(){return"@@INIT"}}class u${constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const MM=new Hg(1);let vSe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&wo();MM.next(t)}catch(n){MM.next(!1)}finally{MM.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new c$,l)}}return n.\u0275fac=function(t){return new(t||n)(I(zm),I(Um),I(ph),I(Nb),I(Y6,8),I(KR))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),bSe=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new u$(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(I(ph),I(Um),I(zm),I(X6,8),I(KR))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();class ia{static forRoot(e=[],t={}){return{ngModule:vSe,providers:[zm,wM,dSe,bM,BR,o$,s$,KR,i$,XR,Um,vM,ph,CM,Nb,YR,...e,...ia.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:bSe,providers:[zm,YR,...e,{provide:X6,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:K6,useValue:HEe},{provide:Z6,useValue:wo},{provide:J6,useClass:t.executionStrategy||q6},{provide:Y6,useValue:e},{provide:ia.ROOT_OPTIONS,useValue:t},{provide:op,useFactory:ia.ngxsConfigFactory,deps:[ia.ROOT_OPTIONS]},{provide:pv,useFactory:ia.appBootstrapListenerFactory,multi:!0,deps:[BR]},{provide:VR,useFactory:ia.getInitialState},{provide:$6,useExisting:wM},{provide:G6,useExisting:zm}]}static ngxsConfigFactory(e){return $R(new op,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return $Ee.pop()}}function gh(n){return i=>{!function(n){MM.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ia.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(sd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,sd,{value:e})}return Fb(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[Q6]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;EM.checkCorrectStateName(d),s.hasOwnProperty(sd)&&(r.actions=Object.assign({},r.actions,(s[sd]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[Q6]=a}}ia.\u0275fac=function(e){return new(e||ia)},ia.\u0275mod=xe({type:ia}),ia.\u0275inj=Ee({}),ia.ROOT_OPTIONS=new _e("ROOT_OPTIONS");let d$=(()=>{class n{constructor(t,i){this._renderer=t,this._elementRef=i,this.onChange=r=>{},this.onTouched=()=>{}}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return n.\u0275fac=function(t){return new(t||n)(E(Lc),E(nt))},n.\u0275dir=he({type:n}),n})(),lp=(()=>{class n extends d${}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,features:[ht]}),n})();const Ao=new _e("NgValueAccessor"),ASe={provide:Ao,useExisting:T(()=>Lb),multi:!0},OSe=new _e("CompositionEventMode");let Lb=(()=>{class n extends d${constructor(t,i,r){super(t,i),this._compositionMode=r,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const n=Vc()?Vc().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return n.\u0275fac=function(t){return new(t||n)(E(Lc),E(nt),E(OSe,8))},n.\u0275dir=he({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,i){1&t&&ye("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},features:[At([ASe]),ht]}),n})();function mh(n){return null==n||0===n.length}function f$(n){return null!=n&&"number"==typeof n.length}const ws=new _e("NgValidators"),_h=new _e("NgAsyncValidators"),ISe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class p${static min(e){return function(n){return e=>{if(mh(e.value)||mh(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t{if(mh(e.value)||mh(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}(e)}static required(e){return function(n){return mh(n.value)?{required:!0}:null}(e)}static requiredTrue(e){return function(n){return!0===n.value?null:{required:!0}}(e)}static email(e){return function(n){return mh(n.value)||ISe.test(n.value)?null:{email:!0}}(e)}static minLength(e){return function(n){return e=>mh(e.value)||!f$(e.value)?null:e.value.lengthf$(e.value)&&e.value.length>n?{maxlength:{requiredLength:n,actualLength:e.value.length}}:null}(e)}static pattern(e){return function(n){if(!n)return yh;let e,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),i=>{if(mh(i.value))return null;const r=i.value;return e.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}(e)}static nullValidator(e){return null}static compose(e){return A$(e)}static composeAsync(e){return D$(e)}}function yh(n){return null}function E$(n){return null!=n}function S$(n){const e=Wy(n)?li(n):n;return yw(e),e}function M$(n){let e={};return n.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function x$(n,e){return e.map(t=>t(n))}function T$(n){return n.map(e=>function(n){return!n.validate}(e)?e:t=>e.validate(t))}function A$(n){if(!n)return null;const e=n.filter(E$);return 0==e.length?null:function(t){return M$(x$(t,e))}}function ZR(n){return null!=n?A$(T$(n)):null}function D$(n){if(!n)return null;const e=n.filter(E$);return 0==e.length?null:function(t){return Bv(x$(t,e).map(S$)).pipe(be(M$))}}function QR(n){return null!=n?D$(T$(n)):null}function O$(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function I$(n){return n._rawValidators}function P$(n){return n._rawAsyncValidators}function JR(n){return n?Array.isArray(n)?n:[n]:[]}function xM(n,e){return Array.isArray(n)?n.includes(e):n===e}function R$(n,e){const t=JR(e);return JR(n).forEach(r=>{xM(t,r)||t.push(r)}),t}function k$(n,e){return JR(e).filter(t=>!xM(n,t))}let F$=(()=>{class n{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=ZR(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=QR(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,i){return!!this.control&&this.control.hasError(t,i)}getError(t,i){return this.control?this.control.getError(t,i):null}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n}),n})(),Do=(()=>{class n extends F${get formDirective(){return null}get path(){return null}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,features:[ht]}),n})();class lc extends F${constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let ek=(()=>{class n extends class{constructor(e){this._cd=e}is(e){var t,i,r;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(r=null===(i=this._cd)||void 0===i?void 0:i.control)||void 0===r?void 0:r[e])}}{constructor(t){super(t)}}return n.\u0275fac=function(t){return new(t||n)(E(lc,2))},n.\u0275dir=he({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,i){2&t&&at("ng-untouched",i.is("untouched"))("ng-touched",i.is("touched"))("ng-pristine",i.is("pristine"))("ng-dirty",i.is("dirty"))("ng-valid",i.is("valid"))("ng-invalid",i.is("invalid"))("ng-pending",i.is("pending"))},features:[ht]}),n})();function Bb(n,e){ik(n,e),e.valueAccessor.writeValue(n.value),function(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&B$(n,e)})}(n,e),function(n,e){const t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&B$(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function(n,e){if(e.valueAccessor.setDisabledState){const t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function DM(n,e,t=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),IM(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function OM(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function ik(n,e){const t=I$(n);null!==e.validator?n.setValidators(O$(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const i=P$(n);null!==e.asyncValidator?n.setAsyncValidators(O$(i,e.asyncValidator)):"function"==typeof i&&n.setAsyncValidators([i]);const r=()=>n.updateValueAndValidity();OM(e._rawValidators,r),OM(e._rawAsyncValidators,r)}function IM(n,e){let t=!1;if(null!==n){if(null!==e.validator){const r=I$(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.validator);s.length!==r.length&&(t=!0,n.setValidators(s))}}if(null!==e.asyncValidator){const r=P$(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.asyncValidator);s.length!==r.length&&(t=!0,n.setAsyncValidators(s))}}}const i=()=>{};return OM(e._rawValidators,i),OM(e._rawAsyncValidators,i),t}function B$(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function V$(n,e){ik(n,e)}function rk(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}function j$(n,e){n._syncPendingControls(),e.forEach(t=>{const i=t.control;"submit"===i.updateOn&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function sk(n,e){if(!e)return null;let t,i,r;return Array.isArray(e),e.forEach(s=>{s.constructor===Lb?t=s:function(n){return Object.getPrototypeOf(n.constructor)===lp}(s)?i=s:r=s}),r||i||t||null}function PM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const Vb="VALID",RM="INVALID",Hm="PENDING",jb="DISABLED";function ok(n){return(lk(n)?n.validators:n)||null}function U$(n){return Array.isArray(n)?ZR(n):n||null}function ak(n,e){return(lk(e)?e.asyncValidators:n)||null}function z$(n){return Array.isArray(n)?QR(n):n||null}function lk(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}class ck{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=U$(this._rawValidators),this._composedAsyncValidatorFn=z$(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===Vb}get invalid(){return this.status===RM}get pending(){return this.status==Hm}get disabled(){return this.status===jb}get enabled(){return this.status!==jb}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=U$(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=z$(e)}addValidators(e){this.setValidators(R$(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(R$(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(k$(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(k$(e,this._rawAsyncValidators))}hasValidator(e){return xM(this._rawValidators,e)}hasAsyncValidator(e){return xM(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Hm,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=jb,this.errors=null,this._forEachChild(i=>{i.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(i=>i(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Vb,this._forEachChild(i=>{i.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Vb||this.status===Hm)&&this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?jb:Vb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Hm,this._hasOwnPendingAsyncValidator=!0;const t=S$(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(i=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(i,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(n,e,t){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=n;return e.forEach(r=>{i=i instanceof uk?i.controls.hasOwnProperty(r)?i.controls[r]:null:i instanceof $Se&&i.at(r)||null}),i}(this,e)}getError(e,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Pe,this.statusChanges=new Pe}_calculateStatus(){return this._allControlsDisabled()?jb:this.errors?RM:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Hm)?Hm:this._anyControlsHaveStatus(RM)?RM:Vb}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){lk(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class vh extends ck{constructor(e=null,t,i){super(ok(t),ak(i,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(i=>i(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){PM(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){PM(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class uk extends ck{constructor(e,t,i){super(ok(t),ak(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t instanceof vh?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>!!i._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error(`Cannot find form control with name: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const i=this.controls[t];if(this.contains(t)&&e(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,i)=>((t.enabled||this.disabled)&&(e[i]=t.value),e))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class $Se extends ck{constructor(e,t,i){super(ok(t),ak(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,i={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((i,r)=>{this._throwIfControlMissing(r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof vh?e.value:e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce((t,i)=>!!i._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error(`Cannot find form control at index ${e}`)}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const GSe={provide:Do,useExisting:T(()=>cp)},Ub=(()=>Promise.resolve(null))();let cp=(()=>{class n extends Do{constructor(t,i){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Pe,this.form=new uk({},ZR(t),QR(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){Ub.then(()=>{const i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),Bb(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){Ub.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name),PM(this._directives,t)})}addFormGroup(t){Ub.then(()=>{const i=this._findContainer(t.path),r=new uk({});V$(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){Ub.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){Ub.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,j$(this.form,this._directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10))},n.\u0275dir=he({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,i){1&t&&ye("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[At([GSe]),ht]}),n})();const qSe={provide:lc,useExisting:T(()=>dk)},W$=(()=>Promise.resolve(null))();let dk=(()=>{class n extends lc{constructor(t,i,r,s){super(),this.control=new vh,this._registered=!1,this.update=new Pe,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=sk(0,s)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),rk(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(n,e){return[...e.path,n]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Bb(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){W$.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const i=t.isDisabled.currentValue,r=""===i||i&&"false"!==i;W$.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable()})}}return n.\u0275fac=function(t){return new(t||n)(E(Do,9),E(ws,10),E(_h,10),E(Ao,10))},n.\u0275dir=he({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[At([qSe]),ht,qn]}),n})(),X$=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const hk=new _e("NgModelWithFormControlWarning"),QSe={provide:lc,useExisting:T(()=>kM)};let kM=(()=>{class n extends lc{constructor(t,i,r,s){super(),this._ngModelWarningConfig=s,this.update=new Pe,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=sk(0,r)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const i=t.form.previousValue;i&&DM(i,this,!1),Bb(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}rk(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&DM(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_isControlChanged(t){return t.hasOwnProperty("form")}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10),E(Ao,10),E(hk,8))},n.\u0275dir=he({type:n,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[At([QSe]),ht,qn]}),n._ngModelWarningSentOnce=!1,n})();const JSe={provide:Do,useExisting:T(()=>$m)};let $m=(()=>{class n extends Do{constructor(t,i){super(),this.validators=t,this.asyncValidators=i,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Pe,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(IM(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const i=this.form.get(t.path);return Bb(i,t),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}removeControl(t){DM(t.control||null,t,!1),PM(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this.submitted=!0,j$(this.form,this.directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const i=t.control,r=this.form.get(t.path);i!==r&&(DM(i||null,t),r instanceof vh&&(Bb(r,t),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const i=this.form.get(t.path);V$(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const i=this.form.get(t.path);i&&function(n,e){return IM(n,e)}(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){ik(this.form,this),this._oldForm&&IM(this._oldForm,this)}_checkFormPresent(){}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10))},n.\u0275dir=he({type:n,selectors:[["","formGroup",""]],hostBindings:function(t,i){1&t&&ye("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[At([JSe]),ht,qn]}),n})(),uG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[X$]]}),n})(),yk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[uG]}),n})(),vk=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:hk,useValue:t.warnOnNgModelWithFormControl}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[uG]}),n})();function zb(n){return new oe(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?li(t):fE()).subscribe(e)})}function bk(n,e=Tf){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new yMe(i,e))}class yMe{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new Ck(e,this.delay,this.scheduler))}}class Ck extends Rt{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(Ck.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new vMe(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(qo.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(qo.createComplete()),this.unsubscribe()}}class vMe{constructor(e,t){this.time=e,this.notification=t}}const pG=Yg({passive:!0});let gG=(()=>{class n{constructor(t,i){this._platform=t,this._ngZone=i,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return Ql;const i=Hu(t),r=this._monitoredElements.get(i);if(r)return r.subject;const s=new we,o="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||i.classList.contains(o)?"cdk-text-field-autofill-end"===l.animationName&&i.classList.contains(o)&&(i.classList.remove(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!1}))):(i.classList.add(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{i.addEventListener("animationstart",a,pG),i.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(i,{subject:s,unlisten:()=>{i.removeEventListener("animationstart",a,pG)}}),s}stopMonitoring(t){const i=Hu(t),r=this._monitoredElements.get(i);r&&(r.unlisten(),r.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((t,i)=>this.stopMonitoring(i))}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt))},token:n,providedIn:"root"}),n})(),mG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Av]]}),n})();const NMe=new _e("MAT_INPUT_VALUE_ACCESSOR"),LMe=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let BMe=0;const VMe=CO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let Hb=(()=>{class n extends VMe{constructor(t,i,r,s,o,a,l,c,d,f){super(a,s,o,r),this._elementRef=t,this._platform=i,this._autofillMonitor=c,this._formField=f,this._uid="mat-input-"+BMe++,this.focused=!1,this.stateChanges=new we,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._required=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(_=>Q3().has(_));const p=this._elementRef.nativeElement,g=p.nodeName.toLowerCase();this._inputValueAccessor=l||p,this._previousNativeValue=this.value,this.id=this.id,i.IOS&&d.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",_=>{const y=_.target;!y.value&&0===y.selectionStart&&0===y.selectionEnd&&(y.setSelectionRange(1,1),y.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===g,this._isTextarea="textarea"===g,this._isInFormField=!!f,this._isNativeSelect&&(this.controlType=p.multiple?"mat-native-select-multiple":"mat-native-select")}get disabled(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Dt(t),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(t){this._id=t||this._uid}get required(){return this._required}set required(t){this._required=Dt(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&Q3().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(t){t!==this.value&&(this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=Dt(t)}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}ngDoCheck(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}_focusChanged(t){t!==this.focused&&(this.focused=t,this.stateChanges.next())}_onInput(){}_dirtyCheckPlaceholder(){var t,i;const r=(null===(i=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===i?void 0:i.call(t))?null:this.placeholder;if(r!==this._previousPlaceholder){const s=this._elementRef.nativeElement;this._previousPlaceholder=r,r?s.setAttribute("placeholder",r):s.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){LMe.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const t=this._elementRef.nativeElement,i=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&i&&i.label)}return this.focused||!this.empty}setDescribedByIds(t){t.length?this._elementRef.nativeElement.setAttribute("aria-describedby",t.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(ii),E(lc,10),E(cp,8),E($m,8),E(kv),E(NMe,10),E(gG),E(lt),E(XE,8))},n.\u0275dir=he({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:9,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&t&&(sl("disabled",i.disabled)("required",i.required),en("id",i.id)("data-placeholder",i.placeholder)("readonly",i.readonly&&!i._isNativeSelect||null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required),at("mat-input-server",i._isServer))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[At([{provide:Nv,useExisting:n}]),ht,qn]}),n})(),$b=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[kv],imports:[[mG,Lv,Nn],mG,Lv]}),n})();function lr(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>be(function(n,e){return i=>{let r=i;for(let s=0;si.lift(new $Me(n,e,t.leading,t.trailing))}class $Me{constructor(e,t,i,r){this.duration=e,this.scheduler=t,this.leading=i,this.trailing=r}call(e,t){return t.subscribe(new GMe(e,this.duration,this.scheduler,this.leading,this.trailing))}}class GMe extends Rt{constructor(e,t,i,r,s){super(e),this.duration=t,this.scheduler=i,this.leading=r,this.trailing=s,this._hasTrailingValue=!1,this._trailingValue=null}_next(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(WMe,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)}}function WMe(n){const{subscriber:e}=n;e.clearThrottle()}var vG=Ve(266);const qMe={tooltipState:Jl("state",[br("initial, void, hidden",Kn({opacity:0,transform:"scale(0)"})),br("visible",Kn({transform:"scale(1)"})),Qs("* => visible",Mo("200ms cubic-bezier(0, 0, 0.2, 1)",kne([Kn({opacity:0,transform:"scale(0)",offset:0}),Kn({opacity:.5,transform:"scale(0.99)",offset:.5}),Kn({opacity:1,transform:"scale(1)",offset:1})]))),Qs("* => hidden",Mo("100ms cubic-bezier(0, 0, 0.2, 1)",Kn({opacity:0})))])},bG="tooltip-panel",CG=Yg({passive:!0}),wG=new _e("mat-tooltip-scroll-strategy"),ZMe={provide:wG,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition({scrollThrottle:20})}},QMe=new _e("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let e1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p,g){this._overlay=t,this._elementRef=i,this._scrollDispatcher=r,this._viewContainerRef=s,this._ngZone=o,this._platform=a,this._ariaDescriber=l,this._focusMonitor=c,this._dir=f,this._defaultOptions=p,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new we,this._handleKeydown=_=>{this._isTooltipVisible()&&27===_.keyCode&&!Yo(_)&&(_.preventDefault(),_.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=d,this._document=g,p&&(p.position&&(this.position=p.position),p.touchGestures&&(this.touchGestures=p.touchGestures)),f.change.pipe(zn(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),o.runOutsideAngular(()=>{i.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var i;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(i=this._tooltipInstance)||void 0===i||i.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}get message(){return this._message}set message(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")})}))}get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(zn(this._destroyed)).subscribe(t=>{t?"keyboard"===t&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const t=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),t.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(([i,r])=>{t.removeEventListener(i,r,CG)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay){if(this.disabled||!this.message||this._isTooltipVisible()&&!this._tooltipInstance._showTimeoutId&&!this._tooltipInstance._hideTimeoutId)return;const i=this._createOverlay();this._detach(),this._portal=this._portal||new sm(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=i.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(zn(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}hide(t=this.hideDelay){this._tooltipInstance&&this._tooltipInstance.hide(t)}toggle(){this._isTooltipVisible()?this.hide():this.show()}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(){if(this._overlayRef)return this._overlayRef;const t=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),i=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return i.positionChanges.pipe(zn(this._destroyed)).subscribe(r=>{this._updateCurrentPositionClass(r.connectionPair),this._tooltipInstance&&r.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:i,panelClass:`${this._cssClassPrefix}-${bG}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(zn(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(zn(this._destroyed)).subscribe(()=>{var r;return null===(r=this._tooltipInstance)||void 0===r?void 0:r._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const i=t.getConfig().positionStrategy,r=this._getOrigin(),s=this._getOverlayPosition();i.withPositions([this._addOffset(Object.assign(Object.assign({},r.main),s.main)),this._addOffset(Object.assign(Object.assign({},r.fallback),s.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i||"below"==i?r={originX:"center",originY:"above"==i?"top":"bottom"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={originX:"start",originY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={originX:"end",originY:"center"});const{x:s,y:o}=this._invertPosition(r.originX,r.originY);return{main:r,fallback:{originX:s,originY:o}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i?r={overlayX:"center",overlayY:"bottom"}:"below"==i?r={overlayX:"center",overlayY:"top"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={overlayX:"end",overlayY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={overlayX:"start",overlayY:"center"});const{x:s,y:o}=this._invertPosition(r.overlayX,r.overlayY);return{main:r,fallback:{overlayX:s,overlayY:o}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(_i(1),zn(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,i){return"above"===this.position||"below"===this.position?"top"===i?i="bottom":"bottom"===i&&(i="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:i}}_updateCurrentPositionClass(t){const{overlayY:i,originX:r,originY:s}=t;let o;if(o="center"===i?this._dir&&"rtl"===this._dir.value?"end"===r?"left":"right":"start"===r?"left":"right":"bottom"===i&&"top"===s?"above":"below",o!==this._currentPosition){const a=this._overlayRef;if(a){const l=`${this._cssClassPrefix}-${bG}-`;a.removePanelClass(l+this._currentPosition),a.addPanelClass(l+o)}this._currentPosition=o}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",()=>{this._setupPointerExitEventsIfNeeded(),this.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",()=>{this._setupPointerExitEventsIfNeeded(),clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>this.show(),500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",()=>this.hide()],["wheel",i=>this._wheelListener(i)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const i=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",i],["touchcancel",i])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([i,r])=>{this._elementRef.nativeElement.addEventListener(i,r,CG)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const i=this._document.elementFromPoint(t.clientX,t.clientY),r=this._elementRef.nativeElement;i!==r&&!r.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const i=this._elementRef.nativeElement,r=i.style;("on"===t||"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName)&&(r.userSelect=r.msUserSelect=r.webkitUserSelect=r.MozUserSelect="none"),("on"===t||!i.draggable)&&(r.webkitUserDrag="none"),r.touchAction="none",r.webkitTapHighlightColor="transparent"}}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(nt),E(rm),E(es),E(lt),E(ii),E(iV),E(hl),E(void 0),E(Ko),E(void 0),E(rt))},n.\u0275dir=he({type:n,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),n})(),cc=(()=>{class n extends e1e{constructor(t,i,r,s,o,a,l,c,d,f,p,g){super(t,i,r,s,o,a,l,c,d,f,p,g),this._tooltipComponent=n1e}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(nt),E(rm),E(es),E(lt),E(ii),E(iV),E(hl),E(wG),E(Ko,8),E(QMe,8),E(rt))},n.\u0275dir=he({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[ht]}),n})(),t1e=(()=>{class n{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new we}show(t){clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(()=>{this._visibility="visible",this._showTimeoutId=void 0,this._onShow(),this._markForCheck()},t)}hide(t){clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._visibility="hidden",this._hideTimeoutId=void 0,this._markForCheck()},t)}afterHidden(){return this._onHide}isVisible(){return"visible"===this._visibility}ngOnDestroy(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}_animationStart(){this._closeOnInteraction=!1}_animationDone(t){const i=t.toState;"hidden"===i&&!this.isVisible()&&this._onHide.next(),("visible"===i||"hidden"===i)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return n.\u0275fac=function(t){return new(t||n)(E(Un))},n.\u0275dir=he({type:n}),n})(),n1e=(()=>{class n extends t1e{constructor(t,i){super(t),this._breakpointObserver=i,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return n.\u0275fac=function(t){return new(t||n)(E(Un),E(kO))},n.\u0275cmp=Le({type:n,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,i){2&t&&gf("zoom","visible"===i._visibility?1:null)},features:[ht],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,i){if(1&t&&(F(0,"div",0),ye("@state.start",function(){return i._animationStart()})("@state.done",function(s){return i._animationDone(s)}),yn(1,"async"),Te(2),N()),2&t){let r;at("mat-tooltip-handset",null==(r=wn(1,5,i._isHandset))?null:r.matches),ie("ngClass",i.tooltipClass)("@state",i._visibility),Y(2),Ai(i.message)}},directives:[sE],pipes:[zu],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[qMe.tooltipState]},changeDetection:0}),n})(),uc=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[ZMe],imports:[[Ine,bn,$v,Nn],Nn,zv]}),n})();const i1e=["sliderWrapper"],yl=Yg({passive:!1}),l1e={provide:Ao,useExisting:T(()=>wk),multi:!0};class c1e{}const u1e=Nf(kf(em(class{constructor(n){this._elementRef=n}}),"accent"));let wk=(()=>{class n extends u1e{constructor(t,i,r,s,o,a,l,c){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this._dir=s,this._ngZone=a,this._animationMode=c,this._invert=!1,this._max=100,this._min=0,this._step=1,this._thumbLabel=!1,this._tickInterval=0,this._value=null,this._vertical=!1,this.change=new Pe,this.input=new Pe,this.valueChange=new Pe,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=Ie.EMPTY,this._pointerDown=d=>{this.disabled||this._isSliding||!Gb(d)&&0!==d.button||this._ngZone.run(()=>{this._touchId=Gb(d)?function(n,e){for(let t=0;t{if("pointer"===this._isSliding){const f=EG(d,this._touchId);if(f){d.preventDefault();const p=this.value;this._lastPointerEvent=d,this._updateValueFromPosition(f),p!=this.value&&this._emitInputEvent()}}},this._pointerUp=d=>{"pointer"===this._isSliding&&(!Gb(d)||"number"!=typeof this._touchId||Ek(d.changedTouches,this._touchId))&&(d.preventDefault(),this._removeGlobalEvents(),this._isSliding=null,this._touchId=void 0,this._valueOnSlideStart!=this.value&&!this.disabled&&this._emitChangeEvent(),this._valueOnSlideStart=this._lastPointerEvent=null)},this._windowBlur=()=>{this._lastPointerEvent&&this._pointerUp(this._lastPointerEvent)},this._document=l,this.tabIndex=parseInt(o)||0,a.runOutsideAngular(()=>{const d=t.nativeElement;d.addEventListener("mousedown",this._pointerDown,yl),d.addEventListener("touchstart",this._pointerDown,yl)})}get invert(){return this._invert}set invert(t){this._invert=Dt(t)}get max(){return this._max}set max(t){this._max=So(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=So(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=So(t,this._step),this._step%1!=0&&(this._roundToDecimal=this._step.toString().split(".").pop().length),this._changeDetectorRef.markForCheck()}get thumbLabel(){return this._thumbLabel}set thumbLabel(t){this._thumbLabel=Dt(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?So(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let i=So(t,0);this._roundToDecimal&&i!==this.min&&i!==this.max&&(i=parseFloat(i.toFixed(this._roundToDecimal))),this._value=i,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=Dt(t)}get displayValue(){return this.displayWith?this.displayWith(this.value):this._roundToDecimal&&this.value&&this.value%1!=0?this.value.toFixed(this._roundToDecimal):this.value||0}focus(t){this._focusHostElement(t)}blur(){this._blurHostElement()}get percent(){return this._clamp(this._percent)}_shouldInvertAxis(){return this.vertical?!this.invert:this.invert}_isMinValue(){return 0===this.percent}_getThumbGap(){return this.disabled?7:this._isMinValue()&&!this.thumbLabel?this._isActive?10:7:0}_getTrackBackgroundStyles(){const i=this.vertical?`1, ${1-this.percent}, 1`:1-this.percent+", 1, 1";return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"-":""}${this._getThumbGap()}px) scale3d(${i})`}}_getTrackFillStyles(){const t=this.percent,r=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${r})`,display:0===t?"none":""}}_getTicksContainerStyles(){return{transform:`translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"-":""}${this._tickIntervalPercent/2*100}%)`}}_getTicksStyles(){let t=100*this._tickIntervalPercent,a={backgroundSize:this.vertical?`2px ${t}%`:`${t}% 2px`,transform:`translateZ(0) translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"":"-"}${t/2}%)${this.vertical||"rtl"!=this._getDirection()?"":" rotate(180deg)"}`};if(this._isMinValue()&&this._getThumbGap()){const l=this._shouldInvertAxis();let c;c=this.vertical?l?"Bottom":"Top":l?"Right":"Left",a[`padding${c}`]=`${this._getThumbGap()}px`}return a}_getThumbContainerStyles(){const t=this._shouldInvertAxis();return{transform:`translate${this.vertical?"Y":"X"}(-${100*(("rtl"!=this._getDirection()||this.vertical?t:!t)?this.percent:1-this.percent)}%)`}}_shouldInvertMouseCoords(){const t=this._shouldInvertAxis();return"rtl"!=this._getDirection()||this.vertical?t:!t}_getDirection(){return this._dir&&"rtl"==this._dir.value?"rtl":"ltr"}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{this._isActive=!!t&&"keyboard"!==t,this._changeDetectorRef.detectChanges()}),this._dir&&(this._dirChangeSubscription=this._dir.change.subscribe(()=>{this._changeDetectorRef.markForCheck()}))}ngOnDestroy(){const t=this._elementRef.nativeElement;t.removeEventListener("mousedown",this._pointerDown,yl),t.removeEventListener("touchstart",this._pointerDown,yl),this._lastPointerEvent=null,this._removeGlobalEvents(),this._focusMonitor.stopMonitoring(this._elementRef),this._dirChangeSubscription.unsubscribe()}_onMouseenter(){this.disabled||(this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent())}_onFocus(){this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent()}_onBlur(){this.onTouched()}_onKeydown(t){if(this.disabled||Yo(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const i=this.value;switch(t.keyCode){case 33:this._increment(10);break;case 34:this._increment(-10);break;case 35:this.value=this.max;break;case 36:this.value=this.min;break;case 37:this._increment("rtl"==this._getDirection()?1:-1);break;case 38:this._increment(1);break;case 39:this._increment("rtl"==this._getDirection()?-1:1);break;case 40:this._increment(-1);break;default:return}i!=this.value&&(this._emitInputEvent(),this._emitChangeEvent()),this._isSliding="keyboard",t.preventDefault()}_onKeyup(){"keyboard"===this._isSliding&&(this._isSliding=null)}_getWindow(){return this._document.defaultView||window}_bindGlobalEvents(t){const i=this._document,r=Gb(t),o=r?"touchend":"mouseup";i.addEventListener(r?"touchmove":"mousemove",this._pointerMove,yl),i.addEventListener(o,this._pointerUp,yl),r&&i.addEventListener("touchcancel",this._pointerUp,yl);const a=this._getWindow();void 0!==a&&a&&a.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,yl),t.removeEventListener("mouseup",this._pointerUp,yl),t.removeEventListener("touchmove",this._pointerMove,yl),t.removeEventListener("touchend",this._pointerUp,yl),t.removeEventListener("touchcancel",this._pointerUp,yl);const i=this._getWindow();void 0!==i&&i&&i.removeEventListener("blur",this._windowBlur)}_increment(t){this.value=this._clamp((this.value||0)+this.step*t,this.min,this.max)}_updateValueFromPosition(t){if(!this._sliderDimensions)return;let o=this._clamp(((this.vertical?t.y:t.x)-(this.vertical?this._sliderDimensions.top:this._sliderDimensions.left))/(this.vertical?this._sliderDimensions.height:this._sliderDimensions.width));if(this._shouldInvertMouseCoords()&&(o=1-o),0===o)this.value=this.min;else if(1===o)this.value=this.max;else{const a=this._calculateValue(o),l=Math.round((a-this.min)/this.step)*this.step+this.min;this.value=this._clamp(l,this.min,this.max)}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.value),this.valueChange.emit(this.value),this.change.emit(this._createChangeEvent())}_emitInputEvent(){this.input.emit(this._createChangeEvent())}_updateTickIntervalPercent(){if(this.tickInterval&&this._sliderDimensions)if("auto"==this.tickInterval){let t=this.vertical?this._sliderDimensions.height:this._sliderDimensions.width,s=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=s/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let i=new c1e;return i.source=this,i.value=t,i}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,i=0,r=1){return Math.max(i,Math.min(t,r))}_getSliderDimensions(){return this._sliderWrapper?this._sliderWrapper.nativeElement.getBoundingClientRect():null}_focusHostElement(t){this._elementRef.nativeElement.focus(t)}_blurHostElement(){this._elementRef.nativeElement.blur()}writeValue(t){this.value=t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Un),E(Ko,8),fs("tabindex"),E(lt),E(rt),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-slider"]],viewQuery:function(t,i){if(1&t&&ni(i1e,5),2&t){let r;Mt(r=xt())&&(i._sliderWrapper=r.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()})("keydown",function(s){return i._onKeydown(s)})("keyup",function(){return i._onKeyup()})("mouseenter",function(){return i._onMouseenter()})("selectstart",function(s){return s.preventDefault()}),2&t&&(sl("tabIndex",i.tabIndex),en("aria-disabled",i.disabled)("aria-valuemax",i.max)("aria-valuemin",i.min)("aria-valuenow",i.value)("aria-valuetext",null==i.valueText?i.displayValue:i.valueText)("aria-orientation",i.vertical?"vertical":"horizontal"),at("mat-slider-disabled",i.disabled)("mat-slider-has-ticks",i.tickInterval)("mat-slider-horizontal",!i.vertical)("mat-slider-axis-inverted",i._shouldInvertAxis())("mat-slider-invert-mouse-coords",i._shouldInvertMouseCoords())("mat-slider-sliding",i._isSliding)("mat-slider-thumb-label-showing",i.thumbLabel)("mat-slider-vertical",i.vertical)("mat-slider-min-value",i._isMinValue())("mat-slider-hide-last-tick",i.disabled||i._isMinValue()&&i._getThumbGap()&&i._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{disabled:"disabled",color:"color",tabIndex:"tabIndex",invert:"invert",max:"max",min:"min",step:"step",thumbLabel:"thumbLabel",tickInterval:"tickInterval",value:"value",vertical:"vertical",displayWith:"displayWith",valueText:"valueText"},outputs:{change:"change",input:"input",valueChange:"valueChange"},exportAs:["matSlider"],features:[At([l1e]),ht],decls:13,vars:6,consts:[[1,"mat-slider-wrapper"],["sliderWrapper",""],[1,"mat-slider-track-wrapper"],[1,"mat-slider-track-background",3,"ngStyle"],[1,"mat-slider-track-fill",3,"ngStyle"],[1,"mat-slider-ticks-container",3,"ngStyle"],[1,"mat-slider-ticks",3,"ngStyle"],[1,"mat-slider-thumb-container",3,"ngStyle"],[1,"mat-slider-focus-ring"],[1,"mat-slider-thumb"],[1,"mat-slider-thumb-label"],[1,"mat-slider-thumb-label-text"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"div",2),et(3,"div",3),et(4,"div",4),N(),F(5,"div",5),et(6,"div",6),N(),F(7,"div",7),et(8,"div",8),et(9,"div",9),F(10,"div",10),F(11,"span",11),Te(12),N(),N(),N(),N()),2&t&&(Y(3),ie("ngStyle",i._getTrackBackgroundStyles()),Y(1),ie("ngStyle",i._getTrackFillStyles()),Y(1),ie("ngStyle",i._getTicksContainerStyles()),Y(1),ie("ngStyle",i._getTicksStyles()),Y(1),ie("ngStyle",i._getThumbContainerStyles()),Y(5),Ai(i.displayValue))},directives:[M3],styles:['.mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:"";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n'],encapsulation:2,changeDetection:0}),n})();function Gb(n){return"t"===n.type[0]}function EG(n,e){let t;return t=Gb(n)?"number"==typeof e?Ek(n.touches,e)||Ek(n.changedTouches,e):n.touches[0]||n.changedTouches[0]:n,t?{x:t.clientX,y:t.clientY}:void 0}function Ek(n,e){for(let t=0;t{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn],Nn]}),n})();function h1e(n,e){}class Sk{constructor(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.maxWidth="80vw",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.autoFocus=!0,this.restoreFocus=!0,this.closeOnNavigation=!0}}const f1e={dialogContainer:Jl("dialogContainer",[br("void, exit",Kn({opacity:0,transform:"scale(0.7)"})),br("enter",Kn({transform:"none"})),Qs("* => enter",Mo("150ms cubic-bezier(0, 0, 0.2, 1)",Kn({transform:"none",opacity:1}))),Qs("* => void, * => exit",Mo("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",Kn({opacity:0})))])};let p1e=(()=>{class n extends nS{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new Pe,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_initializeWithAttachedContent(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()}attachComponentPortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(t)}_recaptureFocus(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()}_trapFocus(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()}_restoreFocus(){const t=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&t&&"function"==typeof t.focus){const i=vE(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_setupFocusTrap(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)}_capturePreviouslyFocusedElement(){this._document&&(this._elementFocusedBeforeDialogWasOpened=vE())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=vE();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(dV),E(Un),E(rt,8),E(Sk),E(hl))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&ni(zf,7),2&t){let r;Mt(r=xt())&&(i._portalOutlet=r.first)}},features:[ht]}),n})(),g1e=(()=>{class n extends p1e{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275cmp=Le({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&qy("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(sl("id",i._id),en("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),Sg("@dialogContainer",i._state))},features:[ht],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&Ct(0,h1e,0,0,"ng-template",0)},directives:[zf],styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[f1e.dialogContainer]}}),n})(),m1e=0;class Gm{constructor(e,t,i="mat-dialog-"+m1e++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new we,this._afterClosed=new we,this._beforeClosed=new we,this._state=0,t._id=i,t._animationStateChanged.pipe(Tn(r=>"opened"===r.state),_i(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Tn(r=>"closed"===r.state),_i(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Tn(r=>27===r.keyCode&&!this.disableClose&&!Yo(r))).subscribe(r=>{r.preventDefault(),Mk(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():Mk(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Tn(t=>"closing"===t.state),_i(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.totalTime+100)}),this._state=1,this._containerInstance._startExitAnimation()}afterOpened(){return this._afterOpened}afterClosed(){return this._afterClosed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._overlayRef.backdropClick()}keydownEvents(){return this._overlayRef.keydownEvents()}updatePosition(e){let t=this._getPositionStrategy();return e&&(e.left||e.right)?e.left?t.left(e.left):t.right(e.right):t.centerHorizontally(),e&&(e.top||e.bottom)?e.top?t.top(e.top):t.bottom(e.bottom):t.centerVertically(),this._overlayRef.updatePosition(),this}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function Mk(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const xk=new _e("MatDialogData"),_1e=new _e("mat-dialog-default-options"),MG=new _e("mat-dialog-scroll-strategy"),v1e={provide:MG,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.block()}};let b1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=d,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new we,this._afterOpenedAtThisLevel=new we,this._ariaHiddenElements=new Map,this.afterAllClosed=zb(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(ns(void 0))),this._scrollStrategy=a}get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){const t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}open(t,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new Sk)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new Hv({positionStrategy:this._overlay.position().global(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,disposeOnNavigation:t.closeOnNavigation});return t.backdropClass&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Tt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:Sk,useValue:i}]}),o=new sm(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Xs)i.attachTemplatePortal(new Uf(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new sm(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Ko,null,vt.Optional))&&o.push({provide:Ko,useValue:{value:t.direction,change:st()}}),Tt.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Tt),E(void 0),E(void 0),E(om),E(void 0),E(Su),E(Su),E(_e))},n.\u0275dir=he({type:n}),n})(),Wm=(()=>{class n extends b1e{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,Gm,g1e,xk)}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(Tt),I(Ug,8),I(_1e,8),I(MG),I(n,12),I(om))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),w1e=0,xG=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+w1e++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.id):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{const t=this._dialogRef._containerInstance;t&&!t._ariaLabelledBy&&(t._ariaLabelledBy=this.id)})}}return n.\u0275fac=function(t){return new(t||n)(E(Gm,8),E(nt),E(Wm))},n.\u0275dir=he({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&sl("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),TG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();let Tk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[Wm,v1e],imports:[[$v,iS,Nn],Nn]}),n})();const Ak=new _e("CdkAccordion");let M1e=0,T1e=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=Ie.EMPTY,this.closed=new Pe,this.opened=new Pe,this.destroyed=new Pe,this.expandedChange=new Pe,this.id="cdk-accordion-child-"+M1e++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=Dt(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ak,12),E(Un),E(tS))},n.\u0275dir=he({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[At([{provide:Ak,useValue:void 0}])]}),n})(),A1e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const D1e=["body"];function O1e(n,e){}const I1e=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],P1e=["mat-expansion-panel-header","*","mat-action-row"];function R1e(n,e){1&n&&et(0,"span",2),2&n&&ie("@indicatorRotate",bt()._getExpandedState())}const k1e=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],F1e=["mat-panel-title","mat-panel-description","*"],Dk=new _e("MAT_ACCORDION"),DG="225ms cubic-bezier(0.4,0.0,0.2,1)",OG={indicatorRotate:Jl("indicatorRotate",[br("collapsed, void",Kn({transform:"rotate(0deg)"})),br("expanded",Kn({transform:"rotate(180deg)"})),Qs("expanded <=> collapsed, void => collapsed",Mo(DG))]),bodyExpansion:Jl("bodyExpansion",[br("collapsed, void",Kn({height:"0px",visibility:"hidden"})),br("expanded",Kn({height:"*",visibility:"visible"})),Qs("expanded <=> collapsed, void => collapsed",Mo(DG))])};let N1e=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(E(Xs))},n.\u0275dir=he({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),L1e=0;const IG=new _e("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let NM=(()=>{class n extends T1e{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new Pe,this.afterCollapse=new Pe,this._inputChanges=new we,this._headerId="mat-expansion-panel-header-"+L1e++,this._bodyAnimationDone=new we,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(Xo((c,d)=>c.fromState===d.fromState&&c.toState===d.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=Dt(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe(ns(null),Tn(()=>this.expanded&&!this._portal),_i(1)).subscribe(()=>{this._portal=new Uf(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(E(Dk,12),E(Un),E(tS),E(es),E(rt),E(Zo,8),E(IG,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,N1e,5),2&t){let s;Mt(s=xt())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&ni(D1e,5),2&t){let r;Mt(r=xt())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&at("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[At([{provide:Dk,useValue:void 0}]),ht,qn],ngContentSelectors:P1e,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,i){1&t&&(Dr(I1e),In(0),F(1,"div",0,1),ye("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),F(3,"div",2),In(4,1),Ct(5,O1e,0,0,"ng-template",3),N(),In(6,2),N()),2&t&&(Y(1),ie("@bodyExpansion",i._getExpandedState())("id",i.id),en("aria-labelledby",i._headerId),Y(4),ie("cdkPortalOutlet",i._portal))},directives:[zf],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[OG.bodyExpansion]},changeDetection:0}),n})();class V1e{}const j1e=Nf(V1e);let LM=(()=>{class n extends j1e{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=Ie.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Tn(d=>!(!d.hideToggle&&!d.togglePosition))):Ql;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=ki(t.opened,t.closed,c,t._inputChanges.pipe(Tn(d=>!!(d.hideToggle||d.disabled||d.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Tn(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case 32:case 13:Yo(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return n.\u0275fac=function(t){return new(t||n)(E(NM,1),E(nt),E(hl),E(Un),E(IG,8),E(Zo,8),fs("tabindex"))},n.\u0275cmp=Le({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&ye("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(en("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),gf("height",i._getHeaderHeight()),at("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[ht],ngContentSelectors:F1e,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(Dr(k1e),F(0,"span",0),In(1),In(2,1),In(3,2),N(),Ct(4,R1e,1,1,"span",1)),2&t&&(Y(4),ie("ngIf",i._showToggle()))},directives:[Is],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[OG.indicatorRotate]},changeDetection:0}),n})(),PG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),n})(),Ok=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn,A1e,iS]]}),n})();var RG=Ve(478);Object.create(Error.prototype);const $1e=["*"];var VM=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(VM||(VM={})),VM))();class W1e{}const FG=new _e("SECURITY_CONTEXT");let Ik=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new RG.Renderer},this.options=s}get options(){return this._options}set options(t){this._options=Object.assign(Object.assign({},this.initialMarkedOptions),t)}get renderer(){return this.options.renderer}set renderer(t){this.options.renderer=t}compile(t,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=RG.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}getSource(t){if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(t,{responseType:"text"}).pipe(be(i=>this.handleExtension(t,i)))}highlight(t){if(xf(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!xf(this.platform))return t;if("undefined"==typeof katex||void 0===katex.renderToString)throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");return t.replace(/\$([^\s][^$]*?[^\s])\$/gm,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!xf(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!xf(this.platform))return t;if("undefined"==typeof joypixels||void 0===joypixels.shortnameToUnicode)throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(t)}trimIndentation(t){if(!t)return"";let i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(I(cl),I(FG),I(im,8),I(W1e,8),I(Kd))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),NG=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new Pe,this.load=new Pe,this.ready=new Pe,this._emoji=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1}get emoji(){return this._emoji}set emoji(t){this._emoji=this.coerceBooleanProperty(t)}get katex(){return this._katex}set katex(t){this._katex=this.coerceBooleanProperty(t)}get lineHighlight(){return this._lineHighlight}set lineHighlight(t){this._lineHighlight=this.coerceBooleanProperty(t)}get lineNumbers(){return this._lineNumbers}set lineNumbers(t){this._lineNumbers=this.coerceBooleanProperty(t)}ngOnChanges(){null==this.data?null==this.src||this.handleSrc():this.handleData()}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion()}render(t,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,this.handlePlugins(),this.markdownService.highlight(this.element.nativeElement),this.ready.emit()}coerceBooleanProperty(t){return null!=t&&"false"!=`${String(t)}`}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe(t=>{this.render(t),this.load.emit(t)},t=>this.error.emit(t))}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,VM.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;s{class n{static forRoot(t){return{ngModule:n,providers:[Ik,t&&t.loader||[],t&&t.markedOptions||[],{provide:FG,useValue:t&&null!=t.sanitize?t.sanitize:on.HTML}]}}static forChild(){return{ngModule:n}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function LG(n,e,t){return t?LG(n,e).pipe(be(i=>Fe(i)?t(...i):t(i))):new oe(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(ft(e))return()=>e(r,s)})}function jM(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new J1e(n,t))}}class J1e{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new exe(e,this.observables,this.project))}}class exe extends RU{constructor(e,t,i){super(e),this.observables=t,this.project=i,this.toRespond=[];const r=t.length;this.values=new Array(r);for(let s=0;s0){const s=r.indexOf(i);-1!==s&&r.splice(s,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}class txe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new nxe(e,this.accumulator,this.seed,this.hasSeed))}}class nxe extends Rt{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class sxe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new oxe(e,this.predicate))}}class oxe extends Rt{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const axe=["youtubeContainer"];let jG=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new we,this._destroyed=new we,this._playerChanges=new sr(void 0),this._videoId=new sr(void 0),this._height=new sr(390),this._width=new sr(640),this._startSeconds=new sr(void 0),this._endSeconds=new sr(void 0),this._suggestedQuality=new sr(void 0),this._playerVars=new sr(void 0),this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange"),this._isBrowser=xf(i)}get videoId(){return this._videoId.value}set videoId(t){this._videoId.next(t)}get height(){return this._height.value}set height(t){this._height.next(t||390)}get width(){return this._width.value}set width(t){this._width.next(t||640)}set startSeconds(t){this._startSeconds.next(t)}set endSeconds(t){this._endSeconds.next(t)}set suggestedQuality(t){this._suggestedQuality.next(t)}get playerVars(){return this._playerVars.value}set playerVars(t){this._playerVars.next(t)}ngOnInit(){if(!this._isBrowser)return;let t=st(!0);if(!window.YT||!window.YT.Player){const r=new we;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(_i(1),ns(!1))}const i=function(n,e,t,i,r,s,o){const a=or([e,s]).pipe(jM(or([i,r])),be(([l,c])=>{const[d,f]=l,[p,g]=c;return d?{videoId:d,playerVars:f,width:p,height:g}:void 0}));return or([n,a,st(o)]).pipe(function(n){return Er(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&Fe(n[0])&&(n=n[0].slice()),t=>t.lift.call(li([t,...n]),new NU(e))}(n),function(n){return e=>e.lift(new sxe(n))}(([e,t])=>!t),be(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new txe(n,e,t))}}(fxe,void 0),Xo())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Di(r=>{this._playerChanges.next(r)}),ci(e=>e?UG(e)?st(e):new oe(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{UG(r)||r.destroy()})(e)}}).pipe(_i(1),ns(void 0)):st(void 0)),zn(this._destroyed),pc(new we));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){or([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){or([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=or([t,i]).pipe(be(([d,f])=>({startSeconds:d,endSeconds:f}))),a=o.pipe(Rk(n,d=>!!d&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(d))),l=e.pipe(Rk(n,(d,f)=>!!d&&d.videoId!==f));ki(n.pipe(Rk(or([e,o]),([d,f],p)=>!(!p||d==p.videoId&&!f.startSeconds&&!f.endSeconds))),l,a).pipe(jM(or([n,e,o,r])),be(([d,f])=>f),zn(s)).subscribe(([d,f,p,g])=>{!f||!d||(d.videoId=f,d.cueVideoById(Object.assign({videoId:f,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.connect()}createEventsBoundInZone(){return{}}ngAfterViewInit(){this._youtubeContainer.next(this.youtubeContainer.nativeElement)}ngOnDestroy(){this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._videoId.complete(),this._height.complete(),this._width.complete(),this._startSeconds.complete(),this._endSeconds.complete(),this._suggestedQuality.complete(),this._youtubeContainer.complete(),this._playerVars.complete(),this._destroyed.next(),this._destroyed.complete()}playVideo(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}pauseVideo(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}stopVideo(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}seekTo(t,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}mute(){this._player?this._player.mute():this._getPendingState().muted=!0}unMute(){this._player?this._player.unMute():this._getPendingState().muted=!1}isMuted(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}setVolume(t){this._player?this._player.setVolume(t):this._getPendingState().volume=t}getVolume(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}setPlaybackRate(t){if(this._player)return this._player.setPlaybackRate(t);this._getPendingState().playbackRate=t}getPlaybackRate(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}getAvailablePlaybackRates(){return this._player?this._player.getAvailablePlaybackRates():[]}getVideoLoadedFraction(){return this._player?this._player.getVideoLoadedFraction():0}getPlayerState(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}getCurrentTime(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}getPlaybackQuality(){return this._player?this._player.getPlaybackQuality():"default"}getAvailableQualityLevels(){return this._player?this._player.getAvailableQualityLevels():[]}getDuration(){return this._player?this._player.getDuration():0}getVideoUrl(){return this._player?this._player.getVideoUrl():""}getVideoEmbedCode(){return this._player?this._player.getVideoEmbedCode():""}_getPendingState(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}_initializePlayer(t,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Ir(i=>i?LG(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):st()),i=>new oe(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),zn(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(E(lt),E(cl))},n.\u0275cmp=Le({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&ni(axe,5),2&t){let r;Mt(r=xt())&&(i.youtubeContainer=r.first)}},inputs:{videoId:"videoId",height:"height",width:"width",startSeconds:"startSeconds",endSeconds:"endSeconds",suggestedQuality:"suggestedQuality",playerVars:"playerVars",showBeforeIframeApiLoads:"showBeforeIframeApiLoads"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},decls:2,vars:0,consts:[["youtubeContainer",""]],template:function(t,i){1&t&&et(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function fxe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function UG(n){return"getPlayerStatus"in n}function Rk(n,e){return Er(jM(n),Tn(([t,i])=>e(i,t)),be(([t])=>t))}let mxe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function qb(n){return!0===n}function no(n){return null==n}function Pa(n){return!no(n)}function kk(n){return Boolean(n)}function $G(n){return no(n)?n:JSON.parse(JSON.stringify(n))}const zM=n=>{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&zM(n[o])}),n};function GG(n){return Pa(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const YG="NGXS_DATA_META",Nk="NGXS_META",XG="NGXS_ARGUMENT_REGISTRY_META";let KG=(()=>{class n{constructor(t){this.sequence$=new sr(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(I(ph,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function Yb(n){return n[YG]}let Ra=(()=>{class n{constructor(t,i,r){n.store=t.get(ph),n.ngZone=t.get(lt),n.factory=i,n.context=r,n.computed=t.get(KG)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(I(Tt),I(G6),I($6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class kr{constructor(){kr.statesCachedMeta.clear()}static createStateContext(e){return Ra.context.createStateContext(e)}static ensureMappedState(e){if(no(Ra.factory)||no(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(Pa(e.name)?kr.statesCachedMeta.get(e.name):null)||kr.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Yb(kr.getStateClassByInstance(e)))&&void 0!==t?t:null;if(no(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=kr.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=kr.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=Pa(e.name)?null===(t=Ra.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Pa(i)&&Pa(e.name)&&kr.statesCachedMeta.set(e.name,i),i}}kr.statesCachedMeta=new Map,kr.\u0275fac=function(e){return new(e||kr)},kr.\u0275prov=ae({token:kr,factory:kr.\u0275fac}),new Hg(1);class Vxe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Pa(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function ZG(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function QG(n){var e;const t=ZG(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=$G(void 0===t.defaults?{}:t.defaults);if(i.length){if(GG(s))return function(n,e){return e.reduce((t,i)=>{const r=ZG(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=QG(i),t},null!=n?n:{})}(s,i);throw new Vxe(s)}return s}function eW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function tW(){var n,e;return null!==(e=null===(n=null==Ra?void 0:Ra.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function Hxe(n){let e=!1;return Uv(n)&&(e=!0),e}function Lk(n){return n[XG]}class $xe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class Gxe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(kk(this.argumentMap.has(e))||kk(this.payloadMap.has(e)))throw new $xe(e,t)}}function Bk(n){return wo()?zM(n):n}function Kxe(n){return{enumerable:!0,configurable:!0,get(){const e=Yb(n),t=kr.ensureMappedState(e.stateMeta);return kr.createStateContext(t)}}}function Vk(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>wo()?zM(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}function ri(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(GG(i))for(;null!==i;){if(qb(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return no(eW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),eW(n)}(this),o=null==s?void 0:s.get(i);if(qb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(no(o)||o.sequenceId!==tW()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:tW(),isObservable:Hxe(l)}),l}return o.value},t}}const tTe={cancelUncompleted:!0,insideZone:!1};function Xt(n=tTe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=kr.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=Lk(r);if(no(f)){const C=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),x=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var C;return qb(n.insideZone)?null===(C=Ra.ngZone)||void 0===C||C.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Uv(l)?st(null).pipe(be(()=>l)):l};const v=kr.createAction(f,o,g),w=Ra.store.dispatch(v);return Uv(l)?function(n,e){return Bv([n,e]).pipe(be(t=>t.pop()))}(w,l):l},i}}function Es(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return no(Lk(t))&&Object.defineProperties(t,{[XG]:{enumerable:!0,configurable:!0,value:new Gxe}}),Lk(t)})(e,t).createPayloadType(r,t,i)}}function Ch(){return n=>{const e=function(n){if(function(n){return!kk(n)}(n.hasOwnProperty(Nk))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,Nk,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[Nk]}(n)}(n);if(no(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=Yb(n))&&void 0!==e?e:null;return(no(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,YG,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Yb(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>$G(t)},context:Kxe(n)})}(n,e,QG(n)),function(n){var e,t;const i=Yb(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(Pa(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Pa(this[s]))return this[s];if(no(Ra.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ra.store.select(n).pipe(be(o=>wo()?zM(o):o),Hc({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}var $M=(()=>(function(n){n.ID="id"}($M||($M={})),$M))(),Xb=(()=>(function(n){n.ASC="asc",n.DESC="desc"}(Xb||(Xb={})),Xb))();let jk=(()=>{class n{constructor(){this.browserStorageEvents$=new we,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),rTe=(()=>{class n extends jk{get snapshot(){return Bk(this.getState())}get ctx(){return Vk(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([Xt(),bs(0,Es("patchValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"patchState",null),De([Xt(),bs(0,Es("stateValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setState",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),n})(),sTe=(()=>{class n extends jk{constructor(){super(...arguments),this.primaryKey=$M.ID,this.comparator=null}get snapshot(){return Bk(this.getState())}get ids(){return this.snapshot.ids}get entities(){return this.snapshot.entities}get entitiesArray(){const t=this.snapshot;return t.ids.map(i=>t.entities[i])}get ids$(){return this.state$.pipe(be(t=>t.ids))}get entities$(){return this.state$.pipe(be(t=>t.entities))}get entitiesArray$(){return this.state$.pipe(be(t=>t.ids.map(i=>t.entities[i])))}get ctx(){return Vk(this.context)}setComparator(t){return this.comparator=t,this}dispatch(t){return this.ctx.dispatch(t)}getState(){return this.ctx.getState()}selectId(t){var i;return null===(i=t)||void 0===i?void 0:i[this.primaryKey]}selectOne(t){var i;return null!==(i=this.snapshot.entities[t])&&void 0!==i?i:null}selectAll(){const t=this.getState();return t.ids.map(i=>t.entities[i])}reset(){this.setEntitiesState(this.initialState),this.markAsDirtyAfterReset()}addOne(t){this.addEntityOne(t)}addMany(t){this.addEntitiesMany(t)}setOne(t){this.setEntityOne(t)}setMany(t){this.setEntitiesMany(t)}setAll(t){this.setEntitiesAll(t)}updateOne(t){this.updateEntitiesMany([t])}updateMany(t){this.updateEntitiesMany(t)}upsertOne(t){this.upsertEntitiesMany([t])}upsertMany(t){this.upsertEntitiesMany(t)}removeOne(t){this.removeEntitiesMany([t])}removeMany(t){this.removeEntitiesMany(t)}removeByEntity(t){const i=this.selectId(t);this.removeEntitiesMany([i])}removeByEntities(t){const i=[];for(const r of t){const s=this.selectId(r);i.push(s)}this.removeEntitiesMany(i)}removeAll(){this.setEntitiesState(this.initialState)}sort(t){this.comparator=null!=t?t:this.comparator,no(this.comparator)?console.warn("You must set the compare function before sorting."):this.setEntitiesState(this.getState())}addEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);r in i.entities||this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}addEntitiesMany(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities||a in r||(s.push(a),r[a]=o)}s.length&&this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,...s],entities:Object.assign(Object.assign({},i.entities),r)}))}setEntitiesAll(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in r||(s.push(a),r[a]=o)}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:s,entities:r}))}setEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);this.setEntitiesState(Object.assign(Object.assign({},i),r in i.entities?{entities:Object.assign(Object.assign({},i.entities),{[r]:t})}:{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}setEntitiesMany(t){for(const i of t)this.setEntityOne(i)}updateEntitiesMany(t){const i=this.getState(),r=t.filter(a=>a.id in i.entities);if(0===r.length)return;const s=this.generateKeyMap(i),o=Object.assign({},i.entities);for(const a of r){const l=this.updateOrigin(o,a),c=this.selectIdValue(l);c!==a.id&&(delete s[a.id],delete o[a.id]),s[a.id]=c,o[c]=l}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.map(a=>{var l;return null!==(l=s[a])&&void 0!==l?l:a}),entities:o}))}upsertEntitiesMany(t){const i=this.getState(),r=[],s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities?r.push({id:a,changes:o}):s.push(o)}this.updateMany(r),this.addMany(s)}removeEntitiesMany(t){const i=this.getState(),r=this.generateKeyMap(i),s=Object.assign({},i.entities);for(const o of t)o in s&&(delete r[o],delete s[o]);this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.filter(o=>o in r),entities:s}))}setEntitiesState(t){const i=this.sortKeysByComparator(t.ids,t.entities);this.ctx.setState(Object.assign(Object.assign({},t),{ids:i,entities:t.entities}))}sortKeysByComparator(t,i){if(no(this.comparator))return t;const r=t.slice(),s=this.comparator;return"function"==typeof s?r.sort((o,a)=>s(i[o],i[a])):this.sortByComparatorOptions(r,s,i)}sortByComparatorOptions(t,i,r){switch(null==i?void 0:i.sortByOrder){case Xb.ASC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?-1:0}(null==i?void 0:i.sortBy,r[s],r[o]));case Xb.DESC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?-1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?1:0}(null==i?void 0:i.sortBy,r[s],r[o]));default:return wo()&&console.warn(`Invalid --\x3e { sortByOrder: "${null==i?void 0:i.sortByOrder}" } not supported!`),t}}generateKeyMap(t){return t.ids.reduce((i,r)=>(i[r]=r,i),{})}updateOrigin(t,i){return Object.assign(Object.assign({},t[i.id]),i.changes)}selectIdValue(t){const i=this.selectId(t);return no(i)&&wo()&&console.warn(`The entity passed to the 'selectId' implementation returned ${i}.`,"You should probably provide your own 'selectId' implementation.","The entity that was passed:",t,"The current `selectId` implementation: (entity: V): K => entity.id"),i}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([ri(),Ge("design:type",Array),Ge("design:paramtypes",[])],n.prototype,"ids",null),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"entities",null),De([ri(),Ge("design:type",Array),Ge("design:paramtypes",[])],n.prototype,"entitiesArray",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"ids$",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"entities$",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"entitiesArray$",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"addOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"addMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"setMany",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"setAll",null),De([Xt(),bs(0,Es("update")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"updateOne",null),De([Xt(),bs(0,Es("updates")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"updateMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"upsertOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"upsertMany",null),De([Xt(),bs(0,Es("id")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"removeOne",null),De([Xt(),bs(0,Es("ids")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"removeMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"removeByEntity",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"removeByEntities",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"removeAll",null),De([Xt(),bs(0,Es("comparator")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"sort",null),n})(),qm=(()=>{class n extends jk{get snapshot(){return Bk(this.getState())}get ctx(){return Vk(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([Xt(),bs(0,Es("patchValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"patchState",null),De([Xt(),bs(0,Es("stateValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setState",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),n})();function Uk(){return Tn(n=>null!=n)}const oTe={};function zk(...n){const e=n[n.length-1];let t=n,i=oTe;return"object"==typeof e&&(i=e,t=t.slice(0,-1)),r=>r.pipe(lr(...t),Xo(i.compare),Hc(1))}const Jm=new _e("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),dF=new _e("ngx-window",{providedIn:"root",factory:()=>function(n){return xf(n)?window:null}(Ac(cl))}),_De=new _e("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Ac(dF))}),hF=new _e("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Ac(dF),Ac(_De))});let io=(()=>{class n{constructor(t,i,r){this.settings=t,this._document=i,this._gtag=r}get document(){return this._document}throw(t){(this.settings.enableTracing||wo())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((i,[r,s])=>Object.defineProperty(i,r,{value:s,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(i=>void 0!==i))}catch(i){this.throw(i)}}event(t,i,r,s,o){try{const a=new Map;i&&a.set("event_category",i),r&&a.set("event_label",r),s&&a.set("value",s),void 0!==o&&a.set("interaction",o);const l=this.toKeyValue(a);l?this.gtag("event",t,l):this.gtag("event",t)}catch(a){this.throw(a)}}pageView(t,i,r,s){try{const o=new Map([["page_path",t]]);i&&o.set("page_title",i),(r||this.document)&&o.set("page_location",r||this.document.location.href),s&&Object.entries(s).map(([a,l])=>o.set(a,l)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(o))}catch(o){this.throw(o)}}appView(t,i,r,s,o){try{const a=new Map([["screen_name",t],["app_name",i]]);r&&a.set("app_id",r),s&&a.set("app_version",s),o&&a.set("app_installer_id",o),this.gtag("event","screen_view",this.toKeyValue(a))}catch(a){this.throw(a)}}set(...t){try{this._gtag("set",...t)}catch(i){this.throw(i)}}exception(t,i){try{const r=new Map;t&&r.set("description",t),i&&r.set("fatal",i),this.toKeyValue(r)?this.gtag("event","exception",this.toKeyValue(r)):this.gtag("event","exception")}catch(r){this.throw(r)}}}return n.\u0275fac=function(t){return new(t||n)(I(Jm),I(rt),I(hF))},n.\u0275prov=ae({factory:function(){return new n(I(Jm),I(rt),I(hF))},token:n,providedIn:"root"}),n})();const bDe={provide:Cf,multi:!0,useFactory:function(n,e,t){return()=>gl(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(wo()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(wo()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));t||wo()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),n.uri=n.uri||`https://www.googletagmanager.com/gtag/js?id=${n.trackingCode}`,n.initCommands=null!==(i=null==n?void 0:n.initCommands)&&void 0!==i?i:[],n.initCommands.find(o=>"config"===o.command)||n.initCommands.unshift({command:"config",values:[n.trackingCode]}),n.initCommands.find(o=>"js"===o.command)||n.initCommands.unshift({command:"js",values:[new Date]});for(const o of n.initCommands)e(o.command,...o.values);const r=t.createElement("script");r.async=!0,r.src=n.uri,n.nonce&&r.setAttribute("nonce",n.nonce),t.getElementsByTagName("head")[0].appendChild(r)})},deps:[Jm,hF,rt]};new _e("ngx-google-analytics-routing-settings",{factory:()=>({})});let fF=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:Jm,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},bDe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[]]}),n})(),o0=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new Hg(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),SDe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new Ie,this.token=r,this.subscriptions.add(t.consentChange.subscribe(s=>this.toggleGoogleAnalytics("rescinded"===s)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return n.\u0275fac=function(t){return new(t||n)(I(o0),I(dF),I(Jm))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const MDe=new _e("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),rq=[o0,SDe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new Ie;try{this.storage=localStorage}catch(r){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(r=>this.saveConsent(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,i;const r=null===(i=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===i?void 0:i.call(t,this.key);if(null==r)return"not-set";const s=r.trim().toLowerCase();switch(s){case"given":case"rescinded":return s;default:return"not-set"}}saveConsent(t){var i,r;null===(r=null===(i=this.storage)||void 0===i?void 0:i.setItem)||void 0===r||r.call(i,this.key,t)}}return n.\u0275fac=function(t){return new(t||n)(I(o0),I(MDe))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})()];function TDe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let DDe=(()=>{class n{static forRoot(t){const{providers:i=[]}=fF.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[TDe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[...rq,{provide:Cf,multi:!0,useFactory:()=>()=>{},deps:rq}],imports:[[fF]]}),n})();const ODe=["bodyCanvas"];let IDe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Pe,this.nodeDrag=new Pe,this.nodeClick=new Pe,this.nodeHoverStart=new Pe,this.nodeHoverStop=new Pe,this.initialized=new Pe,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return gl(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new VEe({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))],this.initialized.emit()})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&ni(ODe,5,nt),2&t){let r;Mt(r=xt())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&et(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),PDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})();function LDe(n,e){if(1&n&&(F(0,"li",4),Te(1),yn(2,"json"),N()),2&n){const t=e.$implicit;Y(1),bw(" ",t[0],": ",wn(2,2,t[1])," ")}}function BDe(n,e){if(1&n&&(F(0,"div",1),F(1,"div"),Te(2),N(),F(3,"ul",2),Ct(4,LDe,3,4,"li",3),N(),N()),2&n){const t=e.$implicit;Y(2),Ai(t[0]),Y(2),ie("ngForOf",t[1])}}let VDe=(()=>{class n{constructor(t,i){this.clsName="ccf-store-debug",this.root={},this.subscriptions=new Ie;const r=t.subscribe(s=>{this.root=s,i.markForCheck()});this.subscriptions.add(r)}get data(){return Object.entries(this.root).map(([s,o])=>[s,Object.entries(o)]).filter(([s,o])=>o.length>0)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(ph),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-store-debug"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:1,vars:1,consts:[["class","state",4,"ngFor","ngForOf"],[1,"state"],[1,"kvlist"],["class","kvpair",4,"ngFor","ngForOf"],[1,"kvpair"]],template:function(t,i){1&t&&Ct(0,BDe,5,2,"div",0),2&t&&ie("ngForOf",i.data)},directives:[Xl],pipes:[T3],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),n})(),jDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})();new _e("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const GDe=["carouselContainer"],WDe=["itemlist"],qDe=["itemcontainer"];function YDe(n,e){if(1&n&&(F(0,"div",14),Te(1),N()),2&n){const t=bt().$implicit,i=bt();Y(1),Ai(i.occurenceData[t.id]||0)}}function XDe(n,e){if(1&n){const t=Lr();F(0,"div",9),ye("click",function(){const s=Vn(t).$implicit;return bt().selectOrgan(s)}),et(1,"mat-icon",10),F(2,"div",11),F(3,"div",12),Te(4),N(),Ct(5,YDe,2,1,"div",13),N(),N()}if(2&n){const t=e.$implicit,i=bt();at("disabled",t.disabled)("selected",i.isSelected(t)),Y(1),Yy("svgIcon",t.src),Y(3),Ai(t.name),Y(1),ie("ngIf",void 0!==t.numResults)}}const a0=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_54449"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/FMA_7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/FMA_7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let oq=(()=>{class n{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=a0,this.selectedOrgans=[],this.organsChanged=new Pe,this.onLeft=!0,this.onRight=!1,this.step=72}set occurenceData(t){this._occurenceData=t}get occurenceData(){return this._occurenceData}ngAfterViewInit(){const{carouselContainer:t}=this;this.sensor=new vG.ResizeSensor(t.nativeElement,()=>{this.set()})}ngOnChanges(t){"organList"in t&&this.set()}ngOnDestroy(){this.sensor.detach()}get error(){return!(!this.displayErrors||0===this.selectedOrgans.length)}shift(t){const{itemList:i}=this;let r=parseInt(i.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(r="right"===t?r-this.step:r+this.step,i.nativeElement.style.left=r+"px",this.setLeftRight(r))}scroll(t){this.timeoutHandler=setInterval(()=>{this.shift(t)},200)}stopScroll(){this.timeoutHandler&&(clearInterval(this.timeoutHandler),this.timeoutHandler=void 0)}selectOrgan(t){this.selectedOrgans=this.multiselect?this.selectedOrgans.includes(t)?this.selectedOrgans.filter(i=>t!==i):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:i,carouselContainer:r}=this,s=parseInt(t.nativeElement.style.left,10)||0;if(t.nativeElement.offsetWidth>=this.organList.length*this.step)t.nativeElement.style.left="0px",this.onLeft=!0,this.onRight=!0;else{this.setLeftRight(s);const o=this.step*Math.floor(r.nativeElement.offsetWidth/this.step)-64;i.nativeElement.style.width=`${o}px`}}setWidth(){const{itemContainer:t,carouselContainer:i}=this,r=this.step*Math.floor(i.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${r}px`}setLeftRight(t){const{itemContainer:i}=this;this.onLeft=0===t,this.onRight=t<=i.nativeElement.offsetWidth-this.organList.length*this.step}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-organ-selector"]],viewQuery:function(t,i){if(1&t&&(ni(GDe,7),ni(WDe,7),ni(qDe,7)),2&t){let r;Mt(r=xt())&&(i.carouselContainer=r.first),Mt(r=xt())&&(i.itemList=r.first),Mt(r=xt())&&(i.itemContainer=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[qn],decls:11,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],[1,"carousel-left-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item",3,"click"],[1,"carousel-icon",3,"svgIcon"],[1,"carousel-text-container"],[1,"carousel-text"],["class","num-results",4,"ngIf"],[1,"num-results"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"mat-icon",2),ye("touchstart",function(){return i.scroll("left")})("touchend",function(){return i.stopScroll()})("click",function(){return i.shift("left")})("mousedown",function(){return i.scroll("left")})("mouseup",function(){return i.stopScroll()}),Te(3,"chevron_left"),N(),F(4,"div",3,4),F(6,"div",5,6),Ct(8,XDe,6,7,"div",7),N(),N(),F(9,"mat-icon",8),ye("touchstart",function(){return i.scroll("right")})("touchend",function(){return i.stopScroll()})("click",function(){return i.shift("right")})("mousedown",function(){return i.scroll("right")})("mouseup",function(){return i.stopScroll()}),Te(10,"chevron_right"),N(),N()),2&t&&(at("error",i.error),ie("matTooltipDisabled",i.multiselect),Y(2),at("disabled",i.onLeft),Y(6),ie("ngForOf",i.organList),Y(1),at("disabled",i.onRight))},directives:[cc,Rs,Xl,Is],styles:["[_nghost-%COMP%] .container[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;justify-content:space-between}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{font-size:2rem;transform:scaleY(1.2);height:2rem;width:2rem;cursor:pointer}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon.disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon.disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{text-align:left}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{overflow:hidden;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{position:relative;left:0rem;display:flex;transition:all .2s linear;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;padding:.25rem .5rem;height:100%;transition:.6s}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-icon[_ngcontent-%COMP%]{text-align:center;width:3.5rem;height:2rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:4rem;justify-content:center;text-align:center}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .carousel-text[_ngcontent-%COMP%]{display:flex;justify-content:center;font-size:.625rem;max-width:3.5rem;line-height:.8rem;min-height:1.6rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{font-size:.6875rem;line-height:1.5}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .error-message[_ngcontent-%COMP%]{color:red;height:1rem}[_nghost-%COMP%] .error-message.hidden[_ngcontent-%COMP%]{opacity:0}"]}),n})(),aq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,uc]]}),n})(),KDe=(()=>{class n{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Pe,this.visibilityToggle=new Pe,this.opacityReset=new Pe}ngOnInit(){this.prevOpacity=this.visible?0:20}reset(){this.prevOpacity=20}changeOpacity(t){this.opacity=parseInt(t,10),this.opacityChange.emit(this.opacity)}toggleVisibility(){const t=this.opacity;this.opacity=this.prevOpacity,this.prevOpacity=t,this.visibilityToggle.emit(),this.opacityChange.emit(this.opacity)}resetOpacity(){this.prevOpacity=0,this.opacityReset.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{opacity:"opacity",visible:"visible"},outputs:{opacityChange:"opacityChange",visibilityToggle:"visibilityToggle",opacityReset:"opacityReset"},decls:10,vars:17,consts:[[1,"slider-box"],[1,"slider-and-label"],[1,"slider",3,"step","min","max","value","input"],[1,"opacity-value"],[1,"icons"],["matRipple","","svgIcon","app:visibility_off",1,"visibility","icon","invisible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","","svgIcon","app:visibility_on",1,"visibility","icon","visible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"mat-slider",2),ye("input",function(s){return i.changeOpacity(s.value)}),N(),F(3,"span",3),Te(4),N(),N(),F(5,"div",4),F(6,"mat-icon",5),ye("click",function(){return i.toggleVisibility()}),N(),F(7,"mat-icon",6),ye("click",function(){return i.toggleVisibility()}),N(),F(8,"mat-icon",7),ye("click",function(){return i.resetOpacity()}),Te(9,"refresh"),N(),N(),N()),2&t&&(Y(2),at("disabled",!i.visible),ie("step",1)("min",0)("max",100)("value",i.opacity),Y(2),Os("",i.opacity,"%"),Y(2),at("hidden",i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(1),at("hidden",!i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(1),ie("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[wk,Rs,Qo],styles:["[_nghost-%COMP%]{height:2.25rem;display:flex;align-items:center;justify-content:space-between;border-radius:.1875rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%]{width:60%;display:flex;align-items:center;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .mat-slider-wrapper{top:1.125rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .opacity-value[_ngcontent-%COMP%]{width:1.5rem;margin-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%]{display:flex;cursor:pointer!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{margin-right:1rem;padding:.25rem;cursor:pointer;transition:.6s;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility[_ngcontent-%COMP%]{transition:.6s;cursor:pointer;padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),n})(),lq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,SG,ec]]}),n})();function ZDe(n,e){if(1&n&&(F(0,"div",15),et(1,"youtube-player",16),N()),2&n){const t=bt(3);Y(1),Yy("videoId",t.videoID)}}function QDe(n,e){if(1&n&&(F(0,"mat-expansion-panel",10),F(1,"mat-expansion-panel-header"),F(2,"h2",11),Te(3),N(),N(),F(4,"div",12),et(5,"markdown",13),Ct(6,ZDe,2,1,"div",14),N(),N()),2&n){const t=bt(),i=t.index,r=t.$implicit;ie("expanded",0===i),Y(3),Ai(r.title),Y(2),at("first",0===i),ie("data",r.content),Y(1),ie("ngIf",0===i)}}function JDe(n,e){if(1&n&&(F(0,"div",8),Ct(1,QDe,7,6,"mat-expansion-panel",9),N()),2&n){const t=e.$implicit;Y(1),ie("ngIf",t)}}let eOe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.videoID}ngOnInit(){const t=document.createElement("script");t.src="https://www.youtube.com/iframe_api",document.body.appendChild(t)}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return n.\u0275fac=function(t){return new(t||n)(E(Gm),E(xk))},n.\u0275cmp=Le({type:n,selectors:[["ccf-info-dialog"]],decls:10,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography","dialog-content"],["class","panel",4,"ngFor","ngForOf"],[1,"panel"],[3,"expanded",4,"ngIf"],[3,"expanded"],[1,"no-header-margin"],[1,"top-padding"],[1,"variable-binding",3,"data"],["class","video-player",4,"ngIf"],[1,"video-player"],[3,"videoId"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),F(3,"mat-icon",3),ye("click",function(){return i.close()}),Te(4,"clear"),N(),N(),F(5,"div",4),F(6,"h2",5),Te(7),N(),F(8,"mat-dialog-content",6),Ct(9,JDe,2,1,"div",7),N(),N(),N(),N()),2&t&&(Y(7),Ai(i.infoTitle),Y(2),ie("ngForOf",i.documentationContents))},directives:[Rs,xG,TG,Xl,Is,NM,LM,NG,jG],styles:[".mat-dialog-container{padding:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;text-align:left}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.5rem;margin-bottom:1rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;cursor:pointer}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:2.25rem;text-align:center}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:1rem;margin-top:0;margin-bottom:.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{margin-bottom:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .no-header-margin[_ngcontent-%COMP%]{font-weight:300;margin-bottom:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%]{display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%] markdown[_ngcontent-%COMP%] ul{margin-top:0;padding-left:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{height:50rem;min-height:10rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%]{font-weight:300}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:3rem;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%]{position:relative;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%] iframe{width:100%;height:100%;max-height:17.5rem}"]}),n})(),tOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,Ok,mxe,Z1e.forRoot({})]]}),n})(),iOe=(()=>{class n{constructor(t){this.http=t,this.markdownContent=new sr([])}readMarkdown(){this.http.get("assets/docs/README.md",{responseType:"text"}).subscribe(t=>{const i=this.parseMarkdown(t);this.markdownContent.next(i)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.split("\n\n");i.push({title:o[0],content:o.splice(1).join("\n\n")})}return i}}return n.\u0275fac=function(t){return new(t||n)(I(im))},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),rOe=(()=>{class n{constructor(t,i){this.dialog=t,this.infoButtonService=i,this.infoTitle="",this.subscriptions=new Ie,this.subscriptions.add(i.markdownContent.subscribe(r=>{r.length&&this.launchInfoDialog(r)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){this.dialog.open(eOe,{autoFocus:!1,panelClass:"modal-animated",width:"60rem",data:{title:this.infoTitle,content:t,videoID:this.videoID}})}onDialogButtonClick(){this.infoButtonService.readMarkdown()}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(iOe))},n.\u0275cmp=Le({type:n,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID"},decls:3,vars:0,consts:[[1,"info-button-wrapper"],["aria-hidden","false","aria-label","Page information",1,"ccf-info-button",3,"click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"mat-icon",1),ye("click",function(){return i.onDialogButtonClick()}),Te(2," info "),N(),N())},directives:[Rs],styles:[".info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.65rem;transition:.6s}.info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.5rem;vertical-align:sub}"]}),n})(),sOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,tOe,Pr,nU]]}),n})(),oOe=(()=>{class n{constructor(t){this.el=t}onInputChange(t){const i=this.el.nativeElement.value;this.el.nativeElement.value=i.replace(/[^0-9]*/g,""),i!==this.el.nativeElement.value&&t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(nt))},n.\u0275dir=he({type:n,selectors:[["input","ccfNumbersOnly",""]],hostBindings:function(t,i){1&t&&ye("input",function(s){return i.onInputChange(s)})}}),n})(),aOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),cq=(()=>{class n{get obj(){const t=this.findGlobalObject();return Object.defineProperties(this,{obj:{configurable:!1,writable:!1,value:t}}),t}has(t){const{obj:i}=this;return null!=i&&t in i}get(t,i){var r;const{obj:s}=this;return null!==(r=s&&s[t])&&void 0!==r?r:i}set(t,i){const{obj:r}=this;r&&(r[t]=i)}remove(t){const{obj:i}=this;i&&delete i[t]}findGlobalObject(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof window)return window;if("undefined"!=typeof self)return self;try{return new Function("return this;")()}catch(t){}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Eh=(()=>{let n=class extends qm{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Uk(),Hc(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(lr(...t),Xo(),Hc(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(lr(...t),Xo(),Hc(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri()],n.prototype,"config$",null),n=De([Ch(),gh({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();let dOe=(()=>{class n{constructor(t,i){t&&function(n,e){zc(n,"mousemove").pipe(yG(1e3),be(r=>{const{clientWidth:s,clientHeight:o}=n,{clientX:a,clientY:l}=r;return[a,l,s,o].join("_")})).subscribe(r=>e.event("webpage","mousemove",r))}(t.body,i)}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(io))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function hOe(n,e){if(1&n){const t=Lr();F(0,"button",1),ye("click",function(){return Vn(t),bt().submit(!0)}),Te(1),N()}if(2&n){const t=bt();Y(1),Os(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function fOe(n,e){if(1&n){const t=Lr();F(0,"button",1),ye("click",function(){return Vn(t),bt().submit(!1)}),Te(1,"Opt out"),N()}}let pOe=(()=>{class n{constructor(t,i,r){this.consentService=i,this.data=r,this.clsName="ccf-tracking-popup",this.container=t.nativeElement}get allowTelemetry(){return this.consentService.consent}dismiss(){this.data.preClose()}submit(t){this.consentService.setConsent(t?"given":"rescinded"),this.dismiss()}showButton(t){const{allowTelemetry:i}=this;return"not-set"===i||("opt-in"===t?"rescinded"===i:"given"===i)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(o0),E(FO))},n.\u0275cmp=Le({type:n,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,i){1&t&&(F(0,"p"),Te(1,"We log usage to improve this service."),N(),Ct(2,hOe,2,1,"button",0),Ct(3,fOe,2,0,"button",0)),2&t&&(Y(2),ie("ngIf",i.showButton("opt-in")),Y(1),ie("ngIf",i.showButton("opt-out")))},directives:[Is,$f],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:400px;color:#ffffffb3;background:#323232;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;z-index:9999}[_nghost-%COMP%] p[_ngcontent-%COMP%]{margin:24px}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin:1rem;min-width:6rem;background-color:#007cbe;display:flex;justify-content:center}"],changeDetection:0}),n})(),gOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf]]}),n})();function a1(n){return Array.isArray(n)?n.join(","):`${n}`}a1([1,110]),a1([13,83]),a1(["http://purl.obolibrary.org/obo/UBERON_0013702"]);const bOe={initialConfig:{},parse:{},rename:{}};class COe{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},bOe),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let wOe=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new COe(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=he({type:n,features:[qn]}),n})();const EOe={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var mF,SOe=Ve(815);class xOe{constructor(e){this.value=e}call(e,t){return t.subscribe(new TOe(e,this.value))}}class TOe extends Rt{constructor(e,t){super(e),this.value=t}_next(e){this.destination.next(this.value)}}class DOe{constructor(e){this.notifier=e}call(e,t){return t.subscribe(new OOe(e,this.notifier))}}class OOe extends ei{constructor(e,t){super(e),this.hasValue=!1;const i=new $r(this);this.add(i),this.innerSubscription=i;const r=oo(t,i);r!==i&&(this.add(r),this.innerSubscription=r)}_next(e){this.hasValue&&super._next(e)}notifyNext(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()}notifyComplete(){}}function pF(n){return"function"==typeof n}function hq(n){return void 0===n}function POe(n,e,t){return function(r){let s=!!n;return function(n){return"function"==typeof n}(n)&&(s=n(r)),function(n,e){return pF(n)?n(e):hq(n)?e:n}(s?e:t,r)}}function ROe(n,e){return function(i){if(function(n){return null===n||hq(n)}(n)&&i)return i;if(!Array.isArray(i))return[n];const r=i.slice();let s=0;return e>0&&(s=e),r.splice(s,0,n),r}}function l0(n){return function(t){let i=null;for(const r in n){const s=n[r],o=t[r],a=pF(s)?s(o):s;a!==o&&(i||(i=Object.assign({},t)),i[r]=a)}return i||t}}const Sh={production:!0,disableDbWorker:!0,dbOptions:{ccfOwlUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf.owl",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(mF=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==mF?mF:""},skipUnsavedChangesConfirmation:!1,googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};let Ui=class extends qm{constructor(e){super(),this.globalConfig=e,this.user$=this.state$.pipe(lr("user")),this.registrationStarted$=this.state$.pipe(zk("registrationStarted")),this.useCancelRegistrationCallback$=this.state$.pipe(lr("useCancelRegistrationCallback")),this.registrationCallbackSet$=this.state$.pipe(lr("registrationCallbackSet"))}get skipConfirmation$(){return this.state$.pipe(zk("skipConfirmation"))}get globalSkipConfirmation$(){return this.globalConfig.getOption("skipUnsavedChangesConfirmation").pipe(be(e=>null!=e?e:Sh.skipUnsavedChangesConfirmation),Xo())}get hasChanges$(){return this.state$.pipe(zk("hasChanges"))}ngxsOnInit(){super.ngxsOnInit(),this.globalConfig.config$.pipe(_i(1),Di(e=>this.setState(l0({registrationCallbackSet:!!e.register,useCancelRegistrationCallback:!!e.cancelRegistration,user:POe(!!e.user,e.user)})))).subscribe(),this.initSkipConfirmationListeners()}cancelRegistration(){const{globalConfig:{snapshot:{cancelRegistration:e}},snapshot:{useCancelRegistrationCallback:t,skipConfirmation:i}}=this;t&&(i||confirm("Changes you made may not be saved."))&&(null==e||e())}setUseCancelRegistrationCallback(e){this.ctx.patchState({useCancelRegistrationCallback:e})}setUserName(e){this.ctx.setState(l0({user:l0(e)}))}registrationStarted(){this.ctx.setState(l0({registrationStarted:!0}))}setHasChanges(){const{snapshot:{registrationStarted:e,hasChanges:t}}=this;e&&!t&&this.ctx.patchState({hasChanges:!0})}clearHasChanges(){this.ctx.patchState({hasChanges:!1})}initSkipConfirmationListeners(){const e=i=>this.patchState({skipConfirmation:i});this.globalSkipConfirmation$.pipe(Tn(i=>i)).subscribe(e),this.hasChanges$.pipe(jM(this.globalSkipConfirmation$),be(([i,r])=>r||!i),Xo()).subscribe(e);const t=i=>(i.preventDefault(),i.returnValue="Changes you made may not be saved.",i.returnValue);this.skipConfirmation$.subscribe(i=>{i?removeEventListener("beforeunload",t):addEventListener("beforeunload",t)})}};Ui.\u0275fac=function(e){return new(e||Ui)(I(Eh))},Ui.\u0275prov=ae({token:Ui,factory:Ui.\u0275fac}),De([ri()],Ui.prototype,"skipConfirmation$",null),De([ri()],Ui.prototype,"globalSkipConfirmation$",null),De([ri()],Ui.prototype,"hasChanges$",null),De([Xt()],Ui.prototype,"setUseCancelRegistrationCallback",null),De([Xt()],Ui.prototype,"setUserName",null),De([Xt()],Ui.prototype,"registrationStarted",null),De([Xt()],Ui.prototype,"setHasChanges",null),De([Xt()],Ui.prototype,"clearHasChanges",null),Ui=De([Ch(),gh({name:"page",defaults:{user:{firstName:"",lastName:""},registrationStarted:!1,useCancelRegistrationCallback:!1,registrationCallbackSet:!1,skipConfirmation:!0,hasChanges:!1}})],Ui);let dc=class extends qm{constructor(e,t){super(),this.globals=e,this.globalConfig=t}ngxsOnInit(){super.ngxsOnInit(),this.getSourceDB().subscribe(e=>{this.setState(e),Sh.production||this.globals.set("db",e)})}getSourceDB(){return this.globalConfig.getOption("baseHref").pipe(be(e=>(null!=e?e:"")+"assets/reference-organ-data.json"),Ir(e=>li(fetch(e)).pipe(Ir(t=>t.json()),Sa(()=>Ql))))}normalizePlacement(e){const i=this.snapshot.placementPatches[null==e?void 0:e.target];if(i){const r=function(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(Jv),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}(new Lt(Lt.IDENTITY),i),s={x:e.x_translation,y:e.y_translation,z:e.z_translation},[o,a,l]=r.transformAsPoint([s.x,s.y,s.z],[]),c=Object.assign(Object.assign({},e),{target:i.target});return c.x_translation=o,c.y_translation=a,c.z_translation=l,c}return e}getReferenceOrganIri(e,t,i,r){const s=this.snapshot;"KIDNEY"!==e.toUpperCase()&&(i=""),(null==r?void 0:r.sex)&&(t=r.sex);const o=[e,t,i||(null==r?void 0:r.side)].join("|").toUpperCase(),a=Object.keys(s.organIRILookup).find(l=>l.toUpperCase().endsWith(o));return a?s.organIRILookup[a]:void 0}getOrganData(e){var t,i,r;const o=this.snapshot.organSpatialEntities[e];if(!o)return;const a=null!==(t=o.label)&&void 0!==t?t:"",l=a0.find(c=>a.endsWith(c.organ));return l?{organ:l,sex:null===(i=o.sex)||void 0===i?void 0:i.toLowerCase(),side:null===(r=o.side)||void 0===r?void 0:r.toLowerCase()}:void 0}};dc.\u0275fac=function(e){return new(e||dc)(I(cq),I(Eh))},dc.\u0275prov=ae({token:dc,factory:dc.\u0275fac}),dc=De([Ch(),gh({name:"reference",defaults:{organIRILookup:{},organSpatialEntities:{},anatomicalStructures:{},extractionSets:{},sceneNodeLookup:{},simpleSceneNodeLookup:{},placementPatches:{}}})],dc);const _F=a0;let si=class extends qm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.id$=this.state$.pipe(lr("id")),this.blockSize$=this.state$.pipe(lr("blockSize")),this.rotation$=this.state$.pipe(lr("rotation")),this.position$=this.state$.pipe(lr("position")),this.slicesConfig$=this.state$.pipe(lr("slicesConfig")),this.viewType$=this.state$.pipe(lr("viewType")),this.viewSide$=this.state$.pipe(lr("viewSide")),this.organ$=this.state$.pipe(lr("organ")),this.organIri$=this.state$.pipe(lr("organIri")),this.organDimensions$=this.state$.pipe(lr("organDimensions")),this.sex$=this.state$.pipe(lr("sex")),this.side$=this.state$.pipe(lr("side")),this.showPrevious$=this.state$.pipe(lr("showPrevious")),this.extractionSites$=this.state$.pipe(lr("extractionSites")),this.anatomicalStructures$=this.state$.pipe(lr("anatomicalStructures")),this.extractionSets$=this.state$.pipe(lr("extractionSets"))}get modelChanged$(){const e=["viewType","viewSide","showPrevious"],t=Object.keys(this.initialState).filter(i=>!e.includes(i));return this.state$.pipe(yG(0,void 0,{leading:!1,trailing:!0}),Xo((i,r)=>{for(const s of t)if(i[s]!==r[s])return!1;return!0}),e=>e.lift(new xOe(void 0)))}ngxsOnInit(){super.ngxsOnInit(),this.referenceData=this.injector.get(dc),this.page=this.injector.get(Ui),this.globalConfig.getOption("organ").pipe(Uk(),Ir(e=>{var t,i;const r=e.name.toLowerCase(),s=e.side;let a=this.idMatches(e.ontologyId,s);return a||(a=this.nameMatches(r,s)),a?(this.ctx.patchState({organ:a,sex:null===(t=e.sex)||void 0===t?void 0:t.toLowerCase(),side:null===(i=null==a?void 0:a.side)||void 0===i?void 0:i.toLowerCase()}),this.referenceData.state$.pipe($g(100),_i(1),bk(200),Di(()=>this.onOrganIriChange()))):Ql})).subscribe(),this.modelChanged$.pipe(function(n){return e=>e.lift(new DOe(n))}(this.page.registrationStarted$.pipe(Tn(e=>e),bk(5)))).subscribe(()=>this.page.setHasChanges())}idMatches(e,t){return a0.find(i=>!(!e||i.id!==e||i.side&&i.side!==t))}nameMatches(e,t){return a0.find(i=>i.side?i.organ.toLowerCase()===e&&i.side===t:i.organ.toLowerCase()===e)}setBlockSize(e){this.ctx.patchState({blockSize:e})}setRotation(e){this.ctx.patchState({rotation:e})}setPosition(e){this.ctx.patchState({position:e})}setSlicesConfig(e){this.ctx.patchState({slicesConfig:e})}setViewType(e){this.ctx.patchState({viewType:e})}setViewSide(e){this.ctx.patchState({viewSide:e})}get defaultPosition(){const e=this.snapshot.organDimensions;return{x:e.x+2*this.snapshot.blockSize.x,y:e.y/2,z:e.z/2}}setOrgan(e){this.ctx.patchState({organ:e}),e.side&&this.ctx.patchState({side:e.side}),this.onOrganIriChange()}setSex(e){this.ctx.patchState({sex:e}),this.onOrganIriChange()}setSide(e){this.ctx.patchState({side:e}),this.onOrganIriChange()}setShowPrevious(e){this.ctx.patchState({showPrevious:e})}setExtractionSites(e){this.ctx.patchState({extractionSites:e})}setAnatomicalStructures(e){this.ctx.patchState({anatomicalStructures:e})}setExtractionSets(e){this.ctx.patchState({extractionSets:e})}toggleRegistrationBlocksVisibility(e,t){if(this.setShowPrevious(e),e){const i=t.map(r=>{var s;return Object.assign(Object.assign({},r),{opacity:Math.min(20,null!==(s=r.opacity)&&void 0!==s?s:20)})});this.setAnatomicalStructures(i)}else this.setAnatomicalStructures(t)}onOrganIriChange(){var e,t,i,r,s;const o=this.referenceData.getReferenceOrganIri((null===(e=this.snapshot.organ)||void 0===e?void 0:e.organ)||"",this.snapshot.sex,this.snapshot.side,this.snapshot.organ),a={x:100,y:100,z:100};if((null===(t=this.snapshot.organ)||void 0===t?void 0:t.sex)&&this.ctx.patchState({sex:null===(i=this.snapshot.organ)||void 0===i?void 0:i.sex}),o){const l=this.referenceData.snapshot,c={};for(const p of l.anatomicalStructures[o]||[]){const g=null!==(r=p.representation_of)&&void 0!==r?r:p["@id"];c[g]||(c[g]={id:null!==(s=p.representation_of)&&void 0!==s?s:p["@id"],name:p.label,visible:!0,opacity:20,tooltip:p.comment})}this.ctx.patchState({anatomicalStructures:Object.values(c)});const d=(l.extractionSets[o]||[]).map(p=>({name:p.label,sites:(0,SOe.sortBy)(p.extractionSites.map(g=>({id:g["@id"],name:g.label,visible:!1,opacity:0,tooltip:g.comment})),"name")}));this.ctx.patchState({extractionSets:d}),this.ctx.patchState({extractionSites:d.length>0?d[0].sites:[]});const f=l.organSpatialEntities[o];a.x=f.x_dimension,a.y=f.y_dimension,a.z=f.z_dimension}this.ctx.patchState({organIri:o,organDimensions:a}),this.ctx.patchState({position:this.defaultPosition})}};si.\u0275fac=function(e){return new(e||si)(I(Tt),I(Eh))},si.\u0275prov=ae({token:si,factory:si.\u0275fac}),De([ri()],si.prototype,"modelChanged$",null),De([Xt()],si.prototype,"setBlockSize",null),De([Xt()],si.prototype,"setRotation",null),De([Xt()],si.prototype,"setPosition",null),De([Xt()],si.prototype,"setSlicesConfig",null),De([Xt()],si.prototype,"setViewType",null),De([Xt()],si.prototype,"setViewSide",null),De([ri()],si.prototype,"defaultPosition",null),De([Xt()],si.prototype,"setOrgan",null),De([Xt()],si.prototype,"setSex",null),De([Xt()],si.prototype,"setSide",null),De([Xt()],si.prototype,"setShowPrevious",null),De([Xt()],si.prototype,"setExtractionSites",null),De([Xt()],si.prototype,"setAnatomicalStructures",null),De([Xt()],si.prototype,"setExtractionSets",null),si=De([Ch(),gh({name:"model",defaults:{id:"",label:"",organ:{src:"",name:""},organIri:"",organDimensions:{x:90,y:90,z:90},sex:"male",side:"left",blockSize:{x:10,y:10,z:10},rotation:{x:0,y:0,z:0},position:{x:0,y:0,z:0},slicesConfig:{thickness:NaN,numSlices:NaN},viewType:"register",viewSide:"anterior",showPrevious:!1,extractionSites:[],anatomicalStructures:[],extractionSets:[]}})],si);const mq=new _e("Default theme class");let yF=(()=>{class n{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(t){const{injector:i,location:r}=t;i.get(n).initialize(r,i)}getTheme(){return this.theme}setTheme(t){t!==this.theme&&(this.applyThemeClass(this.theme,"remove"),this.applyThemeClass(t),this.theme=t)}resetTheme(){this.setTheme(this.defaultTheme)}initialize(t,i){this.element=t,this.injector=i,this.applyThemeClass(this.getTheme())}applyThemeClass(t,i="add"){var r;const{element:s,injector:o}=this;if(!t||!s||!o)return;const a=o.get(Lc,null);if(!a)return;const l=s.nativeElement,c=null===(r=o.get(om,null))||void 0===r?void 0:r.getContainerElement(),d="add"===i?"addClass":"removeClass";a[d](l,t),c&&a[d](c,t)}}return n.\u0275fac=function(t){return new(t||n)(I(mq,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),FOe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-name-input",this.firstNameValidator=new vh("",[p$.required]),this.lastNameValidator=new vh("",[p$.required]),this._name={firstName:"",lastName:""},this.nameChange=new Pe}get name(){return this._name}set name(t){this._name=t,this.firstNameValidator.setValue((null==t?void 0:t.firstName)||""),this.lastNameValidator.setValue((null==t?void 0:t.lastName)||"")}updateName(t,i){const r=t.target;this.name=Object.assign(Object.assign({},this.name),{[i]:r.value}),this.ga.event("name_updated","name_input",i),this.nameChange.emit(this.name)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-name-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{name:"name"},outputs:{nameChange:"nameChange"},decls:8,vars:2,consts:[[1,"field"],[1,"text","label"],["matInput","","matTooltip","Add your first name.",1,"input",3,"value","input"],["matInput","","matTooltip","Add your last name.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"mat-form-field",0),F(1,"mat-label",1),Te(2,"First Name "),N(),F(3,"input",2),ye("input",function(s){return i.updateName(s,"firstName")}),N(),N(),F(4,"mat-form-field",0),F(5,"mat-label",1),Te(6,"Last Name "),N(),F(7,"input",3),ye("input",function(s){return i.updateName(s,"lastName")}),N(),N()),2&t&&(Y(3),ie("value",i.firstNameValidator.value),Y(4),ie("value",i.lastNameValidator.value))},directives:[tm,Bf,Hb,cc],styles:["[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:left;width:100%}"],changeDetection:0}),n})();const NOe=["thumbContainer"],LOe=["toggleBar"],BOe=["input"],VOe=function(n){return{enterDuration:n}},jOe=["*"],UOe=new _e("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let zOe=0;const HOe={provide:Ao,useExisting:T(()=>_q),multi:!0};class $Oe{constructor(e,t){this.source=e,this.checked=t}}const GOe=Nf(kf(Ff(em(class{constructor(n){this._elementRef=n}}))));let _q=(()=>{class n extends GOe{constructor(t,i,r,s,o,a){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this.defaults=o,this._onChange=l=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++zOe,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new Pe,this.toggleChange=new Pe,this.tabIndex=parseInt(s)||0,this.color=this.defaultColor=o.color||"accent",this._noopAnimations="NoopAnimations"===a}get required(){return this._required}set required(t){this._required=Dt(t)}get checked(){return this._checked}set checked(t){this._checked=Dt(t),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new $Oe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Un),fs("tabindex"),E(UOe),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(ni(NOe,5),ni(LOe,5),ni(BOe,5)),2&t){let r;Mt(r=xt())&&(i._thumbEl=r.first),Mt(r=xt())&&(i._thumbBarEl=r.first),Mt(r=xt())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(sl("id",i.id),en("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),at("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[At([HOe]),ht],ngContentSelectors:jOe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"div",2,3),F(4,"input",4,5),ye("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),N(),F(6,"div",6,7),et(8,"div",8),F(9,"div",9),et(10,"div",10),N(),N(),N(),F(11,"span",11,12),ye("cdkObserveContent",function(){return i._onLabelTextChange()}),F(13,"span",13),Te(14,"\xa0"),N(),In(15),N(),N()),2&t){const r=Ys(1),s=Ys(12);en("for",i.inputId),Y(2),at("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),Y(2),ie("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),en("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),Y(5),ie("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Fg(18,VOe,i._noopAnimations?0:150))}},directives:[Qo,kD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),yq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),vq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[yq,ec,Nn,_E],yq,Nn]}),n})(),vF=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-labeled-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new Pe}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.ga.event("slide_toggle_toggled","slide_toggle",this.value),this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-labeled-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{labels:"labels",value:"value",disabled:"disabled"},outputs:{valueChange:"valueChange"},decls:6,vars:12,consts:[[1,"slide-label",3,"click"],[1,"slider",3,"disabled","checked","change"],["toggle",""]],template:function(t,i){if(1&t){const r=Lr();F(0,"span",0),ye("click",function(){Vn(r);const o=Ys(3);return i.left||o.toggle(),i.updateToggle(!0)}),Te(1),N(),F(2,"mat-slide-toggle",1,2),ye("change",function(o){return i.updateToggle(!o.checked)}),N(),F(4,"span",0),ye("click",function(){Vn(r);const o=Ys(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Te(5),N()}2&t&&(at("disabled",i.disabled)("highlighted",i.left),Y(1),Ai(i.labels[0]),Y(1),ie("disabled",i.disabled)("checked",!i.left),Y(2),at("disabled",i.disabled)("highlighted",!i.left),Y(1),Ai(i.labels[1]))},directives:[_q],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%;cursor:not-allowed}"],changeDetection:0}),n})();const YOe=function(){return["Male","Female"]},XOe=function(n){return[n]};let KOe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.dialogRef=r,this.clsName="ccf-registration-content",this.sexByLabel$=this.model.sex$.pipe(be(s=>"female"===s?"Female":"Male")),this.organList=_F,r.disableClose=!0}setSexFromLabel(t){this.currentSex=t,this.sexSelected=!0}checkNameValid(t){this.nameValid=t.firstName.length>0&&t.lastName.length>0}organSelect(t){this.currentOrgan=t,this.organSelected=!0}registerButtonClick(t){t&&t.preventDefault(),this.organSelected&&this.nameValid&&this.closeDialog()}closeDialog(){this.model.setSex("Female"===this.currentSex?"female":"male"),this.model.setOrgan(this.currentOrgan),this.dialogRef.close(!0),this.page.registrationStarted()}}return n.\u0275fac=function(t){return new(t||n)(E(Ui),E(si),E(Gm))},n.\u0275cmp=Le({type:n,selectors:[["ccf-registration-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:17,vars:17,consts:[[1,"modal"],["mat-dialog-content",""],[3,"name","nameChange"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"labels","value","valueChange"],[1,"selector-label"],[1,"selector-container"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],["mat-button","",1,"registration-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"ccf-name-input",2),ye("nameChange",function(s){return i.page.setUserName(s),i.checkNameValid(s)}),yn(3,"async"),N(),F(4,"div",3),F(5,"div",4),Te(6,"Donor Sex:"),N(),F(7,"ccf-labeled-slide-toggle",5),ye("valueChange",function(s){return i.setSexFromLabel(s)}),yn(8,"async"),N(),N(),F(9,"div",6),Te(10,"Select an organ"),N(),F(11,"div",7),F(12,"ccf-organ-selector",8,9),ye("organsChanged",function(s){return i.organSelect(s[0])}),yn(14,"async"),N(),N(),N(),F(15,"button",10),ye("click",function(s){return i.registerButtonClick(s)}),Te(16,"START REGISTRATION"),N(),N()),2&t&&(Y(2),ie("name",wn(3,8,i.page.user$)),Y(5),ie("labels",lv(14,YOe))("value",wn(8,10,i.sexByLabel$)),Y(5),ie("organList",i.organList)("selectedOrgans",Fg(15,XOe,wn(14,12,i.model.organ$))),Y(3),at("disabled",!i.organSelected||!i.nameValid),ie("matTooltip",i.organSelected&&i.nameValid?"":"Required: Enter first and last name, and select an organ"))},directives:[FOe,cc,vF,oq,$f],pipes:[zu],styles:[".modal[_ngcontent-%COMP%]{padding:1rem;border-radius:4px;width:35rem;height:22rem}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}.modal[_ngcontent-%COMP%] .selector-label[_ngcontent-%COMP%]{font-weight:600;height:3rem;line-height:3rem}.modal[_ngcontent-%COMP%] .selector-container[_ngcontent-%COMP%]{height:4rem;width:31rem;margin:0 auto}.modal[_ngcontent-%COMP%] .registration-button[_ngcontent-%COMP%]{display:block;margin:2rem auto 0}"],changeDetection:0}),n})(),ZOe=(()=>{class n{constructor(t,i,r){this.dialog=t,this.page=i,this.model=r,this.clsName="ccf-registration-modal"}ngOnInit(){or([this.page.user$,this.model.organ$]).pipe($g(500),_i(1),Di(([t,i])=>{""!==t.firstName&&""!==t.lastName&&""!==i.src||this.openDialog()})).subscribe()}openDialog(){this.dialog.open(KOe,{autoFocus:!1})}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(Ui),E(si))},n.\u0275cmp=Le({type:n,selectors:[["ccf-registration-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:0,vars:0,template:function(t,i){},encapsulation:2}),n})();function QOe(n,e){1&n&&function(n,e,t){ff(n,e,t),pf()}(0)}function JOe(n,e){if(1&n){const t=Lr();F(0,"div",4),ye("click",function(){return Vn(t),bt().page.cancelRegistration()}),F(1,"mat-icon",5),Te(2,"chevron_left"),N(),F(3,"span",6),Te(4,"BACK"),N(),N()}}function eIe(n,e){1&n&&(F(0,"a",7),et(1,"mat-icon",8),N())}let tIe=(()=>{class n{constructor(t){this.page=t,this.clsName="ccf-header"}}return n.\u0275fac=function(t){return new(t||n)(E(Ui))},n.\u0275cmp=Le({type:n,selectors:[["ccf-header"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:7,vars:5,consts:[[4,"ngIf","ngIfThen","ngIfElse"],["backButton",""],["logo",""],[1,"filler"],["rel","noreferrer noopener",1,"link","home",3,"click"],[1,"icon","backbutton"],[1,"text"],["href","https://ingest.hubmapconsortium.org/","rel","noreferrer noopener","matTooltip","Human BioMolecular Atlas Project","matTooltipPosition","right",1,"link","hubmap"],["svgIcon","app:logo",1,"icon","logo"]],template:function(t,i){if(1&t&&(Ct(0,QOe,1,0,"ng-container",0),yn(1,"async"),Ct(2,JOe,5,0,"ng-template",null,1,Rw),Ct(4,eIe,2,0,"ng-template",null,2,Rw),et(6,"div",3)),2&t){const r=Ys(3),s=Ys(5);ie("ngIf",wn(1,3,i.page.useCancelRegistrationCallback$))("ngIfThen",r)("ngIfElse",s)}},directives:[Is,Rs,cc],pipes:[zu],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid}[_nghost-%COMP%] .text[_ngcontent-%COMP%]{padding:.25rem 0;height:2rem;display:flex;align-items:center;font-weight:lighter;font-size:1.5rem}[_nghost-%COMP%] .link[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;text-decoration:none;padding:.25rem 0}[_nghost-%COMP%] .home[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{transition:color .6s}[_nghost-%COMP%] .home[_ngcontent-%COMP%] .backbutton[_ngcontent-%COMP%]{font-size:2.25rem;width:2.25rem;height:2.25rem}[_nghost-%COMP%] .hubmap[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;margin-right:1rem}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}"],changeDetection:0}),n})();const bq={isolated:!0},Cq=new _e("Message service configuration",{providedIn:"root",factory:()=>bq});let nIe=(()=>{class n{constructor(t,i,r){this.source=t,this.channel=i,this.messages=r}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Tn(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Tn(i=>i.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Tn(i=>t.includes(i.source)))}nextMessageId(){return n.counter++}}return n.counter=0,n})();const c0=(()=>{class n{constructor(t,i){this.config=t,this.parent=i,this.channel=new we,this.messages=t.isolated||!i?this.channel.asObservable():li([this.channel,i.messages.pipe(_U(()=>!this.channel.closed))]).pipe(ao())}ngOnDestroy(){this.channel.complete()}connect(t){return new nIe(t,this.channel,this.messages)}}return n.\u0275fac=function(t){return new(t||n)(I(Cq),I(n,12))},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),iIe=["*"];let l1=(()=>{class n{constructor(t,i){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new Ie;const r=t.connect(this).getMessages();this.subscriptions.add(r.subscribe(s=>{this.handleMessage(s)&&i.markForCheck()}))}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){switch(t.payload.type){case"drawer-containers-changed":return this.drawers=t.payload.drawers,this.updateFaded(),!0;case"drawer-initialized":return this.animationsEnabled=!0,!0;case"drawer-toggled":{const i=t.source.position,{opened:r,width:s,margin:o}=t.payload;return this.updateMargin(i,r,s,o),this.updateFaded(),!0}default:return!1}}updateMargin(t,i,r,s){const o=i?r+s:s;"start"===t?this.leftMargin=o:this.rightMargin=o}updateFaded(){const[t,i]=this.drawers;this.faded=!!((null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==i?void 0:i.opened)&&(null==i?void 0:i.expanded))}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,i){2&t&&(Sg("@fadeInOut",i.faded),Fn(i.className),gf("margin-left",i.leftMargin,"px")("margin-right",i.rightMargin,"px"),at("cff-drawer-content-animations",i.animationsEnabled))},ngContentSelectors:iIe,decls:1,vars:0,template:function(t,i){1&t&&(Dr(),In(0))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;z-index:2;overflow:auto}.cff-drawer-content-animations[_nghost-%COMP%]{transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:margin-left,margin-right}"],data:{animation:[Jl("fadeInOut",[br("false",Kn({opacity:1})),br("true",Kn({opacity:0})),Qs("false <=> true",Mo("1s"))])]},changeDetection:0}),n})();const rIe=["*"],bF={params:{width:0,margin:0,margin2:0}};class sIe{constructor(){this.initialized=!1,this.deferred=new Promise(e=>{this.resolve=e})}set(){this.initialized=!0,this.resolve()}wait(){return gl(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let CF=(()=>{class n{constructor(t,i,r){this.element=r,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Pe(!0),this.expandedChange=new Pe(!0),this.stateChange=new Pe(!0),this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._measuredWidth=0,this.width=0,this._measuredMargin=0,this.margin2=0,this.initialized=new sIe,this.subscriptions=new Ie,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(s=>{this.handleMessage(s)&&i.markForCheck()}))}get classEnd(){return"end"===this.position}get position(){return this._position}set position(t){this._position=t||"start"}get opened(){return this._opened}set opened(t){this.toggle(Dt(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(Dt(t))}get expandedStateObj(){return{value:this.expandedState2,params:{width:this.width,margin:this.measuredMargin,margin2:this.margin2}}}get measuredWidth(){if(this._measuredWidth>0)return this._measuredWidth;const t=this.element.nativeElement;if(!t)return 0;const i=t.getBoundingClientRect(),r=i.right-i.left;return 0===r?0:(this._measuredWidth=r,r)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const s=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),o=Number(s.slice(0,-2));return this._measuredMargin=o,o}ngAfterViewInit(){this.initialized.set(),setTimeout(()=>this.channel.sendMessage({type:"drawer-initialized"}))}ngOnDestroy(){this.subscriptions.unsubscribe()}open(){this.toggle(!0)}close(){this.toggle(!1)}toggle(t=!this.opened){this.opened!==t&&(t?this.openedState=this.initialized.valueOf()?"open":"open-instant":(this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._expanded=!1),this._opened=t,this.sendToggle())}openExpanded(){this.toggleExpanded(!0)}closeExpanded(){this.toggleExpanded(!1)}toggleExpanded(t=!this.expanded){this.expanded!==t&&(t?this.expandedState=this.initialized.valueOf()?"open":"open-instant":(this.expandedState="closed",this.expandedState2="collapsed"),this._expanded=t,this.sendToggle())}closeOpenDone(){this.openedChange.emit(this.opened)}expandCollapseDone(){this.expandedChange.emit(this.expanded)}sendToggle(){return gl(this,void 0,void 0,function*(){yield this.initialized.wait(),this.channel.sendMessage({type:"drawer-toggled",opened:this.opened,expanded:this.expanded,width:this.measuredWidth,margin:this.measuredMargin}),this.stateChange.emit()})}handleMessage(t){switch(t.payload.type){case"drawer-toggled":return this.syncExpanded(t.source),!0;default:return!1}}syncExpanded(t){(this.expanded||t.expanded)&&(this.expanded&&t.expanded?this.expandedState2=t.expandedState2="half":this.expanded?t.opened?(this.expandedState2="extended",this.width=t.measuredWidth+t.measuredMargin):(this.expandedState2="full",this.margin2=t.measuredMargin):this.opened?(t.expandedState2="extended",t.width=this.measuredWidth+this.measuredMargin):(t.expandedState2="full",t.margin2=this.measuredMargin))}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un),E(nt))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,i){1&t&&qy("@openClose.done",function(){return i.closeOpenDone()})("@expandCollapse.done",function(){return i.expandCollapseDone()}),2&t&&(Sg("@openClose",i.openedState)("@expandCollapse",i.expandedStateObj),Fn(i.className),at("ccf-drawer-end",i.classEnd)("ccf-drawer-opened",i.opened)("ccf-drawer-expanded",i.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:rIe,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,i){1&t&&(Dr(),F(0,"div",0),In(1),N())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%)}.ccf-drawer-end[_nghost-%COMP%]{right:0;transform:translate(100%)}[_nghost-%COMP%] .cff-drawer-inner-container[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}"],data:{animation:[Jl("openClose",[br("open, open-instant",Kn({transform:"none"})),br("closed",Kn({})),Qs("closed => open-instant",Mo(0)),Qs("closed <=> open, open-instant => closed",Mo(".5s ease-in-out"))]),Jl("expandCollapse",[br("collapsed",Kn({})),br("half",Kn({width:"calc(50% - {{ margin }}px)"}),bF),br("extended",Kn({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),bF),br("full",Kn({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),bF),Qs("* <=> *",Mo(".5s ease-in-out"))])]},changeDetection:0}),n})();function oIe(n,e){1&n&&(F(0,"ccf-drawer-content"),In(1,2),N())}const aIe=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],lIe=["ccf-drawer","ccf-drawer-content","*"];function wq(n){throw new Error(`Multiple drawers in position ${n}`)}let cIe=(()=>{class n{constructor(t,i){this.cdr=i,this.className="ccf-drawer-container",this.subscriptions=new Ie,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(r=>{this.handleMessage(r)&&i.markForCheck()}))}get content(){var t;return null!==(t=this.content1.first)&&void 0!==t?t:this.content2.first}get hasWrappedContent(){return 0!==this.content1.length}ngAfterViewInit(){this.drawers.changes.pipe(ns(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(ns(null)).subscribe(()=>{this.channel.sendMessage({type:"content-container-changed",content:this.content}),this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return!0}validateDrawers(){const t=this.drawers.toArray(),i=t.filter(s=>"start"===s.position),r=t.filter(s=>"end"===s.position);return i.length>1&&wq("start"),r.length>1&&wq("end"),[i[0],r[0]]}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-container"]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,CF,5),Fi(r,l1,5)),2&t){let s;Mt(s=xt())&&(i.drawers=s),Mt(s=xt())&&(i.content1=s)}},viewQuery:function(t,i){if(1&t&&ni(l1,5),2&t){let r;Mt(r=xt())&&(i.content2=r)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.className)},exportAs:["ccfDrawerContainer"],features:[At([c0])],ngContentSelectors:lIe,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&(Dr(aIe),In(0),In(1,1),Ct(2,oIe,2,0,"ccf-drawer-content",0)),2&t&&(Y(2),ie("ngIf",!i.hasWrappedContent))},directives:[Is,l1],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),n})();var c1,uIe=Ve(457),dIe=new Uint8Array(16);function hIe(){if(!c1&&!(c1="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c1(dIe)}const fIe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,gIe=function(n){return"string"==typeof n&&fIe.test(n)};for(var Ls=[],wF=0;wF<256;++wF)Ls.push((wF+256).toString(16).substr(1));const vIe=function(n,e,t){var i=(n=n||{}).random||(n.rng||hIe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(Ls[n[e+0]]+Ls[n[e+1]]+Ls[n[e+2]]+Ls[n[e+3]]+"-"+Ls[n[e+4]]+Ls[n[e+5]]+"-"+Ls[n[e+6]]+Ls[n[e+7]]+"-"+Ls[n[e+8]]+Ls[n[e+9]]+"-"+Ls[n[e+10]]+Ls[n[e+11]]+Ls[n[e+12]]+Ls[n[e+13]]+Ls[n[e+14]]+Ls[n[e+15]]).toLowerCase();if(!gIe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function Eq(n){const e=new Lt(n.transformMatrix),t=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return new Mi({lowerBound:new S(...t.map((r,s)=>Math.min(r,i[s]))),upperBound:new S(...i.map((r,s)=>Math.max(r,t[s])))})}let ss=class extends qm{constructor(e){super(),this.injector=e,this.gizmo$=st([{"@id":"http://purl.org/ccf/latest/ccf.owl#VHMaleOrgans_VHM_Spleen_Colic_Surface","@type":"SpatialSceneNode",scenegraph:"https://hubmapconsortium.github.io/ccf-3d-reference-object-library/Assets/body4Mesh_1338.glb",transformMatrix:new Lt(Lt.IDENTITY).scale([2,2,2]).rotateY(Jv(0)),tooltip:"Gizmo",unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!1,color:[255,255,255,255],opacity:1}])}get nodes$(){return or([this.placementCube$,this.referenceOrganNodes$,this.previousRegistrationNodes$,this.nodeCollisions$]).pipe(be(([e,t,i,r])=>[...e,...i,...t,...this.snapshot.showCollisions?r:[]]))}get rotatedNodes$(){return or([this.rotation$,this.nodes$]).pipe(be(([e,t])=>0===e?t:t.map(i=>Object.assign(Object.assign({},i),{transformMatrix:new Lt(Lt.IDENTITY).rotateY(Jv(e)).multiplyRight(i.transformMatrix)}))))}get referenceOrganNodes$(){return or([this.model.anatomicalStructures$,this.model.extractionSites$,this.model.organIri$]).pipe($g(400),be(([e,t,i])=>this.createSceneNodes(i,[...e,...t])))}get referenceOrganSimpleNodes$(){return or([this.model.anatomicalStructures$,this.model.organIri$,this.referenceData.state$]).pipe(be(([e,t,i])=>e.map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.simpleSceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[t]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.simpleSceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])))}get nodeCollisions$(){return or([this.referenceOrganSimpleNodes$,this.placementCube$]).pipe(Tn(([e,t])=>t.length>0),be(([e,t])=>{const i=Eq(t[0]);return e.filter(r=>i.overlaps(Eq(r)))}))}get previousRegistrationNodes$(){return or([this.model.organIri$,this.model.showPrevious$,this.registration.previousRegistrations$]).pipe(be(([e,t,i])=>t?i.map(r=>{const s=Array.isArray(r.placement)?r.placement[0]:r.placement;if(s.target===e){const o=this.model.snapshot.organDimensions,a=[o.x,o.y,o.z].map(l=>-l/1e3/2);return{"@id":r["@id"],"@type":"SpatialSceneNode",transformMatrix:new Lt(Lt.IDENTITY).translate([s.x_translation,s.y_translation,s.z_translation].map((l,c)=>l/1e3+a[c])).rotateXYZ([s.x_rotation,s.y_rotation,s.z_rotation].map(Jv)).scale([r.x_dimension,r.y_dimension,r.z_dimension].map(l=>l/1e3/2)),color:[25,118,210,200],tooltip:r.label,unpickable:!0}}}).filter(r=>!!r):[]))}get placementCube$(){return or([this.model.viewType$,this.model.blockSize$,this.model.rotation$,this.model.position$,this.model.organ$]).pipe(be(([e,t,i,r,s])=>""===s.src?[]:[this.placementCube]))}get placementCube(){const{viewType:e,blockSize:t,rotation:i,position:r,organDimensions:s}=this.model.snapshot,o=[s.x,s.y,s.z].map(a=>-a/1e3/2);return{"@id":"#DraftPlacement","@type":"SpatialSceneNode",transformMatrix:new Lt(Lt.IDENTITY).translate([r.x,r.y,r.z].map((a,l)=>a/1e3+o[l])).rotateXYZ([i.x,i.y,i.z].map(Jv)).scale([t.x,t.y,t.z].map(a=>a/1e3/2)),color:[255,255,0,200],tooltip:"Draft Placement",unpickable:"3d"===e}}get rotation$(){return this.model.viewSide$.pipe(be(e=>{let t=0;switch(e){case"left":t=-90;break;case"right":t=90;break;case"posterior":t=180}return t}))}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(si),this.registration=this.injector.get(wr),this.referenceData=this.injector.get(dc)}createSceneNodes(e,t){const i=this.referenceData.snapshot;return t.filter(r=>r.visible&&r.opacity&&r.opacity>0).map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.sceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[e]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.sceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])}};ss.\u0275fac=function(e){return new(e||ss)(I(Tt))},ss.\u0275prov=ae({token:ss,factory:ss.\u0275fac}),De([ri()],ss.prototype,"nodes$",null),De([ri()],ss.prototype,"rotatedNodes$",null),De([ri()],ss.prototype,"referenceOrganNodes$",null),De([ri()],ss.prototype,"referenceOrganSimpleNodes$",null),De([ri()],ss.prototype,"nodeCollisions$",null),De([ri()],ss.prototype,"previousRegistrationNodes$",null),De([ri()],ss.prototype,"placementCube$",null),De([ri()],ss.prototype,"placementCube",null),De([ri()],ss.prototype,"rotation$",null),ss=De([Ch(),gh({name:"scene",defaults:{showCollisions:!Sh.production}})],ss);let Io=class extends sTe{constructor(e){super(),this.injector=e,this._latestTags=[]}get tags$(){return or([this.entities$,this.scene.nodeCollisions$]).pipe(be(([e,t])=>{const i=[],r=new Set,s=new Set;Object.entries(e).forEach(([o,a])=>{"removed"===a.type?s.add(o):(r.add(o),i.push(a))});for(const o of t){const a=o.representation_of;a&&!s.has(a)&&!r.has(a)&&(r.add(a),i.push({id:a,label:o.tooltip,type:"assigned"}))}return i}))}get latestTags(){return this._latestTags}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(si),this.scene=this.injector.get(ss),this.page=this.injector.get(Ui),this.tags$.subscribe(e=>{this._latestTags=e}),this.entities$.subscribe(()=>this.page.setHasChanges())}addTags(e){for(const t of e)this.addTagRaw(t)}addTag(e){this.addTagRaw(e)}removeTag(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"removed"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"removed"}))}searchExternal(e,t){const i=this.model.snapshot.anatomicalStructures.filter(r=>-1!==r.name.toLowerCase().indexOf(e.toLowerCase()));return[{totalCount:i.length,results:i.map(r=>({id:r.id,label:r.name,type:"added"})).slice(0,t)}]}addTagRaw(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"added"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"added"}))}};Io.\u0275fac=function(e){return new(e||Io)(I(Tt))},Io.\u0275prov=ae({token:Io,factory:Io.\u0275fac}),De([ri()],Io.prototype,"tags$",null),De([Xt()],Io.prototype,"addTags",null),De([Xt()],Io.prototype,"addTag",null),De([Xt()],Io.prototype,"removeTag",null),De([su.ak],Io.prototype,"searchExternal",null),Io=De([Ch(),gh({name:"tags",defaults:Object.assign({},{ids:[],entities:{}})})],Io);let wr=class extends qm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.displayErrors$=this.state$.pipe(lr("displayErrors"))}get metadata$(){return or([this.page.state$,this.model.state$,this.tags.tags$]).pipe(be(([e,t,i])=>this.buildMetadata(e,t,i)))}get jsonld$(){return or([this.page.state$,this.model.state$,this.tags.tags$]).pipe(be(([e,t,i])=>this.buildJsonLd(e,t,i)))}get valid$(){return or([this.page.state$,this.model.state$]).pipe(be(()=>this.isValid))}get previousRegistrations$(){const{globalConfig:e,state$:t}=this;return or([t.pipe(lr("registrations")),e.getOption("fetchPreviousRegistrations").pipe(Ir(s=>{var o;return null!==(o=null==s?void 0:s())&&void 0!==o?o:[[]]}),ns([]))]).pipe(be(([s,o])=>[...s,...o]))}get currentIdentifier(){return vIe()}get currentDate(){return(new Date).toISOString().split("T")[0]}ngxsOnInit(){super.ngxsOnInit(),this.page=this.injector.get(Ui),this.model=this.injector.get(si),this.tags=this.injector.get(Io),this.refData=this.injector.get(dc),this.globalConfig.config$.pipe(_i(1),Di(({useDownload:e,register:t})=>this.ctx.patchState({useRegistrationCallback:!(e||!t)}))).subscribe(),this.globalConfig.getOption("editRegistration").pipe(Uk(),Di(e=>this.editRegistration(e))).subscribe()}editRegistration(e){return gl(this,void 0,void 0,function*(){const t=this.refData.normalizePlacement(Array.isArray(e.placement)?e.placement[0]:e.placement),i=this.refData.getOrganData(t.target);this.page.setUserName({firstName:e.creator_first_name,lastName:e.creator_last_name}),i&&(this.model.setOrgan(i.organ),i.sex&&this.model.setSex(i.sex),i.side&&this.model.setSide(i.side)),this.model.setBlockSize({x:e.x_dimension,y:e.y_dimension,z:e.z_dimension}),this.model.setRotation({x:t.x_rotation,y:t.y_rotation,z:t.z_rotation}),this.model.setSlicesConfig({thickness:e.slice_thickness||NaN,numSlices:e.slice_count||NaN}),yield new Promise(s=>{setTimeout(s,1e3)}),this.model.setPosition({x:t.x_translation,y:t.y_translation,z:t.z_translation});const r=new Set(e.ccf_annotations);this.tags.addTags(this.model.snapshot.anatomicalStructures.filter(s=>r.has(s.id)).map(s=>({id:s.id,label:s.name,type:"added"})))})}setUseRegistrationCallback(e){this.ctx.patchState({useRegistrationCallback:e})}setDisplayErrors(e){this.ctx.patchState({displayErrors:e})}addRegistration(e){this.ctx.setState(l0({registrations:ROe(e)}))}isDataValid(e,t){return[e.user.firstName,e.user.lastName,t.organ.src,t.organ.name,t.organ.organ].every(r=>!!r)}get isValid(){return this.isDataValid(this.page.snapshot,this.model.snapshot)}register(e){if(!this.isValid)return;const{globalConfig:{snapshot:{register:t}},page:i,model:r,snapshot:s}=this,o=this.buildJsonLd(i.snapshot,r.snapshot,this.tags.latestTags),a=JSON.stringify(o,void 0,2);if(e||void 0===e&&s.useRegistrationCallback)null==t||t(a);else{const l=new Blob([a],{type:"application/json",endings:"native"});(0,uIe.saveAs)(l,"registration-data.json")}this.addRegistration(o),this.setDisplayErrors(!1),this.page.clearHasChanges()}buildMetadata(e,t,i){const r=[];return e.registrationCallbackSet||r.push({label:"First Name",value:e.user.firstName},{label:"Last Name",value:e.user.lastName}),r.push({label:"Reference Organ Name",value:t.organ.name},{label:"Tissue Block Dimensions (mm)",value:this.xyzTripletToString(t.blockSize)},{label:"Tissue Block Position (mm)",value:this.xyzTripletToString(t.position)},{label:"Tissue Block Rotation",value:this.xyzTripletToString(t.rotation)},{label:"Anatomical Structure Tags",value:i.map(s=>s.label).join(", ")},{label:"Time Stamp",value:this.currentDate},{label:"Alignment ID",value:this.currentIdentifier}),r}buildJsonLd(e,t,i){var r,s;return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}`,"@type":"SpatialEntity",label:t.label||void 0,creator:`${e.user.firstName} ${e.user.lastName}`,creator_first_name:e.user.firstName,creator_last_name:e.user.lastName,creation_date:this.currentDate,ccf_annotations:i.map(o=>o.id),slice_thickness:(null===(r=t.slicesConfig)||void 0===r?void 0:r.thickness)||void 0,slice_count:(null===(s=t.slicesConfig)||void 0===s?void 0:s.numSlices)||void 0,x_dimension:+t.blockSize.x.toFixed(3),y_dimension:+t.blockSize.y.toFixed(3),z_dimension:+t.blockSize.z.toFixed(3),dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}_placement`,"@type":"SpatialPlacement",target:t.organIri,placement_date:this.currentDate,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:+t.rotation.x.toFixed(3),y_rotation:+t.rotation.y.toFixed(3),z_rotation:+t.rotation.z.toFixed(3),rotation_order:"XYZ",rotation_units:"degree",x_translation:+t.position.x.toFixed(3),y_translation:+t.position.y.toFixed(3),z_translation:+t.position.z.toFixed(3),translation_units:"millimeter"}}}xyzTripletToString(e){return`${Math.round(e.x)}, ${Math.round(e.y)}, ${Math.round(e.z)}`}};wr.\u0275fac=function(e){return new(e||wr)(I(Tt),I(Eh))},wr.\u0275prov=ae({token:wr,factory:wr.\u0275fac}),De([ri()],wr.prototype,"metadata$",null),De([ri()],wr.prototype,"jsonld$",null),De([ri()],wr.prototype,"valid$",null),De([ri()],wr.prototype,"previousRegistrations$",null),De([ri()],wr.prototype,"currentIdentifier",null),De([ri()],wr.prototype,"currentDate",null),De([Xt()],wr.prototype,"setUseRegistrationCallback",null),De([Xt()],wr.prototype,"setDisplayErrors",null),De([Xt()],wr.prototype,"addRegistration",null),De([ri()],wr.prototype,"isValid",null),wr=De([Ch(),gh({name:"registration",defaults:{useRegistrationCallback:!1,displayErrors:!1,registrations:[]}})],wr);let Sq=(()=>{class n{constructor(){this._vertical=!1,this._inset=!1}get vertical(){return this._vertical}set vertical(t){this._vertical=Dt(t)}get inset(){return this._inset}set inset(t){this._inset=Dt(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(t,i){2&t&&(en("aria-orientation",i.vertical?"vertical":"horizontal"),at("mat-divider-vertical",i.vertical)("mat-divider-horizontal",!i.vertical)("mat-divider-inset",i.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(t,i){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),n})(),EF=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn],Nn]}),n})();function CIe(n,e){if(1&n){const t=Lr();F(0,"mat-icon",2),ye("click",function(){return Vn(t),bt().setAllOpacity(20)}),Te(1,"refresh"),N()}2&n&&ie("matRippleCentered",!0)("matRippleUnbounded",!0)}function wIe(n,e){if(1&n){const t=Lr();F(0,"div",3),ye("mouseenter",function(){const s=Vn(t).$implicit;return bt().mouseOver(s)})("mouseleave",function(){return Vn(t),bt().mouseOut()}),et(1,"mat-icon",4),F(2,"div",5),Te(3),N(),F(4,"div",6),F(5,"ccf-opacity-slider",7,8),ye("opacityChange",function(r){return Vn(t),bt().updateOpacity(r)})("opacityReset",function(){return Vn(t),bt().resetItem()})("visibilityToggle",function(){const s=Vn(t).$implicit;return bt().toggleVisibility(s)}),N(),N(),N()}if(2&n){const t=e.$implicit,i=bt();at("selected",!!i.selection&&i.getId(0,i.selection)===i.getId(0,t)),Y(1),at("fade",!t.visible),Y(1),at("hidden",t.id===(null==i.selection?null:i.selection.id)),Yy("title",t.name),Y(1),Ai(t.name),Y(1),at("hidden",t.id!==(null==i.selection?null:i.selection.id)),Y(1),ie("visible",t.visible)("opacity",i.selection?null==i.selection?null:i.selection.opacity:20)}}let EIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-menu",this.hover=new Pe,this.itemsChange=new Pe}toggleVisibility(t){t=Object.assign(Object.assign({},t),{visible:!t.visible}),this.selection&&t.id===this.selection.id&&(this.selection=Object.assign(Object.assign({},this.selection),{visible:t.visible})),this.ga.event("visibility_toggled","visibility_menu",""+t.id,+t.visible),this.updateOpacity(t.opacity)}mouseOver(t){this.selection=t===this.selection?void 0:t,this.hover.emit(t)}mouseOut(){this.selection=void 0,this.hover.emit(void 0)}updateOpacity(t){if(!this.selection)return;const i=Object.assign(Object.assign({},this.selection),{opacity:t});this.selection=i,this.items=this.items.map(r=>r.id===i.id?i:r),this.ga.event("opacity_update","visibility_menu",""+i.id,i.opacity),this.itemsChange.emit(this.items)}resetItem(){if(this.selection){const t=Object.assign(Object.assign({},this.selection),{opacity:20,visible:!0});this.selection=t,this.items=this.items.map(i=>i.id===t.id?t:i),this.ga.event("item_reset","visibility_menu",""+t.id),this.itemsChange.emit(this.items)}}setAllOpacity(t){this.items=this.items.map(i=>Object.assign(Object.assign({},i),{opacity:t,visible:!0})),this.ga.event("all_items_opacity_update","visibility_menu",void 0,t),this.itemsChange.emit(this.items)}getId(t,i){return i.id}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-visibility-menu"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{items:"items",selection:"selection"},outputs:{hover:"hover",itemsChange:"itemsChange"},decls:2,vars:3,consts:[["class","icon reset","matRipple","",3,"matRippleCentered","matRippleUnbounded","click",4,"ngIf"],["class","item-entry",3,"selected","mouseenter","mouseleave",4,"ngFor","ngForOf","ngForTrackBy"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"item-entry",3,"mouseenter","mouseleave"],["svgIcon","app:opacity",1,"opacity-icon"],[1,"item-name",3,"title"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider",""]],template:function(t,i){1&t&&(Ct(0,CIe,2,2,"mat-icon",0),Ct(1,wIe,7,12,"div",1)),2&t&&(ie("ngIf",i.items.length),Y(1),ie("ngForOf",i.items)("ngForTrackBy",i.getId))},directives:[Is,Xl,Rs,Qo,KDe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;margin-right:0;margin-left:0;max-height:18rem;overflow-y:auto;scrollbar-width:thin}[_nghost-%COMP%] .icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s;position:absolute;top:3rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%]{display:flex;height:2.25rem;align-items:center;flex-shrink:0;position:relative}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]{z-index:1;transition:.6s}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:.5rem;opacity:1;transition-duration:.4s;transition-timing-function:ease-in-out;transition-property:opacity;max-width:calc(100% - 2.5rem)}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:calc(100% - 2rem);transition-duration:.3s;transition-timing-function:ease-in-out;transition-property:opacity;left:2rem;position:absolute;opacity:1}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.1s;transition-timing-function:ease-in-out;transition-property:opacity}"],changeDetection:0}),n})();const SIe=["*"],Mq=new _e("MatChipRemove"),xq=new _e("MatChipAvatar"),Tq=new _e("MatChipTrailingIcon");class MIe{constructor(e){this._elementRef=e}}const xIe=Nf(kf(Ff(MIe),"primary"),-1);let u0=(()=>{class n extends xIe{constructor(t,i,r,s,o,a,l,c){super(t),this._ngZone=i,this._changeDetectorRef=o,this._hasFocus=!1,this.chipListSelectable=!0,this._chipListMultiple=!1,this._chipListDisabled=!1,this._selected=!1,this._selectable=!0,this._disabled=!1,this._removable=!0,this._onFocus=new we,this._onBlur=new we,this.selectionChange=new Pe,this.destroyed=new Pe,this.removed=new Pe,this._addHostClassName(),this._chipRippleTarget=a.createElement("div"),this._chipRippleTarget.classList.add("mat-chip-ripple"),this._elementRef.nativeElement.appendChild(this._chipRippleTarget),this._chipRipple=new Oj(this,i,this._chipRippleTarget,r),this._chipRipple.setupTriggerEvents(t),this.rippleConfig=s||{},this._animationsDisabled="NoopAnimations"===l,this.tabIndex=null!=c&&parseInt(c)||-1}get rippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||!!this.rippleConfig.disabled}get selected(){return this._selected}set selected(t){const i=Dt(t);i!==this._selected&&(this._selected=i,this._dispatchSelectionChange())}get value(){return void 0!==this._value?this._value:this._elementRef.nativeElement.textContent}set value(t){this._value=t}get selectable(){return this._selectable&&this.chipListSelectable}set selectable(t){this._selectable=Dt(t)}get disabled(){return this._chipListDisabled||this._disabled}set disabled(t){this._disabled=Dt(t)}get removable(){return this._removable}set removable(t){this._removable=Dt(t)}get ariaSelected(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null}_addHostClassName(){const t="mat-basic-chip",i=this._elementRef.nativeElement;i.hasAttribute(t)||i.tagName.toLowerCase()===t?i.classList.add(t):i.classList.add("mat-standard-chip")}ngOnDestroy(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()}select(){this._selected||(this._selected=!0,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}deselect(){this._selected&&(this._selected=!1,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}selectViaInteraction(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0),this._changeDetectorRef.markForCheck())}toggleSelected(t=!1){return this._selected=!this.selected,this._dispatchSelectionChange(t),this._changeDetectorRef.markForCheck(),this.selected}focus(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0}remove(){this.removable&&this.removed.emit({chip:this})}_handleClick(t){this.disabled?t.preventDefault():t.stopPropagation()}_handleKeydown(t){if(!this.disabled)switch(t.keyCode){case 46:case 8:this.remove(),t.preventDefault();break;case 32:this.selectable&&this.toggleSelected(!0),t.preventDefault()}}_blur(){this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this._ngZone.run(()=>{this._hasFocus=!1,this._onBlur.next({chip:this})})})}_dispatchSelectionChange(t=!1){this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(lt),E(ii),E(Ij,8),E(Un),E(rt),E(Zo,8),fs("tabindex"))},n.\u0275dir=he({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,xq,5),Fi(r,Tq,5),Fi(r,Mq,5)),2&t){let s;Mt(s=xt())&&(i.avatar=s.first),Mt(s=xt())&&(i.trailingIcon=s.first),Mt(s=xt())&&(i.removeIcon=s.first)}},hostAttrs:["role","option",1,"mat-chip","mat-focus-indicator"],hostVars:14,hostBindings:function(t,i){1&t&&ye("click",function(s){return i._handleClick(s)})("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i.focus()})("blur",function(){return i._blur()}),2&t&&(en("tabindex",i.disabled?null:i.tabIndex)("disabled",i.disabled||null)("aria-disabled",i.disabled.toString())("aria-selected",i.ariaSelected),at("mat-chip-selected",i.selected)("mat-chip-with-avatar",i.avatar)("mat-chip-with-trailing-icon",i.trailingIcon||i.removeIcon)("mat-chip-disabled",i.disabled)("_mat-animation-noopable",i._animationsDisabled))},inputs:{color:"color",disableRipple:"disableRipple",tabIndex:"tabIndex",selected:"selected",value:"value",selectable:"selectable",disabled:"disabled",removable:"removable"},outputs:{selectionChange:"selectionChange",destroyed:"destroyed",removed:"removed"},exportAs:["matChip"],features:[ht]}),n})(),Aq=(()=>{class n{constructor(t,i){this._parentChip=t,"BUTTON"===i.nativeElement.nodeName&&i.nativeElement.setAttribute("type","button")}_handleClick(t){const i=this._parentChip;i.removable&&!i.disabled&&i.remove(),t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(u0),E(nt))},n.\u0275dir=he({type:n,selectors:[["","matChipRemove",""]],hostAttrs:[1,"mat-chip-remove","mat-chip-trailing-icon"],hostBindings:function(t,i){1&t&&ye("click",function(s){return i._handleClick(s)})},features:[At([{provide:Mq,useExisting:n}])]}),n})();const Dq=new _e("mat-chips-default-options"),DIe=CO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let OIe=0;class IIe{constructor(e,t){this.source=e,this.value=t}}let Oq=(()=>{class n extends DIe{constructor(t,i,r,s,o,a,l){super(a,s,o,l),this._elementRef=t,this._changeDetectorRef=i,this._dir=r,this.controlType="mat-chip-list",this._lastDestroyedChipIndex=null,this._destroyed=new we,this._uid="mat-chip-list-"+OIe++,this._tabIndex=0,this._userTabIndex=null,this._onTouched=()=>{},this._onChange=()=>{},this._multiple=!1,this._compareWith=(c,d)=>c===d,this._required=!1,this._disabled=!1,this.ariaOrientation="horizontal",this._selectable=!0,this.change=new Pe,this.valueChange=new Pe,this.ngControl&&(this.ngControl.valueAccessor=this)}get selected(){var t,i;return this.multiple?(null===(t=this._selectionModel)||void 0===t?void 0:t.selected)||[]:null===(i=this._selectionModel)||void 0===i?void 0:i.selected[0]}get role(){return this.empty?null:"listbox"}get multiple(){return this._multiple}set multiple(t){this._multiple=Dt(t),this._syncChipsState()}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this.writeValue(t),this._value=t}get id(){return this._chipInput?this._chipInput.id:this._uid}get required(){return this._required}set required(t){this._required=Dt(t),this.stateChanges.next()}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get focused(){return this._chipInput&&this._chipInput.focused||this._hasFocusedChip()}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this.chips||0===this.chips.length)}get shouldLabelFloat(){return!this.empty||this.focused}get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Dt(t),this._syncChipsState()}get selectable(){return this._selectable}set selectable(t){this._selectable=Dt(t),this.chips&&this.chips.forEach(i=>i.chipListSelectable=this._selectable)}set tabIndex(t){this._userTabIndex=t,this._tabIndex=t}get chipSelectionChanges(){return ki(...this.chips.map(t=>t.selectionChange))}get chipFocusChanges(){return ki(...this.chips.map(t=>t._onFocus))}get chipBlurChanges(){return ki(...this.chips.map(t=>t._onBlur))}get chipRemoveChanges(){return ki(...this.chips.map(t=>t.destroyed))}ngAfterContentInit(){this._keyManager=new aV(this.chips).withWrap().withVerticalOrientation().withHomeAndEnd().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe(zn(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.tabOut.pipe(zn(this._destroyed)).subscribe(()=>{this._allowFocusEscape()}),this.chips.changes.pipe(ns(null),zn(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>{this._syncChipsState()}),this._resetChips(),this._initializeSelection(),this._updateTabIndex(),this._updateFocusForDestroyedChips(),this.stateChanges.next()})}ngOnInit(){this._selectionModel=new uU(this.multiple,void 0,!1),this.stateChanges.next()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==this._disabled&&(this.disabled=!!this.ngControl.disabled))}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()}registerInput(t){this._chipInput=t,this._elementRef.nativeElement.setAttribute("data-mat-chip-input",t.id)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}writeValue(t){this.chips&&this._setSelectionByValue(t,!1)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}onContainerClick(t){this._originatesFromChip(t)||this.focus()}focus(t){this.disabled||this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(t),this.stateChanges.next()))}_focusInput(t){this._chipInput&&this._chipInput.focus(t)}_keydown(t){const i=t.target;i&&i.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())}_updateTabIndex(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)}_updateFocusForDestroyedChips(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){const t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=null}_isValidIndex(t){return t>=0&&tr.deselect()),Array.isArray(t))t.forEach(r=>this._selectValue(r,i)),this._sortValues();else{const r=this._selectValue(t,i);r&&i&&this._keyManager.setActiveItem(r)}}_selectValue(t,i=!0){const r=this.chips.find(s=>null!=s.value&&this._compareWith(s.value,t));return r&&(i?r.selectViaInteraction():r.select(),this._selectionModel.select(r)),r}_initializeSelection(){Promise.resolve().then(()=>{(this.ngControl||this._value)&&(this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value,!1),this.stateChanges.next())})}_clearSelection(t){this._selectionModel.clear(),this.chips.forEach(i=>{i!==t&&i.deselect()}),this.stateChanges.next()}_sortValues(){this._multiple&&(this._selectionModel.clear(),this.chips.forEach(t=>{t.selected&&this._selectionModel.select(t)}),this.stateChanges.next())}_propagateChanges(t){let i=null;i=Array.isArray(this.selected)?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.change.emit(new IIe(this,i)),this.valueChange.emit(i),this._onChange(i),this._changeDetectorRef.markForCheck()}_blur(){this._hasFocusedChip()||this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(()=>{this.focused||this._markAsTouched()}):this._markAsTouched())}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}_allowFocusEscape(){-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(()=>{this._tabIndex=this._userTabIndex||0,this._changeDetectorRef.markForCheck()}))}_resetChips(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()}_dropSubscriptions(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=null)}_listenToChipsSelection(){this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(t=>{t.source.selected?this._selectionModel.select(t.source):this._selectionModel.deselect(t.source),this.multiple||this.chips.forEach(i=>{!this._selectionModel.isSelected(i)&&i.selected&&i.deselect()}),t.isUserInput&&this._propagateChanges()})}_listenToChipsFocus(){this._chipFocusSubscription=this.chipFocusChanges.subscribe(t=>{let i=this.chips.toArray().indexOf(t.chip);this._isValidIndex(i)&&this._keyManager.updateActiveItem(i),this.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(()=>{this._blur(),this.stateChanges.next()})}_listenToChipsRemoved(){this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(t=>{const i=t.chip,r=this.chips.toArray().indexOf(t.chip);this._isValidIndex(r)&&i._hasFocus&&(this._lastDestroyedChipIndex=r)})}_originatesFromChip(t){let i=t.target;for(;i&&i!==this._elementRef.nativeElement;){if(i.classList.contains("mat-chip"))return!0;i=i.parentElement}return!1}_hasFocusedChip(){return this.chips&&this.chips.some(t=>t._hasFocus)}_syncChipsState(){this.chips&&this.chips.forEach(t=>{t._chipListDisabled=this._disabled,t._chipListMultiple=this.multiple})}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(Ko,8),E(cp,8),E($m,8),E(kv),E(lc,10))},n.\u0275cmp=Le({type:n,selectors:[["mat-chip-list"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,u0,5),2&t){let s;Mt(s=xt())&&(i.chips=s)}},hostAttrs:[1,"mat-chip-list"],hostVars:15,hostBindings:function(t,i){1&t&&ye("focus",function(){return i.focus()})("blur",function(){return i._blur()})("keydown",function(s){return i._keydown(s)}),2&t&&(sl("id",i._uid),en("tabindex",i.disabled?null:i._tabIndex)("aria-describedby",i._ariaDescribedby||null)("aria-required",i.role?i.required:null)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-multiselectable",i.multiple)("role",i.role)("aria-orientation",i.ariaOrientation),at("mat-chip-list-disabled",i.disabled)("mat-chip-list-invalid",i.errorState)("mat-chip-list-required",i.required))},inputs:{ariaOrientation:["aria-orientation","ariaOrientation"],multiple:"multiple",compareWith:"compareWith",value:"value",required:"required",placeholder:"placeholder",disabled:"disabled",selectable:"selectable",tabIndex:"tabIndex",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},exportAs:["matChipList"],features:[At([{provide:Nv,useExisting:n}]),ht],ngContentSelectors:SIe,decls:2,vars:0,consts:[[1,"mat-chip-list-wrapper"]],template:function(t,i){1&t&&(Dr(),F(0,"div",0),In(1),N())},styles:['.mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:"";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n'],encapsulation:2,changeDetection:0}),n})();const kIe={separatorKeyCodes:[13]};let Iq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[kv,{provide:Dq,useValue:kIe}],imports:[[Nn]]}),n})(),FIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-toggle",this.visible=!1,this.toggleLabel="",this.disabled=!1,this.visibilityChanged=new Pe}toggleVisibility(){this.visible=!this.visible,this.ga.event("visibility_toggled","visibility_toggle",""+this.visible),this.visibilityChanged.emit(this.visible)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-visibility-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{visible:"visible",toggleLabel:"toggleLabel",disabled:"disabled"},outputs:{visibilityChanged:"visibilityChanged"},decls:8,vars:9,consts:[[1,"toggle-div"],[1,"toggle-wrapper",3,"click"],[1,"icon-background"],["svgIcon","app:visibility_off_cube",1,"icon","block"],[1,"icon","green"],[1,"toggle-label"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"mat-chip",1),ye("click",function(){return i.toggleVisibility()}),F(2,"div",2),et(3,"mat-icon",3),F(4,"mat-icon",4),Te(5,"done"),N(),N(),F(6,"div",5),Te(7),N(),N(),N()),2&t&&(Y(1),at("disabled",i.disabled),Y(1),at("disabled",i.disabled),Y(1),at("hidden",i.visible),Y(1),at("hidden",!i.visible),Y(3),Ai(i.toggleLabel))},directives:[u0,Rs],styles:["[_nghost-%COMP%]{height:3rem;display:flex;align-items:center}[_nghost-%COMP%] .mat-chip{padding:0!important}[_nghost-%COMP%] .mat-chip.disabled{cursor:not-allowed!important}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;padding-top:1.5rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;display:flex;padding-left:.5rem;cursor:pointer;align-items:center;position:relative;border-width:.075rem;border-style:solid;height:2.25rem;border-radius:1.5rem;transition:background-color .2s ease-in-out}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%]{border-radius:1.5rem;height:2.06rem;width:2.06rem;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transition:.6s;position:absolute}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.block[_ngcontent-%COMP%]{width:1.125rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .toggle-label[_ngcontent-%COMP%]{font-weight:bold;margin-left:.5rem;padding-right:1.25rem;padding-left:.25rem}"],changeDetection:0}),n})();const NIe=["fileInput"];let LIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-json-file-reader",this.label="Upload",this.parsedJson=new Pe}triggerFileInput(){this.fileInput.nativeElement.click()}handleFile(t){const i=t.target;if(!i.files)return;const r=i.files[0],s=new FileReader;s.onload=()=>{const o=JSON.parse(s.result);this.ga.event("json_file_load_end","json_file_reader"),this.parsedJson.emit(o)},this.ga.event("json_file_load_start","json_file_reader"),s.readAsText(r)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-json-file-reader"]],viewQuery:function(t,i){if(1&t&&ni(NIe,5),2&t){let r;Mt(r=xt())&&(i.fileInput=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{label:"label"},outputs:{parsedJson:"parsedJson"},decls:4,vars:1,consts:[["mat-button","",1,"upload-button",3,"click"],["type","file","accept","application/JSON","name","fileInput","id","fileInput",2,"display","none",3,"change"],["fileInput",""]],template:function(t,i){1&t&&(F(0,"button",0),ye("click",function(){return i.triggerFileInput()}),Te(1),N(),F(2,"input",1,2),ye("change",function(s){return i.handleFile(s)}),N()),2&t&&(Y(1),Ai(i.label))},directives:[$f],styles:["[_nghost-%COMP%] .upload-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;cursor:pointer;font-weight:500}"]}),n})(),BIe=(()=>{class n{constructor(){this.clsName="ccf-details-label",this.details=[]}arrayToString(t){return t.join(", ")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-details-label"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{details:"details"},decls:1,vars:1,template:function(t,i){1&t&&Te(0),2&t&&Ai(i.arrayToString(i.details))},styles:["[_nghost-%COMP%]{display:block;height:2.25rem}"],changeDetection:0}),n})();const VIe=["trigger"],jIe=["panel"];function UIe(n,e){if(1&n&&(F(0,"span",8),Te(1),N()),2&n){const t=bt();Y(1),Ai(t.placeholder)}}function zIe(n,e){if(1&n&&(F(0,"span",12),Te(1),N()),2&n){const t=bt(2);Y(1),Ai(t.triggerValue)}}function HIe(n,e){1&n&&In(0,0,["*ngSwitchCase","true"])}function $Ie(n,e){1&n&&(F(0,"span",9),Ct(1,zIe,2,1,"span",10),Ct(2,HIe,1,0,"ng-content",11),N()),2&n&&(ie("ngSwitch",!!bt().customTrigger),Y(2),ie("ngSwitchCase",!0))}function GIe(n,e){if(1&n){const t=Lr();F(0,"div",13),F(1,"div",14,15),ye("@transformPanel.done",function(r){return Vn(t),bt()._panelDoneAnimatingStream.next(r.toState)})("keydown",function(r){return Vn(t),bt()._handleKeydown(r)}),In(3,1),N(),N()}if(2&n){const t=bt();ie("@transformPanelWrap",void 0),Y(1),function(n,e,t){zl(go,Nc,pg(Ce(),n,e,t),!0)}("mat-select-panel ",t._getPanelTheme(),""),gf("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),ie("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),en("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const WIe=[[["mat-select-trigger"]],"*"],qIe=["mat-select-trigger","*"],Pq={transformPanelWrap:Jl("transformPanelWrap",[Qs("* => void",Nne("@transformPanel",[Fne()],{optional:!0}))]),transformPanel:Jl("transformPanel",[br("void",Kn({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),br("showing",Kn({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),br("showing-multiple",Kn({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Qs("void => *",Mo("120ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void",Mo("100ms 25ms linear",Kn({opacity:0})))])};let Rq=0;const Fq=new _e("mat-select-scroll-strategy"),ZIe=new _e("MAT_SELECT_CONFIG"),QIe={provide:Fq,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};class JIe{constructor(e,t){this.source=e,this.value=t}}const ePe=Ff(Nf(em(CO(class{constructor(n,e,t,i,r){this._elementRef=n,this._defaultErrorStateMatcher=e,this._parentForm=t,this._parentFormGroup=i,this.ngControl=r}})))),Nq=new _e("MatSelectTrigger");let tPe=(()=>{class n extends ePe{constructor(t,i,r,s,o,a,l,c,d,f,p,g,_,y){var v,w,C;super(o,s,l,c,f),this._viewportRuler=t,this._changeDetectorRef=i,this._ngZone=r,this._dir=a,this._parentFormField=d,this._liveAnnouncer=_,this._defaultOptions=y,this._panelOpen=!1,this._compareWith=(x,L)=>x===L,this._uid="mat-select-"+Rq++,this._triggerAriaLabelledBy=null,this._destroy=new we,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+Rq++,this._panelDoneAnimatingStream=new we,this._overlayPanelClass=(null===(v=this._defaultOptions)||void 0===v?void 0:v.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(C=null===(w=this._defaultOptions)||void 0===w?void 0:w.disableOptionCentering)&&void 0!==C&&C,this.ariaLabel="",this.optionSelectionChanges=zb(()=>{const x=this.options;return x?x.changes.pipe(ns(x),Ir(()=>ki(...x.map(L=>L.onSelectionChange)))):this._ngZone.onStable.pipe(_i(1),Ir(()=>this.optionSelectionChanges))}),this.openedChange=new Pe,this._openedStream=this.openedChange.pipe(Tn(x=>x),be(()=>{})),this._closedStream=this.openedChange.pipe(Tn(x=>!x),be(()=>{})),this.selectionChange=new Pe,this.valueChange=new Pe,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==y?void 0:y.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=y.typeaheadDebounceInterval),this._scrollStrategyFactory=g,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(p)||0,this.id=this.id}get focused(){return this._focused||this._panelOpen}get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get required(){return this._required}set required(t){this._required=Dt(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=Dt(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=Dt(t)}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){(t!==this._value||this._multiple&&Array.isArray(t))&&(this.options&&this._setSelectionByValue(t),this._value=t)}get typeaheadDebounceInterval(){return this._typeaheadDebounceInterval}set typeaheadDebounceInterval(t){this._typeaheadDebounceInterval=So(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new uU(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Xo(),zn(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(zn(this._destroy)).subscribe(t=>{t.added.forEach(i=>i.select()),t.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(ns(null),zn(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?i.setAttribute("aria-labelledby",t):i.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}ngOnChanges(t){t.disabled&&this.stateChanges.next(),t.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}ngOnDestroy(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}close(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}writeValue(t){this.value=t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){const t=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&t.reverse(),t.join(", ")}return this._selectionModel.selected[0].viewValue}_isRtl(){return!!this._dir&&"rtl"===this._dir.value}_handleKeydown(t){this.disabled||(this.panelOpen?this._handleOpenKeydown(t):this._handleClosedKeydown(t))}_handleClosedKeydown(t){const i=t.keyCode,r=40===i||38===i||37===i||39===i,s=13===i||32===i,o=this._keyManager;if(!o.isTyping()&&s&&!Yo(t)||(this.multiple||t.altKey)&&r)t.preventDefault(),this.open();else if(!this.multiple){const a=this.selected;o.onKeydown(t);const l=this.selected;l&&a!==l&&this._liveAnnouncer.announce(l.viewValue,1e4)}}_handleOpenKeydown(t){const i=this._keyManager,r=t.keyCode,s=40===r||38===r,o=i.isTyping();if(s&&t.altKey)t.preventDefault(),this.close();else if(o||13!==r&&32!==r||!i.activeItem||Yo(t))if(!o&&this._multiple&&65===r&&t.ctrlKey){t.preventDefault();const a=this.options.some(l=>!l.disabled&&!l.selected);this.options.forEach(l=>{l.disabled||(a?l.select():l.deselect())})}else{const a=i.activeItemIndex;i.onKeydown(t),this._multiple&&s&&t.shiftKey&&i.activeItem&&i.activeItemIndex!==a&&i.activeItem._selectViaInteraction()}else t.preventDefault(),i.activeItem._selectViaInteraction()}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_onAttached(){this._overlayDir.positionChange.pipe(_i(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()})}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value),this.stateChanges.next()})}_setSelectionByValue(t){if(this._selectionModel.selected.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(i=>this._selectValue(i)),this._sortValues();else{const i=this._selectValue(t);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const i=this.options.find(r=>{if(this._selectionModel.isSelected(r))return!1;try{return null!=r.value&&this._compareWith(r.value,t)}catch(s){return!1}});return i&&this._selectionModel.select(i),i}_initKeyManager(){this._keyManager=new oV(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(zn(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(zn(this._destroy)).subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){const t=ki(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(zn(t)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),ki(...this.options.map(i=>i._stateChanges)).pipe(zn(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,i){const r=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(r!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),i&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),i&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),r!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((i,r)=>this.sortComparator?this.sortComparator(i,r,t):t.indexOf(i)-t.indexOf(r)),this.stateChanges.next()}}_propagateChanges(t){let i=null;i=this.multiple?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}_canOpen(){var t;return!this._panelOpen&&!this.disabled&&(null===(t=this.options)||void 0===t?void 0:t.length)>0}focus(t){this._elementRef.nativeElement.focus(t)}_getPanelAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(i?i+" ":"")+this.ariaLabelledby:i}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let r=(i?i+" ":"")+this._valueId;return this.ariaLabelledby&&(r+=" "+this.ariaLabelledby),r}_panelDoneAnimating(t){this.openedChange.emit(t)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}return n.\u0275fac=function(t){return new(t||n)(E(jf),E(Un),E(lt),E(kv),E(nt),E(Ko,8),E(cp,8),E($m,8),E(XE,8),E(lc,10),fs("tabindex"),E(Fq),E(wE),E(ZIe,8))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&(ni(VIe,5),ni(jIe,5),ni(DU,5)),2&t){let r;Mt(r=xt())&&(i.trigger=r.first),Mt(r=xt())&&(i.panel=r.first),Mt(r=xt())&&(i._overlayDir=r.first)}},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[ht,qn]}),n})(),nPe=(()=>{class n extends tPe{constructor(){super(...arguments),this._scrollTop=0,this._triggerFontSize=0,this._transformOrigin="top",this._offsetY=0,this._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}]}_calculateOverlayScroll(t,i,r){const s=this._getItemHeight();return Math.min(Math.max(0,s*t-i+s/2),r)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(zn(this._destroy)).subscribe(()=>{this.panelOpen&&(this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._changeDetectorRef.markForCheck())})}open(){super._canOpen()&&(super.open(),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const i=EO(t,this.options,this.optionGroups),r=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===i?0:function(n,e,t,i){return nt+i?Math.max(0,n-i+e):t}((t+i)*r,r,this.panel.nativeElement.scrollTop,256)}_positioningSettled(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}_panelDoneAnimating(t){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),super._panelDoneAnimating(t)}_getChangeEvent(t){return new JIe(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),i=this._viewportRuler.getViewportSize(),r=this._isRtl(),s=this.multiple?56:32;let o;if(this.multiple)o=40;else if(this.disableOptionCentering)o=16;else{let c=this._selectionModel.selected[0]||this.options.first;o=c&&c.group?32:16}r||(o*=-1);const a=0-(t.left+o-(r?s:0)),l=t.right+o-i.width+(r?0:s);a>0?o+=a+8:l>0&&(o-=l+8),this._overlayDir.offsetX=Math.round(o),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,i,r){const s=this._getItemHeight(),o=(s-this._triggerRect.height)/2,a=Math.floor(256/s);let l;return this.disableOptionCentering?0:(l=0===this._scrollTop?t*s:this._scrollTop===r?(t-(this._getItemCount()-a))*s+(s-(this._getItemCount()*s-256)%s):i-s/2,Math.round(-1*l-o))}_checkOverlayWithinViewport(t){const i=this._getItemHeight(),r=this._viewportRuler.getViewportSize(),s=this._triggerRect.top-8,o=r.height-this._triggerRect.bottom-8,a=Math.abs(this._offsetY),c=Math.min(this._getItemCount()*i,256)-a-this._triggerRect.height;c>o?this._adjustPanelUp(c,o):a>s?this._adjustPanelDown(a,s,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,i){const r=Math.round(t-i);this._scrollTop-=r,this._offsetY-=r,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,i,r){const s=Math.round(t-i);if(this._scrollTop+=s,this._offsetY+=s,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=r)return this._scrollTop=r,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),i=this._getItemCount(),r=Math.min(i*t,256),o=i*t-r;let a;a=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),a+=EO(a,this.options,this.optionGroups);const l=r/2;this._scrollTop=this._calculateOverlayScroll(a,l,o),this._offsetY=this._calculateOverlayOffsetY(a,l,o),this._checkOverlayWithinViewport(o)}_getOriginBasedOnOption(){const t=this._getItemHeight(),i=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-i+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275cmp=Le({type:n,selectors:[["mat-select"]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,Nq,5),Fi(r,WE,5),Fi(r,GE,5)),2&t){let s;Mt(s=xt())&&(i.customTrigger=s.first),Mt(s=xt())&&(i.options=s),Mt(s=xt())&&(i.optionGroups=s)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,i){1&t&&ye("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),2&t&&(en("id",i.id)("tabindex",i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-describedby",i._ariaDescribedby||null)("aria-activedescendant",i._getAriaActiveDescendant()),at("mat-select-disabled",i.disabled)("mat-select-invalid",i.errorState)("mat-select-required",i.required)("mat-select-empty",i.empty)("mat-select-multiple",i.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[At([{provide:Nv,useExisting:n},{provide:$E,useExisting:n}]),ht],ngContentSelectors:qIe,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(t,i){if(1&t&&(Dr(WIe),F(0,"div",0,1),ye("click",function(){return i.toggle()}),F(3,"div",2),Ct(4,UIe,2,1,"span",3),Ct(5,$Ie,3,2,"span",4),N(),F(6,"div",5),et(7,"div",6),N(),N(),Ct(8,GIe,4,14,"ng-template",7),ye("backdropClick",function(){return i.close()})("attach",function(){return i._onAttached()})("detach",function(){return i.close()})),2&t){const r=Ys(1);en("aria-owns",i.panelOpen?i.id+"-panel":null),Y(3),ie("ngSwitch",i.empty),en("id",i._valueId),Y(1),ie("ngSwitchCase",!0),Y(1),ie("ngSwitchCase",!1),Y(3),ie("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",r)("cdkConnectedOverlayOpen",i.panelOpen)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayMinWidth",null==i._triggerRect?null:i._triggerRect.width)("cdkConnectedOverlayOffsetY",i._offsetY)}},directives:[Doe,Cv,vD,DU,E3,sE],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[Pq.transformPanelWrap,Pq.transformPanel]},changeDetection:0}),n})(),Lq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[QIe],imports:[[bn,$v,qE,Nn],zv,Lv,qE,Nn]}),n})();function iPe(n,e){if(1&n&&(F(0,"mat-option",5),Te(1),N()),2&n){const t=e.$implicit;ie("value",t),Y(1),bw(" ",t.name," (",t.sites.length,") ")}}function rPe(n,e){if(1&n){const t=Lr();F(0,"mat-form-field",1),F(1,"mat-label",2),Te(2,"Landmark Set"),N(),F(3,"mat-select",3),ye("selectionChange",function(r){return Vn(t),bt().extractionSetChanged(r.value)}),Ct(4,iPe,2,3,"mat-option",4),N(),N()}if(2&n){const t=bt();Y(3),ie("value",t.sets[0]),Y(1),ie("ngForOf",t.sets)}}let sPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-extraction-set-dropdown",this.setChange=new Pe}extractionSetChanged(t){this.selected=t,this.ga.event("selected_extraction_set_change","extraction_set_dropdown",t.name),this.setChange.emit(t)}isMultiple(){return this.sets.length>1}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-extraction-set-dropdown"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{sets:"sets"},outputs:{setChange:"setChange"},decls:1,vars:1,consts:[["class","dropdown-form-field","appearance","fill",4,"ngIf"],["appearance","fill",1,"dropdown-form-field"],[1,"extraction-dropdown-label"],["disableOptionCentering","true","panelClass","extraction-set-panel",3,"value","selectionChange"],["class","extraction-set-options",3,"value",4,"ngFor","ngForOf"],[1,"extraction-set-options",3,"value"]],template:function(t,i){1&t&&Ct(0,rPe,5,2,"mat-form-field",0),2&t&&ie("ngIf",i.isMultiple())},directives:[Is,tm,Bf,nPe,Xl,WE],styles:[".extraction-set-panel{box-shadow:0 0 .3rem .1rem #9e9e9e;position:absolute;top:-1rem;left:1rem;width:10.5rem} .extraction-set-panel .extraction-set-options{height:2.5rem!important} .extraction-set-panel .extraction-set-options:first-child{margin-top:.5rem} .extraction-set-panel .extraction-set-options:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .mat-form-field{width:10.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper{padding-bottom:.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-flex{padding:0}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:.75rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:none} .cdk-overlay-pane{min-width:0rem!important}"],changeDetection:0}),n})();function oPe(n,e){if(1&n&&(ff(0),et(1,"ccf-details-label",19),yn(2,"async"),pf()),2&n){const t=bt();Y(1),ie("details",wn(2,1,t.detailsLabels$))}}function aPe(n,e){if(1&n){const t=Lr();F(0,"div",9),F(1,"ccf-extraction-set-dropdown",20,21),ye("setChange",function(r){return Vn(t),bt().model.setExtractionSites(r.sites)}),yn(3,"async"),N(),F(4,"ccf-visibility-menu",22),ye("itemsChange",function(r){return Vn(t),bt().model.setExtractionSites(r)})("hover",function(r){return Vn(t),bt().updateExtractionSiteTooltip(r)}),yn(5,"async"),N(),N()}if(2&n){const t=bt();Y(1),ie("sets",wn(3,2,t.model.extractionSets$)),Y(3),ie("items",wn(5,4,t.model.extractionSites$))}}function lPe(n,e){if(1&n&&(F(0,"div",23),Te(1),N()),2&n){const t=bt();Y(1),Os(" ",t.extractionSiteTooltip," ")}}const cPe=function(){return["Male","Female"]};let uPe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.registration=r,this.clsName="ccf-left-sidebar",this.disableSlider=!1,this.modalClosed=!1,this.sexByLabel$=this.model.sex$.pipe(be(s=>"female"===s?"Female":"Male")),this.sideByLabel$=this.model.side$.pipe(be(s=>"left"===s?"L":"R")),this.organSelected$=this.model.organ$.pipe(be(s=>void 0!==s)),this.detailsLabels$=or([this.model.organ$,this.model.side$,this.model.sex$]).pipe(be(([s,o,a])=>[null==s?void 0:s.name,o,a])),this.extractionSiteTooltip="",this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures],this.organList=_F}updateExtractionSiteTooltip(t){this.extractionSiteTooltip=(null==t?void 0:t.tooltip)?t.tooltip:""}setSexFromLabel(t){this.model.setSex("Female"===t?"female":"male")}setSideFromLabel(t){this.model.setSide("L"===t?"left":"right")}togglePreviousRegistrationBlocks(t){t&&(this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures]),this.model.toggleRegistrationBlocksVisibility(t,this.previousVisibilityItems)}updateRegistration(t){this.registration.editRegistration(t)}}return n.\u0275fac=function(t){return new(t||n)(E(Ui),E(si),E(wr))},n.\u0275cmp=Le({type:n,selectors:[["ccf-left-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{disableSlider:"disableSlider",modalClosed:"modalClosed"},decls:31,vars:22,consts:[[1,"scroll-wrapper"],[1,"container"],[4,"ngIf"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"disabled","labels","value","valueChange"],[1,"anatomical-structures-menu",3,"expanded"],[1,"expansion-header"],["matTooltip","Use opacity icons to change visibility of anatomical structures",1,"expansion-title"],[1,"expansion-content"],[3,"items","itemsChange"],[1,"extraction-menu",3,"expanded"],["matTooltip","Some organs have predefined landmarks to guide manual tissue registration--you can turn these on/off.",1,"expansion-title"],["class","expansion-content",4,"ngIf"],["toggleLabel","Previously Registered Blocks","matTooltip","If you previously registered tissue blocks, you can turn their positions on/off.",3,"visible","disabled","visibilityChanged"],[1,"space"],["class","extraction-site-tooltip mat-elevation-z8",4,"ngIf"],[1,"filler"],["label","UPLOAD PREVIOUS REGISTRATION DATA",3,"parsedJson"],[3,"details"],[3,"sets","setChange"],["dropdown",""],[3,"items","itemsChange","hover"],[1,"extraction-site-tooltip","mat-elevation-z8"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),Ct(2,oPe,3,3,"ng-container",2),yn(3,"async"),F(4,"div",3),F(5,"div",4),Te(6,"Donor Sex:"),N(),F(7,"ccf-labeled-slide-toggle",5),ye("valueChange",function(s){return i.setSexFromLabel(s)}),yn(8,"async"),N(),N(),et(9,"mat-divider"),F(10,"mat-expansion-panel",6),F(11,"mat-expansion-panel-header",7),F(12,"mat-panel-title",8),Te(13,"Anatomical Structures"),N(),N(),F(14,"div",9),F(15,"ccf-visibility-menu",10),ye("itemsChange",function(s){return i.model.setAnatomicalStructures(s)}),yn(16,"async"),N(),N(),N(),et(17,"mat-divider"),F(18,"mat-expansion-panel",11),F(19,"mat-expansion-panel-header",7),F(20,"mat-panel-title",12),Te(21,"Landmarks"),N(),N(),Ct(22,aPe,6,6,"div",13),yn(23,"async"),N(),et(24,"mat-divider"),F(25,"ccf-visibility-toggle",14),ye("visibilityChanged",function(s){return i.togglePreviousRegistrationBlocks(s)}),yn(26,"async"),N(),et(27,"div",15),Ct(28,lPe,2,1,"div",16),et(29,"div",17),F(30,"ccf-json-file-reader",18),ye("parsedJson",function(s){return i.updateRegistration(s)}),N(),N(),N()),2&t&&(Y(2),ie("ngIf",wn(3,11,i.page.registrationCallbackSet$)),Y(5),ie("disabled",i.disableSlider)("labels",lv(21,cPe))("value",wn(8,13,i.sexByLabel$)),Y(3),ie("expanded",i.modalClosed),Y(5),ie("items",wn(16,15,i.model.anatomicalStructures$)),Y(3),ie("expanded",i.modalClosed),Y(4),ie("ngIf",wn(23,17,i.organSelected$)),Y(3),ie("visible",wn(26,19,i.model.showPrevious$))("disabled",i.disableSlider),Y(3),ie("ngIf",i.extractionSiteTooltip.length>0))},directives:[Is,cc,vF,Sq,NM,LM,PG,EIe,FIe,LIe,BIe,sPe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{overflow-y:scroll;height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:1.5rem;margin-right:.375rem;min-height:100%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .space[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .ccf-organ-selector[_ngcontent-%COMP%]{margin-top:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .expansion-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header{-webkit-user-select:none;-moz-user-select:none;padding:0;font-weight:bold;height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator{display:flex;align-items:center;justify-content:center;height:24px;width:24px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%]{margin-bottom:.75rem;text-align:center;margin-top:2.25rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%]{width:100%;font-size:.9rem;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-site-tooltip[_ngcontent-%COMP%]{position:absolute;top:4rem;left:27rem;width:21rem;padding:1rem;border-radius:.5rem;border:1px solid;z-index:2}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})(),dPe=(()=>{class n{constructor(t,i,r){this.drawer=t,this.cdr=r,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new Ie;const s=i.connect(this);this.subscriptions.add(s.getMessagesFromSource(t).subscribe(o=>{this.handleMessage(o)&&r.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",i="arrow_left";return"end"===this.position&&([t,i]=[i,t]),this.opened?i:t}ngAfterViewInit(){setTimeout(()=>{this.position=this.drawer.position,this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return"drawer-toggled"===t.payload.type&&(this.opened=t.payload.opened,!0)}toggle(){const t=this.drawer,{opened:i,expanded:r}=t;i?r?t.closeExpanded():t.close():t.open()}}return n.\u0275fac=function(t){return new(t||n)(E(CF),E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,i){2&t&&(Fn(i.className),at("ccf-drawer-toggle-button-end",i.classEnd))},decls:4,vars:4,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,i){1&t&&(F(0,"mat-icon",0),ye("click",function(){return i.toggle()}),Te(1," arrow_right\n"),N(),F(2,"mat-icon",0),ye("click",function(){return i.toggle()}),Te(3," arrow_left\n"),N()),2&t&&(at("hidden","arrow_left"===i.icon),Y(2),at("hidden","arrow_right"===i.icon))},directives:[Rs],styles:["[_nghost-%COMP%]{position:absolute;top:calc(50% - 2.0625rem);right:-1.0625rem;width:1.0625rem;height:3rem;border-radius:0 .25rem .25rem 0;cursor:pointer;transition:.25s}.ccf-drawer-toggle-button-end[_nghost-%COMP%]{right:unset;left:calc(-1rem - 1px);border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{position:absolute;right:0rem;transition:.6s;padding-left:.15rem}[_nghost-%COMP%] .expand-collapse-icon.hidden[_ngcontent-%COMP%]{opacity:0}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}.mat-icon[_ngcontent-%COMP%]{right:.3rem;top:.675rem;padding-top:.05rem}"],changeDetection:0}),n})();const Bq={x:10,y:10,z:10};let hPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-block-size-input",this.blockSize=Bq,this.blockSizeChange=new Pe}updateBlockSizes(t,i){const r=t.target;this.blockSize=Object.assign(Object.assign({},this.blockSize),{[i]:+r.value}),this.ga.event("block_size_change","block_size_input",i,this.blockSize[i]),this.blockSizeChange.emit(this.blockSize)}refreshBlockSize(){this.blockSize=Bq,this.ga.event("block_size_reset","block_size_input"),this.blockSizeChange.emit(this.blockSize)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-block-size-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{blockSize:"blockSize"},outputs:{blockSizeChange:"blockSizeChange"},decls:19,vars:5,consts:[["matTooltip","Set the tissue block width, height and depth (dimensions)",1,"header"],[1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"size-inputs"],["floatLabel","always",1,"field"],[1,"text","label"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block width.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block height.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block depth.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Block Dimensions (mm)"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.refreshBlockSize()}),Te(5,"refresh"),N(),N(),F(6,"div",4),F(7,"mat-form-field",5),F(8,"mat-label",6),Te(9,"Width (X)"),N(),F(10,"input",7),ye("input",function(s){return i.updateBlockSizes(s,"x")}),N(),N(),F(11,"mat-form-field",5),F(12,"mat-label",6),Te(13,"Height (Y)"),N(),F(14,"input",8),ye("input",function(s){return i.updateBlockSizes(s,"y")}),N(),N(),F(15,"mat-form-field",5),F(16,"mat-label",6),Te(17,"Depth (Z)"),N(),F(18,"input",9),ye("input",function(s){return i.updateBlockSizes(s,"z")}),N(),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("value",i.blockSize.x),Y(4),ie("value",i.blockSize.y),Y(4),ie("value",i.blockSize.z))},directives:[cc,Rs,Qo,tm,Bf,Hb],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;height:1.5rem;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const Vq={thickness:NaN,numSlices:NaN};let fPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-slices-input",this.slicesConfig=Vq,this.slicesConfigChange=new Pe}get hasThicknessValue(){return!isNaN(this.slicesConfig.thickness)}updateSlicesData(t,i){const{value:r}=t.target;this.slicesConfig=Object.assign(Object.assign({},this.slicesConfig),{[i]:""!==r?+r:NaN}),this.ga.event("slice_config_update","slice_input",i,this.slicesConfig[i]),this.slicesConfigChange.emit(this.slicesConfig)}refreshSlices(){this.slicesConfig=Vq,this.ga.event("slice_config_reset","slice_input"),this.slicesConfigChange.emit(this.slicesConfig)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-slices-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{slicesConfig:"slicesConfig"},outputs:{slicesConfigChange:"slicesConfigChange"},decls:17,vars:6,consts:[[1,"header"],["matTooltip","\u201cAdd thickness of tissue sections and the total number of sections",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slices-inputs"],[1,"field"],[1,"text","label"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter thickness of tissue sections",1,"input",3,"value","input"],["matSuffix","",1,"suffix"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter total number of sections",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Sections"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.refreshSlices()}),Te(5," refresh "),N(),N(),F(6,"div",4),F(7,"mat-form-field",5),F(8,"mat-label",6),Te(9,"Thickness"),N(),F(10,"input",7),ye("input",function(s){return i.updateSlicesData(s,"thickness")}),N(),F(11,"div",8),Te(12,"\u03bcm"),N(),N(),F(13,"mat-form-field",5),F(14,"mat-label",6),Te(15,"# Sections"),N(),F(16,"input",9),ye("input",function(s){return i.updateSlicesData(s,"numSlices")}),N(),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("value",i.slicesConfig.thickness),Y(1),at("show",i.hasThicknessValue),Y(5),ie("value",i.slicesConfig.numSlices))},directives:[cc,Rs,Qo,tm,Bf,Hb,oOe,SO],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field.mat-focused[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%], [_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix.show[_ngcontent-%COMP%]{display:initial}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const jq={x:0,y:0,z:0};let pPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-rotation-slider",this.rotation=jq,this.rotationChange=new Pe}changeRotation(t,i){this.rotation=Object.assign(Object.assign({},this.rotation),{[i]:+t}),this.ga.event("rotation_update","rotation_slider",i,+t),this.rotationChange.emit(this.rotation)}resetRotation(){this.rotation=jq,this.ga.event("rotation_reset","rotation_slider"),this.rotationChange.emit(this.rotation)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-rotation-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{rotation:"rotation"},outputs:{rotationChange:"rotationChange"},decls:27,vars:23,consts:[[1,"header"],["matTooltip","Use sliders below to rotate tissue block for registration",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slider-box","red"],[1,"text","label"],[1,"slider-container"],[1,"slider",3,"max","min","step","thumbLabel","tickInterval","value","input"],[1,"text","value"],[1,"slider-box","green"],[1,"slider-box","blue"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Block Rotation"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.resetRotation()}),Te(5,"refresh"),N(),N(),F(6,"div",4),F(7,"span",5),Te(8,"X"),N(),F(9,"div",6),F(10,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"x")}),N(),N(),F(11,"span",8),Te(12),N(),N(),F(13,"div",9),F(14,"span",5),Te(15,"Y"),N(),F(16,"div",6),F(17,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"y")}),N(),N(),F(18,"span",8),Te(19),N(),N(),F(20,"div",10),F(21,"span",5),Te(22,"Z"),N(),F(23,"div",6),F(24,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"z")}),N(),N(),F(25,"span",8),Te(26),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.x),Y(2),Ai(i.rotation.x),Y(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.y),Y(2),Ai(i.rotation.y),Y(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.z),Y(2),Ai(i.rotation.z))},directives:[cc,Rs,Qo,wk],styles:["[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;height:4rem;padding-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:1rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{width:2.75rem;text-align:center}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{width:100%;padding:1rem 2rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:not(.cdk-focused) .mat-slider-thumb{width:1.25rem;height:1.25rem;transform:none}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper{right:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper:after{margin-top:-.25rem;height:.625rem!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container{margin-top:-.25rem;height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container .mat-slider-ticks{height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function mPe(n){const{subscriber:e,counter:t,period:i}=n;e.next(t),this.schedule({subscriber:e,counter:t+1,period:i},i)}const _Pe=["input"],yPe=function(n){return{enterDuration:n}},vPe=["*"],bPe=new _e("mat-checkbox-default-options",{providedIn:"root",factory:Uq});function Uq(){return{color:"accent",clickAction:"check-indeterminate"}}let CPe=0;const zq=Uq(),wPe={provide:Ao,useExisting:T(()=>Hq),multi:!0};class EPe{}const SPe=Nf(kf(Ff(em(class{constructor(n){this._elementRef=n}}))));let Hq=(()=>{class n extends SPe{constructor(t,i,r,s,o,a,l){super(t),this._changeDetectorRef=i,this._focusMonitor=r,this._ngZone=s,this._animationMode=a,this._options=l,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++CPe,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Pe,this.indeterminateChange=new Pe,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||zq,this.color=this.defaultColor=this._options.color||zq.color,this.tabIndex=parseInt(o)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=Dt(t)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t||Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}),this._syncIndeterminate(this._indeterminate)}ngAfterViewChecked(){}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}get checked(){return this._checked}set checked(t){t!=this.checked&&(this._checked=t,this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){const i=Dt(t);i!==this.disabled&&(this._disabled=i,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const i=t!=this._indeterminate;this._indeterminate=Dt(t),i&&(this._transitionCheckState(this._indeterminate?3:this.checked?1:2),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(t){this.checked=!!t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_getAriaChecked(){return this.checked?"true":this.indeterminate?"mixed":"false"}_transitionCheckState(t){let i=this._currentCheckState,r=this._elementRef.nativeElement;if(i!==t&&(this._currentAnimationClass.length>0&&r.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){r.classList.add(this._currentAnimationClass);const s=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{r.classList.remove(s)},1e3)})}}_emitChangeEvent(){const t=new EPe;t.source=this,t.checked=this.checked,this._controlValueAccessorChangeFn(this.checked),this.change.emit(t),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked}_onInputClick(t){var i;const r=null===(i=this._options)||void 0===i?void 0:i.clickAction;t.stopPropagation(),this.disabled||"noop"===r?!this.disabled&&"noop"===r&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==r&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,i){t?this._focusMonitor.focusVia(this._inputElement,t,i):this._inputElement.nativeElement.focus(i)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,i){if("NoopAnimations"===this._animationMode)return"";let r="";switch(t){case 0:if(1===i)r="unchecked-checked";else{if(3!=i)return"";r="unchecked-indeterminate"}break;case 2:r=1===i?"unchecked-checked":"unchecked-indeterminate";break;case 1:r=2===i?"checked-unchecked":"checked-indeterminate";break;case 3:r=1===i?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${r}`}_syncIndeterminate(t){const i=this._inputElement;i&&(i.nativeElement.indeterminate=t)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(hl),E(lt),fs("tabindex"),E(Zo,8),E(bPe,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-checkbox"]],viewQuery:function(t,i){if(1&t&&(ni(_Pe,5),ni(Qo,5)),2&t){let r;Mt(r=xt())&&(i._inputElement=r.first),Mt(r=xt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,i){2&t&&(sl("id",i.id),en("tabindex",null),at("mat-checkbox-indeterminate",i.indeterminate)("mat-checkbox-checked",i.checked)("mat-checkbox-disabled",i.disabled)("mat-checkbox-label-before","before"==i.labelPosition)("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],id:"id",labelPosition:"labelPosition",name:"name",required:"required",checked:"checked",disabled:"disabled",indeterminate:"indeterminate",ariaDescribedby:["aria-describedby","ariaDescribedby"],value:"value"},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[At([wPe]),ht],ngContentSelectors:vPe,decls:17,vars:21,consts:[[1,"mat-checkbox-layout"],["label",""],[1,"mat-checkbox-inner-container"],["type","checkbox",1,"mat-checkbox-input","cdk-visually-hidden",3,"id","required","checked","disabled","tabIndex","change","click"],["input",""],["matRipple","",1,"mat-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleRadius","matRippleCentered","matRippleAnimation"],[1,"mat-ripple-element","mat-checkbox-persistent-ripple"],[1,"mat-checkbox-frame"],[1,"mat-checkbox-background"],["version","1.1","focusable","false","viewBox","0 0 24 24",0,"xml","space","preserve","aria-hidden","true",1,"mat-checkbox-checkmark"],["fill","none","stroke","white","d","M4.1,12.7 9,17.6 20.3,6.3",1,"mat-checkbox-checkmark-path"],[1,"mat-checkbox-mixedmark"],[1,"mat-checkbox-label",3,"cdkObserveContent"],["checkboxLabel",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"span",2),F(3,"input",3,4),ye("change",function(s){return i._onInteractionEvent(s)})("click",function(s){return i._onInputClick(s)}),N(),F(5,"span",5),et(6,"span",6),N(),et(7,"span",7),F(8,"span",8),Ut.lFrame.currentNamespace=Bn,F(9,"svg",9),et(10,"path",10),N(),Ut.lFrame.currentNamespace=null,et(11,"span",11),N(),N(),F(12,"span",12,13),ye("cdkObserveContent",function(){return i._onLabelTextChange()}),F(14,"span",14),Te(15,"\xa0"),N(),In(16),N(),N()),2&t){const r=Ys(1),s=Ys(13);en("for",i.inputId),Y(2),at("mat-checkbox-inner-container-no-side-margin",!s.textContent||!s.textContent.trim()),Y(1),ie("id",i.inputId)("required",i.required)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex),en("value",i.value)("name",i.name)("aria-label",i.ariaLabel||null)("aria-labelledby",i.ariaLabelledby)("aria-checked",i._getAriaChecked())("aria-describedby",i.ariaDescribedby),Y(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Fg(19,yPe,"NoopAnimations"===i._animationMode?0:150))}},directives:[Qo,kD],styles:["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"],encapsulation:2,changeDetection:0}),n})(),$q=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),TPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn,_E,$q],Nn,$q]}),n})();const APe=["closeSearch"];function DPe(n,e){if(1&n){const t=Lr();F(0,"div",12),F(1,"mat-checkbox",13),ye("ngModelChange",function(r){const o=Vn(t).$implicit;return bt(2).checkedResults[o.id]=r}),Te(2),N(),N()}if(2&n){const t=e.$implicit,i=bt(2);Y(1),ie("ngModel",i.checkedResults[t.id]),Y(1),Os(" ",t.label," ")}}function OPe(n,e){if(1&n&&(F(0,"div",9),Ct(1,DPe,3,2,"div",10),F(2,"div",11),Te(3),yn(4,"i18nPlural"),N(),N()),2&n){const t=bt();Y(1),ie("ngForOf",t.searchResults.results)("ngForTrackBy",t.tagId),Y(2),Os(" ",QL(4,3,t.searchResults.totalCount,t.countMapping)," ")}}const Gq=5,d1={totalCount:0,results:[]};class gp{constructor(e,t,i){this.el=e,this.ga=t,this.clsName="ccf-tag-search",this.placeholder="Add Anatomical Structures ...",this.added=new Pe,this.countMapping={"=1":"1 result",other:"# results"},this.searchControl=new vh,this.searchResults=d1,this.checkedResults={},this.resultsVisible=!1,this.destroy$=new we,this.searchControl.valueChanges.pipe(zn(this.destroy$),function(n,e=_G){return t=>t.lift(new zMe(n,!!e.leading,!!e.trailing))}(()=>{var r;return function(n=0,e=Tf){return(!IO(n)||n<0)&&(n=0),(!e||"function"!=typeof e.schedule)&&(e=Tf),new oe(t=>(t.add(e.schedule(mPe,n,{subscriber:t,counter:0,period:n})),t))}(null!==(r=this.searchThrottle)&&void 0!==r?r:100)},{leading:!0,trailing:!0}),Ir(this.executeSearch)).subscribe(r=>{this.searchResults=r,this.checkedResults=this.getUpdatedCheckedResults(r),i.markForCheck()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}tagId(e,t){return t.id}hasCheckedTags(){return Object.values(this.checkedResults).some(e=>e)}addTags(){const{searchControl:e,searchResults:t,checkedResults:i}=this,r=t.results.filter(s=>i[s.id]);r.length>0&&(e.reset(),this.searchResults=d1,this.checkedResults={},this.ga.event("tags_added","tag_search",r.map(s=>s.label).join(",")),this.added.emit(r))}openResults(){this.resultsVisible||(this.resultsVisible=!0)}closeResults(e){const{closeSearch:t}=this;this.resultsVisible&&e.target instanceof Node&&(!this.el.nativeElement.contains(e.target)||t.nativeElement.contains(e.target))&&(this.resultsVisible=!1)}executeSearch(e){const{search:t,searchLimit:i=Gq}=this;return e&&t?li(t(e,i)).pipe(Sa(()=>[d1]),be(this.truncateResults)):[d1]}truncateResults(e){const{searchLimit:t=Gq}=this,i=e.results;return i.length>t?Object.assign(Object.assign({},e),{results:i.slice(0,t)}):e}getUpdatedCheckedResults(e){const t=this.checkedResults;return e.results.reduce((i,{id:r})=>{var s;return i[r]=null!==(s=t[r])&&void 0!==s&&s,i},{})}}function PPe(n,e){if(1&n&&(F(0,"div",11),F(1,"div",12),Te(2),N(),F(3,"div",13),Te(4),N(),N()),2&n){const t=e.$implicit;Y(2),Ai(t.label),Y(2),Ai(t.value)}}gp.\u0275fac=function(e){return new(e||gp)(E(nt),E(io),E(Un))},gp.\u0275cmp=Le({type:gp,selectors:[["ccf-tag-search"]],viewQuery:function(e,t){if(1&e&&ni(APe,5,nt),2&e){let i;Mt(i=xt())&&(t.closeSearch=i.first)}},hostVars:2,hostBindings:function(e,t){1&e&&ye("click",function(){return t.openResults()})("focusin",function(){return t.openResults()})("click",function(r){return t.closeResults(r)},!1,ny)("focusin",function(r){return t.closeResults(r)},!1,ny),2&e&&Fn(t.clsName)},inputs:{placeholder:"placeholder",search:"search",searchLimit:"searchLimit",searchThrottle:"searchThrottle"},outputs:{added:"added"},decls:10,vars:8,consts:[[1,"spacer"],["appearance","outline",1,"overlay"],[1,"search-box"],["matInput","","type","search",3,"placeholder","formControl"],["search",""],["matSuffix","",1,"add-button",3,"disabled","click"],["closeSearch",""],[1,"icon"],["class","results",4,"ngIf"],[1,"results"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"count"],[1,"item"],["labelPosition","after",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e){const i=Lr();et(0,"div",0),F(1,"mat-form-field",1),F(2,"div",2),et(3,"input",3,4),F(5,"button",5,6),ye("click",function(){Vn(i);const s=Ys(4);return t.addTags(),s.focus()}),F(7,"mat-icon",7),Te(8,"add"),N(),N(),N(),Ct(9,OPe,5,6,"div",8),N()}2&e&&(Y(1),at("expanded",t.resultsVisible),Y(2),ie("placeholder",t.placeholder)("formControl",t.searchControl),Y(2),at("active",t.hasCheckedTags()),ie("disabled",!t.hasCheckedTags()),Y(4),ie("ngIf",t.resultsVisible))},directives:[tm,Hb,Lb,ek,kM,SO,Rs,Is,Xl,Hq,dk],pipes:[x3],styles:["[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] .spacer[_ngcontent-%COMP%]{height:3.25rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;z-index:10}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;height:3rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .add-button[_ngcontent-%COMP%]{border-radius:.25rem;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;height:100%}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-top:.5rem;font-size:.75rem;text-align:end}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:0;border-radius:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex{padding-right:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline{opacity:1!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline-thick{opacity:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-infix{padding:.313rem .063rem .063rem;border:0}[_nghost-%COMP%] .overlay.expanded[_ngcontent-%COMP%] .mat-form-field-wrapper{box-shadow:0 0 .3rem .1rem #9e9e9e5e}"],changeDetection:0}),De([su.ak],gp.prototype,"executeSearch",null),De([su.ak],gp.prototype,"truncateResults",null);let RPe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.clsName="ccf-review-modal",this.metaData=i.metaData,this.registrationCallbackSet=i.registrationCallbackSet}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return n.\u0275fac=function(t){return new(t||n)(E(Gm),E(xk))},n.\u0275cmp=Le({type:n,selectors:[["ccf-review-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:14,vars:2,consts:[[1,"ccf-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography"],[1,"display-fields"],["class","field",4,"ngFor","ngForOf"],[1,"footer"],["mat-button","",1,"download-button",3,"click"],[1,"field"],[1,"label"],[1,"data"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),F(3,"mat-icon",3),ye("click",function(){return i.close()}),Te(4,"clear"),N(),N(),F(5,"div",4),F(6,"h2",5),Te(7,"Registration Review"),N(),F(8,"mat-dialog-content",6),F(9,"div",7),Ct(10,PPe,5,2,"div",8),N(),N(),F(11,"div",9),F(12,"button",10),ye("click",function(){return i.dialogRef.close(!0)}),Te(13),N(),N(),N(),N(),N()),2&t&&(Y(10),ie("ngForOf",i.metaData),Y(3),Ai(i.registrationCallbackSet?"REGISTER":"DOWNLOAD REGISTRATION DATA"))},directives:[Rs,xG,TG,Xl,$f],styles:[".mat-dialog-container{padding:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;background-color:#fff}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{text-align:center;font-size:1.5rem;margin-bottom:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%]{justify-content:space-around;display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%]{margin-top:2rem;margin-bottom:2rem;width:100%}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:50%;text-align:right;padding-right:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .data[_ngcontent-%COMP%]{width:50%;text-align:left;padding-left:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;margin-top:1rem;margin-right:1rem;cursor:pointer}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{padding-top:1.5rem;display:flex;justify-content:space-around}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .review-button[_ngcontent-%COMP%]{height:3rem}"]}),n})(),kPe=(()=>{class n{constructor(t,i){this.dialog=t,this.ga=i,this.clsName="ccf-review-button",this.registrationCallbackSet=!0,this.metaData=[],this.displayErrors=!0,this.registrationIsValid=!1,this.registerData=new Pe,this.enterErrorMode=new Pe}ngOnChanges(){this.registrationIsValid=this.metaData.length>=3&&this.metaData.slice(0,3).every(t=>t.value)}get disabled(){return!this.registrationIsValid}registerButtonClick(t){return t&&t.preventDefault(),this.enterErrorMode.emit(),this.registrationIsValid&&(this.ga.event("review_start","review_button"),this.launchReviewModal()),!1}launchReviewModal(){this.dialog.open(RPe,{panelClass:"modal-animated",width:"60rem",data:{registrationCallbackSet:this.registrationCallbackSet,metaData:this.metaData}}).afterClosed().subscribe(i=>{i&&(this.ga.event("register","review_button"),this.registerData.emit())})}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-review-button"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{registrationCallbackSet:"registrationCallbackSet",metaData:"metaData",displayErrors:"displayErrors",registrationIsValid:"registrationIsValid"},outputs:{registerData:"registerData",enterErrorMode:"enterErrorMode"},features:[qn],decls:2,vars:4,consts:[["mat-button","",1,"review-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(F(0,"button",0),ye("click",function(s){return i.registerButtonClick(s)}),Te(1),N()),2&t&&(at("disabled",i.disabled),ie("matTooltip",i.disabled?"Required: Select an organ and position tissue block inside organ.":"Review registration and submit/download."),Y(1),Os(" ",i.registrationCallbackSet?"REVIEW AND REGISTER":"REVIEW AND DOWNLOAD","\n"))},directives:[$f,cc],styles:[".review-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;font-weight:500}.review-button.disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]}),n})();function FPe(n,e){if(1&n){const t=Lr();F(0,"mat-chip",2),ye("removed",function(){const s=Vn(t).$implicit;return bt().removeTag(s)}),Te(1),F(2,"mat-icon",3),Te(3,"cancel"),N(),N()}if(2&n){const t=e.$implicit;Fn(bt().tagClasses(t)),Y(1),Os(" ",t.label," ")}}let NPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-tag-list",this.tagRemoved=new Pe,this.tagsChange=new Pe}tagId(t,i){return i.id}tagClasses(t){return"added"===t.type?["added"]:["assigned"]}removeTag(t){this.tags=this.tags.filter(i=>i!==t),this.ga.event("tag_removed","tag_list",t.label),this.tagRemoved.emit(t),this.tagsChange.emit(this.tags)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-tag-list"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{tags:"tags"},outputs:{tagRemoved:"tagRemoved",tagsChange:"tagsChange"},decls:2,vars:2,consts:[["selectable","false"],["removable","","disableRipple","",3,"class","removed",4,"ngFor","ngForOf","ngForTrackBy"],["removable","","disableRipple","",3,"removed"],["matChipRemove","",1,"icon","remove"]],template:function(t,i){1&t&&(F(0,"mat-chip-list",0),Ct(1,FPe,4,3,"mat-chip",1),N()),2&t&&(Y(1),ie("ngForOf",i.tags)("ngForTrackBy",i.tagId))},directives:[Oq,Xl,u0,Rs,Aq],styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto}[_nghost-%COMP%] .mat-chip-list-wrapper{margin:0}"],changeDetection:0}),n})();function LPe(n,e){if(1&n){const t=Lr();F(0,"ccf-tag-list",20),ye("tagRemoved",function(r){return Vn(t),bt().astags.removeTag(r)}),yn(1,"async"),N()}2&n&&ie("tags",wn(1,1,bt().astags.tags$))}function BPe(n,e){}const VPe=function(){return[]};let jPe=(()=>{class n{constructor(t,i,r,s){this.model=t,this.registration=i,this.page=r,this.astags=s,this.clsName="ccf-right-sidebar",this.modalClosed=!1}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(wr),E(Ui),E(Io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-right-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{modalClosed:"modalClosed"},decls:34,vars:28,consts:[[1,"scroll-wrapper"],[1,"container"],[1,"info-button-container"],["videoID","gY3_-LIoKaU","infoTitle","HuBMAP CCF Registration User Interface"],[3,"blockSize","blockSizeChange"],[3,"slicesConfig","slicesConfigChange"],[3,"rotation","rotationChange"],[1,"tags-container",3,"expanded"],[1,"header"],["matTooltip","Review tags generated via collision detection. Add or delete tags as needed."],[3,"search","added"],["class","tag-list",3,"tags","tagRemoved",4,"ngIf","ngIfElse"],["tagListPlaceholder",""],[1,"legend"],[1,"dot","assigned"],[1,"text","assigned"],[1,"dot","added"],[1,"text","added"],[1,"filler"],[3,"registrationCallbackSet","displayErrors","registrationIsValid","metaData","registerData","enterErrorMode"],[1,"tag-list",3,"tags","tagRemoved"]],template:function(t,i){if(1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),et(3,"ccf-info-button",3),N(),F(4,"ccf-block-size-input",4),ye("blockSizeChange",function(s){return i.model.setBlockSize(s)}),yn(5,"async"),N(),F(6,"ccf-slices-input",5),ye("slicesConfigChange",function(s){return i.model.setSlicesConfig(s)}),yn(7,"async"),N(),F(8,"ccf-rotation-slider",6),ye("rotationChange",function(s){return i.model.setRotation(s)}),yn(9,"async"),N(),et(10,"mat-divider"),F(11,"mat-expansion-panel",7),F(12,"mat-expansion-panel-header",8),F(13,"mat-panel-title",9),Te(14,"Anatomical Structure Tags"),N(),N(),F(15,"ccf-tag-search",10),ye("added",function(s){return i.astags.addTags(s)}),N(),Ct(16,LPe,2,3,"ccf-tag-list",11),yn(17,"async"),Ct(18,BPe,0,0,"ng-template",null,12,Rw),F(20,"div",13),et(21,"span",14),F(22,"span",15),Te(23,"Assigned"),N(),et(24,"span",16),F(25,"span",17),Te(26,"Added"),N(),N(),N(),et(27,"mat-divider"),et(28,"div",18),F(29,"ccf-review-button",19),ye("registerData",function(){return i.registration.register()})("enterErrorMode",function(){return i.registration.setDisplayErrors(!i.registration.isValid)}),yn(30,"async"),yn(31,"async"),yn(32,"async"),yn(33,"async"),N(),N(),N()),2&t){const r=Ys(19);let s,o;Y(4),ie("blockSize",wn(5,11,i.model.blockSize$)),Y(2),ie("slicesConfig",wn(7,13,i.model.slicesConfig$)),Y(2),ie("rotation",wn(9,15,i.model.rotation$)),Y(3),ie("expanded",i.modalClosed),Y(4),ie("search",i.astags.searchExternal),Y(1),ie("ngIf",null==(s=wn(17,17,i.model.organ$))?null:s.name)("ngIfElse",r),Y(13),ie("registrationCallbackSet",wn(30,19,i.page.registrationCallbackSet$))("displayErrors",wn(31,21,i.registration.displayErrors$))("registrationIsValid",wn(32,23,i.registration.valid$))("metaData",null!==(o=wn(33,25,i.registration.metadata$))&&void 0!==o?o:lv(27,VPe))}},directives:[rOe,hPe,fPe,pPe,Sq,NM,LM,PG,cc,gp,Is,kPe,NPe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100%;margin-left:1.5rem;margin-right:.375rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .info-button-container[_ngcontent-%COMP%]{height:3.75rem;display:flex;justify-content:flex-end}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 .5rem 0 0;font-weight:bold;-webkit-user-select:none;-moz-user-select:none;font-size:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%]{overflow:visible}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding-left:0;padding-right:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{margin-top:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%] .icon.add[_ngcontent-%COMP%]{position:absolute;width:3.625rem;height:3.625rem;font-size:3.625rem;top:-1.9375rem;right:-1.1875rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list[_ngcontent-%COMP%]{max-height:32rem;margin-left:-1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list-placeholder[_ngcontent-%COMP%]{display:flex;height:4rem;align-items:center;justify-content:center;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{display:flex;width:100%;margin-top:1.5rem;align-items:center;font-size:.9rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{display:inline-block;width:1rem;height:1rem;border-radius:50%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.assigned[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.added[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function Wq(n,e){return Xo((t,i)=>e?e(t[n],i[n]):t[n]===i[n])}const UPe=["input"],zPe=function(n){return{enterDuration:n}},HPe=["*"],$Pe=new _e("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let qq=0;const WPe={provide:Ao,useExisting:T(()=>Zq),multi:!0};class Yq{constructor(e,t){this.source=e,this.value=t}}const Xq=new _e("MatRadioGroup");let Kq=(()=>{class n{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+qq++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new Pe}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=Dt(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(i=>{i.checked=this.value===i.value,i.checked&&(this._selected=i)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new Yq(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return n.\u0275fac=function(t){return new(t||n)(E(Un))},n.\u0275dir=he({type:n,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),n})(),Zq=(()=>{class n extends Kq{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,selectors:[["mat-radio-group"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,Qq,5),2&t){let s;Mt(s=xt())&&(i._radios=s)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[At([WPe,{provide:Xq,useExisting:n}]),ht]}),n})();class qPe{constructor(e){this._elementRef=e}}const YPe=Ff(Nf(qPe));let XPe=(()=>{class n extends YPe{constructor(t,i,r,s,o,a,l,c){super(i),this._changeDetector=r,this._focusMonitor=s,this._radioDispatcher=o,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++qq,this.id=this._uniqueId,this.change=new Pe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===a,c&&(this.tabIndex=So(c,0)),this._removeUniqueSelectionListener=o.listen((d,f)=>{d!==this.id&&f===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const i=Dt(t);this._checked!==i&&(this._checked=i,i&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!i&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),i&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(Dt(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=Dt(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new Yq(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const i=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),i&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(Kq),E(nt),E(Un),E(hl),E(tS),E(String),E(void 0),E(String))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&ni(UPe,5),2&t){let r;Mt(r=xt())&&(i._inputElement=r.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[ht]}),n})(),Qq=(()=>{class n extends XPe{constructor(t,i,r,s,o,a,l,c){super(t,i,r,s,o,a,l,c)}}return n.\u0275fac=function(t){return new(t||n)(E(Xq,8),E(nt),E(Un),E(hl),E(tS),E(Zo,8),E($Pe,8),fs("tabindex"))},n.\u0275cmp=Le({type:n,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._inputElement.nativeElement.focus()}),2&t&&(en("tabindex",null)("id",i.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),at("mat-radio-checked",i.checked)("mat-radio-disabled",i.disabled)("_mat-animation-noopable",i._noopAnimations)("mat-primary","primary"===i.color)("mat-accent","accent"===i.color)("mat-warn","warn"===i.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[ht],ngContentSelectors:HPe,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"span",2),et(3,"span",3),et(4,"span",4),F(5,"input",5,6),ye("change",function(s){return i._onInputInteraction(s)})("click",function(s){return i._onInputClick(s)}),N(),F(7,"span",7),et(8,"span",8),N(),N(),F(9,"span",9),F(10,"span",10),Te(11,"\xa0"),N(),In(12),N(),N()),2&t){const r=Ys(1);en("for",i.inputId),Y(5),ie("id",i.inputId)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex)("required",i.required),en("name",i.name)("value",i.value)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),Y(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Fg(18,zPe,i._noopAnimations?0:150)),Y(2),at("mat-radio-label-before","before"==i.labelPosition)}},directives:[Qo],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),n})(),KPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn],Nn]}),n})();const ZPe=["label"],QPe=["options"],JPe=function(){return["Register","3D\xa0Preview"]};let eRe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-stage-nav",this.side="anterior",this.view3D=!1,this.sideChange=new Pe,this.view3DChange=new Pe,this.isDropdownActive=!1,this.isDropdownHidden=!0}set useDropdownMenu(t){this.isDropdownActive=t,this.isDropdownHidden=!0}get labelEl(){return this.labelRef.nativeElement}get optionsEl(){return this.optionsRef.nativeElement}handleClick(t){const{isDropdownHidden:i,labelEl:r,optionsEl:s}=this;r.contains(t)?this.isDropdownHidden=!i:s.contains(t)||(this.isDropdownHidden=!0)}updateSide(t){this.ga.event("side_update","stage_nav",t),"3D"===t?this.updateView(!0):(this.updateView(!1),this.side=t,this.sideChange.emit(this.side))}updateView(t){this.view3D=t,this.ga.event("view_update","stage_nav",t?"3D":"Register"),this.view3DChange.emit(this.view3D)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-stage-nav"]],viewQuery:function(t,i){if(1&t&&(ni(ZPe,7),ni(QPe,7)),2&t){let r;Mt(r=xt())&&(i.labelRef=r.first),Mt(r=xt())&&(i.optionsRef=r.first)}},hostVars:2,hostBindings:function(t,i){1&t&&ye("click",function(s){return i.handleClick(s.target)},!1,Qp),2&t&&Fn(i.clsName)},inputs:{useDropdownMenu:"useDropdownMenu",side:"side",view3D:"view3D"},outputs:{sideChange:"sideChange",view3DChange:"view3DChange"},decls:18,vars:10,consts:[[1,"dropdown-label"],["label",""],[1,"stage-options"],["options",""],[1,"input-group",3,"value","change"],["value","left",1,"nav-input"],["value","right",1,"nav-input"],["value","anterior","checked","",1,"nav-input"],["value","posterior",1,"nav-input"],["matTooltip","Change view.",1,"view-slider",3,"labels","value","valueChange"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"mat-label"),Te(3,"Options"),N(),F(4,"mat-icon"),Te(5,"arrow_drop_down"),N(),N(),F(6,"div",2,3),F(8,"mat-radio-group",4),ye("change",function(s){return i.updateSide(s.value)}),F(9,"mat-radio-button",5),Te(10,"Left"),N(),F(11,"mat-radio-button",6),Te(12,"Right"),N(),F(13,"mat-radio-button",7),Te(14,"Anterior"),N(),F(15,"mat-radio-button",8),Te(16,"Posterior"),N(),N(),F(17,"ccf-labeled-slide-toggle",9),ye("valueChange",function(s){return i.updateView("Register"!==s)}),N(),N()),2&t&&(at("dropdown",i.isDropdownActive),Y(6),at("dropdowncontainer",i.isDropdownActive)("hidden",i.isDropdownActive&&i.isDropdownHidden),Y(2),ie("value",i.side),Y(9),ie("labels",lv(9,JPe))("value",i.view3D?"3D\xa0Preview":"Register"))},directives:[Bf,Rs,Zq,Qq,vF,cc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%]{display:none;align-items:center}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-label[_ngcontent-%COMP%], [_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{line-height:1.5rem}[_nghost-%COMP%] .dropdown-label.dropdown[_ngcontent-%COMP%]{display:flex;cursor:pointer;align-items:start}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{margin-right:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{margin-left:-1rem;margin-bottom:1.5rem;white-space:nowrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-radius:.25rem;width:16.5rem;position:absolute;top:3.5rem;z-index:1;transition:opacity .25s}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{margin-left:1.5rem;margin-right:0;display:flex;flex-wrap:wrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{display:flex;margin:0 1.5rem 0 0;height:2.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{display:flex;align-items:center;height:3rem;margin:0 .5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:visible;border-top:2px solid}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%]{visibility:hidden;opacity:0;transition:visibility .25s,opacity .25s}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:hidden}"],changeDetection:0}),n})();function tRe(n,e){if(1&n){const t=Lr();F(0,"ccf-body-ui",16),ye("rotationChange",function(r){Vn(t),bt();const s=Ys(24);return s.rotation=r[0],s.rotationX=r[1]}),yn(1,"async"),yn(2,"async"),yn(3,"async"),N()}if(2&n){const t=bt();ie("scene",wn(1,5,t.scene.nodes$))("rotation",wn(2,7,t.scene.rotation$))("bounds",wn(3,9,t.bounds$))("zoom",11.5)("interactive",!0)}}function nRe(n,e){if(1&n){const t=Lr();F(0,"ccf-body-ui",17),ye("nodeDrag",function(r){return Vn(t),bt().handleNodeDrag(r)}),yn(1,"async"),yn(2,"async"),N()}if(2&n){const t=bt();ie("scene",wn(1,4,t.scene.rotatedNodes$))("interactive",!1)("bounds",wn(2,6,t.bounds$))("zoom",11.5)}}function iRe(n,e){1&n&&et(0,"ccf-store-debug",18)}function rRe(n,e){if(1&n){const t=Lr();F(0,"div",19),F(1,"button",20),ye("click",function(){Vn(t);const r=bt();return r.debugMode=!r.debugMode}),Te(2,"State"),N(),F(3,"button",21),ye("click",function(){return Vn(t),bt().registration.setUseRegistrationCallback(!0)}),Te(4,"Use callback"),N(),F(5,"button",21),ye("click",function(){return Vn(t),bt().registration.setUseRegistrationCallback(!1)}),Te(6,"Use download"),N(),N()}}let sRe=(()=>{class n{constructor(t,i,r,s,o,a){this.model=t,this.page=i,this.registration=r,this.scene=s,this.rootRef=o,this.cdr=a,this.clsName="ccf-content",this.position$=this.model.position$.pipe(be(l=>({x:Math.floor(l.x),y:Math.floor(l.y),z:Math.floor(l.z)}))),this.is3DView$=this.model.viewType$.pipe(be(l=>"3d"===l)),this.bounds$=this.model.organDimensions$.pipe(be(l=>({x:Math.max(l.x,this.model.defaultPosition.x+40)/1e3,y:Math.max(l.y,this.model.defaultPosition.y+40)/1e3,z:Math.max(l.z,this.model.defaultPosition.z+40)/1e3})),Wq("x"),Wq("y")),this.isNarrowView=!1,this.debugMode=!1,this.showDebugButtons=!Sh.production}ngOnInit(){this.sensor=new vG.ResizeSensor(this.rootRef.nativeElement,({width:t})=>{const i=t<440;this.isNarrowView!==i&&(this.isNarrowView=i,this.cdr.markForCheck())})}ngOnDestroy(){this.sensor.detach()}setViewType(t){this.model.setViewType(t?"3d":"register")}resetStage(){this.model.setPosition(this.model.defaultPosition),this.model.setViewSide("anterior"),this.model.setViewType("register")}handleNodeDrag(t){if("#DraftPlacement"===t.node["@id"]&&t.info.coordinate){const[i,r]=t.info.coordinate.map(d=>1e3*d),{position:s,viewSide:o,organDimensions:a}=this.model.snapshot,l=[a.x,a.y,a.z].map(d=>d/2);let c=s;switch(o){case"anterior":c={x:i+l[0],y:r+l[1],z:s.z};break;case"posterior":c={x:-i+l[0],y:r+l[1],z:s.z};break;case"left":c={x:s.x,y:r+l[1],z:-i+l[2]};break;case"right":c={x:s.x,y:r+l[1],z:i+l[2]}}this.model.setPosition(c)}}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(Ui),E(wr),E(ss),E(nt),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:29,vars:34,consts:[[1,"top-bar"],[3,"useDropdownMenu","view3D","side","view3DChange","sideChange"],["matRipple","","matRippleColor","rgba(204, 204, 204, 0.25)",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"main-content"],["class","body-ui","camera","perspective",3,"scene","rotation","bounds","zoom","interactive","rotationChange",4,"ngIf"],["class","body-ui","camera","orthographic",3,"scene","interactive","bounds","zoom","nodeDrag",4,"ngIf"],[1,"gizmo-area"],[1,"position-display"],[1,"position"],[1,"x"],[1,"y"],[1,"z"],[1,"gizmo",3,"scene","rotation","interactive","zoom"],["gizmo",""],["class","debug",4,"ngIf"],["style","position: absolute; bottom: 1rem; display: flex; flex-direction: row; justify-content: space-between; width: 7rem;",4,"ngIf"],["camera","perspective",1,"body-ui",3,"scene","rotation","bounds","zoom","interactive","rotationChange"],["camera","orthographic",1,"body-ui",3,"scene","interactive","bounds","zoom","nodeDrag"],[1,"debug"],[2,"position","absolute","bottom","1rem","display","flex","flex-direction","row","justify-content","space-between","width","7rem"],[2,"width","3rem","font-size",".7rem",3,"click"],[3,"click"]],template:function(t,i){if(1&t&&(F(0,"div",0),F(1,"ccf-stage-nav",1),ye("view3DChange",function(s){return i.setViewType(s)})("sideChange",function(s){return i.model.setViewSide(s)}),yn(2,"async"),yn(3,"async"),N(),F(4,"mat-icon",2),ye("click",function(){return i.resetStage()}),Te(5,"refresh"),N(),N(),F(6,"div",3),Ct(7,tRe,4,11,"ccf-body-ui",4),yn(8,"async"),Ct(9,nRe,3,8,"ccf-body-ui",5),yn(10,"async"),F(11,"div",6),F(12,"div",7),F(13,"div",8),F(14,"div",9),Te(15),yn(16,"async"),N(),F(17,"div",10),Te(18),yn(19,"async"),N(),F(20,"div",11),Te(21),yn(22,"async"),N(),N(),N(),et(23,"ccf-body-ui",12,13),yn(25,"async"),yn(26,"async"),N(),N(),Ct(27,iRe,1,0,"ccf-store-debug",14),Ct(28,rRe,7,0,"div",15)),2&t){let r,s,o;Y(1),ie("useDropdownMenu",i.isNarrowView)("view3D",wn(2,16,i.is3DView$))("side",wn(3,18,i.model.viewSide$)),Y(3),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(3),ie("ngIf","3d"===wn(8,20,i.model.viewType$)),Y(2),ie("ngIf","register"===wn(10,22,i.model.viewType$)),Y(6),Os("X: ",null==(r=wn(16,24,i.position$))?null:r.x,""),Y(3),Os("Y: ",null==(s=wn(19,26,i.position$))?null:s.y,""),Y(3),Os("Z: ",null==(o=wn(22,28,i.position$))?null:o.z,""),Y(2),ie("scene",wn(25,30,i.scene.gizmo$))("rotation",wn(26,32,i.scene.rotation$))("interactive",!1)("zoom",9.5),Y(4),ie("ngIf",i.showDebugButtons&&i.debugMode),Y(1),ie("ngIf",i.showDebugButtons)}},directives:[eRe,Rs,Qo,Is,IDe,VDe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;padding:1.5rem;overflow:hidden}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%]{display:flex;height:calc(100% - 1rem)}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .body-ui[_ngcontent-%COMP%]{flex:auto;transition:opacity 1s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%]{width:4rem;margin-top:1.5rem;margin-left:1.5rem;z-index:10}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .position-display[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:1.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%]{height:5.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{opacity:0;z-index:0}[_nghost-%COMP%] .ccf-store-debug[_ngcontent-%COMP%]{color:#fff;position:absolute;top:.5rem;max-width:55rem}"],changeDetection:0}),n})();const oRe=function(n){return[n]};let aRe=(()=>{class n{constructor(t,i,r,s,o,a,l,c){this.model=t,this.page=i,this.consentService=r,this.snackbar=s,this.theming=o,this.globalConfig=c,this.organList=_F,this.open=!0,this.registrationStarted=!1,this.disablePositionChange=!1,this.subscriptions=new Ie,o.initialize(a,l),this.subscriptions.add(i.registrationCallbackSet$.subscribe(d=>{this.open=!d})),this.subscriptions.add(i.registrationStarted$.subscribe(d=>{this.registrationStarted=d}))}ngOnInit(){const t=this.snackbar.openFromComponent(pOe,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3})}handleKey(t){const i=this.model.snapshot.position;if(this.disablePositionChange||!this.registrationStarted)return;t.preventDefault();const r=t.repeat?1:.5;let s=i;switch(t.key){case"q":s=Object.assign(Object.assign({},i),{z:i.z+r});break;case"e":s=Object.assign(Object.assign({},i),{z:i.z-r});break;case"w":s=Object.assign(Object.assign({},i),{y:i.y+r});break;case"s":s=Object.assign(Object.assign({},i),{y:i.y-r});break;case"a":s=Object.assign(Object.assign({},i),{x:i.x-r});break;case"d":s=Object.assign(Object.assign({},i),{x:i.x+r})}this.model.setPosition(s)}handleClick(t){this.disablePositionChange="INPUT"===t.nodeName}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(Ui),E(o0),E(Woe),E(yF),E(nt),E(Tt),E(Eh))},n.\u0275cmp=Le({type:n,selectors:[["ccf-root"]],hostBindings:function(t,i){1&t&&ye("keydown",function(s){return i.handleKey(s)},!1,Qp)("click",function(s){return i.handleClick(s.target)},!1,Qp)},decls:18,vars:16,consts:[["opened",""],[3,"modalClosed","disableSlider"],["position","end","opened",""],[3,"modalClosed"],[1,"selector-drawer"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],[1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",3,"click"],[1,"stage-content"]],template:function(t,i){if(1&t&&(et(0,"ccf-registration-modal"),et(1,"ccf-header"),F(2,"ccf-drawer-container"),F(3,"ccf-drawer",0),et(4,"ccf-left-sidebar",1),et(5,"ccf-drawer-toggle-button"),N(),F(6,"ccf-drawer",2),et(7,"ccf-right-sidebar",3),et(8,"ccf-drawer-toggle-button"),N(),F(9,"ccf-drawer-content"),F(10,"div",4),F(11,"ccf-organ-selector",5,6),ye("organsChanged",function(s){return i.model.setOrgan(s[0])}),yn(13,"async"),N(),F(14,"div",7),F(15,"mat-icon",8),ye("click",function(){return i.open=!i.open}),Te(16),N(),N(),N(),et(17,"ccf-content",9),N(),N()),2&t){const r=Ys(12);Y(4),ie("modalClosed",i.registrationStarted)("disableSlider",!(null!=r.selectedOrgans[0]&&r.selectedOrgans[0].hasSex)),Y(3),ie("modalClosed",i.registrationStarted),Y(3),at("closed",!i.open),Y(1),at("closed",!i.open),ie("organList",i.organList)("selectedOrgans",Fg(14,oRe,wn(13,12,i.model.organ$))),Y(5),Os(" ",i.open?"arrow_drop_up":"arrow_drop_down"," "),Y(1),at("expanded-stage",!i.open)}},directives:[ZOe,tIe,cIe,CF,uPe,dPe,jPe,l1,oq,Rs,sRe],pipes:[zu],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;color:#000}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:25.5rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{position:relative;z-index:1}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-organ-selector[_ngcontent-%COMP%]{height:100%;padding-top:.5rem;transition:all .5s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-organ-selector.closed[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;justify-content:center;height:5.688rem;transition:all .5s ease-in-out}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{width:3rem;height:1.2rem;position:absolute;bottom:0;right:calc(50% - 1.5rem);margin-bottom:-1.2rem;z-index:99;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:#fff;border-bottom-left-radius:.2rem;border-bottom-right-radius:.2rem;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]:hover{background-color:#ececec}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:3rem;top:-2.9rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{border-radius:.5rem!important;height:calc(100% - 2.688rem - 3rem - 1.5rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 1.5rem);padding-bottom:1rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-content[_ngcontent-%COMP%]{position:absolute;transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:all;bottom:1.5rem;z-index:1}"],changeDetection:0}),n})();function lRe(n,e){1&n&&et(0,"ccf-root")}let cRe=(()=>{class n extends wOe{constructor(t,i){var r;super(t,i,{initialDelay:500,initialConfig:null!==(r=globalThis.ruiConfig)&&void 0!==r?r:{},parse:{useDownload:EOe.boolean,user:EOe.json,organ:EOe.json,editRegistration:EOe.json,register:EOe.function,cancelRegistration:EOe.function,fetchPreviousRegistrations:EOe.function,skipUnsavedChangesConfirmation:EOe.boolean}})}}return n.\u0275fac=function(t){return new(t||n)(E(Eh),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-root-wc"]],inputs:{baseHref:"baseHref",useDownload:"useDownload",user:"user",organ:"organ",editRegistration:"editRegistration",register:"register",cancelRegistration:"cancelRegistration",fetchPreviousRegistrations:"fetchPreviousRegistrations",skipUnsavedChangesConfirmation:"skipUnsavedChangesConfirmation"},features:[ht],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&Ct(0,lRe,1,0,"ccf-root",0),2&t&&ie("ngIf",i.initialized)},directives:[Is,aRe],encapsulation:2,changeDetection:0}),n})();const uRe=new _e("Global configuration object");function dRe(n){return n.get("ruiConfig",{user:{firstName:"",lastName:""}})}let hRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:uRe,useFactory:dRe,deps:[cq]}]}),n})(),fRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:pv,useValue:yF.initialize,multi:!0},yF]}),n})(),pRe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[kr,Ra,KG,...t]}}}return n.\u0275fac=function(t){return new(t||n)(I(kr,2),I(Ra,2))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const h1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class _Re{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=ap(this.action),i=function(n){return h1(n.getHours(),2)+":"+h1(n.getMinutes(),2)+":"+h1(n.getSeconds(),2)+"."+h1(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class yRe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const Jq=new _e("NGXS_LOGGER_PLUGIN_OPTIONS");let vRe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new yRe(this._options),this._store=this._store||this._injector.get(ph);const s=new _Re(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Di(o=>{s.completed(o)}),Sa(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(I(Jq),I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const e9=new _e("LOGGER_USER_OPTIONS");function bRe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let CRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:jR,useClass:vRe,multi:!0},{provide:e9,useValue:t},{provide:Jq,useFactory:bRe,deps:[e9]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const SF=new _e("NGXS_STORAGE_PLUGIN_OPTION"),t9=new _e("STORAGE_ENGINE"),MF="@@STATE",n9="NGXS_OPTIONS_META";function wRe(n){return Array.isArray(n)||(n=[n]),n.map(e=>(e.hasOwnProperty(n9)&&(e=e[n9].name),e instanceof class{constructor(e){this.name=e,(function(n){return n.hasOwnProperty(UR)||Object.defineProperty(n,UR,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),qR(n)}(this)).makeRootSelector=i=>i.getStateGetter(this.name)}getName(){return this.name}toString(){return`StateToken[${this.name}]`}}?e.getName():e))}function ERe(n){return void 0!==n&&n.key&&(n.key=wRe(n.key)),Object.assign({key:[MF],storage:0,serialize:JSON.stringify,deserialize:JSON.parse,beforeSerialize:e=>e,afterDeserialize:e=>e},n)}function SRe(n,e){return wD(e)?null:0===n.storage?localStorage:1===n.storage?sessionStorage:null}let MRe=(()=>{class n{constructor(t,i,r){this._options=t,this._engine=i,this._platformId=r}handle(t,i,r){if(wD(this._platformId)&&null===this._engine)return r(t,i);const s=this._options.key,o=function(n){const e=ap(n);return function(t){return e===ap(t)}}(i),a=o(c$)||o(u$);let l=!1;if(a)for(const c of s){const d=c===MF;let f=this._engine.getItem(c);if("undefined"!==f&&null!=f){try{const p=this._options.deserialize(f);f=this._options.afterDeserialize(p,c)}catch(p){console.error("Error ocurred while deserializing the store value, falling back to empty object."),f={}}this._options.migrations&&this._options.migrations.forEach(p=>{p.version===Vm(f,p.versionKey||"version")&&(!p.key&&d||p.key===c)&&(f=p.migrate(f),l=!0)}),t=d?Object.assign({},t,f):zR(t,c,f)}}return r(t,i).pipe(Di(c=>{if(!a||a&&l)for(const d of s){let f=c;d!==MF&&(f=Vm(c,d));try{const p=this._options.beforeSerialize(f,d);this._engine.setItem(d,this._options.serialize(p))}catch(p){console.error("Error ocurred while serializing the store value, value not updated.")}}}))}}return n.\u0275fac=function(t){return new(t||n)(I(SF),I(t9),I(cl))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const i9=new _e("USER_OPTIONS");let xRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:jR,useClass:MRe,multi:!0},{provide:i9,useValue:t},{provide:SF,useFactory:ERe,deps:[i9]},{provide:t9,useFactory:SRe,deps:[SF,cl]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const r9=[{name:"logo",namespace:"app",url:"assets/icons/logo-rui.svg"},{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.svg"},{name:"bone-marrow",namespace:"app",url:"assets/icons/organs/ico-organs-bone-marrow.svg"},{name:"brain",namespace:"app",url:"assets/icons/organs/ico-organs-brain.svg"},{name:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.svg"},{name:"heart",namespace:"app",url:"assets/icons/organs/ico-organs-heart.svg"},{name:"kidney-left",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-left.svg"},{name:"kidney-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.svg"},{name:"large-intestine",namespace:"app",url:"assets/icons/organs/ico-organs-large-intestine.svg"},{name:"liver",namespace:"app",url:"assets/icons/organs/ico-organs-liver.svg"},{name:"lung-left",namespace:"app",url:"assets/icons/organs/ico-organs-lung-left.svg"},{name:"lung-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.svg"},{name:"skin",namespace:"app",url:"assets/icons/organs/ico-organs-skin.svg"},{name:"small-intestine",namespace:"app",url:"assets/icons/organs/ico-organs-small intestine.svg"},{name:"spleen",namespace:"app",url:"assets/icons/organs/ico-organs-spleen.svg"},{name:"stomach",namespace:"app",url:"assets/icons/organs/ico-organs-stomach.svg"},{name:"thymus",namespace:"app",url:"assets/icons/organs/ico-organs-thymus.svg"},{name:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.svg"},{name:"opacity",namespace:"app",url:"assets/icons/opacity-24px.svg"},{name:"visibility_on",namespace:"app",url:"assets/icons/visibility-on-24px.svg"},{name:"visibility_off",namespace:"app",url:"assets/icons/visibility-off-24px.svg"},{name:"visibility_off_cube",namespace:"app",url:"assets/icons/ico-cube.svg"}];let ld=class extends rTe{constructor(e,t,i){super(),this.registry=e,this.sanitizer=t,this.globalConfig=i}ngxsOnInit(){var e;r9.filter(t=>void 0!==t.html).map(t=>Object.assign(Object.assign({},t),{html:this.sanitizer.bypassSecurityTrustHtml(t.html)})).forEach(t=>this.registerIconImpl(t)),null===(e=this.registry)||void 0===e||e.addSvgIconResolver((t,i)=>{var r;const s=r9.find(a=>{var l,c;return(null!==(l=a.name)&&void 0!==l?l:"")===t&&(null!==(c=a.namespace)&&void 0!==c?c:"")===i});if(void 0===s||void 0===s.url)return null;const o=null!==(r=this.globalConfig.snapshot.baseHref)&&void 0!==r?r:"";return this.sanitizer.bypassSecurityTrustResourceUrl(o+s.url)})}registerIcon(e){return this.registerIconImpl(e)}registerIconImpl(e){if(!this.registry||!e.url&&!e.html)return!1;const t=this.registry,r=t[this.getMethodName(e)],s=this.getArguments(e);if(!r)return!1;try{return r.apply(t,s),!0}catch(o){return!1}}getMethodName({name:e,namespace:t,url:i}){const r=["addSvgIcon"];return e||r.push("Set"),i||r.push("Literal"),t&&r.push("InNamespace"),r.join("")}getArguments({name:e,namespace:t,url:i,html:r}){return[t,e,null!=i?i:r].filter(o=>!!o)}};ld.\u0275fac=function(e){return new(e||ld)(I(jv,8),I(Kd),I(Eh))},ld.\u0275prov=ae({token:ld,factory:ld.\u0275fac}),De([Xt()],ld.prototype,"registerIcon",null),ld=De([Ch(),gh({name:"iconRegistry"})],ld);const TRe=[Eh,ld,Ui,si,Io,dc,wr,ss];let ARe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[pRe.forRoot(),ia.forRoot(TRe,{developmentMode:!Sh.production}),xRe.forRoot({key:["registration.registrations"]}),CRe.forRoot({disabled:Sh.production})]]}),n})(),DRe=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[nU,DDe.forRoot({gaToken:Sh.googleAnalyticsToken,appName:"rui"}),dOe,hRe,ARe,fRe]]}),n})(),xF=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,vq]]}),n})(),ORe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,KPe,Lq,Pr,EF,xF,uc]]}),n})(),IRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr]]}),n})(),PRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,ORe,Pr,jDe,IRe,ec,PDe]]}),n})(),RRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,uc]]}),n})(),kRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})(),FRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Lq]]}),n})(),s9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,vq,$b,yk,vk,uc]]}),n})(),NRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,ec,lq]]}),n})(),o9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,Iq]]}),n})(),LRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf]]}),n})(),BRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Ok,Pr,uc,EF,kRe,xF,s9,o9,FRe,lq,NRe,o9,LRe]]}),n})(),VRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf,uc,s9,xF,aq]]}),n})(),jRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,VRe]]}),n})(),URe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,$b,Pr,ec,uc]]}),n})(),zRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,SG,ec,uc]]}),n})(),HRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,$b,Pr,ec,uc,aOe]]}),n})(),$Re=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Iq,Pr]]}),n})(),GRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,yk,vk,Gf,TPe,Lv,Pr,$b]]}),n})(),WRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,Gf]]}),n})(),qRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,WRe,Gf,uc]]}),n})(),YRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Ok,EF,Pr,bO,uc,URe,qRe,zRe,HRe,$Re,GRe,sOe]]}),n})(),XRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:Cq,useValue:bq}],imports:[[dE,bO,Pr]]}),n})(),KRe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ol).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new Ote(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends Pte{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(cRe,{injector:this.injector});customElements.define("ccf-rui",t)}}return n.\u0275fac=function(t){return new(t||n)(I(Tt))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:mq,useValue:"light-theme"},{provide:zj,useValue:{appearance:"standard",floatLabel:!1,hideRequiredMarker:!0}}],imports:[[dE,bO,DRe,Pr,XRe,RRe,PRe,BRe,YRe,aq,jRe,gOe,UU]]}),n})();Sh.production&&function(){if(DB)throw new Error("Cannot enable prod mode after platform setup.");AB=!1}(),Jee().bootstrapModule(KRe).catch(n=>console.error(n))},948:pt=>{pt.exports=function(Ve){return Ve&&Ve.__esModule?Ve:{default:Ve}},pt.exports.default=pt.exports,pt.exports.__esModule=!0},321:pt=>{function We(Ve){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(pt.exports=We=function(k){return typeof k},pt.exports.default=pt.exports,pt.exports.__esModule=!0):(pt.exports=We=function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},pt.exports.default=pt.exports,pt.exports.__esModule=!0),We(Ve)}pt.exports=We,pt.exports.default=pt.exports,pt.exports.__esModule=!0},833:pt=>{function We(Ve){return Promise.resolve().then(()=>{var _t=new Error("Cannot find module '"+Ve+"'");throw _t.code="MODULE_NOT_FOUND",_t})}We.keys=()=>[],We.resolve=We,We.id=833,pt.exports=We},521:()=>{},125:()=>{},307:()=>{}},pt=>{pt(pt.s=473)}]); \ No newline at end of file +var ZRe=Object.defineProperty,QRe=Object.defineProperties,JRe=Object.getOwnPropertyDescriptors,l9=Object.getOwnPropertySymbols,eke=Object.prototype.hasOwnProperty,tke=Object.prototype.propertyIsEnumerable,zi=Math.pow,c9=(pt,We,Ve)=>We in pt?ZRe(pt,We,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):pt[We]=Ve,J=(pt,We)=>{for(var Ve in We||(We={}))eke.call(We,Ve)&&c9(pt,Ve,We[Ve]);if(l9)for(var Ve of l9(We))tke.call(We,Ve)&&c9(pt,Ve,We[Ve]);return pt},an=(pt,We)=>QRe(pt,JRe(We));(self.webpackChunkccf_ui=self.webpackChunkccf_ui||[]).push([[179],{517:(pt,We)=>{"use strict";var _t=(()=>{return(It=_t||(_t={})).typeOfFunction="function",It.boolTrue=!0,_t;var It})();function k(It,Pt,ft){if(!ft||typeof ft.value!==_t.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+Pt+"> is not a method!");return{configurable:_t.boolTrue,get:function(){var qt=ft.value.bind(this);return Object.defineProperty(this,Pt,{value:qt,configurable:_t.boolTrue,writable:_t.boolTrue}),qt}}}We.ak=k,We.ZP=k},266:(pt,We,Ve)=>{pt.exports={ResizeSensor:Ve(835),ElementQueries:Ve(845)}},845:function(pt,We,Ve){"use strict";var _t,k,It;"undefined"!=typeof window&&window,k=[Ve(835)],void 0!==(It="function"==typeof(_t=function(Pt){var ft=function(){var yt,dn={},En=[];function Fe(Ae){Ae||(Ae=document.documentElement);var oe=window.getComputedStyle(Ae,null).fontSize;return parseFloat(oe)||16}function $t(Ae,oe){var kt=oe.split(/\d/),Bt=kt[kt.length-1];switch(oe=parseFloat(oe),Bt){case"px":return oe;case"em":return oe*Fe(Ae);case"rem":return oe*Fe();case"vw":return oe*document.documentElement.clientWidth/100;case"vh":return oe*document.documentElement.clientHeight/100;case"vmin":case"vmax":var Gt=document.documentElement.clientWidth/100,oi=document.documentElement.clientHeight/100;return oe*(0,Math["vmin"===Bt?"min":"max"])(Gt,oi);default:return oe}}function Ne(Ae,oe){this.element=Ae;var kt,Bt,Gt,oi,Oi,we,rn,Ln,be=["min-width","min-height","max-width","max-height"];this.call=function(){for(kt in Gt=function(Ae){if(!Ae.getBoundingClientRect)return{width:Ae.offsetWidth,height:Ae.offsetHeight};var oe=Ae.getBoundingClientRect();return{width:Math.round(oe.width),height:Math.round(oe.height)}}(this.element),we={},dn[oe])!dn[oe].hasOwnProperty(kt)||(oi=$t(this.element,(Bt=dn[oe][kt]).value),Oi="width"===Bt.property?Gt.width:Gt.height,rn="","min"===Bt.mode&&Oi>=oi&&(rn+=Bt.value),"max"===Bt.mode&&Oi<=oi&&(rn+=Bt.value),we[Ln=Bt.mode+"-"+Bt.property]||(we[Ln]=""),rn&&-1===(" "+we[Ln]+" ").indexOf(" "+rn+" ")&&(we[Ln]+=" "+rn));for(var Ii in be)!be.hasOwnProperty(Ii)||(we[be[Ii]]?this.element.setAttribute(be[Ii],we[be[Ii]].substr(1)):this.element.removeAttribute(be[Ii]))}}function Ie(Ae,oe){Ae.elementQueriesSetupInformation||(Ae.elementQueriesSetupInformation=new Ne(Ae,oe)),Ae.elementQueriesSensor||(Ae.elementQueriesSensor=new Pt(Ae,function(){Ae.elementQueriesSetupInformation.call()}))}function pi(Ae,oe,kt,Bt){if(void 0===dn[Ae]){dn[Ae]=[];var Gt=En.length;yt.innerHTML+="\n"+Ae+" {animation: 0.1s element-queries;}",yt.innerHTML+="\n"+Ae+" > .resize-sensor {min-width: "+Gt+"px;}",En.push(Ae)}dn[Ae].push({mode:oe,property:kt,value:Bt})}function qe(Ae){var oe;if(document.querySelectorAll&&(oe=Ae?Ae.querySelectorAll.bind(Ae):document.querySelectorAll.bind(document)),!oe&&"undefined"!=typeof $$&&(oe=$$),!oe&&"undefined"!=typeof jQuery&&(oe=jQuery),!oe)throw"No document.querySelectorAll, jQuery or Mootools's $$ found.";return oe}function Rt(Ae){var oe=[],kt=[],Bt=[],Gt=0,oi=-1,Oi=[];for(var we in Ae.children)if(Ae.children.hasOwnProperty(we)&&Ae.children[we].tagName&&"img"===Ae.children[we].tagName.toLowerCase()){oe.push(Ae.children[we]);var rn=Ae.children[we].getAttribute("min-width")||Ae.children[we].getAttribute("data-min-width"),Ln=Ae.children[we].getAttribute("data-src")||Ae.children[we].getAttribute("url");Bt.push(Ln),kt.push({minWidth:rn}),rn?Ae.children[we].style.display="none":(Gt=oe.length-1,Ae.children[we].style.display="block")}function Ii(){var Sr,Ft=!1;for(Sr in oe)!oe.hasOwnProperty(Sr)||kt[Sr].minWidth&&Ae.offsetWidth>kt[Sr].minWidth&&(Ft=Sr);if(Ft||(Ft=Gt),oi!==Ft)if(Oi[Ft])oe[oi].style.display="none",oe[Ft].style.display="block",oi=Ft;else{var os=new Image;os.onload=function(){oe[Ft].src=Bt[Ft],oe[oi].style.display="none",oe[Ft].style.display="block",Oi[Ft]=!0,oi=Ft},os.src=Bt[Ft]}else oe[Ft].src=Bt[Ft]}oi=Gt,Ae.resizeSensorInstance=new Pt(Ae,Ii),Ii()}var $n=/,?[\s\t]*([^,\n]*?)((?:\[[\s\t]*?(?:min|max)-(?:width|height)[\s\t]*?[~$\^]?=[\s\t]*?"[^"]*?"[\s\t]*?])+)([^,\n\s\{]*)/gim,Ci=/\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]/gim;function yi(Ae){var oe,kt,Bt,Gt;for(Ae=Ae.replace(/'/g,'"');null!==(oe=$n.exec(Ae));)for(kt=oe[1]+oe[3],Bt=oe[2];null!==(Gt=Ci.exec(Bt));)pi(kt,Gt[1],Gt[2],Gt[3])}function vi(Ae){var oe="";if(Ae)if("string"==typeof Ae)(-1!==(Ae=Ae.toLowerCase()).indexOf("min-width")||-1!==Ae.indexOf("max-width"))&&yi(Ae);else for(var kt=0,Bt=Ae.length;kt img, [data-responsive-image] {overflow: hidden; padding: 0; } [responsive-image] > img, [data-responsive-image] > img {width: 100%;}",yt.innerHTML+="\n@keyframes element-queries { 0% { visibility: inherit; } }",document.getElementsByTagName("head")[0].appendChild(yt),Er=!0);for(var oe=0,kt=document.styleSheets.length;oe=je.status}function qt(Fe){try{Fe.dispatchEvent(new MouseEvent("click"))}catch($t){var je=document.createEvent("MouseEvents");je.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),Fe.dispatchEvent(je)}}var yt="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,dn=yt.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),En=yt.saveAs||("object"!=typeof window||window!==yt?function(){}:"download"in HTMLAnchorElement.prototype&&!dn?function(Fe,je,$t){var Ne=yt.URL||yt.webkitURL,Ie=document.createElement("a");Ie.download=je=je||Fe.name||"download",Ie.rel="noopener","string"==typeof Fe?(Ie.href=Fe,Ie.origin===location.origin?qt(Ie):ft(Ie.href)?Pt(Fe,je,$t):qt(Ie,Ie.target="_blank")):(Ie.href=Ne.createObjectURL(Fe),setTimeout(function(){Ne.revokeObjectURL(Ie.href)},4e4),setTimeout(function(){qt(Ie)},0))}:"msSaveOrOpenBlob"in navigator?function(Fe,je,$t){if(je=je||Fe.name||"download","string"!=typeof Fe)navigator.msSaveOrOpenBlob(function(Fe,je){return void 0===je?je={autoBom:!1}:"object"!=typeof je&&(console.warn("Deprecated: Expected third argument to be a object"),je={autoBom:!je}),je.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(Fe.type)?new Blob(["\ufeff",Fe],{type:Fe.type}):Fe}(Fe,$t),je);else if(ft(Fe))Pt(Fe,je,$t);else{var Ne=document.createElement("a");Ne.href=Fe,Ne.target="_blank",setTimeout(function(){qt(Ne)})}}:function(Fe,je,$t,Ne){if((Ne=Ne||open("","_blank"))&&(Ne.document.title=Ne.document.body.innerText="downloading..."),"string"==typeof Fe)return Pt(Fe,je,$t);var Ie="application/octet-stream"===Fe.type,pi=/constructor/i.test(yt.HTMLElement)||yt.safari,qe=/CriOS\/[\d]+/.test(navigator.userAgent);if((qe||Ie&&pi||dn)&&"undefined"!=typeof FileReader){var Jn=new FileReader;Jn.onloadend=function(){var $n=Jn.result;$n=qe?$n:$n.replace(/^data:[^;]*;/,"data:attachment/file;"),Ne?Ne.location.href=$n:location=$n,Ne=null},Jn.readAsDataURL(Fe)}else{var Rt=yt.URL||yt.webkitURL,nn=Rt.createObjectURL(Fe);Ne?Ne.location=nn:location.href=nn,Ne=null,setTimeout(function(){Rt.revokeObjectURL(nn)},4e4)}});yt.saveAs=En.saveAs=En,pt.exports=En})?Ve.apply(We,[]):Ve)&&(pt.exports=k)},524:(pt,We,Ve)=>{var _t;!function(k,It,Pt,ft){"use strict";var qe,qt=["","webkit","Moz","MS","ms","o"],yt=It.createElement("div"),En=Math.round,Fe=Math.abs,je=Date.now;function $t(A,R,j){return setTimeout($n(A,j),R)}function Ne(A,R,j){return!!Array.isArray(A)&&(Ie(A,j[R],j),!0)}function Ie(A,R,j){var te;if(A)if(A.forEach)A.forEach(R,j);else if(A.length!==ft)for(te=0;te\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",hn=k.console&&(k.console.warn||k.console.log);return hn&&hn.call(k.console,te,Re),A.apply(this,arguments)}}qe="function"!=typeof Object.assign?function(R){if(R===ft||null===R)throw new TypeError("Cannot convert undefined or null to object");for(var j=Object(R),te=1;te-1}function kt(A){return A.trim().split(/\s+/g)}function Bt(A,R,j){if(A.indexOf&&!j)return A.indexOf(R);for(var te=0;teGr[R]}):te.sort()),te}function Oi(A,R){for(var j,te,Me=R[0].toUpperCase()+R.slice(1),Re=0;Re1&&!j.firstMultiple?j.firstMultiple=La(R):1===Me&&(j.firstMultiple=!1);var Re=j.firstInput,hn=j.firstMultiple,cr=hn?hn.center:Re.center,mr=R.center=ao(te);R.timeStamp=je(),R.deltaTime=R.timeStamp-Re.timeStamp,R.angle=lo(cr,mr),R.distance=ls(cr,mr),function(A,R){var j=R.center,te=A.offsetDelta||{},Me=A.prevDelta||{},Re=A.prevInput||{};(1===R.eventType||4===Re.eventType)&&(Me=A.prevDelta={x:Re.deltaX||0,y:Re.deltaY||0},te=A.offsetDelta={x:j.x,y:j.y}),R.deltaX=Me.x+(j.x-te.x),R.deltaY=Me.y+(j.y-te.y)}(j,R),R.offsetDirection=ki(R.deltaX,R.deltaY);var Gr=Ba(R.deltaTime,R.deltaX,R.deltaY);R.overallVelocityX=Gr.x,R.overallVelocityY=Gr.y,R.overallVelocity=Fe(Gr.x)>Fe(Gr.y)?Gr.x:Gr.y,R.scale=hn?function(A,R){return ls(R[0],R[1],Fr)/ls(A[0],A[1],Fr)}(hn.pointers,te):1,R.rotation=hn?function(A,R){return lo(R[1],R[0],Fr)+lo(A[1],A[0],Fr)}(hn.pointers,te):0,R.maxPointers=j.prevInput?R.pointers.length>j.prevInput.maxPointers?R.pointers.length:j.prevInput.maxPointers:R.pointers.length,function(A,R){var Me,Re,hn,cr,j=A.lastInterval||R,te=R.timeStamp-j.timeStamp;if(8!=R.eventType&&(te>25||j.velocity===ft)){var mr=R.deltaX-j.deltaX,Gr=R.deltaY-j.deltaY,cn=Ba(te,mr,Gr);Re=cn.x,hn=cn.y,Me=Fe(cn.x)>Fe(cn.y)?cn.x:cn.y,cr=ki(mr,Gr),A.lastInterval=R}else Me=j.velocity,Re=j.velocityX,hn=j.velocityY,cr=j.direction;R.velocity=Me,R.velocityX=Re,R.velocityY=hn,R.direction=cr}(j,R);var cn=A.element;Ae(R.srcEvent.target,cn)&&(cn=R.srcEvent.target),R.target=cn}(A,j),A.emit("hammer.input",j),A.recognize(j),A.session.prevInput=j}function La(A){for(var R=[],j=0;j=Fe(R)?A<0?2:4:R<0?8:16}function ls(A,R,j){j||(j=$r);var te=R[j[0]]-A[j[0]],Me=R[j[1]]-A[j[1]];return Math.sqrt(te*te+Me*Me)}function lo(A,R,j){return j||(j=$r),180*Math.atan2(R[j[1]]-A[j[1]],R[j[0]]-A[j[0]])/Math.PI}ei.prototype={handler:function(){},init:function(){this.evEl&&vi(this.element,this.evEl,this.domHandler),this.evTarget&&vi(this.target,this.evTarget,this.domHandler),this.evWin&&vi(Ln(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Er(this.element,this.evEl,this.domHandler),this.evTarget&&Er(this.target,this.evTarget,this.domHandler),this.evWin&&Er(Ln(this.element),this.evWin,this.domHandler)}};var lu={mousedown:1,mousemove:2,mouseup:4},cu="mousedown",uu="mousemove mouseup";function wl(){this.evEl=cu,this.evWin=uu,this.pressed=!1,ei.apply(this,arguments)}nn(wl,ei,{handler:function(R){var j=lu[R.type];1&j&&0===R.button&&(this.pressed=!0),2&j&&1!==R.which&&(j=4),this.pressed&&(4&j&&(this.pressed=!1),this.callback(this.manager,j,{pointers:[R],changedPointers:[R],pointerType:as,srcEvent:R}))}});var pc={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ud={2:os,3:"pen",4:as,5:"kinect"},du="pointerdown",Vs="pointermove pointerup pointercancel";function Ye(){this.evEl=du,this.evWin=Vs,ei.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}k.MSPointerEvent&&!k.PointerEvent&&(du="MSPointerDown",Vs="MSPointerMove MSPointerUp MSPointerCancel"),nn(Ye,ei,{handler:function(R){var j=this.store,te=!1,Me=R.type.toLowerCase().replace("ms",""),Re=pc[Me],hn=ud[R.pointerType]||R.pointerType,cr=hn==os,mr=Bt(j,R.pointerId,"pointerId");1&Re&&(0===R.button||cr)?mr<0&&(j.push(R),mr=j.length-1):12&Re&&(te=!0),!(mr<0)&&(j[mr]=R,this.callback(this.manager,Re,{pointers:j,changedPointers:[R],pointerType:hn,srcEvent:R}),te&&j.splice(mr,1))}});var hu={touchstart:1,touchmove:2,touchend:4,touchcancel:8},G="touchstart",q="touchstart touchmove touchend touchcancel";function Z(){this.evTarget=G,this.evWin=q,this.started=!1,ei.apply(this,arguments)}function T(A,R){var j=Gt(A.touches),te=Gt(A.changedTouches);return 12&R&&(j=oi(j.concat(te),"identifier",!0)),[j,te]}nn(Z,ei,{handler:function(R){var j=hu[R.type];if(1===j&&(this.started=!0),this.started){var te=T.call(this,R,j);12&j&&te[0].length-te[1].length==0&&(this.started=!1),this.callback(this.manager,j,{pointers:te[0],changedPointers:te[1],pointerType:os,srcEvent:R})}}});var D={touchstart:1,touchmove:2,touchend:4,touchcancel:8},B="touchstart touchmove touchend touchcancel";function K(){this.evTarget=B,this.targetIds={},ei.apply(this,arguments)}function H(A,R){var j=Gt(A.touches),te=this.targetIds;if(3&R&&1===j.length)return te[j[0].identifier]=!0,[j,j];var Me,Re,hn=Gt(A.changedTouches),cr=[],mr=this.target;if(Re=j.filter(function(Gr){return Ae(Gr.target,mr)}),1===R)for(Me=0;Me-1&&te.splice(Re,1)},2500)}}function Cn(A){for(var R=A.srcEvent.clientX,j=A.srcEvent.clientY,te=0;te-1&&this.requireFail.splice(R,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(A){return!!this.simultaneous[A.id]},emit:function(A){var R=this,j=this.state;function te(Me){R.manager.emit(Me,A)}j<8&&te(R.options.event+ae(j)),te(R.options.event),A.additionalEvent&&te(A.additionalEvent),j>=8&&te(R.options.event+ae(j))},tryEmit:function(A){if(this.canEmit())return this.emit(A);this.state=32},canEmit:function(){for(var A=0;AR.threshold&&Me&R.direction},attrTest:function(A){return ir.prototype.attrTest.call(this,A)&&(2&this.state||!(2&this.state)&&this.directionTest(A))},emit:function(A){this.pX=A.deltaX,this.pY=A.deltaY;var R=r_(A.direction);R&&(A.additionalEvent=this.options.event+R),this._super.emit.call(this,A)}}),nn(gu,ir,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||2&this.state)},emit:function(A){1!==A.scale&&(A.additionalEvent=this.options.event+(A.scale<1?"in":"out")),this._super.emit.call(this,A)}}),nn(Th,Va,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(A){var R=this.options,j=A.pointers.length===R.pointers,te=A.distanceR.time;if(this._input=A,!te||!j||12&A.eventType&&!Me)this.reset();else if(1&A.eventType)this.reset(),this._timer=$t(function(){this.state=8,this.tryEmit()},R.time,this);else if(4&A.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(A){8===this.state&&(A&&4&A.eventType?this.manager.emit(this.options.event+"up",A):(this._input.timeStamp=je(),this.manager.emit(this.options.event,this._input)))}}),nn(mu,ir,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[$i]},attrTest:function(A){return this._super.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||2&this.state)}}),nn(la,ir,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _c.prototype.getTouchAction.call(this)},attrTest:function(A){var j,R=this.options.direction;return 30&R?j=A.overallVelocity:6&R?j=A.overallVelocityX:24&R&&(j=A.overallVelocityY),this._super.attrTest.call(this,A)&&R&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers==this.options.pointers&&Fe(j)>this.options.velocity&&4&A.eventType},emit:function(A){var R=r_(A.offsetDirection);R&&this.manager.emit(this.options.event+R,A),this.manager.emit(this.options.event,A)}}),nn(Sl,Va,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Hi]},process:function(A){var R=this.options,j=A.pointers.length===R.pointers,te=A.distance"']/g,Vs=RegExp(ud.source),Ye=RegExp(du.source),hu=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,D=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,K=RegExp(B.source),H=/^\s+/,se=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,de=/\{\n\/\* \[wrapped with (.+)\] \*/,Be=/,? & /,Kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cn=/[()=,{}\[\]\/\s]/,jt=/\\(\\)?/g,gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zt=/\w*$/,ti=/^[-+]0x[0-9a-f]+$/i,Hi=/^0b[01]+$/i,$i=/^\[object .+?Constructor\]$/,ln=/^0o[0-7]+$/i,bi=/^(?:0|[1-9]\d*)$/,gc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,co=/($^)/,dd=/['\n\r\u2028\u2029\\]/g,El="\\ud800-\\udfff",Gi="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xn="\\u2700-\\u27bf",pu="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",ir="\\ufe0e\\ufe0f",_c="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Th="["+El+"]",mu="["+_c+"]",la="["+Gi+"]",Sl="\\d+",ja="["+xn+"]",mp="["+pu+"]",vt="[^"+El+_c+Sl+xn+pu+Ee+"]",Ml="\\ud83c[\\udffb-\\udfff]",ca="[^"+El+"]",hd="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",R="["+Ee+"]",j="\\u200d",te="(?:"+mp+"|"+vt+")",Me="(?:"+R+"|"+vt+")",Re="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",hn="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",cr="(?:"+la+"|"+Ml+")?",mr="["+ir+"]?",f1=mr+cr+"(?:"+j+"(?:"+[ca,hd,A].join("|")+")"+mr+cr+")*",fd="(?:"+[ja,hd,A].join("|")+")"+f1,gi="(?:"+[ca+la+"?",la,hd,A,Th].join("|")+")",yp=RegExp("['\u2019]","g"),s_=RegExp(la,"g"),Ah=RegExp(Ml+"(?="+Ml+")|"+gi+f1,"g"),h0=RegExp([R+"?"+mp+"+"+Re+"(?="+[mu,R,"$"].join("|")+")",Me+"+"+hn+"(?="+[mu,R+te,"$"].join("|")+")",R+"?"+te+"+"+Re,R+"+"+hn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sl,fd].join("|"),"g"),p1=RegExp("["+j+El+Gi+ir+"]"),xl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Dh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],g1=-1,Le={};Le[ao]=Le[Ba]=Le[ki]=Le[ls]=Le[lo]=Le[fc]=Le[Cl]=Le[lu]=Le[cu]=!0,Le[as]=Le[sa]=Le[bl]=Le[ai]=Le[La]=Le[ot]=Le[Pi]=Le[oa]=Le[Ri]=Le[Hr]=Le[nr]=Le[$r]=Le[Fr]=Le[ei]=Le[ci]=!1;var wi={};wi[as]=wi[sa]=wi[bl]=wi[La]=wi[ai]=wi[ot]=wi[ao]=wi[Ba]=wi[ki]=wi[ls]=wi[lo]=wi[Ri]=wi[Hr]=wi[nr]=wi[$r]=wi[Fr]=wi[ei]=wi[hc]=wi[fc]=wi[Cl]=wi[lu]=wi[cu]=!0,wi[Pi]=wi[oa]=wi[ci]=!1;var xe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},m1=parseFloat,m0=parseInt,he="object"==typeof global&&global&&global.Object===Object&&global,cs="object"==typeof self&&self&&self.Object===Object&&self,Wn=he||cs||Function("return this")(),Tl=We&&!We.nodeType&&We,ua=Tl&&pt&&!pt.nodeType&&pt,uo=ua&&ua.exports===Tl,o_=uo&&he.process,Wi=function(){try{return ua&&ua.require&&ua.require("util").types||o_&&o_.binding&&o_.binding("util")}catch(ue){}}(),Ze=Wi&&Wi.isArrayBuffer,fn=Wi&&Wi.isDate,xi=Wi&&Wi.isMap,Us=Wi&&Wi.isRegExp,yc=Wi&&Wi.isSet,Mr=Wi&&Wi.isTypedArray;function xr(W,ue,ne){switch(ne.length){case 0:return W.call(ue);case 1:return W.call(ue,ne[0]);case 2:return W.call(ue,ne[0],ne[1]);case 3:return W.call(ue,ne[0],ne[1],ne[2])}return W.apply(ue,ne)}function ur(W,ue,ne,it){for(var Et=-1,Bn=null==W?0:W.length;++Et-1}function Oh(W,ue,ne){for(var it=-1,Et=null==W?0:W.length;++it-1;);return ne}function b1(W,ue){for(var ne=W.length;ne--&&Ua(ue,W[ne],0)>-1;);return ne}function AF(W,ue){for(var ne=W.length,it=0;ne--;)W[ne]===ue&&++it;return it}var DF=Po({\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"Ae",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010a:"C",\u010c:"C",\u0107:"c",\u0109:"c",\u010b:"c",\u010d:"c",\u010e:"D",\u0110:"D",\u010f:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011a:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011b:"e",\u011c:"G",\u011e:"G",\u0120:"G",\u0122:"G",\u011d:"g",\u011f:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012a:"I",\u012c:"I",\u012e:"I",\u0130:"I",\u0129:"i",\u012b:"i",\u012d:"i",\u012f:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013b:"L",\u013d:"L",\u013f:"L",\u0141:"L",\u013a:"l",\u013c:"l",\u013e:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014a:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014b:"n",\u014c:"O",\u014e:"O",\u0150:"O",\u014d:"o",\u014f:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015a:"S",\u015c:"S",\u015e:"S",\u0160:"S",\u015b:"s",\u015d:"s",\u015f:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016a:"U",\u016c:"U",\u016e:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016b:"u",\u016d:"u",\u016f:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017b:"Z",\u017d:"Z",\u017a:"z",\u017c:"z",\u017e:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017f:"s"}),OF=Po({"&":"&","<":"<",">":">",'"':""","'":"'"});function IF(W){return"\\"+xe[W]}function Rh(W){return p1.test(W)}function y0(W){var ue=-1,ne=Array(W.size);return W.forEach(function(it,Et){ne[++ue]=[Et,it]}),ne}function C1(W,ue){return function(ne){return W(ue(ne))}}function yu(W,ue){for(var ne=-1,it=W.length,Et=0,Bn=[];++ne",""":'"',"'":"'"}),Fh=function W(ue){var u,ne=(ue=null==ue?Wn:Fh.defaults(Wn.Object(),ue,Fh.pick(Wn,Dh))).Array,it=ue.Date,Et=ue.Error,Bn=ue.Function,_r=ue.Math,di=ue.Object,f_=ue.RegExp,p_=ue.String,fa=ue.TypeError,Ti=ne.prototype,vu=di.prototype,bp=ue["__core-js_shared__"],qi=Bn.prototype.toString,hi=vu.hasOwnProperty,LF=0,Nh=(u=/[^.]+$/.exec(bp&&bp.keys&&bp.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Ss=vu.toString,S1=qi.call(di),g_=Wn._,vd=f_("^"+qi.call(hi).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ds=uo?ue.Buffer:k,Dl=ue.Symbol,bd=ue.Uint8Array,C0=ds?ds.allocUnsafe:k,pa=C1(di.getPrototypeOf,di),m_=di.create,Cp=vu.propertyIsEnumerable,Ut=Ti.splice,M1=Dl?Dl.isConcatSpreadable:k,Lh=Dl?Dl.iterator:k,bu=Dl?Dl.toStringTag:k,wp=function(){try{var u=Oc(di,"defineProperty");return u({},"",{}),u}catch(h){}}(),w0=ue.clearTimeout!==Wn.clearTimeout&&ue.clearTimeout,x1=it&&it.now!==Wn.Date.now&&it.now,T1=ue.setTimeout!==Wn.setTimeout&&ue.setTimeout,Ce=_r.ceil,Sn=_r.floor,Vn=di.getOwnPropertySymbols,Tr=ds?ds.isBuffer:k,__=ue.isFinite,Bh=Ti.join,Ha=C1(di.keys,di),hr=_r.max,Nr=_r.min,BF=it.now,A1=ue.parseInt,Vh=_r.random,Ep=Ti.reverse,qr=Oc(ue,"DataView"),zs=Oc(ue,"Map"),Sp=Oc(ue,"Promise"),ga=Oc(ue,"Set"),fo=Oc(ue,"WeakMap"),jh=Oc(di,"create"),Uh=fo&&new fo,Cd={},D1=Pu(qr),y_=Pu(zs),v_=Pu(Sp),E0=Pu(ga),b_=Pu(fo),Mp=Dl?Dl.prototype:k,wd=Mp?Mp.valueOf:k,zh=Mp?Mp.toString:k;function O(u){if(Ki(u)&&!Ot(u)&&!(u instanceof pn)){if(u instanceof po)return u;if(hi.call(u,"__wrapped__"))return Xp(u)}return new po(u)}var Cu=function(){function u(){}return function(h){if(!Xi(h))return{};if(m_)return m_(h);u.prototype=h;var m=new u;return u.prototype=k,m}}();function Hh(){}function po(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=k}function pn(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ft,this.__views__=[]}function Hs(u){var h=-1,m=null==u?0:u.length;for(this.clear();++h=h?u:h)),u}function hs(u,h,m,b,M,P){var V,z=1&h,X=2&h,ge=4&h;if(m&&(V=M?m(u,b,M,P):m(u)),V!==k)return V;if(!Xi(u))return u;var me=Ot(u);if(me){if(V=function(u){var h=u.length,m=new u.constructor(h);return h&&"string"==typeof u[0]&&hi.call(u,"index")&&(m.index=u.index,m.input=u.input),m}(u),!z)return xs(u,V)}else{var Se=gs(u),Ke=Se==oa||Se==Fa;if(el(u))return Bp(u,z);if(Se==nr||Se==as||Ke&&!M){if(V=X||Ke?{}:K0(u),!z)return X?function(u,h){return va(u,q0(u),h)}(u,function(u,h){return u&&va(h,As(h),u)}(V,u)):function(u,h){return va(u,z_(u),h)}(u,V1(V,u))}else{if(!wi[Se])return M?u:{};V=function(u,h,m){var b=u.constructor;switch(h){case bl:return Au(u);case ai:case ot:return new b(+u);case La:return function(u,h){var m=h?Au(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.byteLength)}(u,m);case ao:case Ba:case ki:case ls:case lo:case fc:case Cl:case lu:case cu:return L_(u,m);case Ri:return new b;case Hr:case ei:return new b(u);case $r:return function(u){var h=new u.constructor(u.source,Zt.exec(u));return h.lastIndex=u.lastIndex,h}(u);case Fr:return new b;case hc:return function(u){return wd?di(wd.call(u)):{}}(u)}}(u,Se,z)}}P||(P=new _a);var mt=P.get(u);if(mt)return mt;P.set(u,V),iT(u)?u.forEach(function(zt){V.add(hs(zt,h,m,zt,u,P))}):Jx(u)&&u.forEach(function(zt,_n){V.set(_n,hs(zt,h,m,_n,u,P))});var mn=me?k:(ge?X?j_:Fl:X?As:Qr)(u);return us(mn||u,function(zt,_n){mn&&(zt=u[_n=zt]),Ga(V,_n,hs(zt,h,m,_n,u,P))}),V}function Ip(u,h,m){var b=m.length;if(null==u)return!b;for(u=di(u);b--;){var M=m[b],V=u[M];if(V===k&&!(M in u)||!(0,h[M])(V))return!1}return!0}function Wh(u,h,m){if("function"!=typeof u)throw new fa(qt);return Jh(function(){u.apply(k,m)},h)}function wc(u,h,m,b){var M=-1,P=Al,V=!0,z=u.length,X=[],ge=h.length;if(!z)return X;m&&(h=ui(h,ko(m))),b?(P=Oh,V=!1):h.length>=200&&(P=Ph,V=!1,h=new ma(h));e:for(;++M-1},Ol.prototype.set=function(u,h){var m=this.__data__,b=Sd(m,u);return b<0?(++this.size,m.push([u,h])):m[b][1]=h,this},$a.prototype.clear=function(){this.size=0,this.__data__={hash:new Hs,map:new(zs||Ol),string:new Hs}},$a.prototype.delete=function(u){var h=ps(this,u).delete(u);return this.size-=h?1:0,h},$a.prototype.get=function(u){return ps(this,u).get(u)},$a.prototype.has=function(u){return ps(this,u).has(u)},$a.prototype.set=function(u,h){var m=ps(this,u),b=m.size;return m.set(u,h),this.size+=m.size==b?0:1,this},ma.prototype.add=ma.prototype.push=function(u){return this.__data__.set(u,dn),this},ma.prototype.has=function(u){return this.__data__.has(u)},_a.prototype.clear=function(){this.__data__=new Ol,this.size=0},_a.prototype.delete=function(u){var h=this.__data__,m=h.delete(u);return this.size=h.size,m},_a.prototype.get=function(u){return this.__data__.get(u)},_a.prototype.has=function(u){return this.__data__.has(u)},_a.prototype.set=function(u,h){var m=this.__data__;if(m instanceof Ol){var b=m.__data__;if(!zs||b.length<199)return b.push([u,h]),this.size=++m.size,this;m=this.__data__=new $a(b)}return m.set(u,h),this.size=m.size,this};var Ec=Xa(qa),A_=Xa(Pp,!0);function D0(u,h){var m=!0;return Ec(u,function(b,M,P){return m=!!h(b,M,P)}),m}function qh(u,h,m){for(var b=-1,M=u.length;++b0&&m(z)?h>1?Yr(z,h-1,m,b,M):dr(M,z):b||(M[M.length]=z)}return M}var Md=B0(),xd=B0(!0);function qa(u,h){return u&&Md(u,h,Qr)}function Pp(u,h){return u&&xd(u,h,Qr)}function Yh(u,h){return da(h,function(m){return Ho(u[m])})}function Fo(u,h){for(var m=0,b=(h=Tc(h,u)).length;null!=u&&mh}function Td(u,h){return null!=u&&hi.call(u,h)}function Ad(u,h){return null!=u&&h in di(u)}function Eu(u,h,m){for(var b=m?Oh:Al,M=u[0].length,P=u.length,V=P,z=ne(P),X=1/0,ge=[];V--;){var me=u[V];V&&h&&(me=ui(me,ko(h))),X=Nr(me.length,X),z[V]=!m&&(h||M>=120&&me.length>=120)?new ma(V&&me):k}me=u[0];var Se=-1,Ke=z[0];e:for(;++Se=z?X:X*("desc"==m[b]?-1:1)}return u.index-h.index}(P,V,m)});ne--;)W[ne]=W[ne].value;return W}($1(u,function(P,V,z){return{criteria:ui(h,function(ge){return ge(P)}),index:++b,value:P}}))}function k0(u,h,m){for(var b=-1,M=h.length,P={};++b-1;)z!==u&&Ut.call(z,X,1),Ut.call(u,X,1);return u}function Kh(u,h){for(var m=u?h.length:0,b=m-1;m--;){var M=h[m];if(m==b||M!==P){var P=M;_o(M)?Ut.call(u,M,1):Mu(u,M)}}return u}function Il(u,h){return u+Sn(Vh()*(h-u+1))}function kp(u,h){var m="";if(!u||h<1||h>Ln)return m;do{h%2&&(m+=u),(h=Sn(h/2))&&(u+=u)}while(h);return m}function gn(u,h){return Yp(ox(u,h,Ds),u+"")}function W1(u){return S_(Wd(u))}function qF(u,h){var m=Wd(u);return Ld(m,wu(h,0,m.length))}function Fp(u,h,m,b){if(!Xi(u))return u;for(var M=-1,P=(h=Tc(h,u)).length,V=P-1,z=u;null!=z&&++MM?0:M+h),(m=m>M?M:m)<0&&(m+=M),M=h>m?0:m-h>>>0,h>>>=0;for(var P=ne(M);++b>>1,V=u[P];null!==V&&!$o(V)&&(m?V<=h:V=200){var ge=h?null:V_(u);if(ge)return u_(ge);V=!1,M=Ph,X=new ma}else X=h?[]:z;e:for(;++b=b?u:Kr(u,h,m)}var X1=w0||function(u){return Wn.clearTimeout(u)};function Bp(u,h){if(h)return u.slice();var m=u.length,b=C0?C0(m):new u.constructor(m);return u.copy(b),b}function Au(u){var h=new u.constructor(u.byteLength);return new bd(h).set(new bd(u)),h}function L_(u,h){var m=h?Au(u.buffer):u.buffer;return new u.constructor(m,u.byteOffset,u.length)}function Ac(u,h){if(u!==h){var m=u!==k,b=null===u,M=u==u,P=$o(u),V=h!==k,z=null===h,X=h==h,ge=$o(h);if(!z&&!ge&&!P&&u>h||P&&V&&X&&!z&&!ge||b&&V&&X||!m&&X||!M)return 1;if(!b&&!P&&!ge&&u1?m[M-1]:k,V=M>2?m[2]:k;for(P=u.length>3&&"function"==typeof P?(M--,P):k,V&&ms(m[0],m[1],V)&&(P=M<3?k:P,M=1),h=di(h);++b-1?M[P?h[V]:V]:k}}function Ou(u){return Ka(function(h){var m=h.length,b=m,M=po.prototype.thru;for(u&&h.reverse();b--;){var P=h[b];if("function"!=typeof P)throw new fa(qt);if(M&&!V&&"wrapper"==Gp(P))var V=new po([],!0)}for(b=V?b:m;++b1&&On.reverse(),me&&X<_n&&(On.length=X),this&&this!==Wn&&this instanceof zt&&(kc=mn||kd(kc)),kc.apply(il,On)}}function U0(u,h){return function(m,b){return function(u,h,m,b){return qa(u,function(M,P,V){h(b,m(M),P,V)}),b}(m,u,h(b),{})}}function B_(u,h){return function(m,b){var M;if(m===k&&b===k)return h;if(m!==k&&(M=m),b!==k){if(M===k)return b;"string"==typeof m||"string"==typeof b?(m=mo(m),b=mo(b)):(m=N0(m),b=N0(b)),M=u(m,b)}return M}}function jp(u){return Ka(function(h){return h=ui(h,ko(Nt())),gn(function(m){var b=this;return u(h,function(M){return xr(M,b,m)})})})}function Up(u,h){var m=(h=h===k?" ":mo(h)).length;if(m<2)return m?kp(h,u):h;var b=kp(h,Ce(u/kh(h)));return Rh(h)?Ya(za(b),0,u).join(""):b.slice(0,u)}function z0(u){return function(h,m,b){return b&&"number"!=typeof b&&ms(h,m,b)&&(m=b=k),h=tl(h),m===k?(m=h,h=0):m=tl(m),function(u,h,m,b){for(var M=-1,P=hr(Ce((h-u)/(m||1)),0),V=ne(P);P--;)V[b?P:++M]=u,u+=m;return V}(h,m,b=b===k?hz))return!1;var ge=P.get(u),me=P.get(h);if(ge&&me)return ge==h&&me==u;var Se=-1,Ke=!0,mt=2&m?new ma:k;for(P.set(u,h),P.set(h,u);++Se-1&&u%1==0&&u1?"& ":"")+h[b],h=h.join(m>2?", ":" "),u.replace(ce,"{\n/* [wrapped with "+h+"] */\n")}(b,function(u,h){return us(Mh,function(m){var b="_."+m[0];h&m[1]&&!Al(u,b)&&u.push(b)}),u.sort()}(function(u){var h=u.match(de);return h?h[1].split(Be):[]}(b),m)))}function Y_(u){var h=0,m=0;return function(){var b=BF(),M=16-(b-m);if(m=b,M>0){if(++h>=800)return arguments[0]}else h=0;return u.apply(k,arguments)}}function Ld(u,h){var m=-1,b=u.length,M=b-1;for(h=h===k?b:h;++m1?u[h-1]:k;return m="function"==typeof m?(u.pop(),m):k,Dx(u,m)});function sy(u){var h=O(u);return h.__chain__=!0,h}function Vd(u,h){return h(u)}var oy=Ka(function(u){var h=u.length,m=h?u[0]:0,b=this.__wrapped__,M=function(P){return x_(P,u)};return!(h>1||this.__actions__.length)&&b instanceof pn&&_o(m)?((b=b.slice(m,+m+(h?1:0))).__actions__.push({func:Vd,args:[M],thisArg:k}),new po(b,this.__chain__).thru(function(P){return h&&!P.length&&P.push(k),P})):this.thru(M)}),Px=yr(function(u,h,m){hi.call(u,m)?++u[m]:Wa(u,m,1)}),Fx=j0(K_),Nx=j0(Z_);function uy(u,h){return(Ot(u)?us:Ec)(u,Nt(h,3))}function Jp(u,h){return(Ot(u)?pd:A_)(u,Nt(h,3))}var Bx=yr(function(u,h,m){hi.call(u,m)?u[m].push(h):Wa(u,m,[h])}),yC=gn(function(u,h,m){var b=-1,M="function"==typeof h,P=$s(u)?ne(u.length):[];return Ec(u,function(V){P[++b]=M?xr(h,V,m):ya(V,h,m)}),P}),vC=yr(function(u,h,m){Wa(u,m,h)});function Qa(u,h){return(Ot(u)?ui:$1)(u,Nt(h,3))}var CC=yr(function(u,h,m){u[m?0:1].push(h)},function(){return[[],[]]}),tg=gn(function(u,h){if(null==u)return[];var m=h.length;return m>1&&ms(u,h[0],h[1])?h=[]:m>2&&ms(h[0],h[1],h[2])&&(h=[h[0]]),Xh(u,Yr(h,1),[])}),Ru=x1||function(){return Wn.Date.now()};function ng(u,h,m){return h=m?k:h,kl(u,128,k,k,k,k,h=u&&null==h?u.length:h)}function hy(u,h){var m;if("function"!=typeof h)throw new fa(qt);return u=Jt(u),function(){return--u>0&&(m=h.apply(this,arguments)),u<=1&&(h=k),m}}var sf=gn(function(u,h,m){var b=1;if(m.length){var M=yu(m,Nd(sf));b|=32}return kl(u,b,h,m,M)}),Ud=gn(function(u,h,m){var b=3;if(m.length){var M=yu(m,Nd(Ud));b|=32}return kl(h,b,u,m,M)});function AC(u,h,m){var b,M,P,V,z,X,ge=0,me=!1,Se=!1,Ke=!0;if("function"!=typeof u)throw new fa(qt);function mt(Xn){var il=b,kc=M;return b=M=k,ge=Xn,V=u.apply(kc,il)}function Vt(Xn){return ge=Xn,z=Jh(_n,h),me?mt(Xn):V}function zt(Xn){var il=Xn-X;return X===k||il>=h||il<0||Se&&Xn-ge>=P}function _n(){var Xn=Ru();if(zt(Xn))return On(Xn);z=Jh(_n,function(Xn){var WT=h-(Xn-X);return Se?Nr(WT,P-(Xn-ge)):WT}(Xn))}function On(Xn){return z=k,Ke&&b?mt(Xn):(b=M=k,V)}function Go(){var Xn=Ru(),il=zt(Xn);if(b=arguments,M=this,X=Xn,il){if(z===k)return Vt(X);if(Se)return X1(z),z=Jh(_n,h),mt(X)}return z===k&&(z=Jh(_n,h)),V}return h=Gs(h)||0,Xi(m)&&(me=!!m.leading,P=(Se="maxWait"in m)?hr(Gs(m.maxWait)||0,h):P,Ke="trailing"in m?!!m.trailing:Ke),Go.cancel=function(){z!==k&&X1(z),ge=0,b=X=M=z=k},Go.flush=function(){return z===k?V:On(Ru())},Go}var zx=gn(function(u,h){return Wh(u,1,h)}),DC=gn(function(u,h,m){return Wh(u,Gs(h)||0,m)});function of(u,h){if("function"!=typeof u||null!=h&&"function"!=typeof h)throw new fa(qt);var m=function(){var b=arguments,M=h?h.apply(this,b):b[0],P=m.cache;if(P.has(M))return P.get(M);var V=u.apply(this,b);return m.cache=P.set(M,V)||P,V};return m.cache=new(of.Cache||$a),m}function gy(u){if("function"!=typeof u)throw new fa(qt);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}of.Cache=$a;var Hx=Y1(function(u,h){var m=(h=1==h.length&&Ot(h[0])?ui(h[0],ko(Nt())):ui(Yr(h,1),ko(Nt()))).length;return gn(function(b){for(var M=-1,P=Nr(b.length,m);++M=h}),Ja=j1(function(){return arguments}())?j1:function(u){return Ki(u)&&hi.call(u,"callee")&&!Cp.call(u,"callee")},Ot=ne.isArray,FC=Ze?ko(Ze):function(u){return Ki(u)&&Xr(u)==bl};function $s(u){return null!=u&&_y(u.length)&&!Ho(u)}function Yi(u){return Ki(u)&&$s(u)}var el=Tr||jy,NC=fn?ko(fn):function(u){return Ki(u)&&Xr(u)==ot};function Ca(u){if(!Ki(u))return!1;var h=Xr(u);return h==Pi||"[object DOMException]"==h||"string"==typeof u.message&&"string"==typeof u.name&&!og(u)}function Ho(u){if(!Xi(u))return!1;var h=Xr(u);return h==oa||h==Fa||"[object AsyncFunction]"==h||"[object Proxy]"==h}function sg(u){return"number"==typeof u&&u==Jt(u)}function _y(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=Ln}function Xi(u){var h=typeof u;return null!=u&&("object"==h||"function"==h)}function Ki(u){return null!=u&&"object"==typeof u}var Jx=xi?ko(xi):function(u){return Ki(u)&&gs(u)==Ri};function nT(u){return"number"==typeof u||Ki(u)&&Xr(u)==Hr}function og(u){if(!Ki(u)||Xr(u)!=nr)return!1;var h=pa(u);if(null===h)return!0;var m=hi.call(h,"constructor")&&h.constructor;return"function"==typeof m&&m instanceof m&&qi.call(m)==S1}var jC=Us?ko(Us):function(u){return Ki(u)&&Xr(u)==$r},iT=yc?ko(yc):function(u){return Ki(u)&&gs(u)==Fr};function vy(u){return"string"==typeof u||!Ot(u)&&Ki(u)&&Xr(u)==ei}function $o(u){return"symbol"==typeof u||Ki(u)&&Xr(u)==hc}var af=Mr?ko(Mr):function(u){return Ki(u)&&_y(u.length)&&!!Le[Xr(u)]},Ic=zp(R0),by=zp(function(u,h){return u<=h});function UC(u){if(!u)return[];if($s(u))return vy(u)?za(u):xs(u);if(Lh&&u[Lh])return function(W){for(var ue,ne=[];!(ue=W.next()).done;)ne.push(ue.value);return ne}(u[Lh]());var h=gs(u);return(h==Ri?y0:h==Fr?u_:Wd)(u)}function tl(u){return u?(u=Gs(u))===rn||u===-rn?17976931348623157e292*(u<0?-1:1):u==u?u:0:0===u?u:0}function Jt(u){var h=tl(u),m=h%1;return h==h?m?h-m:h:0}function Cy(u){return u?wu(Jt(u),0,Ft):0}function Gs(u){if("number"==typeof u)return u;if($o(u))return NaN;if(Xi(u)){var h="function"==typeof u.valueOf?u.valueOf():u;u=Xi(h)?h+"":h}if("string"!=typeof u)return 0===u?u:+u;u=_0(u);var m=Hi.test(u);return m||ln.test(u)?m0(u.slice(2),m?2:8):ti.test(u)?NaN:+u}function zC(u){return va(u,As(u))}function Yn(u){return null==u?"":mo(u)}var rT=Pl(function(u,h){if(qp(h)||$s(h))va(h,Qr(h),u);else for(var m in h)hi.call(h,m)&&Ga(u,m,h[m])}),sT=Pl(function(u,h){va(h,As(h),u)}),zd=Pl(function(u,h,m,b){va(h,As(h),u,b)}),oT=Pl(function(u,h,m,b){va(h,Qr(h),u,b)}),HC=Ka(x_),lT=gn(function(u,h){u=di(u);var m=-1,b=h.length,M=b>2?h[2]:k;for(M&&ms(h[0],h[1],M)&&(b=1);++m1),P}),va(u,j_(u),m),b&&(m=hs(m,7,Hp));for(var M=h.length;M--;)Mu(m,h[M]);return m}),fT=Ka(function(u,h){return null==u?{}:function(u,h){return k0(u,h,function(m,b){return ag(u,b)})}(u,h)});function KC(u,h){if(null==u)return{};var m=ui(j_(u),function(b){return[b]});return h=Nt(h),k0(u,m,function(b,M){return h(b,M[0])})}var pT=Iu(Qr),QC=Iu(As);function Wd(u){return null==u?[]:c_(u,Qr(u))}var vT=Rl(function(u,h,m){return h=h.toLowerCase(),u+(m?My(h):h)});function My(u){return ug(Yn(u).toLowerCase())}function xy(u){return(u=Yn(u))&&u.replace(gc,DF).replace(s_,"")}var CT=Rl(function(u,h,m){return u+(m?"-":"")+h.toLowerCase()}),wT=Rl(function(u,h,m){return u+(m?" ":"")+h.toLowerCase()}),pN=Vp("toLowerCase"),TT=Rl(function(u,h,m){return u+(m?"_":"")+h.toLowerCase()}),Dy=Rl(function(u,h,m){return u+(m?" ":"")+ug(h)}),rw=Rl(function(u,h,m){return u+(m?" ":"")+h.toUpperCase()}),ug=Vp("toUpperCase");function Ry(u,h,m){return u=Yn(u),(h=m?k:h)===k?function(W){return xl.test(W)}(u)?function(W){return W.match(h0)||[]}(u):function(W){return W.match(Kt)||[]}(u):u.match(h)||[]}var ky=gn(function(u,h){try{return xr(u,k,h)}catch(m){return Ca(m)?m:new Et(m)}}),sw=Ka(function(u,h){return us(h,function(m){m=on(m),Wa(u,m,sf(u[m],u))}),u});function Fy(u){return function(){return u}}var mN=Ou(),ku=Ou(!0);function Ds(u){return u}function Fu(u){return H1("function"==typeof u?u:hs(u,1))}var Ny=gn(function(u,h){return function(m){return ya(m,u,h)}}),ow=gn(function(u,h){return function(m){return ya(u,m,h)}});function Ly(u,h,m){var b=Qr(h),M=Yh(h,b);null==m&&(!Xi(h)||!M.length&&b.length)&&(m=h,h=u,u=this,M=Yh(h,Qr(h)));var P=!(Xi(m)&&"chain"in m&&!m.chain),V=Ho(u);return us(M,function(z){var X=h[z];u[z]=X,V&&(u.prototype[z]=function(){var ge=this.__chain__;if(P||ge){var me=u(this.__wrapped__),Se=me.__actions__=xs(this.__actions__);return Se.push({func:X,args:arguments,thisArg:u}),me.__chain__=ge,me}return X.apply(u,dr([this.value()],arguments))})}),u}function By(){}var kT=jp(ui),FT=jp(sn),lw=jp(ho);function Nu(u){return Vo(u)?a_(on(u)):function(u){return function(h){return Fo(h,u)}}(u)}var NT=z0(),LT=z0(!0);function Rc(){return[]}function jy(){return!1}var Tt=B_(function(u,h){return u+h},0),Uy=Fd("ceil"),yN=B_(function(u,h){return u/h},1),Bl=Fd("floor"),hw=B_(function(u,h){return u*h},1),fw=Fd("round"),pw=B_(function(u,h){return u-h},0);return O.after=function(u,h){if("function"!=typeof h)throw new fa(qt);return u=Jt(u),function(){if(--u<1)return h.apply(this,arguments)}},O.ary=ng,O.assign=rT,O.assignIn=sT,O.assignInWith=zd,O.assignWith=oT,O.at=HC,O.before=hy,O.bind=sf,O.bindAll=sw,O.bindKey=Ud,O.castArray=function(){if(!arguments.length)return[];var u=arguments[0];return Ot(u)?u:[u]},O.chain=sy,O.chunk=function(u,h,m){h=(m?ms(u,h,m):h===k)?1:hr(Jt(h),0);var b=null==u?0:u.length;if(!b||h<1)return[];for(var M=0,P=0,V=ne(Ce(b/h));MM?0:M+m),(b=b===k||b>M?M:Jt(b))<0&&(b+=M),b=m>b?0:Cy(b);m>>0)?(u=Yn(u))&&("string"==typeof h||null!=h&&!jC(h))&&!(h=mo(h))&&Rh(u)?Ya(za(u),0,m):u.split(h,m):[]},O.spread=function(u,h){if("function"!=typeof u)throw new fa(qt);return h=null==h?0:hr(Jt(h),0),gn(function(m){var b=m[h],M=Ya(m,0,h);return b&&dr(M,b),xr(u,this,M)})},O.tail=function(u){var h=null==u?0:u.length;return h?Kr(u,1,h):[]},O.take=function(u,h,m){return u&&u.length?Kr(u,0,(h=m||h===k?1:Jt(h))<0?0:h):[]},O.takeRight=function(u,h,m){var b=null==u?0:u.length;return b?Kr(u,(h=b-(h=m||h===k?1:Jt(h)))<0?0:h,b):[]},O.takeRightWhile=function(u,h){return u&&u.length?xu(u,Nt(h,3),!1,!0):[]},O.takeWhile=function(u,h){return u&&u.length?xu(u,Nt(h,3)):[]},O.tap=function(u,h){return h(u),u},O.throttle=function(u,h,m){var b=!0,M=!0;if("function"!=typeof u)throw new fa(qt);return Xi(m)&&(b="leading"in m?!!m.leading:b,M="trailing"in m?!!m.trailing:M),AC(u,h,{leading:b,maxWait:h,trailing:M})},O.thru=Vd,O.toArray=UC,O.toPairs=pT,O.toPairsIn=QC,O.toPath=function(u){return Ot(u)?ui(u,on):$o(u)?[u]:xs(eC(Yn(u)))},O.toPlainObject=zC,O.transform=function(u,h,m){var b=Ot(u),M=b||el(u)||af(u);if(h=Nt(h,4),null==m){var P=u&&u.constructor;m=M?b?new P:[]:Xi(u)&&Ho(P)?Cu(pa(u)):{}}return(M?us:qa)(u,function(V,z,X){return h(m,V,z,X)}),m},O.unary=function(u){return ng(u,1)},O.union=uC,O.unionBy=ny,O.unionWith=Qp,O.uniq=function(u){return u&&u.length?Mc(u):[]},O.uniqBy=function(u,h){return u&&u.length?Mc(u,Nt(h,2)):[]},O.uniqWith=function(u,h){return h="function"==typeof h?h:k,u&&u.length?Mc(u,k,h):[]},O.unset=function(u,h){return null==u||Mu(u,h)},O.unzip=dC,O.unzipWith=Dx,O.update=function(u,h,m){return null==u?u:Np(u,h,N_(m))},O.updateWith=function(u,h,m,b){return b="function"==typeof b?b:k,null==u?u:Np(u,h,N_(m),b)},O.values=Wd,O.valuesIn=function(u){return null==u?[]:c_(u,As(u))},O.without=hC,O.words=Ry,O.wrap=function(u,h){return ig(N_(h),u)},O.xor=iN,O.xorBy=yo,O.xorWith=iy,O.zip=ry,O.zipObject=function(u,h){return Lp(u||[],h||[],Ga)},O.zipObjectDeep=function(u,h){return Lp(u||[],h||[],Fp)},O.zipWith=rf,O.entries=pT,O.entriesIn=QC,O.extend=sT,O.extendWith=zd,Ly(O,O),O.add=Tt,O.attempt=ky,O.camelCase=vT,O.capitalize=My,O.ceil=Uy,O.clamp=function(u,h,m){return m===k&&(m=h,h=k),m!==k&&(m=(m=Gs(m))==m?m:0),h!==k&&(h=(h=Gs(h))==h?h:0),wu(Gs(u),h,m)},O.clone=function(u){return hs(u,4)},O.cloneDeep=function(u){return hs(u,5)},O.cloneDeepWith=function(u,h){return hs(u,5,h="function"==typeof h?h:k)},O.cloneWith=function(u,h){return hs(u,4,h="function"==typeof h?h:k)},O.conformsTo=function(u,h){return null==h||Ip(u,h,Qr(h))},O.deburr=xy,O.defaultTo=function(u,h){return null==u||u!=u?h:u},O.divide=yN,O.endsWith=function(u,h,m){u=Yn(u),h=mo(h);var b=u.length,M=m=m===k?b:wu(Jt(m),0,b);return(m-=h.length)>=0&&u.slice(m,M)==h},O.eq=St,O.escape=function(u){return(u=Yn(u))&&Ye.test(u)?u.replace(du,OF):u},O.escapeRegExp=function(u){return(u=Yn(u))&&K.test(u)?u.replace(B,"\\$&"):u},O.every=function(u,h,m){var b=Ot(u)?sn:D0;return m&&ms(u,h,m)&&(h=k),b(u,Nt(h,3))},O.find=Fx,O.findIndex=K_,O.findKey=function(u,h){return Ih(u,Nt(h,3),qa)},O.findLast=Nx,O.findLastIndex=Z_,O.findLastKey=function(u,h){return Ih(u,Nt(h,3),Pp)},O.floor=Bl,O.forEach=uy,O.forEachRight=Jp,O.forIn=function(u,h){return null==u?u:Md(u,Nt(h,3),As)},O.forInRight=function(u,h){return null==u?u:xd(u,Nt(h,3),As)},O.forOwn=function(u,h){return u&&qa(u,Nt(h,3))},O.forOwnRight=function(u,h){return u&&Pp(u,Nt(h,3))},O.get=uf,O.gt=Y,O.gte=kC,O.has=function(u,h){return null!=u&&X0(u,h,Td)},O.hasIn=ag,O.head=nC,O.identity=Ds,O.includes=function(u,h,m,b){u=$s(u)?u:Wd(u),m=m&&!b?Jt(m):0;var M=u.length;return m<0&&(m=hr(M+m,0)),vy(u)?m<=M&&u.indexOf(h,m)>-1:!!M&&Ua(u,h,m)>-1},O.indexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=null==m?0:Jt(m);return M<0&&(M=hr(b+M,0)),Ua(u,h,M)},O.inRange=function(u,h,m){return h=tl(h),m===k?(m=h,h=0):m=tl(m),function(u,h,m){return u>=Nr(h,m)&&u=-Ln&&u<=Ln},O.isSet=iT,O.isString=vy,O.isSymbol=$o,O.isTypedArray=af,O.isUndefined=function(u){return u===k},O.isWeakMap=function(u){return Ki(u)&&gs(u)==ci},O.isWeakSet=function(u){return Ki(u)&&"[object WeakSet]"==Xr(u)},O.join=function(u,h){return null==u?"":Bh.call(u,h)},O.kebabCase=CT,O.last=jo,O.lastIndexOf=function(u,h,m){var b=null==u?0:u.length;if(!b)return-1;var M=b;return m!==k&&(M=(M=Jt(m))<0?hr(b+M,0):Nr(M,b-1)),h==h?function(W,ue,ne){for(var it=ne+1;it--;)if(W[it]===ue)return it;return it}(u,h,M):md(u,vc,M,!0)},O.lowerCase=wT,O.lowerFirst=pN,O.lt=Ic,O.lte=by,O.max=function(u){return u&&u.length?qh(u,Ds,fs):k},O.maxBy=function(u,h){return u&&u.length?qh(u,Nt(h,2),fs):k},O.mean=function(u){return Wr(u,Ds)},O.meanBy=function(u,h){return Wr(u,Nt(h,2))},O.min=function(u){return u&&u.length?qh(u,Ds,R0):k},O.minBy=function(u,h){return u&&u.length?qh(u,Nt(h,2),R0):k},O.stubArray=Rc,O.stubFalse=jy,O.stubObject=function(){return{}},O.stubString=function(){return""},O.stubTrue=function(){return!0},O.multiply=hw,O.nth=function(u,h){return u&&u.length?Su(u,Jt(h)):k},O.noConflict=function(){return Wn._===this&&(Wn._=g_),this},O.noop=By,O.now=Ru,O.pad=function(u,h,m){u=Yn(u);var b=(h=Jt(h))?kh(u):0;if(!h||b>=h)return u;var M=(h-b)/2;return Up(Sn(M),m)+u+Up(Ce(M),m)},O.padEnd=function(u,h,m){u=Yn(u);var b=(h=Jt(h))?kh(u):0;return h&&bh){var b=u;u=h,h=b}if(m||u%1||h%1){var M=Vh();return Nr(u+M*(h-u+m1("1e-"+((M+"").length-1))),h)}return Il(u,h)},O.reduce=function(u,h,m){var b=Ot(u)?_u:Ro,M=arguments.length<3;return b(u,Nt(h,4),m,M,Ec)},O.reduceRight=function(u,h,m){var b=Ot(u)?gd:Ro,M=arguments.length<3;return b(u,Nt(h,4),m,M,A_)},O.repeat=function(u,h,m){return h=(m?ms(u,h,m):h===k)?1:Jt(h),kp(Yn(u),h)},O.replace=function(){var u=arguments,h=Yn(u[0]);return u.length<3?h:h.replace(u[1],u[2])},O.result=function(u,h,m){var b=-1,M=(h=Tc(h,u)).length;for(M||(M=1,u=k);++bLn)return[];var m=Ft,b=Nr(u,Ft);h=Nt(h),u-=Ft;for(var M=yd(b,h);++m=P)return u;var z=m-kh(b);if(z<1)return b;var X=V?Ya(V,0,z).join(""):u.slice(0,z);if(M===k)return X+b;if(V&&(z+=X.length-z),jC(M)){if(u.slice(z).search(M)){var ge,me=X;for(M.global||(M=f_(M.source,Yn(Zt.exec(M))+"g")),M.lastIndex=0;ge=M.exec(me);)var Se=ge.index;X=X.slice(0,Se===k?z:Se)}}else if(u.indexOf(mo(M),z)!=z){var Ke=X.lastIndexOf(M);Ke>-1&&(X=X.slice(0,Ke))}return X+b},O.unescape=function(u){return(u=Yn(u))&&Vs.test(u)?u.replace(ud,h_):u},O.uniqueId=function(u){var h=++LF;return Yn(u)+h},O.upperCase=rw,O.upperFirst=ug,O.each=uy,O.eachRight=Jp,O.first=nC,Ly(O,function(){var u={};return qa(O,function(h,m){hi.call(O.prototype,m)||(u[m]=h)}),u}(),{chain:!1}),O.VERSION="4.17.21",us(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){O[u].placeholder=O}),us(["drop","take"],function(u,h){pn.prototype[u]=function(m){m=m===k?1:hr(Jt(m),0);var b=this.__filtered__&&!h?new pn(this):this.clone();return b.__filtered__?b.__takeCount__=Nr(m,b.__takeCount__):b.__views__.push({size:Nr(m,Ft),type:u+(b.__dir__<0?"Right":"")}),b},pn.prototype[u+"Right"]=function(m){return this.reverse()[u](m).reverse()}}),us(["filter","map","takeWhile"],function(u,h){var m=h+1,b=1==m||3==m;pn.prototype[u]=function(M){var P=this.clone();return P.__iteratees__.push({iteratee:Nt(M,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),us(["head","last"],function(u,h){var m="take"+(h?"Right":"");pn.prototype[u]=function(){return this[m](1).value()[0]}}),us(["initial","tail"],function(u,h){var m="drop"+(h?"":"Right");pn.prototype[u]=function(){return this.__filtered__?new pn(this):this[m](1)}}),pn.prototype.compact=function(){return this.filter(Ds)},pn.prototype.find=function(u){return this.filter(u).head()},pn.prototype.findLast=function(u){return this.reverse().find(u)},pn.prototype.invokeMap=gn(function(u,h){return"function"==typeof u?new pn(this):this.map(function(m){return ya(m,u,h)})}),pn.prototype.reject=function(u){return this.filter(gy(Nt(u)))},pn.prototype.slice=function(u,h){u=Jt(u);var m=this;return m.__filtered__&&(u>0||h<0)?new pn(m):(u<0?m=m.takeRight(-u):u&&(m=m.drop(u)),h!==k&&(m=(h=Jt(h))<0?m.dropRight(-h):m.take(h-u)),m)},pn.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},pn.prototype.toArray=function(){return this.take(Ft)},qa(pn.prototype,function(u,h){var m=/^(?:filter|find|map|reject)|While$/.test(h),b=/^(?:head|last)$/.test(h),M=O[b?"take"+("last"==h?"Right":""):h],P=b||/^find/.test(h);!M||(O.prototype[h]=function(){var V=this.__wrapped__,z=b?[1]:arguments,X=V instanceof pn,ge=z[0],me=X||Ot(V),Se=function(_n){var On=M.apply(O,dr([_n],z));return b&&Ke?On[0]:On};me&&m&&"function"==typeof ge&&1!=ge.length&&(X=me=!1);var Ke=this.__chain__,mt=!!this.__actions__.length,Vt=P&&!Ke,mn=X&&!mt;if(!P&&me){V=mn?V:new pn(this);var zt=u.apply(V,z);return zt.__actions__.push({func:Vd,args:[Se],thisArg:k}),new po(zt,Ke)}return Vt&&mn?u.apply(this,z):(zt=this.thru(Se),Vt?b?zt.value()[0]:zt.value():zt)})}),us(["pop","push","shift","sort","splice","unshift"],function(u){var h=Ti[u],m=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",b=/^(?:pop|shift)$/.test(u);O.prototype[u]=function(){var M=arguments;if(b&&!this.__chain__){var P=this.value();return h.apply(Ot(P)?P:[],M)}return this[m](function(V){return h.apply(Ot(V)?V:[],M)})}}),qa(pn.prototype,function(u,h){var m=O[h];if(m){var b=m.name+"";hi.call(Cd,b)||(Cd[b]=[]),Cd[b].push({name:h,func:m})}}),Cd[Dc(k,2).name]=[{name:"wrapper",func:k}],pn.prototype.clone=function(){var u=new pn(this.__wrapped__);return u.__actions__=xs(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=xs(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=xs(this.__views__),u},pn.prototype.reverse=function(){if(this.__filtered__){var u=new pn(this);u.__dir__=-1,u.__filtered__=!0}else(u=this.clone()).__dir__*=-1;return u},pn.prototype.value=function(){var u=this.__wrapped__.value(),h=this.__dir__,m=Ot(u),b=h<0,M=m?u.length:0,P=function(u,h,m){for(var b=-1,M=m.length;++b=this.__values__.length;return{done:u,value:u?k:this.__values__[this.__index__++]}},O.prototype.plant=function(u){for(var h,m=this;m instanceof Hh;){var b=Xp(m);b.__index__=0,b.__values__=k,h?M.__wrapped__=b:h=b;var M=b;m=m.__wrapped__}return M.__wrapped__=u,h},O.prototype.reverse=function(){var u=this.__wrapped__;if(u instanceof pn){var h=u;return this.__actions__.length&&(h=new pn(this)),(h=h.reverse()).__actions__.push({func:Vd,args:[ty],thisArg:k}),new po(h,this.__chain__)}return this.thru(ty)},O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=function(){return q1(this.__wrapped__,this.__actions__)},O.prototype.first=O.prototype.head,Lh&&(O.prototype[Lh]=function(){return this}),O}();Wn._=Fh,(_t=function(){return Fh}.call(We,Ve,We,pt))!==k&&(pt.exports=_t)}.call(this)},478:function(pt){pt.exports=function(){"use strict";function We(G,q){for(var Z=0;ZG.length)&&(q=G.length);for(var Z=0,T=new Array(q);Z=G.length?{done:!0}:{done:!1,value:G[T++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Pt={exports:{}};function ft(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Pt.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:ft,changeDefaults:function(G){Pt.exports.defaults=G}};var yt=/[&<>"']/,dn=/[&<>"']/g,En=/[<>"']|&(?!#?\w+;)/,Fe=/[<>"']|&(?!#?\w+;)/g,je={"&":"&","<":"<",">":">",'"':""","'":"'"},$t=function(q){return je[q]};var Ie=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function pi(G){return G.replace(Ie,function(q,Z){return"colon"===(Z=Z.toLowerCase())?":":"#"===Z.charAt(0)?"x"===Z.charAt(1)?String.fromCharCode(parseInt(Z.substring(2),16)):String.fromCharCode(+Z.substring(1)):""})}var qe=/(^|[^\[])\^/g;var Rt=/[^\w:]/g,nn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var Ci={},yi=/^[^:]+:\/*[^/]*$/,vi=/^([^:]+:)[\s\S]*$/,Er=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ae(G,q){Ci[" "+G]||(Ci[" "+G]=yi.test(G)?G+"/":Gt(G,"/",!0));var Z=-1===(G=Ci[" "+G]).indexOf(":");return"//"===q.substring(0,2)?Z?q:G.replace(vi,"$1")+q:"/"===q.charAt(0)?Z?q:G.replace(Er,"$1")+q:G+q}function Gt(G,q,Z){var T=G.length;if(0===T)return"";for(var D=0;D1;)1&q&&(Z+=G),q>>=1,G+=G;return Z+G},Ln=Pt.exports.defaults,be=Gt,Ii=function(G,q){var T=G.replace(/\|/g,function(B,K,H){for(var se=!1,ce=K;--ce>=0&&"\\"===H[ce];)se=!se;return se?"|":" |"}).split(/ \|/),D=0;if(T.length>q)T.splice(q);else for(;T.length1?{type:"space",raw:D[0]}:{raw:"\n"}},q.code=function(T){var D=this.rules.block.code.exec(T);if(D){var B=D[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:D[0],codeBlockStyle:"indented",text:this.options.pedantic?B:be(B,"\n")}}},q.fences=function(T){var D=this.rules.block.fences.exec(T);if(D){var B=D[0],K=function(G,q){var Z=G.match(/^(\s+)(?:```)/);if(null===Z)return q;var T=Z[1];return q.split("\n").map(function(D){var B=D.match(/^\s+/);return null===B?D:B[0].length>=T.length?D.slice(T.length):D}).join("\n")}(B,D[3]||"");return{type:"code",raw:B,lang:D[2]?D[2].trim():D[2],text:K}}},q.heading=function(T){var D=this.rules.block.heading.exec(T);if(D){var B=D[2].trim();if(/#$/.test(B)){var K=be(B,"#");(this.options.pedantic||!K||/ $/.test(K))&&(B=K.trim())}return{type:"heading",raw:D[0],depth:D[1].length,text:B}}},q.nptable=function(T){var D=this.rules.block.nptable.exec(T);if(D){var B={type:"table",header:Ii(D[1].replace(/^ *| *\| *$/g,"")),align:D[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:D[3]?D[3].replace(/\n$/,"").split("\n"):[],raw:D[0]};if(B.header.length===B.align.length){var H,K=B.align.length;for(H=0;H ?/gm,"");return{type:"blockquote",raw:D[0],text:B}}},q.list=function(T){var D=this.rules.block.list.exec(T);if(D){var Be,Kt,Cn,jt,gt,Zt,ti,Hi,$i,B=D[0],K=D[2],H=K.length>1,se={type:"list",raw:B,ordered:H,start:H?+K.slice(0,-1):"",loose:!1,items:[]},ce=D[0].match(this.rules.block.item),de=!1,ln=ce.length;Cn=this.rules.block.listItemStart.exec(ce[0]);for(var bi=0;biCn[1].length:jt[1].length>=Cn[0].length||jt[1].length>3){ce.splice(bi,2,ce[bi]+(!this.options.pedantic&&jt[1].length/i.test(K[0])&&(D=!1),!B&&/^<(pre|code|kbd|script)(\s|>)/i.test(K[0])?B=!0:B&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(K[0])&&(B=!1),{type:this.options.sanitize?"text":"html",raw:K[0],inLink:D,inRawBlock:B,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):Ft(K[0]):K[0]}},q.link=function(T){var D=this.rules.inline.link.exec(T);if(D){var B=D[2].trim();if(!this.options.pedantic&&/^$/.test(B))return;var K=be(B.slice(0,-1),"\\");if((B.length-K.length)%2==0)return}else{var H=Sr(D[2],"()");if(H>-1){var ce=(0===D[0].indexOf("!")?5:4)+D[1].length+H;D[2]=D[2].substring(0,H),D[0]=D[0].substring(0,ce).trim(),D[3]=""}}var de=D[2],Be="";if(this.options.pedantic){var Kt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(de);Kt&&(de=Kt[1],Be=Kt[3])}else Be=D[3]?D[3].slice(1,-1):"";return de=de.trim(),/^$/.test(B)?de.slice(1):de.slice(1,-1)),os(D,{href:de&&de.replace(this.rules.inline._escapes,"$1"),title:Be&&Be.replace(this.rules.inline._escapes,"$1")},D[0])}},q.reflink=function(T,D){var B;if((B=this.rules.inline.reflink.exec(T))||(B=this.rules.inline.nolink.exec(T))){var K=(B[2]||B[1]).replace(/\s+/g," ");if(!(K=D[K.toLowerCase()])||!K.href){var H=B[0].charAt(0);return{type:"text",raw:H,text:H}}return os(B,K,B[0])}},q.emStrong=function(T,D,B){void 0===B&&(B="");var K=this.rules.inline.emStrong.lDelim.exec(T);if(K&&(!K[3]||!B.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var H=K[1]||K[2]||"";if(!H||H&&(""===B||this.rules.inline.punctuation.exec(B))){var ce,de,se=K[0].length-1,Be=se,Kt=0,Cn="*"===K[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Cn.lastIndex=0,D=D.slice(-1*T.length+se);null!=(K=Cn.exec(D));)if(ce=K[1]||K[2]||K[3]||K[4]||K[5]||K[6]){if(de=ce.length,K[3]||K[4]){Be+=de;continue}if((K[5]||K[6])&&se%3&&!((se+de)%3)){Kt+=de;continue}if(!((Be-=de)>0))return de=Math.min(de,de+Be+Kt),Math.min(se,de)%2?{type:"em",raw:T.slice(0,se+K.index+de+1),text:T.slice(1,se+K.index+de)}:{type:"strong",raw:T.slice(0,se+K.index+de+1),text:T.slice(2,se+K.index+de-1)}}}}},q.codespan=function(T){var D=this.rules.inline.code.exec(T);if(D){var B=D[2].replace(/\n/g," "),K=/[^ ]/.test(B),H=/^ /.test(B)&&/ $/.test(B);return K&&H&&(B=B.substring(1,B.length-1)),B=Ft(B,!0),{type:"codespan",raw:D[0],text:B}}},q.br=function(T){var D=this.rules.inline.br.exec(T);if(D)return{type:"br",raw:D[0]}},q.del=function(T){var D=this.rules.inline.del.exec(T);if(D)return{type:"del",raw:D[0],text:D[2]}},q.autolink=function(T,D){var K,H,B=this.rules.inline.autolink.exec(T);if(B)return H="@"===B[2]?"mailto:"+(K=Ft(this.options.mangle?D(B[1]):B[1])):K=Ft(B[1]),{type:"link",raw:B[0],text:K,href:H,tokens:[{type:"text",raw:K,text:K}]}},q.url=function(T,D){var B;if(B=this.rules.inline.url.exec(T)){var K,H;if("@"===B[2])H="mailto:"+(K=Ft(this.options.mangle?D(B[0]):B[0]));else{var se;do{se=B[0],B[0]=this.rules.inline._backpedal.exec(B[0])[0]}while(se!==B[0]);K=Ft(B[0]),H="www."===B[1]?"http://"+K:K}return{type:"link",raw:B[0],text:K,href:H,tokens:[{type:"text",raw:K,text:K}]}}},q.inlineText=function(T,D,B){var H,K=this.rules.inline.text.exec(T);if(K)return H=D?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):Ft(K[0]):K[0]:Ft(this.options.smartypants?B(K[0]):K[0]),{type:"text",raw:K[0],text:H}},G}(),sa=rn_noopTest,Gn=rn_edit,ai=rn_merge,ot={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:sa,table:sa,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};ot.def=Gn(ot.def).replace("label",ot._label).replace("title",ot._title).getRegex(),ot.bullet=/(?:[*+-]|\d{1,9}[.)])/,ot.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ot.item=Gn(ot.item,"gm").replace(/bull/g,ot.bullet).getRegex(),ot.listItemStart=Gn(/^( *)(bull) */).replace("bull",ot.bullet).getRegex(),ot.list=Gn(ot.list).replace(/bull/g,ot.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ot.def.source+")").getRegex(),ot._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ot._comment=/|$)/,ot.html=Gn(ot.html,"i").replace("comment",ot._comment).replace("tag",ot._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ot.paragraph=Gn(ot._paragraph).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.blockquote=Gn(ot.blockquote).replace("paragraph",ot.paragraph).getRegex(),ot.normal=ai({},ot),ot.gfm=ai({},ot.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ot.gfm.nptable=Gn(ot.gfm.nptable).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.gfm.table=Gn(ot.gfm.table).replace("hr",ot.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ot._tag).getRegex(),ot.pedantic=ai({},ot.normal,{html:Gn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ot._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:sa,paragraph:Gn(ot.normal._paragraph).replace("hr",ot.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ot.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var He={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:sa,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:sa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};He.punctuation=Gn(He.punctuation).replace(/punctuation/g,He._punctuation).getRegex(),He.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,He.escapedEmSt=/\\\*|\\_/g,He._comment=Gn(ot._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),He.emStrong.lDelim=Gn(He.emStrong.lDelim).replace(/punct/g,He._punctuation).getRegex(),He.emStrong.rDelimAst=Gn(He.emStrong.rDelimAst,"g").replace(/punct/g,He._punctuation).getRegex(),He.emStrong.rDelimUnd=Gn(He.emStrong.rDelimUnd,"g").replace(/punct/g,He._punctuation).getRegex(),He._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,He._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,He._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,He.autolink=Gn(He.autolink).replace("scheme",He._scheme).replace("email",He._email).getRegex(),He._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,He.tag=Gn(He.tag).replace("comment",He._comment).replace("attribute",He._attribute).getRegex(),He._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,He._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,He._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,He.link=Gn(He.link).replace("label",He._label).replace("href",He._href).replace("title",He._title).getRegex(),He.reflink=Gn(He.reflink).replace("label",He._label).getRegex(),He.reflinkSearch=Gn(He.reflinkSearch,"g").replace("reflink",He.reflink).replace("nolink",He.nolink).getRegex(),He.normal=ai({},He),He.pedantic=ai({},He.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Gn(/^!?\[(label)\]\((.*?)\)/).replace("label",He._label).getRegex(),reflink:Gn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",He._label).getRegex()}),He.gfm=ai({},He.normal,{escape:Gn(He.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(T="x"+T.toString(16)),q+="&#"+T+";";return q}var li=function(){function G(Z){this.tokens=[],this.tokens.links=Object.create(null),this.options=Z||Fa,this.options.tokenizer=this.options.tokenizer||new oa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var T={block:Ri.normal,inline:Hr.normal};this.options.pedantic?(T.block=Ri.pedantic,T.inline=Hr.pedantic):this.options.gfm&&(T.block=Ri.gfm,T.inline=this.options.breaks?Hr.breaks:Hr.gfm),this.tokenizer.rules=T}G.lex=function(T,D){return new G(D).lex(T)},G.lexInline=function(T,D){return new G(D).inlineTokens(T)};var q=G.prototype;return q.lex=function(T){return T=T.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(T,this.tokens,!0),this.inline(this.tokens),this.tokens},q.blockTokens=function(T,D,B){var H,se,ce,de,Be,Kt,K=this;for(void 0===D&&(D=[]),void 0===B&&(B=!0),this.options.pedantic&&(T=T.replace(/^ +$/gm,""));T;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(jt){return!!(H=jt.call(K,T,D))&&(T=T.substring(H.raw.length),D.push(H),!0)}))){if(H=this.tokenizer.space(T)){T=T.substring(H.raw.length),H.type&&D.push(H);continue}if(H=this.tokenizer.code(T)){T=T.substring(H.raw.length),(de=D[D.length-1])&&"paragraph"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H);continue}if(H=this.tokenizer.fences(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.heading(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.nptable(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.hr(T)){T=T.substring(H.raw.length),D.push(H);continue}if(H=this.tokenizer.blockquote(T)){T=T.substring(H.raw.length),H.tokens=this.blockTokens(H.text,[],B),D.push(H);continue}if(H=this.tokenizer.list(T)){for(T=T.substring(H.raw.length),ce=H.items.length,se=0;se=0&&(jt=Math.min(jt,Zt))}),jt<1/0&&jt>=0&&(Be=T.substring(0,jt+1))}(),B&&(H=this.tokenizer.paragraph(Be))){de=D[D.length-1],Kt&&"paragraph"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H),Kt=Be.length!==T.length,T=T.substring(H.raw.length);continue}if(H=this.tokenizer.text(T)){T=T.substring(H.raw.length),(de=D[D.length-1])&&"text"===de.type?(de.raw+="\n"+H.raw,de.text+="\n"+H.text):D.push(H);continue}if(T){var Cn="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(Cn);break}throw new Error(Cn)}}return D},q.inline=function(T){var D,B,K,H,se,ce,de=T.length;for(D=0;D0)for(;null!=(Kt=this.tokenizer.rules.inline.reflinkSearch.exec(Be));)gt.includes(Kt[0].slice(Kt[0].lastIndexOf("[")+1,-1))&&(Be=Be.slice(0,Kt.index)+"["+Na("a",Kt[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(Kt=this.tokenizer.rules.inline.blockSkip.exec(Be));)Be=Be.slice(0,Kt.index)+"["+Na("a",Kt[0].length-2)+"]"+Be.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(Kt=this.tokenizer.rules.inline.escapedEmSt.exec(Be));)Be=Be.slice(0,Kt.index)+"++"+Be.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;T;)if(Cn||(jt=""),Cn=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ti){return!!(se=ti.call(H,T,D))&&(T=T.substring(se.raw.length),D.push(se),!0)}))){if(se=this.tokenizer.escape(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.tag(T,B,K)){T=T.substring(se.raw.length),B=se.inLink,K=se.inRawBlock,(ce=D[D.length-1])&&"text"===se.type&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(se=this.tokenizer.link(T)){T=T.substring(se.raw.length),"link"===se.type&&(se.tokens=this.inlineTokens(se.text,[],!0,K)),D.push(se);continue}if(se=this.tokenizer.reflink(T,this.tokens.links)){T=T.substring(se.raw.length),ce=D[D.length-1],"link"===se.type?(se.tokens=this.inlineTokens(se.text,[],!0,K),D.push(se)):ce&&"text"===se.type&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(se=this.tokenizer.emStrong(T,Be,jt)){T=T.substring(se.raw.length),se.tokens=this.inlineTokens(se.text,[],B,K),D.push(se);continue}if(se=this.tokenizer.codespan(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.br(T)){T=T.substring(se.raw.length),D.push(se);continue}if(se=this.tokenizer.del(T)){T=T.substring(se.raw.length),se.tokens=this.inlineTokens(se.text,[],B,K),D.push(se);continue}if(se=this.tokenizer.autolink(T,so)){T=T.substring(se.raw.length),D.push(se);continue}if(!B&&(se=this.tokenizer.url(T,so))){T=T.substring(se.raw.length),D.push(se);continue}if(de=T,this.options.extensions&&this.options.extensions.startInline&&function(){var ti=1/0,Hi=T.slice(1),$i=void 0;H.options.extensions.startInline.forEach(function(ln){"number"==typeof($i=ln.call(this,Hi))&&$i>=0&&(ti=Math.min(ti,$i))}),ti<1/0&&ti>=0&&(de=T.substring(0,ti+1))}(),se=this.tokenizer.inlineText(de,K,nr)){T=T.substring(se.raw.length),"_"!==se.raw.slice(-1)&&(jt=se.raw.slice(-1)),Cn=!0,(ce=D[D.length-1])&&"text"===ce.type?(ce.raw+=se.raw,ce.text+=se.text):D.push(se);continue}if(T){var Zt="Infinite loop on byte: "+T.charCodeAt(0);if(this.options.silent){console.error(Zt);break}throw new Error(Zt)}}return D},function(G,q,Z){q&&We(G.prototype,q),Z&&We(G,Z)}(G,null,[{key:"rules",get:function(){return{block:Ri,inline:Hr}}}]),G}(),$r=Pt.exports.defaults,Fr=rn_cleanUrl,ei=rn_escape,hc=function(){function G(Z){this.options=Z||$r}var q=G.prototype;return q.code=function(T,D,B){var K=(D||"").match(/\S*/)[0];if(this.options.highlight){var H=this.options.highlight(T,K);null!=H&&H!==T&&(B=!0,T=H)}return T=T.replace(/\n$/,"")+"\n",K?'
    '+(B?T:ei(T,!0))+"
    \n":"
    "+(B?T:ei(T,!0))+"
    \n"},q.blockquote=function(T){return"
    \n"+T+"
    \n"},q.html=function(T){return T},q.heading=function(T,D,B,K){return this.options.headerIds?"'+T+"\n":""+T+"\n"},q.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},q.list=function(T,D,B){var K=D?"ol":"ul";return"<"+K+(D&&1!==B?' start="'+B+'"':"")+">\n"+T+"\n"},q.listitem=function(T){return"
  • "+T+"
  • \n"},q.checkbox=function(T){return" "},q.paragraph=function(T){return"

    "+T+"

    \n"},q.table=function(T,D){return D&&(D=""+D+""),"\n\n"+T+"\n"+D+"
    \n"},q.tablerow=function(T){return"\n"+T+"\n"},q.tablecell=function(T,D){var B=D.header?"th":"td";return(D.align?"<"+B+' align="'+D.align+'">':"<"+B+">")+T+"\n"},q.strong=function(T){return""+T+""},q.em=function(T){return""+T+""},q.codespan=function(T){return""+T+""},q.br=function(){return this.options.xhtml?"
    ":"
    "},q.del=function(T){return""+T+""},q.link=function(T,D,B){if(null===(T=Fr(this.options.sanitize,this.options.baseUrl,T)))return B;var K='"+B+""},q.image=function(T,D,B){if(null===(T=Fr(this.options.sanitize,this.options.baseUrl,T)))return B;var K=''+B+'":">")},q.text=function(T){return T},G}(),oo=function(){function G(){}var q=G.prototype;return q.strong=function(T){return T},q.em=function(T){return T},q.codespan=function(T){return T},q.del=function(T){return T},q.html=function(T){return T},q.text=function(T){return T},q.link=function(T,D,B){return""+B},q.image=function(T,D,B){return""+B},q.br=function(){return""},G}(),ci=function(){function G(){this.seen={}}var q=G.prototype;return q.serialize=function(T){return T.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},q.getNextSafeSlug=function(T,D){var B=T,K=0;if(this.seen.hasOwnProperty(B)){K=this.seen[T];do{B=T+"-"+ ++K}while(this.seen.hasOwnProperty(B))}return D||(this.seen[T]=K,this.seen[B]=0),B},q.slug=function(T,D){void 0===D&&(D={});var B=this.serialize(T);return this.getNextSafeSlug(B,D.dryrun)},G}(),xh=hc,bl=oo,La=ci,ao=Pt.exports.defaults,Ba=rn_unescape,ls=li,lo=function(){function G(Z){this.options=Z||ao,this.options.renderer=this.options.renderer||new xh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new bl,this.slugger=new La}G.parse=function(T,D){return new G(D).parse(T)},G.parseInline=function(T,D){return new G(D).parseInline(T)};var q=G.prototype;return q.parse=function(T,D){void 0===D&&(D=!0);var K,H,se,ce,de,Be,Kt,Cn,jt,gt,Zt,ti,Hi,$i,ln,bi,gc,co,dd,B="",El=T.length;for(K=0;K0&&"text"===ln.tokens[0].type?(ln.tokens[0].text=co+" "+ln.tokens[0].text,ln.tokens[0].tokens&&ln.tokens[0].tokens.length>0&&"text"===ln.tokens[0].tokens[0].type&&(ln.tokens[0].tokens[0].text=co+" "+ln.tokens[0].tokens[0].text)):ln.tokens.unshift({type:"text",text:co}):$i+=co),$i+=this.parse(ln.tokens,Hi),jt+=this.renderer.listitem($i,gc,bi);B+=this.renderer.list(jt,Zt,ti);continue;case"html":B+=this.renderer.html(gt.text);continue;case"paragraph":B+=this.renderer.paragraph(this.parseInline(gt.tokens));continue;case"text":for(jt=gt.tokens?this.parseInline(gt.tokens):gt.text;K+1An error occurred:

    "+pc(se.message+"",!0)+"
    ";throw se}}return Ye.options=Ye.setOptions=function(G){return uu(Ye.defaults,G),du(Ye.defaults),Ye},Ye.getDefaults=ud,Ye.defaults=Vs,Ye.use=function(){for(var G=this,q=arguments.length,Z=new Array(q),T=0;TAn error occurred:

    "+pc(T.message+"",!0)+"
    ";throw T}},Ye.Parser=lo,Ye.parser=lo.parse,Ye.Renderer=Cl,Ye.TextRenderer=lu,Ye.Lexer=ls,Ye.lexer=ls.lex,Ye.Tokenizer=fc,Ye.Slugger=cu,Ye.parse=Ye,Ye}()},310:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.isMobile=function(){return void 0!==k.window.orientation},We.default=function(yt){if(!yt&&!(0,It.default)())return"Node";if((0,Pt.default)(yt))return"Electron";var dn="undefined"!=typeof navigator?navigator:{},En=yt||dn.userAgent||"";if(En.indexOf("Edge")>-1)return"Edge";var Fe=-1!==En.indexOf("MSIE "),je=-1!==En.indexOf("Trident/");return Fe||je?"IE":k.window.chrome?"Chrome":k.window.safari?"Safari":k.window.mozInnerScreenX?"Firefox":"Unknown"};var k=Ve(151),It=_t(Ve(602)),Pt=_t(Ve(344))},151:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.console=We.process=We.document=We.global=We.window=We.self=void 0;var k=_t(Ve(321)),It={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"===("undefined"==typeof process?"undefined":(0,k.default)(process))&&process};We.self=It.self||It.window||It.global,We.window=It.window||It.self||It.global,We.global=It.global||It.self||It.window,We.document=It.document||{},We.process=It.process||{};var En=console;We.console=En},761:(pt,We,Ve)=>{"use strict";var k=Ve(948),It=Ve(321);Object.defineProperty(We,"CO",{enumerable:!0,get:function(){return Pt.global}}),Object.defineProperty(We,"jU",{enumerable:!0,get:function(){return ft.default}}),Object.defineProperty(We,"qs",{enumerable:!0,get:function(){return qt.default}});var Pt=Ve(151),ft=En(Ve(602)),qt=En(Ve(310));k(Ve(344));function dn(Fe){if("function"!=typeof WeakMap)return null;var je=new WeakMap,$t=new WeakMap;return(dn=function(Ie){return Ie?$t:je})(Fe)}function En(Fe,je){if(!je&&Fe&&Fe.__esModule)return Fe;if(null===Fe||"object"!==It(Fe)&&"function"!=typeof Fe)return{default:Fe};var $t=dn(je);if($t&&$t.has(Fe))return $t.get(Fe);var Ne={},Ie=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var pi in Fe)if("default"!==pi&&Object.prototype.hasOwnProperty.call(Fe,pi)){var qe=Ie?Object.getOwnPropertyDescriptor(Fe,pi):null;qe&&(qe.get||qe.set)?Object.defineProperty(Ne,pi,qe):Ne[pi]=Fe[pi]}return Ne.default=Fe,$t&&$t.set(Fe,Ne),Ne}},602:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=Pt,We.isBrowserMainThread=function(){return Pt()&&"undefined"!=typeof document};var k=_t(Ve(321)),It=_t(Ve(344));function Pt(){return!("object"===("undefined"==typeof process?"undefined":(0,k.default)(process))&&"[object process]"===String(process)&&!process.browser)||(0,It.default)()}},344:(pt,We,Ve)=>{"use strict";var _t=Ve(948);Object.defineProperty(We,"__esModule",{value:!0}),We.default=function(Pt){if("undefined"!=typeof window&&"object"===(0,k.default)(window.process)&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"===(0,k.default)(process.versions)&&Boolean(process.versions.electron))return!0;var ft="object"===("undefined"==typeof navigator?"undefined":(0,k.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,qt=Pt||ft;return!!(qt&&qt.indexOf("Electron")>=0)};var k=_t(Ve(321))},473:(pt,We,Ve)=>{"use strict";var _t={};Ve.r(_t),Ve.d(_t,{decode:()=>$ve,encode:()=>Gve});var k={};Ve.r(k),Ve.d(k,{decode:()=>Kve,encode:()=>Zve});var It={};Ve.r(It),Ve.d(It,{decode:()=>Qve,encode:()=>Jve});var Pt={};function ft(n){return"function"==typeof n}Ve.r(Pt),Ve.d(Pt,{decode:()=>ebe,encode:()=>tbe});let qt=!1;const yt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(n){if(n){const e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else qt&&console.log("RxJS: Back to a better error behavior. Thank you. <3");qt=n},get useDeprecatedSynchronousErrorHandling(){return qt}};function dn(n){setTimeout(()=>{throw n},0)}const En={closed:!0,next(n){},error(n){if(yt.useDeprecatedSynchronousErrorHandling)throw n;dn(n)},complete(){}},Fe=Array.isArray||(n=>n&&"number"==typeof n.length);function je(n){return null!==n&&"object"==typeof n}const Ne=(()=>{function n(e){return Error.call(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((t,i)=>`${i+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e,this}return n.prototype=Object.create(Error.prototype),n})();class Ie{constructor(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:t,_ctorUnsubscribe:i,_unsubscribe:r,_subscriptions:s}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof Ie)t.remove(this);else if(null!==t)for(let o=0;oe.concat(t instanceof Ne?t.errors:t),[])}Ie.EMPTY=((n=new Ie).closed=!0,n);const qe="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class Rt extends Ie{constructor(e,t,i){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=En;break;case 1:if(!e){this.destination=En;break}if("object"==typeof e){e instanceof Rt?(this.syncErrorThrowable=e.syncErrorThrowable,this.destination=e,e.add(this)):(this.syncErrorThrowable=!0,this.destination=new nn(this,e));break}default:this.syncErrorThrowable=!0,this.destination=new nn(this,e,t,i)}}[qe](){return this}static create(e,t,i){const r=new Rt(e,t,i);return r.syncErrorThrowable=!1,r}next(e){this.isStopped||this._next(e)}error(e){this.isStopped||(this.isStopped=!0,this._error(e))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(e){this.destination.next(e)}_error(e){this.destination.error(e),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:e}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this}}class nn extends Rt{constructor(e,t,i,r){super(),this._parentSubscriber=e;let s,o=this;ft(t)?s=t:t&&(s=t.next,i=t.error,r=t.complete,t!==En&&(o=Object.create(t),ft(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=s,this._error=i,this._complete=r}next(e){if(!this.isStopped&&this._next){const{_parentSubscriber:t}=this;yt.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}}error(e){if(!this.isStopped){const{_parentSubscriber:t}=this,{useDeprecatedSynchronousErrorHandling:i}=yt;if(this._error)i&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)i?(t.syncErrorValue=e,t.syncErrorThrown=!0):dn(e),this.unsubscribe();else{if(this.unsubscribe(),i)throw e;dn(e)}}}complete(){if(!this.isStopped){const{_parentSubscriber:e}=this;if(this._complete){const t=()=>this._complete.call(this._context);yt.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(e,t){try{e.call(this._context,t)}catch(i){if(this.unsubscribe(),yt.useDeprecatedSynchronousErrorHandling)throw i;dn(i)}}__tryOrSetError(e,t,i){if(!yt.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,i)}catch(r){return yt.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(dn(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:e}=this;this._context=null,this._parentSubscriber=null,e.unsubscribe()}}const yi="function"==typeof Symbol&&Symbol.observable||"@@observable";function vi(n){return n}function Er(...n){return Ae(n)}function Ae(n){return 0===n.length?vi:1===n.length?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}let oe=(()=>{class n{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(t){const i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){const{operator:s}=this,o=function(n,e,t){if(n){if(n instanceof Rt)return n;if(n[qe])return n[qe]()}return n||e||t?new Rt(n,e,t):new Rt(En)}(t,i,r);if(o.add(s?s.call(o,this.source):this.source||yt.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),yt.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o}_trySubscribe(t){try{return this._subscribe(t)}catch(i){yt.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=i),function(n){for(;n;){const{closed:e,destination:t,isStopped:i}=n;if(e||i)return!1;n=t&&t instanceof Rt?t:null}return!0}(t)?t.error(i):console.warn(i)}}forEach(t,i){return new(i=kt(i))((r,s)=>{let o;o=this.subscribe(a=>{try{t(a)}catch(l){s(l),o&&o.unsubscribe()}},s,r)})}_subscribe(t){const{source:i}=this;return i&&i.subscribe(t)}[yi](){return this}pipe(...t){return 0===t.length?this:Ae(t)(this)}toPromise(t){return new(t=kt(t))((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function kt(n){if(n||(n=yt.Promise||Promise),!n)throw new Error("no Promise impl found");return n}const Gt=(()=>{function n(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return n.prototype=Object.create(Error.prototype),n})();class oi extends Ie{constructor(e,t){super(),this.subject=e,this.subscriber=t,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const e=this.subject,t=e.observers;if(this.subject=null,!t||0===t.length||e.isStopped||e.closed)return;const i=t.indexOf(this.subscriber);-1!==i&&t.splice(i,1)}}class Oi extends Rt{constructor(e){super(e),this.destination=e}}let we=(()=>{class n extends oe{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[qe](){return new Oi(this)}lift(t){const i=new rn(this,this);return i.operator=t,i}next(t){if(this.closed)throw new Gt;if(!this.isStopped){const{observers:i}=this,r=i.length,s=i.slice();for(let o=0;onew rn(e,t),n})();class rn extends we{constructor(e,t){super(),this.destination=e,this.source=t}next(e){const{destination:t}=this;t&&t.next&&t.next(e)}error(e){const{destination:t}=this;t&&t.error&&this.destination.error(e)}complete(){const{destination:e}=this;e&&e.complete&&this.destination.complete()}_subscribe(e){const{source:t}=this;return t?this.source.subscribe(e):Ie.EMPTY}}function Ln(n){return n&&"function"==typeof n.schedule}function be(n,e){return function(i){if("function"!=typeof n)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return i.lift(new Ii(n,e))}}class Ii{constructor(e,t){this.project=e,this.thisArg=t}call(e,t){return t.subscribe(new Ft(e,this.project,this.thisArg))}}class Ft extends Rt{constructor(e,t,i){super(e),this.project=t,this.count=0,this.thisArg=i||this}_next(e){let t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}const Sr=n=>e=>{for(let t=0,i=n.length;tn&&"number"==typeof n.length&&"function"!=typeof n;function He(n){return!!n&&"function"!=typeof n.subscribe&&"function"==typeof n.then}const Pi=n=>{if(n&&"function"==typeof n[yi])return(n=>e=>{const t=n[yi]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)})(n);if(ot(n))return Sr(n);if(He(n))return(n=>e=>(n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,dn),e))(n);if(n&&"function"==typeof n[as])return(n=>e=>{const t=n[as]();for(;;){let i;try{i=t.next()}catch(r){return e.error(r),e}if(i.done){e.complete();break}if(e.next(i.value),e.closed)break}return"function"==typeof t.return&&e.add(()=>{t.return&&t.return()}),e})(n);{const t=`You provided ${je(n)?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`;throw new TypeError(t)}};function Ri(n,e){return new oe(t=>{const i=new Ie;let r=0;return i.add(e.schedule(function(){r!==n.length?(t.next(n[r++]),t.closed||i.add(this.schedule())):t.complete()})),i})}function li(n,e){return e?function(n,e){if(null!=n){if(function(n){return n&&"function"==typeof n[yi]}(n))return function(n,e){return new oe(t=>{const i=new Ie;return i.add(e.schedule(()=>{const r=n[yi]();i.add(r.subscribe({next(s){i.add(e.schedule(()=>t.next(s)))},error(s){i.add(e.schedule(()=>t.error(s)))},complete(){i.add(e.schedule(()=>t.complete()))}}))})),i})}(n,e);if(He(n))return function(n,e){return new oe(t=>{const i=new Ie;return i.add(e.schedule(()=>n.then(r=>{i.add(e.schedule(()=>{t.next(r),i.add(e.schedule(()=>t.complete()))}))},r=>{i.add(e.schedule(()=>t.error(r)))}))),i})}(n,e);if(ot(n))return Ri(n,e);if(function(n){return n&&"function"==typeof n[as]}(n)||"string"==typeof n)return function(n,e){if(!n)throw new Error("Iterable cannot be null");return new oe(t=>{const i=new Ie;let r;return i.add(()=>{r&&"function"==typeof r.return&&r.return()}),i.add(e.schedule(()=>{r=n[as](),i.add(e.schedule(function(){if(t.closed)return;let s,o;try{const a=r.next();s=a.value,o=a.done}catch(a){return void t.error(a)}o?t.complete():(t.next(s),this.schedule())}))})),i})}(n,e)}throw new TypeError((null!==n&&typeof n||n)+" is not observable")}(n,e):n instanceof oe?n:new oe(Pi(n))}class $r extends Rt{constructor(e){super(),this.parent=e}_next(e){this.parent.notifyNext(e)}_error(e){this.parent.notifyError(e),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class ei extends Rt{notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.destination.complete()}}function oo(n,e){if(e.closed)return;if(n instanceof oe)return n.subscribe(e);let t;try{t=Pi(n)(e)}catch(i){e.error(i)}return t}function ci(n,e,t=Number.POSITIVE_INFINITY){return"function"==typeof e?i=>i.pipe(ci((r,s)=>li(n(r,s)).pipe(be((o,a)=>e(r,o,s,a))),t)):("number"==typeof e&&(t=e),i=>i.lift(new xh(n,t)))}class xh{constructor(e,t=Number.POSITIVE_INFINITY){this.project=e,this.concurrent=t}call(e,t){return t.subscribe(new bl(e,this.project,this.concurrent))}}class bl extends ei{constructor(e,t,i=Number.POSITIVE_INFINITY){super(e),this.project=t,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(e){this.active0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function ao(n=Number.POSITIVE_INFINITY){return ci(vi,n)}function Ba(n,e){return e?Ri(n,e):new oe(Sr(n))}function ki(...n){let e=Number.POSITIVE_INFINITY,t=null,i=n[n.length-1];return Ln(i)?(t=n.pop(),n.length>1&&"number"==typeof n[n.length-1]&&(e=n.pop())):"number"==typeof i&&(e=n.pop()),null===t&&1===n.length&&n[0]instanceof oe?n[0]:ao(e)(Ba(n,t))}function ls(){return function(e){return e.lift(new lo(e))}}class lo{constructor(e){this.connectable=e}call(e,t){const{connectable:i}=this;i._refCount++;const r=new fc(e,i),s=t.subscribe(r);return r.closed||(r.connection=i.connect()),s}}class fc extends Rt{constructor(e,t){super(e),this.connectable=t}_unsubscribe(){const{connectable:e}=this;if(!e)return void(this.connection=null);this.connectable=null;const t=e._refCount;if(t<=0)return void(this.connection=null);if(e._refCount=t-1,t>1)return void(this.connection=null);const{connection:i}=this,r=e._connection;this.connection=null,r&&(!i||r===i)&&r.unsubscribe()}}class Cl extends oe{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._refCount=0,this._isComplete=!1}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}connect(){let e=this._connection;return e||(this._isComplete=!1,e=this._connection=new Ie,e.add(this.source.subscribe(new cu(this.getSubject(),this))),e.closed&&(this._connection=null,e=Ie.EMPTY)),e}refCount(){return ls()(this)}}const lu=(()=>{const n=Cl.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:n._subscribe},_isComplete:{value:n._isComplete,writable:!0},getSubject:{value:n.getSubject},connect:{value:n.connect},refCount:{value:n.refCount}}})();class cu extends Oi{constructor(e,t){super(e),this.connectable=t}_error(e){this._unsubscribe(),super._error(e)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const e=this.connectable;if(e){this.connectable=null;const t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}}}function pc(n,e){return function(i){let r;if(r="function"==typeof n?n:function(){return n},"function"==typeof e)return i.lift(new ud(r,e));const s=Object.create(i,lu);return s.source=i,s.subjectFactory=r,s}}class ud{constructor(e,t){this.subjectFactory=e,this.selector=t}call(e,t){const{selector:i}=this,r=this.subjectFactory(),s=i(r).subscribe(e);return s.add(t.subscribe(r)),s}}function du(){return new we}function Vs(){return n=>ls()(pc(du)(n))}function Ye(n){for(let e in n)if(n[e]===Ye)return e;throw Error("Could not find renamed property on target object.")}function hu(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function G(n){if("string"==typeof n)return n;if(Array.isArray(n))return"["+n.map(G).join(", ")+"]";if(null==n)return""+n;if(n.overriddenName)return`${n.overriddenName}`;if(n.name)return`${n.name}`;const e=n.toString();if(null==e)return""+e;const t=e.indexOf("\n");return-1===t?e:e.substring(0,t)}function q(n,e){return null==n||""===n?null===e?"":e:null==e||""===e?n:n+" "+e}const Z=Ye({__forward_ref__:Ye});function T(n){return n.__forward_ref__=T,n.toString=function(){return G(this())},n}function D(n){return B(n)?n():n}function B(n){return"function"==typeof n&&n.hasOwnProperty(Z)&&n.__forward_ref__===T}class H extends Error{constructor(e,t){super(function(n,e){return`${n?`NG0${n}: `:""}${e}`}(e,t)),this.code=e}}function de(n){return"string"==typeof n?n:null==n?"":String(n)}function Be(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():de(n)}function gt(n,e){const t=e?` in ${e}`:"";throw new H("201",`No provider for ${Be(n)} found${t}`)}function Gi(n,e){null==n&&function(n,e,t,i){throw new Error(`ASSERTION ERROR: ${n}`+(null==i?"":` [Expected=> ${t} ${i} ${e} <=Actual]`))}(e,n,null,"!=")}function ae(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function Ee(n){return{providers:n.providers||[],imports:n.imports||[]}}function ir(n){return _c(n,la)||_c(n,ja)}function _c(n,e){return n.hasOwnProperty(e)?n[e]:null}function mu(n){return n&&(n.hasOwnProperty(Sl)||n.hasOwnProperty(mp))?n[Sl]:null}const la=Ye({\u0275prov:Ye}),Sl=Ye({\u0275inj:Ye}),ja=Ye({ngInjectableDef:Ye}),mp=Ye({ngInjectorDef:Ye});var vt=(()=>((vt=vt||{})[vt.Default=0]="Default",vt[vt.Host=1]="Host",vt[vt.Self=2]="Self",vt[vt.SkipSelf=4]="SkipSelf",vt[vt.Optional=8]="Optional",vt))();let Ml;function ca(n){const e=Ml;return Ml=n,e}function hd(n,e,t){const i=ir(n);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:t&vt.Optional?null:void 0!==e?e:void gt(G(n),"Injector")}function R(n){return{toString:n}.toString()}var j=(()=>((j=j||{})[j.OnPush=0]="OnPush",j[j.Default=1]="Default",j))(),Re=(()=>((Re=Re||{})[Re.Emulated=0]="Emulated",Re[Re.None=2]="None",Re[Re.ShadowDom=3]="ShadowDom",Re))();const hn="undefined"!=typeof globalThis&&globalThis,cr="undefined"!=typeof window&&window,mr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Gr="undefined"!=typeof global&&global,cn=hn||Gr||cr||mr,fd={},gi=[],yp=Ye({\u0275cmp:Ye}),s_=Ye({\u0275dir:Ye}),Ah=Ye({\u0275pipe:Ye}),h0=Ye({\u0275mod:Ye}),p1=Ye({\u0275loc:Ye}),xl=Ye({\u0275fac:Ye}),Dh=Ye({__NG_ELEMENT_ID__:Ye});let g1=0;function Le(n){return R(()=>{const t={},i={type:n.type,providersResolver:null,decls:n.decls,vars:n.vars,factory:null,template:n.template||null,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:t,inputs:null,outputs:null,exportAs:n.exportAs||null,onPush:n.changeDetection===j.OnPush,directiveDefs:null,pipeDefs:null,selectors:n.selectors||gi,viewQuery:n.viewQuery||null,features:n.features||null,data:n.data||{},encapsulation:n.encapsulation||Re.Emulated,id:"c",styles:n.styles||gi,_:null,setInput:null,schemas:n.schemas||null,tView:null},r=n.directives,s=n.features,o=n.pipes;return i.id+=g1++,i.inputs=m0(n.inputs,t),i.outputs=m0(n.outputs),s&&s.forEach(a=>a(i)),i.directiveDefs=r?()=>("function"==typeof r?r():r).map(f0):null,i.pipeDefs=o?()=>("function"==typeof o?o():o).map(p0):null,i})}function f0(n){return Wn(n)||function(n){return n[s_]||null}(n)}function p0(n){return function(n){return n[Ah]||null}(n)}const g0={};function xe(n){return R(()=>{const e={type:n.type,bootstrap:n.bootstrap||gi,declarations:n.declarations||gi,imports:n.imports||gi,exports:n.exports||gi,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null};return null!=n.id&&(g0[n.id]=n.type),e})}function m0(n,e){if(null==n)return fd;const t={};for(const i in n)if(n.hasOwnProperty(i)){let r=n[i],s=r;Array.isArray(r)&&(s=r[1],r=r[0]),t[r]=i,e&&(e[r]=s)}return t}const he=Le;function cs(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,onDestroy:n.type.prototype.ngOnDestroy||null}}function Wn(n){return n[yp]||null}function uo(n,e){const t=n[h0]||null;if(!t&&!0===e)throw new Error(`Type ${G(n)} does not have '\u0275mod' property.`);return t}function Po(n){return Array.isArray(n)&&"object"==typeof n[1]}function Ro(n){return Array.isArray(n)&&!0===n[1]}function l_(n){return 0!=(8&n.flags)}function _d(n){return 2==(2&n.flags)}function yd(n){return 1==(1&n.flags)}function ha(n){return null!==n.template}function _0(n){return 0!=(512&n[2])}function bc(n,e){return n.hasOwnProperty(xl)?n[xl]:null}class h_{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}}function qn(){return b0}function b0(n){return n.type.prototype.ngOnChanges&&(n.setInput=E1),w1}function w1(){const n=W(this),e=null==n?void 0:n.current;if(e){const t=n.previous;if(t===fd)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function E1(n,e,t,i){const r=W(n)||function(n,e){return n[Fh]=e}(n,{previous:fd,current:null}),s=r.current||(r.current={}),o=r.previous,a=this.declaredInputs[t],l=o[a];s[a]=new h_(l&&l.currentValue,e,o===fd),n[i]=e}qn.ngInherit=!0;const Fh="__ngSimpleChanges__";function W(n){return n[Fh]||null}const Bn="http://www.w3.org/2000/svg";let di;function Ti(n){return!!n.listen}const vu={createRenderer:(n,e)=>void 0!==di?di:"undefined"!=typeof document?document:void 0};function qi(n){for(;Array.isArray(n);)n=n[0];return n}function Nh(n,e){return qi(e[n])}function Ss(n,e){return qi(e[n.index])}function g_(n,e){return n.data[e]}function vd(n,e){return n[e]}function ds(n,e){const t=e[n];return Po(t)?t:t[0]}function Dl(n){return 4==(4&n[2])}function bd(n){return 128==(128&n[2])}function pa(n,e){return null==e?null:n[e]}function m_(n){n[18]=0}function Cp(n,e){n[5]+=e;let t=n,i=n[3];for(;null!==i&&(1===e&&1===t[5]||-1===e&&0===t[5]);)i[5]+=e,t=i,i=i[3]}const Ut={lFrame:Cu(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function w0(){return Ut.bindingsEnabled}function Ce(){return Ut.lFrame.lView}function Sn(){return Ut.lFrame.tView}function Vn(n){return Ut.lFrame.contextLView=n,n[8]}function Tr(){let n=__();for(;null!==n&&64===n.type;)n=n.parent;return n}function __(){return Ut.lFrame.currentTNode}function Ha(n,e){const t=Ut.lFrame;t.currentTNode=n,t.isParent=e}function hr(){return Ut.lFrame.isParent}function Nr(){Ut.lFrame.isParent=!1}function Vh(){return Ut.isInCheckNoChangesMode}function Ep(n){Ut.isInCheckNoChangesMode=n}function qr(){const n=Ut.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function zs(){return Ut.lFrame.bindingIndex}function ga(){return Ut.lFrame.bindingIndex++}function fo(n){const e=Ut.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Cd(n,e){const t=Ut.lFrame;t.bindingIndex=t.bindingRootIndex=n,y_(e)}function y_(n){Ut.lFrame.currentDirectiveIndex=n}function v_(n){const e=Ut.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function E0(){return Ut.lFrame.currentQueryIndex}function b_(n){Ut.lFrame.currentQueryIndex=n}function Mp(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[6]:null}function wd(n,e,t){if(t&vt.SkipSelf){let r=e,s=n;for(;!(r=r.parent,null!==r||t&vt.Host||(r=Mp(s),null===r||(s=s[15],10&r.type))););if(null===r)return!1;e=r,n=s}const i=Ut.lFrame=O();return i.currentTNode=e,i.lView=n,!0}function zh(n){const e=O(),t=n[1];Ut.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function O(){const n=Ut.lFrame,e=null===n?null:n.child;return null===e?Cu(n):e}function Cu(n){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function Hh(){const n=Ut.lFrame;return Ut.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const po=Hh;function pn(){const n=Hh();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Ms(){return Ut.lFrame.selectedIndex}function Hs(n){Ut.lFrame.selectedIndex=n}function rr(){const n=Ut.lFrame;return g_(n.tView,n.selectedIndex)}function xp(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[18]+=65536),(a>11>16&&(3&n[2])===e){n[2]+=2048;try{s.call(a)}finally{}}}else try{s.call(a)}finally{}}class $h{constructor(e,t,i){this.factory=e,this.resolving=!1,this.canSeeViewProviders=t,this.injectImpl=i}}function Dp(n,e,t){const i=Ti(n);let r=0;for(;re){o=s-1;break}}}for(;s>16}(n),i=e;for(;t>0;)i=i[15],t--;return i}let Sd=!0;function Op(n){const e=Sd;return Sd=n,e}let x_=0;function hs(n,e){const t=Ip(n,e);if(-1!==t)return t;const i=e[1];i.firstCreatePass&&(n.injectorIndex=e.length,T_(i.data,n),T_(e,null),T_(i.blueprint,null));const r=Wh(n,e),s=n.injectorIndex;if(T0(r)){const o=Ed(r),a=Ga(r,e),l=a[1].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function T_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Ip(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function Wh(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;null!==r;){const s=r[1],o=s.type;if(i=2===o?s.declTNode:1===o?r[6]:null,null===i)return-1;if(t++,r=r[15],-1!==i.injectorIndex)return i.injectorIndex|t<<16}return-1}function wc(n,e,t){!function(n,e,t){let i;"string"==typeof t?i=t.charCodeAt(0)||0:t.hasOwnProperty(Dh)&&(i=t[Dh]),null==i&&(i=t[Dh]=x_++);const r=255&i;e.data[n+(r>>5)]|=1<=0?255&e:I0:e}(t);if("function"==typeof s){if(!wd(e,n,i))return i&vt.Host?A_(r,t,i):D0(e,t,i,r);try{const o=s(i);if(null!=o||i&vt.Optional)return o;gt(t)}finally{po()}}else if("number"==typeof s){let o=null,a=Ip(n,e),l=-1,c=i&vt.Host?e[16][6]:null;for((-1===a||i&vt.SkipSelf)&&(l=-1===a?Wh(n,e):e[a+8],-1!==l&&Yh(i,!1)?(o=e[1],a=Ed(l),e=Ga(l,e)):a=-1);-1!==a;){const d=e[1];if(Pp(s,a,d.data)){const f=Yr(a,e,t,o,i,c);if(f!==O0)return f}l=e[a+8],-1!==l&&Yh(i,e[1].data[a+8]===c)&&Pp(s,a,e)?(o=d,a=Ed(l),e=Ga(l,e)):a=-1}}}return D0(e,t,i,r)}const O0={};function I0(){return new Fo(Tr(),Ce())}function Yr(n,e,t,i,r,s){const o=e[1],a=o.data[n+8],d=Md(a,o,t,null==i?_d(a)&&Sd:i!=o&&0!=(3&a.type),r&vt.Host&&s===a);return null!==d?xd(e,o,d,a):O0}function Md(n,e,t,i,r){const s=n.providerIndexes,o=e.data,a=1048575&s,l=n.directiveStart,d=s>>20,p=r?a+d:n.directiveEnd;for(let g=i?a:a+d;g=l&&_.type===t)return g}if(r){const g=o[l];if(g&&ha(g)&&g.type===t)return l}return null}function xd(n,e,t,i){let r=n[t];const s=e.data;if(function(n){return n instanceof $h}(r)){const o=r;o.resolving&&function(n,e){throw new H("200",`Circular dependency in DI detected for ${n}`)}(Be(s[t]));const a=Op(o.canSeeViewProviders);o.resolving=!0;const l=o.injectImpl?ca(o.injectImpl):null;wd(n,i,vt.Default);try{r=n[t]=o.factory(void 0,s,n,i),e.firstCreatePass&&t>=i.directiveStart&&function(n,e,t){const{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){const o=b0(e);(t.preOrderHooks||(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,o)}r&&(t.preOrderHooks||(t.preOrderHooks=[])).push(0-n,r),s&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n,s),(t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n,s))}(t,s[t],e)}finally{null!==l&&ca(l),Op(a),o.resolving=!1,po()}}return r}function Pp(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[xl]||Xr(e),i=Object.prototype;let r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){const s=r[xl]||Xr(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Xr(n){return B(n)?()=>{const e=Xr(D(n));return e&&e()}:bc(n)}function fs(n){return function(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const i=t.length;let r=0;for(;r{const i=function(n){return function(...t){if(n){const i=n(...t);for(const r in i)this[r]=i[r]}}}(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;const o=new r(...s);return a.annotation=o,a;function a(l,c,d){const f=l.hasOwnProperty(Ad)?l[Ad]:Object.defineProperty(l,Ad,{value:[]})[Ad];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(o),l}}return t&&(r.prototype=Object.create(t.prototype)),r.prototype.ngMetadataName=n,r.annotationCls=r,r})}class _e{constructor(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=ae({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}toString(){return`InjectionToken ${this._desc}`}}const Su=Function;function No(n,e){void 0===e&&(e=n);for(let t=0;tArray.isArray(t)?Lo(t,e):e(t))}function Kh(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Il(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Sc(n,e){const t=[];for(let i=0;i=0?n[1|i]=t:(i=~i,function(n,e,t,i){let r=n.length;if(r==e)n.push(t,i);else if(1===r)n.push(i,n[0]),n[0]=t;else{for(r--,n.push(n[r-1],n[r]);r>e;)n[r]=n[r-2],r--;n[e]=t,n[e+1]=i}}(n,i,e,t)),i}function k_(n,e){const t=Kr(n,e);if(t>=0)return n[1|t]}function Kr(n,e){return function(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){const s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r< ");else if("object"==typeof e){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+("string"==typeof a?JSON.stringify(a):G(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Tc,"\n ")}`}("\n"+n.message,r,t,i),n.ngTokenPath=r,n[xc]=null,n}const Rd=Pd(ya("Inject",n=>({token:n})),-1),yr=Pd(ya("Optional"),8),Xa=Pd(ya("SkipSelf"),4);let Fd;function Iu(n){var e;return(null===(e=function(){if(void 0===Fd&&(Fd=null,cn.trustedTypes))try{Fd=cn.trustedTypes.createPolicy("angular",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch(n){}return Fd}())||void 0===e?void 0:e.createHTML(n))||n}class Fl{constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}class j_ extends Fl{getTypeName(){return"HTML"}}class U_ extends Fl{getTypeName(){return"Style"}}class Gp extends Fl{getTypeName(){return"Script"}}class Nd extends Fl{getTypeName(){return"URL"}}class Nt extends Fl{getTypeName(){return"ResourceURL"}}function ps(n){return n instanceof Fl?n.changingThisBreaksApplicationSecurity:n}function Bo(n,e){const t=Oc(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see https://g.co/ng/security#xss)`)}return t===e}function Oc(n){return n instanceof Fl&&n.getTypeName()||null}class X0{constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(Iu(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.removeChild(t.firstChild),t)}catch(t){return null}}}class tx{constructor(e){if(this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const i=this.inertDocument.createElement("body");t.appendChild(i)}}getInertBodyElement(e){const t=this.inertDocument.createElement("template");if("content"in t)return t.innerHTML=Iu(e),t;const i=this.inertDocument.createElement("body");return i.innerHTML=Iu(e),this.defaultDoc.documentMode&&this.stripCustomNsAttrs(i),i}stripCustomNsAttrs(e){const t=e.attributes;for(let r=t.length-1;0_o(e.trim())).join(", ")}function Vo(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Qh(...n){const e={};for(const t of n)for(const i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}const Wp=Vo("area,br,col,hr,img,wbr"),Z0=Vo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Q0=Vo("rp,rt"),H_=Qh(Wp,Qh(Z0,Vo("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Qh(Q0,Vo("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Qh(Q0,Z0)),$_=Vo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),G_=Vo("srcset"),W_=Qh($_,G_,Vo("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Vo("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),ax=Vo("script,style,template");class q_{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(e){let t=e.firstChild,i=!0;for(;t;)if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild)t=t.firstChild;else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let r=this.checkClobberedElement(t,t.nextSibling);if(r){t=r;break}t=this.checkClobberedElement(t,t.parentNode)}return this.buf.join("")}startElement(e){const t=e.nodeName.toLowerCase();if(!H_.hasOwnProperty(t))return this.sanitizedSomething=!0,!ax.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const i=e.attributes;for(let r=0;r"),!0}endElement(e){const t=e.nodeName.toLowerCase();H_.hasOwnProperty(t)&&!Wp.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Yp(e))}checkClobberedElement(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`);return t}}const J0=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Jh=/([^\#-~ |!])/g;function Yp(n){return n.replace(/&/g,"&").replace(J0,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Jh,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let ef;function Y_(n,e){let t=null;try{ef=ef||function(n){const e=new tx(n);return function(){try{return!!(new window.DOMParser).parseFromString(Iu(""),"text/html")}catch(n){return!1}}()?new X0(e):e}(n);let i=e?String(e):"";t=ef.getInertBodyElement(i);let r=5,s=i;do{if(0===r)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=t.innerHTML,t=ef.getInertBodyElement(i)}while(i!==s);return Iu((new q_).sanitizeChildren(Ld(t)||t))}finally{if(t){const i=Ld(t)||t;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Ld(n){return"content"in n&&function(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var on=(()=>((on=on||{})[on.NONE=0]="NONE",on[on.HTML=1]="HTML",on[on.STYLE=2]="STYLE",on[on.SCRIPT=3]="SCRIPT",on[on.URL=4]="URL",on[on.RESOURCE_URL=5]="RESOURCE_URL",on))();const Z_="__ngContext__";function Zr(n,e){n[Z_]=e}function Q_(n){const e=function(n){return n[Z_]||null}(n);return e?Array.isArray(e)?e:e.lView:null}function Kp(n){return n.ngOriginalError}function bx(n,...e){n.error(...e)}class Uo{constructor(){this._console=console}handleError(e){const t=this._findOriginalError(e),i=this._findContext(e),r=function(n){return n&&n.ngErrorLogger||bx}(e);r(this._console,"ERROR",e),t&&r(this._console,"ORIGINAL ERROR",t),i&&r(this._console,"ERROR CONTEXT",i)}_findContext(e){return e?function(n){return n.ngDebugContext}(e)||this._findContext(Kp(e)):null}_findOriginalError(e){let t=e&&Kp(e);for(;t&&Kp(t);)t=Kp(t);return t||null}}const uC=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(cn))();function ny(n){return n.ownerDocument.defaultView}function Qp(n){return n.ownerDocument}function Za(n){return n instanceof Function?n():n}var yo=(()=>((yo=yo||{})[yo.Important=1]="Important",yo[yo.DashCase=2]="DashCase",yo))();function ry(n,e){return undefined(n,e)}function rf(n){const e=n[3];return Ro(e)?e[3]:e}function Vd(n){return gC(n[13])}function oy(n){return gC(n[4])}function gC(n){for(;null!==n&&!Ro(n);)n=n[4];return n}function jd(n,e,t,i,r){if(null!=i){let s,o=!1;Ro(i)?s=i:Po(i)&&(o=!0,i=i[0]);const a=qi(i);0===n&&null!==t?null==r?bC(e,t,a):Qa(e,t,a,r||null,!0):1===n&&null!==t?Qa(e,t,a,r||null,!0):2===n?function(n,e,t){const i=eg(n,e);i&&function(n,e,t,i){Ti(n)?n.removeChild(e,t,i):e.removeChild(t)}(n,i,e,t)}(e,a,o):3===n&&e.destroyNode(a),null!=s&&function(n,e,t,i,r){const s=t[7];s!==qi(t)&&jd(e,n,i,s,r);for(let a=10;a0&&(n[t-1][4]=i[4]);const s=Il(n,10+e);!function(n,e){Ud(n,e,e[11],2,null,null),e[0]=null,e[6]=null}(i[1],i);const o=s[19];null!==o&&o.detachView(s[1]),i[3]=null,i[4]=null,i[2]&=-129}return i}function uy(n,e){if(!(256&e[2])){const t=e[11];Ti(t)&&t.destroyNode&&Ud(n,e,t,3,null,null),function(n){let e=n[13];if(!e)return Jp(n[1],n);for(;e;){let t=null;if(Po(e))t=e[13];else{const i=e[10];i&&(t=i)}if(!t){for(;e&&!e[4]&&e!==n;)Po(e)&&Jp(e[1],e),e=e[3];null===e&&(e=n),Po(e)&&Jp(e[1],e),t=e&&e[4]}e=t}}(e)}}function Jp(n,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(n,e){let t;if(null!=n&&null!=(t=n.destroyHooks))for(let i=0;i=0?i[r=c]():i[r=-c].unsubscribe(),s+=2}else{const o=i[r=t[s+1]];t[s].call(o)}if(null!==i){for(let s=r+1;ss?"":r[f+1].toLowerCase();const g=8&i?p:null;if(g&&-1!==of(g,c,0)||2&i&&c!==p){if(ba(i))return!1;o=!0}}}}else{if(!o&&!ba(i)&&!ba(l))return!1;if(o&&ba(l))continue;o=!1,i=l|1&i}}return ba(i)||o}function ba(n){return 0==(1&n)}function Gx(n,e,t,i){if(null===e)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&i?r+="."+o:4&i&&(r+=" "+o);else""!==r&&!ba(o)&&(e+=RC(s,r),r=""),i=o,s=s||!ba(i);t++}return""!==r&&(e+=RC(s,r)),e}const St={};function Y(n){kC(Sn(),Ce(),Ms()+n,Vh())}function kC(n,e,t,i){if(!i)if(3==(3&e[2])){const s=n.preOrderCheckHooks;null!==s&&Tp(e,s,t)}else{const s=n.preOrderHooks;null!==s&&Ap(e,s,0,t)}Hs(t)}function Ja(n,e){return n<<17|e<<2}function Ot(n){return n>>17&32767}function Yi(n){return 2|n}function Nl(n){return(131068&n)>>2}function el(n,e){return-131069&n|e<<2}function my(n){return 1|n}function HC(n,e){const t=n.contentQueries;if(null!==t)for(let i=0;i20&&kC(n,e,20,Vh()),t(i,r)}finally{Hs(s)}}function GC(n,e,t){if(l_(e)){const r=e.directiveEnd;for(let s=e.directiveStart;s0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(a)!=l&&a.push(l),a.push(i,r,o)}}function ew(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function tw(n,e){e.flags|=2,(n.components||(n.components=[])).push(e.index)}function vT(n,e,t){if(t){if(e.exportAs)for(let i=0;i0&&Ay(t)}}function Ay(n){for(let i=Vd(n);null!==i;i=oy(i))for(let r=10;r0&&Ay(s)}const t=n[1].components;if(null!==t)for(let i=0;i0&&Ay(r)}}function xT(n,e){const t=ds(e,n),i=t[1];(function(n,e){for(let t=e.length;tPromise.resolve(null))();function rw(n){return n[7]||(n[7]=[])}function ug(n){return n.cleanup||(n.cleanup=[])}function Ry(n,e,t){return(null===n||ha(n))&&(t=function(n){for(;Array.isArray(n);){if("object"==typeof n[1])return n;n=n[0]}return null}(t[e.index])),t[11]}function ky(n,e){const t=n[9],i=t?t.get(Uo,null):null;i&&i.handleError(e)}function sw(n,e,t,i,r){for(let s=0;sthis.processProvider(a,e,t)),Lo([e],a=>this.processInjectorType(a,[],s)),this.records.set(ku,Nu(void 0,this));const o=this.records.get(Fu);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof e?null:G(e))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(e=>e.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(e,t=Tu,i=vt.Default){this.assertNotDestroyed();const r=Id(this),s=ca(void 0);try{if(!(i&vt.SkipSelf)){let a=this.records.get(e);if(void 0===a){const l=function(n){return"function"==typeof n||"object"==typeof n&&n instanceof _e}(e)&&ir(e);a=l&&this.injectableDefInScope(l)?Nu(Vy(e),df):null,this.records.set(e,a)}if(null!=a)return this.hydrate(e,a)}return(i&vt.Self?ow():this.parent).get(e,t=i&vt.Optional&&t===Tu?null:t)}catch(o){if("NullInjectorError"===o.name){if((o[xc]=o[xc]||[]).unshift(G(e)),r)throw o;return xs(o,e,"R3InjectorError",this.source)}throw o}finally{ca(s),Id(r)}}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(e=>this.get(e))}toString(){const e=[];return this.records.forEach((i,r)=>e.push(G(r))),`R3Injector[${e.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(e,t,i){if(!(e=D(e)))return!1;let r=mu(e);const s=null==r&&e.ngModule||void 0,o=void 0===s?e:s,a=-1!==i.indexOf(o);if(void 0!==s&&(r=mu(s)),null==r)return!1;if(null!=r.imports&&!a){let d;i.push(o);try{Lo(r.imports,f=>{this.processInjectorType(f,t,i)&&(void 0===d&&(d=[]),d.push(f))})}finally{}if(void 0!==d)for(let f=0;fthis.processProvider(_,p,g||gi))}}this.injectorDefTypes.add(o);const l=bc(o)||(()=>new o);this.records.set(o,Nu(l,df));const c=r.providers;if(null!=c&&!a){const d=e;Lo(c,f=>this.processProvider(f,d,c))}return void 0!==s&&void 0!==e.providers}processProvider(e,t,i){let r=Rc(e=D(e))?e:D(e&&e.provide);const s=function(n,e,t){return cw(n)?Nu(void 0,n.useValue):Nu(lw(n),df)}(e);if(Rc(e)||!0!==e.multi)this.records.get(r);else{let o=this.records.get(r);o||(o=Nu(void 0,df,!0),o.factory=()=>Du(o.multi),this.records.set(r,o)),r=e,o.multi.push(e)}this.records.set(r,s)}hydrate(e,t){return t.value===df&&(t.value=RT,t.value=t.factory()),"object"==typeof t.value&&t.value&&function(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this.onDestroy.add(t.value),t.value}injectableDefInScope(e){if(!e.providedIn)return!1;const t=D(e.providedIn);return"string"==typeof t?"any"===t||t===this.scope:this.injectorDefTypes.has(t)}}function Vy(n){const e=ir(n),t=null!==e?e.factory:bc(n);if(null!==t)return t;if(n instanceof _e)throw new Error(`Token ${G(n)} is missing a \u0275prov definition.`);if(n instanceof Function)return function(n){const e=n.length;if(e>0){const i=Sc(e,"?");throw new Error(`Can't resolve all parameters for ${G(n)}: (${i.join(", ")}).`)}const t=function(n){const e=n&&(n[la]||n[ja]);if(e){const t=function(n){if(n.hasOwnProperty("name"))return n.name;const e=(""+n).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(n);return console.warn(`DEPRECATED: DI is instantiating a token "${t}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${t}" class.`),e}return null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new Error("unreachable")}function lw(n,e,t){let i;if(Rc(n)){const r=D(n);return bc(r)||Vy(r)}if(cw(n))i=()=>D(n.useValue);else if(function(n){return!(!n||!n.useFactory)}(n))i=()=>n.useFactory(...Du(n.deps||[]));else if(function(n){return!(!n||!n.useExisting)}(n))i=()=>I(D(n.useExisting));else{const r=D(n&&(n.useClass||n.provide));if(!function(n){return!!n.deps}(n))return bc(r)||Vy(r);i=()=>new r(...Du(n.deps))}return i}function Nu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function cw(n){return null!==n&&"object"==typeof n&&Bp in n}function Rc(n){return"function"==typeof n}const uw=function(n,e,t){return function(n,e=null,t=null,i){const r=aw(n,e,t,i);return r._resolveInjectorDefTypes(),r}({name:t},e,n,t)};class Tt{static create(e,t){return Array.isArray(e)?uw(e,t,""):uw(e.providers,e.parent,e.name||"")}}function u9(n,e){xp(Q_(n)[1],Tr())}function ht(n){let e=function(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const i=[n];for(;e;){let r;if(ha(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(t){i.push(r);const o=n;o.inputs=qT(n.inputs),o.declaredInputs=qT(n.declaredInputs),o.outputs=qT(n.outputs);const a=r.hostBindings;a&&p9(n,a);const l=r.viewQuery,c=r.contentQueries;if(l&&h9(n,l),c&&f9(n,c),hu(n.inputs,r.inputs),hu(n.declaredInputs,r.declaredInputs),hu(n.outputs,r.outputs),ha(r)&&r.data.animation){const d=n.data;d.animation=(d.animation||[]).concat(r.data.animation)}}const s=r.features;if(s)for(let o=0;o=0;i--){const r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Gh(r.hostAttrs,t=Gh(t,r.hostAttrs))}}(i)}function qT(n){return n===fd?{}:n===gi?[]:n}function h9(n,e){const t=n.viewQuery;n.viewQuery=t?(i,r)=>{e(i,r),t(i,r)}:e}function f9(n,e){const t=n.contentQueries;n.contentQueries=t?(i,r,s)=>{e(i,r,s),t(i,r,s)}:e}function p9(n,e){const t=n.hostBindings;n.hostBindings=t?(i,r)=>{e(i,r),t(i,r)}:e}Tt.THROW_IF_NOT_FOUND=Tu,Tt.NULL=new Ds,Tt.\u0275prov=ae({token:Tt,providedIn:"any",factory:()=>I(ku)}),Tt.__NG_ELEMENT_ID__=-1;let gw=null;function hg(){if(!gw){const n=cn.Symbol;if(n&&n.iterator)gw=n.iterator;else{const e=Object.getOwnPropertyNames(Map.prototype);for(let t=0;ta(qi(L[i.index])):i.index;if(Ti(t)){let L=null;if(!a&&l&&(L=function(n,e,t,i){const r=n.cleanup;if(null!=r)for(let s=0;sl?a[l]:null}"string"==typeof o&&(s+=2)}return null}(n,e,r,i.index)),null!==L)(L.__ngLastListenerFn__||L).__ngNextListenerFn__=s,L.__ngLastListenerFn__=s,g=!1;else{s=tA(i,e,f,s,!1);const U=t.listen(w,r,s);p.push(s,U),d&&d.push(r,x,C,C+1)}}else s=tA(i,e,f,s,!0),w.addEventListener(r,s,o),p.push(s),d&&d.push(r,x,C,o)}else s=tA(i,e,f,s,!1);const _=i.outputs;let y;if(g&&null!==_&&(y=_[r])){const v=y.length;if(v)for(let w=0;w0;)e=e[15],n--;return e}(n,Ut.lFrame.contextLView))[8]}(n)}function q9(n,e){let t=null;const i=function(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(n);for(let r=0;r=0}const Jr={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function o2(n){return n.substring(Jr.key,Jr.keyEnd)}function a2(n,e){const t=Jr.textEnd;return t===e?-1:(e=Jr.keyEnd=function(n,e,t){for(;e32;)e++;return e}(n,Jr.key=e,t),Eg(n,e,t))}function Eg(n,e,t){for(;e=0;t=a2(e,t))go(n,o2(e),!0)}function Ul(n,e,t,i){const r=Ce(),s=Sn(),o=fo(2);s.firstUpdatePass&&f2(s,n,o,i),e!==St&&qs(r,o,e)&&g2(s,s.data[Ms()],r,r[11],n,r[o+1]=function(n,e){return null==n||("string"==typeof e?n+=e:"object"==typeof n&&(n=G(ps(n)))),n}(e,t),i,o)}function zl(n,e,t,i){const r=Sn(),s=fo(2);r.firstUpdatePass&&f2(r,null,s,i);const o=Ce();if(t!==St&&qs(o,s,t)){const a=r.data[Ms()];if(_2(a,i)&&!h2(r,s)){let l=i?a.classesWithoutHost:a.stylesWithoutHost;null!==l&&(t=q(l,t||"")),eA(r,a,o,t,i)}else!function(n,e,t,i,r,s,o,a){r===St&&(r=gi);let l=0,c=0,d=0=n.expandoStartIndex}function f2(n,e,t,i){const r=n.data;if(null===r[t+1]){const s=r[Ms()],o=h2(n,t);_2(s,i)&&null===e&&!o&&(e=!1),e=function(n,e,t,i){const r=v_(n);let s=i?e.residualClasses:e.residualStyles;if(null===r)0===(i?e.classBindings:e.styleBindings)&&(t=Xy(t=iA(null,n,e,t,i),e.attrs,i),s=null);else{const o=e.directiveStylingLast;if(-1===o||n[o]!==r)if(t=iA(r,n,e,t,i),null===s){let l=function(n,e,t){const i=t?e.classBindings:e.styleBindings;if(0!==Nl(i))return n[Ot(i)]}(n,e,i);void 0!==l&&Array.isArray(l)&&(l=iA(null,n,e,l[1],i),l=Xy(l,e.attrs,i),function(n,e,t,i){n[Ot(t?e.classBindings:e.styleBindings)]=i}(n,e,i,l))}else s=function(n,e,t){let i;const r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0)&&(c=!0)}else d=t;if(r)if(0!==l){const p=Ot(n[a+1]);n[i+1]=Ja(p,a),0!==p&&(n[p+1]=el(n[p+1],i)),n[a+1]=function(n,e){return 131071&n|e<<17}(n[a+1],i)}else n[i+1]=Ja(a,0),0!==a&&(n[a+1]=el(n[a+1],i)),a=i;else n[i+1]=Ja(l,0),0===a?a=i:n[l+1]=el(n[l+1],i),l=i;c&&(n[i+1]=Yi(n[i+1])),s2(n,d,i,!0),s2(n,d,i,!1),function(n,e,t,i,r){const s=r?n.residualClasses:n.residualStyles;null!=s&&"string"==typeof e&&Kr(s,e)>=0&&(t[i+1]=my(t[i+1]))}(e,d,n,i,s),o=Ja(a,l),s?e.classBindings=o:e.styleBindings=o}(r,s,e,t,o,i)}}function iA(n,e,t,i,r){let s=null;const o=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[r],c=Array.isArray(l),d=c?l[1]:l,f=null===d;let p=t[r+1];p===St&&(p=f?gi:void 0);let g=f?k_(p,i):d===i?p:void 0;if(c&&!vw(g)&&(g=k_(l,i)),vw(g)&&(a=g,o))return a;const _=n[r+1];r=o?Ot(_):Nl(_)}if(null!==e){let l=s?e.residualClasses:e.residualStyles;null!=l&&(a=k_(l,i))}return a}function vw(n){return void 0!==n}function _2(n,e){return 0!=(n.flags&(e?16:32))}function Te(n,e=""){const t=Ce(),i=Sn(),r=n+20,s=i.firstCreatePass?Hd(i,r,1,e,null):i.data[r],o=t[r]=function(n,e){return Ti(n)?n.createText(e):n.createTextNode(e)}(t[11],e);tg(i,t,o,s),Ha(s,!1)}function Ai(n){return Os("",n,""),Ai}function Os(n,e,t){const i=Ce(),r=pg(i,n,e,t);return r!==St&&Ll(i,Ms(),r),Os}function bw(n,e,t,i,r){const s=Ce(),o=function(n,e,t,i,r,s){const a=hf(n,zs(),t,r);return fo(2),a?e+de(t)+i+de(r)+s:St}(s,n,e,t,i,r);return o!==St&&Ll(s,Ms(),o),bw}function sl(n,e,t){const i=Ce();return qs(i,ga(),e)&&vo(Sn(),rr(),i,n,e,i[11],t,!0),sl}function Sg(n,e,t){const i=Ce();if(qs(i,ga(),e)){const s=Sn(),o=rr();vo(s,o,i,n,e,Ry(v_(s.data),o,i),t,!0)}return Sg}const mf=void 0;var D7=["en",[["a","p"],["AM","PM"],mf],[["AM","PM"],mf,mf],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],mf,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],mf,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",mf,"{1} 'at' {0}",mf],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(n){const e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===t?1:5}];let Mg={};function N2(n){return n in Mg||(Mg[n]=cn.ng&&cn.ng.common&&cn.ng.common.locales&&cn.ng.common.locales[n]),Mg[n]}var tt=(()=>((tt=tt||{})[tt.LocaleId=0]="LocaleId",tt[tt.DayPeriodsFormat=1]="DayPeriodsFormat",tt[tt.DayPeriodsStandalone=2]="DayPeriodsStandalone",tt[tt.DaysFormat=3]="DaysFormat",tt[tt.DaysStandalone=4]="DaysStandalone",tt[tt.MonthsFormat=5]="MonthsFormat",tt[tt.MonthsStandalone=6]="MonthsStandalone",tt[tt.Eras=7]="Eras",tt[tt.FirstDayOfWeek=8]="FirstDayOfWeek",tt[tt.WeekendRange=9]="WeekendRange",tt[tt.DateFormat=10]="DateFormat",tt[tt.TimeFormat=11]="TimeFormat",tt[tt.DateTimeFormat=12]="DateTimeFormat",tt[tt.NumberSymbols=13]="NumberSymbols",tt[tt.NumberFormats=14]="NumberFormats",tt[tt.CurrencyCode=15]="CurrencyCode",tt[tt.CurrencySymbol=16]="CurrencySymbol",tt[tt.CurrencyName=17]="CurrencyName",tt[tt.Currencies=18]="Currencies",tt[tt.Directionality=19]="Directionality",tt[tt.PluralCase=20]="PluralCase",tt[tt.ExtraData=21]="ExtraData",tt))();const Cw="en-US";let L2=Cw;function rA(n){Gi(n,"Expected localeId to be defined"),"string"==typeof n&&(L2=n.toLowerCase().replace(/_/g,"-"))}function aA(n,e,t,i,r){if(n=D(n),Array.isArray(n))for(let s=0;s>20;if(Rc(n)||!n.multi){const g=new $h(l,r,E),_=cA(a,e,r?d:d+p,f);-1===_?(wc(hs(c,o),s,a),lA(s,n,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(g),o.push(g)):(t[_]=g,o[_]=g)}else{const g=cA(a,e,d+p,f),_=cA(a,e,d,d+p),y=g>=0&&t[g],v=_>=0&&t[_];if(r&&!v||!r&&!y){wc(hs(c,o),s,a);const w=function(n,e,t,i,r){const s=new $h(n,t,E);return s.multi=[],s.index=e,s.componentProviders=0,aL(s,r,i&&!t),s}(r?xY:MY,t.length,r,i,l);!r&&v&&(t[_].providerFactory=w),lA(s,n,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),t.push(w),o.push(w)}else lA(s,n,g>-1?g:_,aL(t[r?_:g],l,!r&&i));!r&&i&&v&&t[_].componentProviders++}}}function lA(n,e,t,i){const r=Rc(e);if(r||function(n){return!!n.useClass}(e)){const o=(e.useClass||e).prototype.ngOnDestroy;if(o){const a=n.destroyHooks||(n.destroyHooks=[]);if(!r&&e.multi){const l=a.indexOf(t);-1===l?a.push(t,[i,o]):a[l+1].push(i,o)}else a.push(t,o)}}}function aL(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function cA(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>function(n,e,t){const i=Sn();if(i.firstCreatePass){const r=ha(n);aA(t,i.data,i.blueprint,r,!0),aA(e,i.data,i.blueprint,r,!1)}}(i,r?r(n):n,e)}}class lL{}const uL="ngComponent";class DY{resolveComponentFactory(e){throw function(n){const e=Error(`No component factory found for ${G(n)}. Did you add it to @NgModule.entryComponents?`);return e[uL]=n,e}(e)}}class ol{}function xw(...n){}function Tg(n,e){return new nt(Ss(n,e))}ol.NULL=new DY;const PY=function(){return Tg(Tr(),Ce())};let nt=(()=>{class n{constructor(t){this.nativeElement=t}}return n.__NG_ELEMENT_ID__=PY,n})();function dL(n){return n instanceof nt?n.nativeElement:n}class _f{}let Lc=(()=>{class n{}return n.__NG_ELEMENT_ID__=()=>kY(),n})();const kY=function(){const n=Ce(),t=ds(Tr().index,n);return function(n){return n[11]}(Po(t)?t:n)};let hA=(()=>{class n{}return n.\u0275prov=ae({token:n,providedIn:"root",factory:()=>null}),n})();class Lu{constructor(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}const hL=new Lu("12.2.5");class fL{constructor(){}supports(e){return $y(e)}create(e){return new BY(e)}}const LY=(n,e)=>e;class BY{constructor(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||LY}forEachItem(e){let t;for(t=this._itHead;null!==t;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){const o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),null!==t&&Object.is(t.trackById,o)?(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)):(t=this._mismatch(t,a,o,r),i=!0),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return null===e?s=this._itTail:(s=e._prev,this._remove(e)),null!==(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):null!==(e=null===this._linkedRecords?null:this._linkedRecords.get(i,r))?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new VY(t,i),s,r),e}_verifyReinsertion(e,t,i,r){let s=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==s?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;null!==e;){const t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);const r=e._prevRemoved,s=e._nextRemoved;return null===r?this._removalsHead=s:r._nextRemoved=s,null===s?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail=null===this._additionsTail?this._additionsHead=e:this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){const r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new pL),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);const t=e._prev,i=e._next;return null===t?this._itHead=i:t._next=i,null===i?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail=null===this._movesTail?this._movesHead=e:this._movesTail._nextMoved=e),e}_addToRemovals(e){return null===this._unlinkedRecords&&(this._unlinkedRecords=new pL),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=e:this._identityChangesTail._nextIdentityChange=e,e}}class VY{constructor(e,t){this.item=e,this.trackById=t,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class jY{constructor(){this._head=null,this._tail=null}add(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===t||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){const t=e._prevDup,i=e._nextDup;return null===t?this._head=i:t._nextDup=i,null===i?this._tail=t:i._prevDup=t,null===this._head}}class pL{constructor(){this.map=new Map}put(e){const t=e.trackById;let i=this.map.get(t);i||(i=new jY,this.map.set(t,i)),i.add(e)}get(e,t){const r=this.map.get(e);return r?r.get(e,t):null}remove(e){const t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function gL(n,e,t){const i=n.previousIndex;if(null===i)return i;let r=0;return t&&i{if(t&&t.key===r)this._maybeAddToChanges(t,i),this._appendAfter=t,t=t._next;else{const s=this._getOrCreateRecordForKey(r,i);t=this._insertBeforeOrAppend(t,s)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let i=t;null!==i;i=i._nextRemoved)i===this._mapHead&&(this._mapHead=null),this._records.delete(i.key),i._nextRemoved=i._next,i.previousValue=i.currentValue,i.currentValue=null,i._prev=null,i._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){const i=e._prev;return t._next=e,t._prev=i,e._prev=t,i&&(i._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){const r=this._records.get(e);this._maybeAddToChanges(r,t);const s=r._prev,o=r._next;return s&&(s._next=o),o&&(o._prev=s),r._next=null,r._prev=null,r}const i=new zY(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(i=>t(e[i],i))}}class zY{constructor(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function _L(){return new Ag([new fL])}let Ag=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(null!=i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||_L()),deps:[[n,new Xa,new yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(null!=i)return i;throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'`)}}return n.\u0275prov=ae({token:n,providedIn:"root",factory:_L}),n})();function yL(){return new Dg([new mL])}let Dg=(()=>{class n{constructor(t){this.factories=t}static create(t,i){if(i){const r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||yL()),deps:[[n,new Xa,new yr]]}}find(t){const i=this.factories.find(r=>r.supports(t));if(i)return i;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return n.\u0275prov=ae({token:n,providedIn:"root",factory:yL}),n})();function Tw(n,e,t,i,r=!1){for(;null!==t;){const s=e[t.index];if(null!==s&&i.push(qi(s)),Ro(s))for(let a=10;a-1&&(cy(e,i),Il(t,i))}this._attachedToViewContainer=!1}uy(this._lView[1],this._lView)}onDestroy(e){qC(this._lView[1],this._lView,null,e)}markForCheck(){Dy(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){Iy(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(n,e,t){Ep(!0);try{Iy(n,e,t)}finally{Ep(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,function(n,e){Ud(n,e,e[11],2,null,null)}(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e}}class $Y extends ev{constructor(e){super(e),this._view=e}detectChanges(){iw(this._view)}checkNoChanges(){!function(n){Ep(!0);try{iw(n)}finally{Ep(!1)}}(this._view)}get context(){return null}}const WY=function(n){return function(n,e,t){if(_d(n)&&!t){const i=ds(n.index,e);return new ev(i,i)}return 47&n.type?new ev(e[16],e):null}(Tr(),Ce(),16==(16&n))};let Un=(()=>{class n{}return n.__NG_ELEMENT_ID__=WY,n})();const XY=[new mL],ZY=new Ag([new fL]),QY=new Dg(XY),eX=function(){return Aw(Tr(),Ce())};let Xs=(()=>{class n{}return n.__NG_ELEMENT_ID__=eX,n})();const tX=Xs,nX=class extends tX{constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}createEmbeddedView(e){const t=this._declarationTContainer.tViews,i=lf(this._declarationLView,t,e,16,null,t.declTNode,null,null,null,null);i[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(i[19]=s.createEmbeddedView(t)),cf(t,i,e),new ev(i)}};function Aw(n,e){return 4&n.type?new nX(e,n,Tg(n,e)):null}class Bc{}const sX=function(){return wL(Tr(),Ce())};let es=(()=>{class n{}return n.__NG_ELEMENT_ID__=sX,n})();const aX=es,bL=class extends aX{constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return Tg(this._hostTNode,this._hostLView)}get injector(){return new Fo(this._hostTNode,this._hostLView)}get parentInjector(){const e=Wh(this._hostTNode,this._hostLView);if(T0(e)){const t=Ga(e,this._hostLView),i=Ed(e);return new Fo(t[1].data[i+8],t)}return new Fo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=CL(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,i){const r=e.createEmbeddedView(t||{});return this.insert(r,i),r}createComponent(e,t,i,r,s){const o=i||this.parentInjector;if(!s&&null==e.ngModule&&o){const l=o.get(Bc,null);l&&(s=l)}const a=e.create(o,r,void 0,s);return this.insert(a.hostView,t),a}insert(e,t){const i=e._lView,r=i[1];if(function(n){return Ro(n[3])}(i)){const d=this.indexOf(e);if(-1!==d)this.detach(d);else{const f=i[3],p=new bL(f,f[6],f[3]);p.detach(p.indexOf(e))}}const s=this._adjustIndex(t),o=this._lContainer;!function(n,e,t,i){const r=10+i,s=t.length;i>0&&(t[r-1][4]=e),iuC});class $L extends lL{constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function(n){return n.map(Kx).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors?e.ngContentSelectors:[],this.isBoundToModule=!!t}get inputs(){return HL(this.componentDef.inputs)}get outputs(){return HL(this.componentDef.outputs)}create(e,t,i,r){const s=(r=r||this.ngModule)?function(n,e){return{get:(t,i,r)=>{const s=n.get(t,Rg,r);return s!==Rg||i===Rg?s:e.get(t,i,r)}}}(e,r.injector):e,o=s.get(_f,vu),a=s.get(hA,null),l=o.createRenderer(null,this.componentDef),c=this.componentDef.selectors[0][0]||"div",d=i?function(n,e,t){if(Ti(n))return n.selectRootElement(e,t===Re.ShadowDom);let i="string"==typeof e?n.querySelector(e):e;return i.textContent="",i}(l,i,this.componentDef.encapsulation):ly(o.createRenderer(null,this.componentDef),c,function(n){const e=n.toLowerCase();return"svg"===e?Bn:"math"===e?"http://www.w3.org/1998/MathML/":null}(c)),f=this.componentDef.onPush?576:528,p=function(n,e){return{components:[],scheduler:n||uC,clean:IT,playerHandler:e||null,flags:0}}(),g=lg(0,null,null,1,0,null,null,null,null,null),_=lf(null,g,p,f,null,null,o,l,a,s);let y,v;zh(_);try{const w=function(n,e,t,i,r,s){const o=t[1];t[20]=n;const l=Hd(o,20,2,"#host",null),c=l.mergedAttrs=e.hostAttrs;null!==c&&(dg(l,c,!0),null!==n&&(Dp(r,n,c),null!==l.classes&&py(r,n,l.classes),null!==l.styles&&DC(r,n,l.styles)));const d=i.createRenderer(n,e),f=lf(t,ag(e),null,e.onPush?64:16,t[20],l,i,d,s||null,null);return o.firstCreatePass&&(wc(hs(l,t),o,e.type),tw(o,l),My(l,t.length,1)),cg(t,f),t[20]=f}(d,this.componentDef,_,o,l);if(d)if(i)Dp(l,d,["ng-version",hL.full]);else{const{attrs:C,classes:x}=function(n){const e=[],t=[];let i=1,r=2;for(;i0&&py(l,d,x.join(" "))}if(v=g_(g,20),void 0!==t){const C=v.projection=[];for(let x=0;xl(o,e)),e.contentQueries){const l=Tr();e.contentQueries(1,o,l.directiveStart)}const a=Tr();return!s.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(Hs(a.index),JC(t[1],a,0,a.directiveStart,a.directiveEnd,e),ew(e,o)),o}(w,this.componentDef,_,p,[u9]),cf(g,_,null)}finally{pn()}return new oK(this.componentType,y,Tg(v,_),_,v)}}class oK extends class{}{constructor(e,t,i,r,s){super(),this.location=i,this._rootLView=r,this._tNode=s,this.instance=t,this.hostView=this.changeDetectorRef=new $Y(r),this.componentType=e}get injector(){return new Fo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}}const kg=new Map;class cK extends Bc{constructor(e,t){super(),this._parent=t,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new zL(this);const i=uo(e),r=function(n){return n[p1]||null}(e);r&&rA(r),this._bootstrapComponents=Za(i.bootstrap),this._r3Injector=aw(e,t,[{provide:Bc,useValue:this},{provide:ol,useValue:this.componentFactoryResolver}],G(e)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(e)}get(e,t=Tt.THROW_IF_NOT_FOUND,i=vt.Default){return e===Tt||e===Bc||e===ku?this:this._r3Injector.get(e,t,i)}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class xA extends class{}{constructor(e){super(),this.moduleType=e,null!==uo(e)&&function(n){const e=new Set;!function t(i){const r=uo(i,!0),s=r.id;null!==s&&(function(n,e,t){if(e&&e!==t)throw new Error(`Duplicate module registered for ${n} - ${G(e)} vs ${G(e.name)}`)}(s,kg.get(s),i),kg.set(s,i));const o=Za(r.imports);for(const a of o)e.has(a)||(e.add(a),t(a))}(n)}(e)}create(e){return new cK(this.moduleType,e)}}function lv(n,e,t){const i=qr()+n,r=Ce();return r[i]===St?Fc(r,i,t?e.call(t):e()):function(n,e){return n[e]}(r,i)}function Fg(n,e,t,i){return qL(Ce(),qr(),n,e,t,i)}function cv(n,e){const t=n[e];return t===St?void 0:t}function qL(n,e,t,i,r,s){const o=e+t;return qs(n,o,r)?Fc(n,o+1,s?i.call(s,r):i(r)):cv(n,o+1)}function yn(n,e){const t=Sn();let i;const r=n+20;t.firstCreatePass?(i=function(n,e){if(e)for(let t=e.length-1;t>=0;t--){const i=e[t];if(n===i.name)return i}throw new H("302",`The pipe '${n}' could not be found!`)}(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks||(t.destroyHooks=[])).push(r,i.onDestroy)):i=t.data[r];const s=i.factory||(i.factory=bc(i.type)),o=ca(E);try{const a=Op(!1),l=s();return Op(a),function(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}(t,Ce(),r,l),l}finally{ca(o)}}function wn(n,e,t){const i=n+20,r=Ce(),s=vd(r,i);return dv(r,uv(r,i)?qL(r,qr(),e,s.transform,t,s):s.transform(t))}function QL(n,e,t,i){const r=n+20,s=Ce(),o=vd(s,r);return dv(s,uv(s,r)?function(n,e,t,i,r,s,o){const a=e+t;return hf(n,a,r,s)?Fc(n,a+2,o?i.call(o,r,s):i(r,s)):cv(n,a+2)}(s,qr(),e,o.transform,t,i,o):o.transform(t,i))}function uv(n,e){return n[1].data[e].pure}function dv(n,e){return Vl.isWrapped(e)&&(e=Vl.unwrap(e),n[zs()]=St),e}function TA(n){return e=>{setTimeout(n,void 0,e)}}const Pe=class extends we{constructor(e=!1){super(),this.__isAsync=e}emit(e){super.next(e)}subscribe(e,t,i){var r,s,o;let a=e,l=t||(()=>null),c=i;if(e&&"object"==typeof e){const f=e;a=null===(r=f.next)||void 0===r?void 0:r.bind(f),l=null===(s=f.error)||void 0===s?void 0:s.bind(f),c=null===(o=f.complete)||void 0===o?void 0:o.bind(f)}this.__isAsync&&(l=TA(l),a&&(a=TA(a)),c&&(c=TA(c)));const d=super.subscribe({next:a,error:l,complete:c});return e instanceof Ie&&e.add(d),d}};function EK(){return this._results[hg()]()}class bf{constructor(e=!1){this._emitDistinctChangesOnly=e,this.dirty=!0,this._results=[],this._changesDetected=!1,this._changes=null,this.length=0,this.first=void 0,this.last=void 0;const t=hg(),i=bf.prototype;i[t]||(i[t]=EK)}get changes(){return this._changes||(this._changes=new Pe)}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){const i=this;i.dirty=!1;const r=No(e);(this._changesDetected=!function(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i0)i.push(o[a/2]);else{const c=s[a+1],d=e[-l];for(let f=10;f{class n{constructor(t){this.appInits=t,this.resolve=xw,this.reject=xw,this.initialized=!1,this.done=!1,this.donePromise=new Promise((i,r)=>{this.resolve=i,this.reject=r})}runInitializers(){if(this.initialized)return;const t=[],i=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let r=0;r{s.subscribe({complete:a,error:l})});t.push(o)}}Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),0===t.length&&i(),this.initialized=!0}}return n.\u0275fac=function(t){return new(t||n)(I(Cf,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const fv=new _e("AppId"),rZ={provide:fv,useFactory:function(){return`${BA()}${BA()}${BA()}`},deps:[]};function BA(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const CB=new _e("Platform Initializer"),cl=new _e("Platform ID"),pv=new _e("appBootstrapListener");let Nw=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Bu=new _e("LocaleId"),wB=new _e("DefaultCurrencyCode");class oZ{constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}const VA=function(n){return new xA(n)},aZ=VA,lZ=function(n){return Promise.resolve(VA(n))},EB=function(n){const e=VA(n),i=Za(uo(n).declarations).reduce((r,s)=>{const o=Wn(s);return o&&r.push(new $L(o)),r},[]);return new oZ(e,i)},cZ=EB,uZ=function(n){return Promise.resolve(EB(n))};let wf=(()=>{class n{constructor(){this.compileModuleSync=aZ,this.compileModuleAsync=lZ,this.compileModuleAndAllComponentsSync=cZ,this.compileModuleAndAllComponentsAsync=uZ}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const SB=new _e("compilerOptions"),hZ=(()=>Promise.resolve(0))();function jA(n){"undefined"==typeof Zone?hZ.then(()=>{n&&n.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",n)}class lt{constructor({enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:t=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Pe(!1),this.onMicrotaskEmpty=new Pe(!1),this.onStable=new Pe(!1),this.onError=new Pe(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const r=this;r._nesting=0,r._outer=r._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(r._inner=r._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(r._inner=r._inner.fork(Zone.longStackTraceZoneSpec)),r.shouldCoalesceEventChangeDetection=!i&&t,r.shouldCoalesceRunChangeDetection=i,r.lastRequestAnimationFrameId=-1,r.nativeRequestAnimationFrame=function(){let n=cn.requestAnimationFrame,e=cn.cancelAnimationFrame;if("undefined"!=typeof Zone&&n&&e){const t=n[Zone.__symbol__("OriginalDelegate")];t&&(n=t);const i=e[Zone.__symbol__("OriginalDelegate")];i&&(e=i)}return{nativeRequestAnimationFrame:n,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(n){const e=()=>{!function(n){n.isCheckStableRunning||-1!==n.lastRequestAnimationFrameId||(n.lastRequestAnimationFrameId=n.nativeRequestAnimationFrame.call(cn,()=>{n.fakeTopEventTask||(n.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{n.lastRequestAnimationFrameId=-1,zA(n),n.isCheckStableRunning=!0,UA(n),n.isCheckStableRunning=!1},void 0,()=>{},()=>{})),n.fakeTopEventTask.invoke()}),zA(n))}(n)};n._inner=n._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,i,r,s,o,a)=>{try{return MB(n),t.invokeTask(r,s,o,a)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),xB(n)}},onInvoke:(t,i,r,s,o,a,l)=>{try{return MB(n),t.invoke(r,s,o,a,l)}finally{n.shouldCoalesceRunChangeDetection&&e(),xB(n)}},onHasTask:(t,i,r,s)=>{t.hasTask(r,s),i===r&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,zA(n),UA(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(t,i,r,s)=>(t.handleError(r,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(r)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!lt.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(lt.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){const s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,pZ,xw,xw);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}}const pZ={};function UA(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function zA(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&-1!==n.lastRequestAnimationFrameId)}function MB(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function xB(n){n._nesting--,UA(n)}class _Z{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Pe,this.onMicrotaskEmpty=new Pe,this.onStable=new Pe,this.onError=new Pe}run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}}let HA=(()=>{class n{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{lt.assertNotInAngularZone(),jA(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())jA(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(t)||(clearTimeout(i.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,i,r){let s=-1;i&&i>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(o=>o.timeoutId!==s),t(this._didWork,this.getPendingTasks())},i)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:r})}whenStable(t,i,r){if(r&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,i,r),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,i,r){return[]}}return n.\u0275fac=function(t){return new(t||n)(I(lt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),TB=(()=>{class n{constructor(){this._applications=new Map,$A.addToWindow(this)}registerApplication(t,i){this._applications.set(t,i)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,i=!0){return $A.findTestabilityInTree(this,t,i)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class yZ{addToWindow(e){}findTestabilityInTree(e,t,i){return null}}let $A=new yZ,AB=!0,DB=!1;function wo(){return DB=!0,AB}let Gl;const OB=new _e("AllowMultipleToken");function IB(n,e,t=[]){const i=`Platform: ${e}`,r=new _e(i);return(s=[])=>{let o=WA();if(!o||o.injector.get(OB,!1))if(n)n(t.concat(s).concat({provide:r,useValue:!0}));else{const a=t.concat(s).concat({provide:r,useValue:!0},{provide:Fu,useValue:"platform"});!function(n){if(Gl&&!Gl.destroyed&&!Gl.injector.get(OB,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Gl=n.get(PB);const e=n.get(CB,null);e&&e.forEach(t=>t())}(Tt.create({providers:a,name:i}))}return function(n){const e=WA();if(!e)throw new Error("No platform exists!");if(!e.injector.get(n,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function WA(){return Gl&&!Gl.destroyed?Gl:null}let PB=(()=>{class n{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,i){const a=function(n,e){let t;return t="noop"===n?new _Z:("zone.js"===n?void 0:n)||new lt({enableLongStackTrace:wo(),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),t}(i?i.ngZone:void 0,{ngZoneEventCoalescing:i&&i.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:i&&i.ngZoneRunCoalescing||!1}),l=[{provide:lt,useValue:a}];return a.run(()=>{const c=Tt.create({providers:l,parent:this.injector,name:t.moduleType.name}),d=t.create(c),f=d.injector.get(Uo,null);if(!f)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return a.runOutsideAngular(()=>{const p=a.onError.subscribe({next:g=>{f.handleError(g)}});d.onDestroy(()=>{qA(this._modules,d),p.unsubscribe()})}),function(n,e,t){try{const i=t();return Wy(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}(f,a,()=>{const p=d.injector.get(Lg);return p.runInitializers(),p.donePromise.then(()=>(rA(d.injector.get(Bu,Cw)||Cw),this._moduleDoBootstrap(d),d))})})}bootstrapModule(t,i=[]){const r=RB({},i);return function(n,e,t){const i=new xA(t);return Promise.resolve(i)}(0,0,t).then(s=>this.bootstrapModuleFactory(s,r))}_moduleDoBootstrap(t){const i=t.injector.get(Yd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(r=>i.bootstrap(r));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${G(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(i)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return n.\u0275fac=function(t){return new(t||n)(I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function RB(n,e){return Array.isArray(e)?e.reduce(RB,n):Object.assign(Object.assign({},n),e)}let Yd=(()=>{class n{constructor(t,i,r,s,o){this._zone=t,this._injector=i,this._exceptionHandler=r,this._componentFactoryResolver=s,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const a=new oe(c=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{c.next(this._stable),c.complete()})}),l=new oe(c=>{let d;this._zone.runOutsideAngular(()=>{d=this._zone.onStable.subscribe(()=>{lt.assertNotInAngularZone(),jA(()=>{!this._stable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks&&(this._stable=!0,c.next(!0))})})});const f=this._zone.onUnstable.subscribe(()=>{lt.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{c.next(!1)}))});return()=>{d.unsubscribe(),f.unsubscribe()}});this.isStable=ki(a,l.pipe(Vs()))}bootstrap(t,i){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let r;r=t instanceof lL?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(r.componentType);const s=function(n){return n.isBoundToModule}(r)?void 0:this._injector.get(Bc),a=r.create(Tt.NULL,[],i||r.selector,s),l=a.location.nativeElement,c=a.injector.get(HA,null),d=c&&a.injector.get(TB);return c&&d&&d.registerApplication(l,c),a.onDestroy(()=>{this.detachView(a.hostView),qA(this.components,a),d&&d.unregisterApplication(l)}),this._loadComponent(a),a}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){const i=t;qA(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(pv,[]).concat(this._bootstrapListeners).forEach(r=>r(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(Tt),I(Uo),I(ol),I(Lg))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function qA(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const GZ=IB(null,"core",[{provide:cl,useValue:"unknown"},{provide:PB,deps:[Tt]},{provide:TB,deps:[]},{provide:Nw,deps:[]}]),KZ=[{provide:Yd,useClass:Yd,deps:[lt,Tt,Uo,ol,Lg]},{provide:iK,deps:[lt],useFactory:function(n){let e=[];return n.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Lg,useClass:Lg,deps:[[new yr,Cf]]},{provide:wf,useClass:wf,deps:[]},rZ,{provide:Ag,useFactory:function(){return ZY},deps:[]},{provide:Dg,useFactory:function(){return QY},deps:[]},{provide:Bu,useFactory:function(n){return rA(n=n||"undefined"!=typeof $localize&&$localize.locale||Cw),n},deps:[[new Rd(Bu),new yr,new Xa]]},{provide:wB,useValue:"USD"}];let QZ=(()=>{class n{constructor(t){}}return n.\u0275fac=function(t){return new(t||n)(I(Yd))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:KZ}),n})(),Yw=null;function Vc(){return Yw}const rt=new _e("DocumentToken");let Mf=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:ZQ,token:n,providedIn:"platform"}),n})();function ZQ(){return I(a3)}let a3=(()=>{class n extends Mf{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Vc().getBaseHref(this._doc)}onPopState(t){const i=Vc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){const i=Vc().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,i,r){l3()?this._history.pushState(t,i,r):this.location.hash=r}replaceState(t,i,r){l3()?this._history.replaceState(t,i,r):this.location.hash=r}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:JQ,token:n,providedIn:"platform"}),n})();function l3(){return!!window.history.pushState}function JQ(){return new a3(I(rt))}function lD(n,e){if(0==n.length)return e;if(0==e.length)return n;let t=0;return n.endsWith("/")&&t++,e.startsWith("/")&&t++,2==t?n+e.substring(1):1==t?n+e:n+"/"+e}function c3(n){const e=n.match(/#|\?|$/),t=e&&e.index||n.length;return n.slice(0,t-("/"===n[t-1]?1:0))+n.slice(t)}function ju(n){return n&&"?"!==n[0]?"?"+n:n}let jg=(()=>{class n{historyGo(t){throw new Error("Not implemented")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:eJ,token:n,providedIn:"root"}),n})();function eJ(n){const e=I(rt).location;return new u3(I(Mf),e&&e.origin||"")}const cD=new _e("appBaseHref");let u3=(()=>{class n extends jg{constructor(t,i){if(super(),this._platformLocation=t,this._removeListenerFns=[],null==i&&(i=this._platformLocation.getBaseHrefFromDOM()),null==i)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=i}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return lD(this._baseHref,t)}path(t=!1){const i=this._platformLocation.pathname+ju(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){const o=this.prepareExternalUrl(r+ju(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){const o=this.prepareExternalUrl(r+ju(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformLocation).historyGo)||void 0===r||r.call(i,t)}}return n.\u0275fac=function(t){return new(t||n)(I(Mf),I(cD,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Ug=(()=>{class n{constructor(t,i){this._subject=new Pe,this._urlChangeListeners=[],this._platformStrategy=t;const r=this._platformStrategy.getBaseHref();this._platformLocation=i,this._baseHref=c3(d3(r)),this._platformStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+ju(i))}normalize(t){return n.stripTrailingSlash(function(n,e){return n&&e.startsWith(n)?e.substring(n.length):e}(this._baseHref,d3(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._platformStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ju(i)),r)}replaceState(t,i="",r=null){this._platformStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ju(i)),r)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}historyGo(t=0){var i,r;null===(r=(i=this._platformStrategy).historyGo)||void 0===r||r.call(i,t)}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}))}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i,complete:r})}}return n.\u0275fac=function(t){return new(t||n)(I(jg),I(Mf))},n.normalizeQueryParams=ju,n.joinWithSlash=lD,n.stripTrailingSlash=c3,n.\u0275prov=ae({factory:nJ,token:n,providedIn:"root"}),n})();function nJ(){return new Ug(I(jg),I(Mf))}function d3(n){return n.replace(/\/index.html$/,"")}var Br=(()=>((Br=Br||{})[Br.Zero=0]="Zero",Br[Br.One=1]="One",Br[Br.Two=2]="Two",Br[Br.Few=3]="Few",Br[Br.Many=4]="Many",Br[Br.Other=5]="Other",Br))();const uJ=function(n){return function(n){const e=function(n){return n.toLowerCase().replace(/_/g,"-")}(n);let t=N2(e);if(t)return t;const i=e.split("-")[0];if(t=N2(i),t)return t;if("en"===i)return D7;throw new Error(`Missing locale data for the locale "${n}".`)}(n)[tt.PluralCase]};class rE{}let VJ=(()=>{class n extends rE{constructor(t){super(),this.locale=t}getPluralCategory(t,i){switch(uJ(i||this.locale)(t)){case Br.Zero:return"zero";case Br.One:return"one";case Br.Two:return"two";case Br.Few:return"few";case Br.Many:return"many";default:return"other"}}}return n.\u0275fac=function(t){return new(t||n)(I(Bu))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function b3(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const i=t.indexOf("="),[r,s]=-1==i?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}let sE=(()=>{class n{constructor(t,i,r,s){this._iterableDiffers=t,this._keyValueDiffers=i,this._ngEl=r,this._renderer=s,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(t){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&($y(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachChangedItem(i=>this._toggleClass(i.key,i.currentValue)),t.forEachRemovedItem(i=>{i.previousValue&&this._toggleClass(i.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(i=>{if("string"!=typeof i.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${G(i.item)}`);this._toggleClass(i.item,!0)}),t.forEachRemovedItem(i=>this._toggleClass(i.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!0)):Object.keys(t).forEach(i=>this._toggleClass(i,!!t[i])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(i=>this._toggleClass(i,!1)):Object.keys(t).forEach(i=>this._toggleClass(i,!1)))}_toggleClass(t,i){(t=t.trim())&&t.split(/\s+/g).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ag),E(Dg),E(nt),E(Lc))},n.\u0275dir=he({type:n,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),n})();class UJ{constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Xl=(()=>{class n{constructor(t,i,r){this._viewContainer=t,this._template=i,this._differs=r,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(i){throw new Error(`Cannot find a differ supporting object '${t}' of type '${function(n){return n.name||typeof n}(t)}'. NgFor only supports binding to Iterables such as Arrays.`)}}if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const i=[];t.forEachOperation((r,s,o)=>{if(null==r.previousIndex){const a=this._viewContainer.createEmbeddedView(this._template,new UJ(null,this._ngForOf,-1,-1),null===o?void 0:o),l=new C3(r,a);i.push(l)}else if(null==o)this._viewContainer.remove(null===s?void 0:s);else if(null!==s){const a=this._viewContainer.get(s);this._viewContainer.move(a,o);const l=new C3(r,a);i.push(l)}});for(let r=0;r{this._viewContainer.get(r.currentIndex).context.$implicit=r.item})}_perViewChange(t,i){t.context.$implicit=i.item}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Ag))},n.\u0275dir=he({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),n})();class C3{constructor(e,t){this.record=e,this.view=t}}let Is=(()=>{class n{constructor(t,i){this._viewContainer=t,this._context=new HJ,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){w3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){w3("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,i){return!0}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs))},n.\u0275dir=he({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),n})();class HJ{constructor(){this.$implicit=null,this.ngIf=null}}function w3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${G(e)}'.`)}class yD{constructor(e,t){this._viewContainerRef=e,this._templateRef=t,this._created=!1}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}}let Cv=(()=>{class n{constructor(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}set ngSwitch(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)}_matchCase(t){const i=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||i,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),i}_updateDefaultCases(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(let i=0;i{class n{constructor(t,i,r){this.ngSwitch=r,r._addCase(),this._view=new yD(t,i)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Cv,9))},n.\u0275dir=he({type:n,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}}),n})(),E3=(()=>{class n{constructor(t,i,r){r._addDefault(new yD(t,i))}}return n.\u0275fac=function(t){return new(t||n)(E(es),E(Xs),E(Cv,9))},n.\u0275dir=he({type:n,selectors:[["","ngSwitchDefault",""]]}),n})(),M3=(()=>{class n{constructor(t,i,r){this._ngEl=t,this._differs=i,this._renderer=r,this._ngStyle=null,this._differ=null}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,i){const[r,s]=t.split(".");null!=(i=null!=i&&s?`${i}${s}`:i)?this._renderer.setStyle(this._ngEl.nativeElement,r,i):this._renderer.removeStyle(this._ngEl.nativeElement,r)}_applyChanges(t){t.forEachRemovedItem(i=>this._setStyle(i.key,null)),t.forEachAddedItem(i=>this._setStyle(i.key,i.currentValue)),t.forEachChangedItem(i=>this._setStyle(i.key,i.currentValue))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Dg),E(Lc))},n.\u0275dir=he({type:n,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}}),n})();function Kl(n,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${G(n)}'`)}class WJ{createSubscription(e,t){return e.subscribe({next:t,error:i=>{throw i}})}dispose(e){e.unsubscribe()}onDestroy(e){e.unsubscribe()}}class qJ{createSubscription(e,t){return e.then(t,i=>{throw i})}dispose(e){}onDestroy(e){}}const YJ=new qJ,XJ=new WJ;let zu=(()=>{class n{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,i=>this._updateLatestValue(t,i))}_selectStrategy(t){if(Wy(t))return YJ;if(qN(t))return XJ;throw Kl(n,t)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,i){t===this._obj&&(this._latestValue=i,this._ref.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(Un,16))},n.\u0275pipe=cs({name:"async",type:n,pure:!1}),n})();const tee=/#/g;let x3=(()=>{class n{constructor(t){this._localization=t}transform(t,i,r){if(null==t)return"";if("object"!=typeof i||null===i)throw Kl(n,i);return i[function(n,e,t,i){let r=`=${n}`;if(e.indexOf(r)>-1||(r=t.getPluralCategory(n,i),e.indexOf(r)>-1))return r;if(e.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${n}"`)}(t,Object.keys(i),this._localization,r)].replace(tee,t.toString())}}return n.\u0275fac=function(t){return new(t||n)(E(rE,16))},n.\u0275pipe=cs({name:"i18nPlural",type:n,pure:!0}),n})(),T3=(()=>{class n{transform(t){return JSON.stringify(t,null,2)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=cs({name:"json",type:n,pure:!1}),n})(),bn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:rE,useClass:VJ}]}),n})();const D3="browser";function xf(n){return n===D3}function wD(n){return"server"===n}class P3{}class ED extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){!function(n){Yw||(Yw=n)}(new ED)}onAndCancel(e,t,i){return e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=(wv=wv||document.querySelector("base"),wv?wv.getAttribute("href"):null);return null==t?null:function(n){oE=oE||document.createElement("a"),oE.setAttribute("href",n);const e=oE.pathname;return"/"===e.charAt(0)?e:`/${e}`}(t)}resetBaseElement(){wv=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return b3(document.cookie,e)}}let oE,wv=null;const R3=new _e("TRANSITION_ID"),yee=[{provide:Cf,useFactory:function(n,e,t){return()=>{t.get(Lg).donePromise.then(()=>{const i=Vc(),r=e.querySelectorAll(`style[ng-transition="${n}"]`);for(let s=0;s{const s=e.findTestabilityInTree(i,r);if(null==s)throw new Error("Could not find testability for element.");return s},cn.getAllAngularTestabilities=()=>e.getAllTestabilities(),cn.getAllAngularRootElements=()=>e.getAllRootElements(),cn.frameworkStabilizers||(cn.frameworkStabilizers=[]),cn.frameworkStabilizers.push(i=>{const r=cn.getAllAngularTestabilities();let s=r.length,o=!1;const a=function(l){o=o||l,s--,0==s&&i(o)};r.forEach(function(l){l.whenStable(a)})})}findTestabilityInTree(e,t,i){if(null==t)return null;const r=e.getTestability(t);return null!=r?r:i?Vc().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null}}let vee=(()=>{class n{build(){return new XMLHttpRequest}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Ev=new _e("EventManagerPlugins");let lE=(()=>{class n{constructor(t,i){this._zone=i,this._eventNameToPlugin=new Map,t.forEach(r=>r.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,i,r){return this._findPluginFor(i).addEventListener(t,i,r)}addGlobalEventListener(t,i,r){return this._findPluginFor(i).addGlobalEventListener(t,i,r)}getZone(){return this._zone}_findPluginFor(t){const i=this._eventNameToPlugin.get(t);if(i)return i;const r=this._plugins;for(let s=0;s{class n{constructor(){this._stylesSet=new Set}addStyles(t){const i=new Set;t.forEach(r=>{this._stylesSet.has(r)||(this._stylesSet.add(r),i.add(r))}),this.onStylesAdded(i)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Sv=(()=>{class n extends F3{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,i,r){t.forEach(s=>{const o=this._doc.createElement("style");o.textContent=s,r.push(i.appendChild(o))})}addHost(t){const i=[];this._addStylesToHost(this._stylesSet,t,i),this._hostNodes.set(t,i)}removeHost(t){const i=this._hostNodes.get(t);i&&i.forEach(N3),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((i,r)=>{this._addStylesToHost(t,r,i)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(N3))}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function N3(n){Vc().remove(n)}const xD={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},TD=/%COMP%/g;function cE(n,e,t){for(let i=0;i{if("__ngUnwrap__"===e)return n;!1===n(e)&&(e.preventDefault(),e.returnValue=!1)}}let uE=(()=>{class n{constructor(t,i,r){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.rendererByCompId=new Map,this.defaultRenderer=new AD(t)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;switch(i.encapsulation){case Re.Emulated:{let r=this.rendererByCompId.get(i.id);return r||(r=new kee(this.eventManager,this.sharedStylesHost,i,this.appId),this.rendererByCompId.set(i.id,r)),r.applyToHost(t),r}case 1:case Re.ShadowDom:return new Fee(this.eventManager,this.sharedStylesHost,t,i);default:if(!this.rendererByCompId.has(i.id)){const r=cE(i.id,i.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(i.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return n.\u0275fac=function(t){return new(t||n)(I(lE),I(Sv),I(fv))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class AD{constructor(e){this.eventManager=e,this.data=Object.create(null)}destroy(){}createElement(e,t){return t?document.createElementNS(xD[t]||t,e):document.createElement(e)}createComment(e){return document.createComment(e)}createText(e){return document.createTextNode(e)}appendChild(e,t){e.appendChild(t)}insertBefore(e,t,i){e&&e.insertBefore(t,i)}removeChild(e,t){e&&e.removeChild(t)}selectRootElement(e,t){let i="string"==typeof e?document.querySelector(e):e;if(!i)throw new Error(`The selector "${e}" did not match any elements`);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;const s=xD[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){const r=xD[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(yo.DashCase|yo.Important)?e.style.setProperty(t,i,r&yo.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&yo.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e[t]=i}setValue(e,t){e.nodeValue=t}listen(e,t,i){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,V3(i)):this.eventManager.addEventListener(e,t,V3(i))}}class kee extends AD{constructor(e,t,i,r){super(e),this.component=i;const s=cE(r+"-"+i.id,i.styles,[]);t.addStyles(s),this.contentAttr=function(n){return"_ngcontent-%COMP%".replace(TD,n)}(r+"-"+i.id),this.hostAttr=function(n){return"_nghost-%COMP%".replace(TD,n)}(r+"-"+i.id)}applyToHost(e){super.setAttribute(e,this.hostAttr,"")}createElement(e,t){const i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}}class Fee extends AD{constructor(e,t,i,r){super(e),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const s=cE(r.id,r.styles,[]);for(let o=0;o{class n extends MD{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r){return t.addEventListener(i,r,!1),()=>this.removeEventListener(t,i,r)}removeEventListener(t,i,r){return t.removeEventListener(i,r)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const z3=["alt","control","meta","shift"],Hee={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},H3={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},$ee={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};let Gee=(()=>{class n extends MD{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,i,r){const s=n.parseEventName(i),o=n.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Vc().onAndCancel(t,s.domEventName,o))}static parseEventName(t){const i=t.toLowerCase().split("."),r=i.shift();if(0===i.length||"keydown"!==r&&"keyup"!==r)return null;const s=n._normalizeKey(i.pop());let o="";if(z3.forEach(l=>{const c=i.indexOf(l);c>-1&&(i.splice(c,1),o+=l+".")}),o+=s,0!=i.length||0===s.length)return null;const a={};return a.domEventName=r,a.fullKey=o,a}static getEventFullKey(t){let i="",r=function(n){let e=n.key;if(null==e){if(e=n.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===n.location&&H3.hasOwnProperty(e)&&(e=H3[e]))}return Hee[e]||e}(t);return r=r.toLowerCase()," "===r?r="space":"."===r&&(r="dot"),z3.forEach(s=>{s!=r&&$ee[s](t)&&(i+=s+".")}),i+=r,i}static eventCallback(t,i,r){return s=>{n.getEventFullKey(s)===t&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Kd=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return I(OD)},token:n,providedIn:"root"}),n})(),OD=(()=>{class n extends Kd{constructor(t){super(),this._doc=t}sanitize(t,i){if(null==i)return null;switch(t){case on.NONE:return i;case on.HTML:return Bo(i,"HTML")?ps(i):Y_(this._doc,String(i)).toString();case on.STYLE:return Bo(i,"Style")?ps(i):i;case on.SCRIPT:if(Bo(i,"Script"))return ps(i);throw new Error("unsafe value used in a script context");case on.URL:return Oc(i),Bo(i,"URL")?ps(i):_o(String(i));case on.RESOURCE_URL:if(Bo(i,"ResourceURL"))return ps(i);throw new Error("unsafe value used in a resource URL context (see https://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see https://g.co/ng/security#xss)`)}}bypassSecurityTrustHtml(t){return function(n){return new j_(n)}(t)}bypassSecurityTrustStyle(t){return function(n){return new U_(n)}(t)}bypassSecurityTrustScript(t){return function(n){return new Gp(n)}(t)}bypassSecurityTrustUrl(t){return function(n){return new Nd(n)}(t)}bypassSecurityTrustResourceUrl(t){return function(n){return new Nt(n)}(t)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return function(n){return new OD(n.get(rt))}(I(ku))},token:n,providedIn:"root"}),n})();const Jee=IB(GZ,"browser",[{provide:cl,useValue:D3},{provide:CB,useValue:function(){ED.makeCurrent(),SD.init()},multi:!0},{provide:rt,useFactory:function(){return function(n){di=n}(document),document},deps:[]}]),ete=[[],{provide:Fu,useValue:"root"},{provide:Uo,useFactory:function(){return new Uo},deps:[]},{provide:Ev,useClass:Nee,multi:!0,deps:[rt,lt,cl]},{provide:Ev,useClass:Gee,multi:!0,deps:[rt]},[],{provide:uE,useClass:uE,deps:[lE,Sv,fv]},{provide:_f,useExisting:uE},{provide:F3,useExisting:Sv},{provide:Sv,useClass:Sv,deps:[rt]},{provide:HA,useClass:HA,deps:[lt]},{provide:lE,useClass:lE,deps:[Ev,lt]},{provide:P3,useClass:vee,deps:[]},[]];let dE=(()=>{class n{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:n,providers:[{provide:fv,useValue:t.appId},{provide:R3,useExisting:fv},yee]}}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:ete,imports:[bn,QZ]}),n})();"undefined"!=typeof window&&window;class lte extends Ie{constructor(e,t){super()}schedule(e,t=0){return this}}class hE extends lte{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;const i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,i=0){return setInterval(e.flush.bind(e,this),i)}recycleAsyncId(e,t,i=0){if(null!==i&&this.delay===i&&!1===this.pending)return t;clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r,i=!1;try{this.work(e)}catch(s){i=!0,r=!!s&&s||new Error(s)}if(i)return this.unsubscribe(),r}_unsubscribe(){const e=this.id,t=this.scheduler,i=t.actions,r=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&i.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null}}let G3=(()=>{class n{constructor(t,i=n.now){this.SchedulerAction=t,this.now=i}schedule(t,i=0,r){return new this.SchedulerAction(this,t).schedule(r,i)}}return n.now=()=>Date.now(),n})();class Zl extends G3{constructor(e,t=G3.now){super(e,()=>Zl.delegate&&Zl.delegate!==this?Zl.delegate.now():t()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(e,t=0,i){return Zl.delegate&&Zl.delegate!==this?Zl.delegate.schedule(e,t,i):super.schedule(e,t,i)}flush(e){const{actions:t}=this;if(this.active)return void t.push(e);let i;this.active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}}const dte=new class extends Zl{}(class extends hE{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!==i&&i>0||null===i&&this.delay>0?super.requestAsyncId(e,t,i):e.flush(this)}}),Ql=new oe(n=>n.complete());function fE(n){return n?function(n){return new oe(e=>n.schedule(()=>e.complete()))}(n):Ql}function st(...n){let e=n[n.length-1];return Ln(e)?(n.pop(),Ri(n,e)):Ba(n)}function zg(n,e){return new oe(e?t=>e.schedule(fte,0,{error:n,subscriber:t}):t=>t.error(n))}function fte({error:n,subscriber:e}){e.error(n)}class qo{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}}do(e,t,i){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return i&&i()}}accept(e,t,i){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,i)}toObservable(){switch(this.kind){case"N":return st(this.value);case"E":return zg(this.error);case"C":return fE()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new qo("N",e):qo.undefinedValueNotification}static createError(e){return new qo("E",void 0,e)}static createComplete(){return qo.completeNotification}}qo.completeNotification=new qo("C"),qo.undefinedValueNotification=new qo("N",void 0);class pE extends Rt{constructor(e,t,i=0){super(e),this.scheduler=t,this.delay=i}static dispatch(e){const{notification:t,destination:i}=e;t.observe(i),this.unsubscribe()}scheduleMessage(e){this.destination.add(this.scheduler.schedule(pE.dispatch,this.delay,new gte(e,this.destination)))}_next(e){this.scheduleMessage(qo.createNext(e))}_error(e){this.scheduleMessage(qo.createError(e)),this.unsubscribe()}_complete(){this.scheduleMessage(qo.createComplete()),this.unsubscribe()}}class gte{constructor(e,t){this.notification=e,this.destination=t}}class Hg extends we{constructor(e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,i){super(),this.scheduler=i,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=e<1?1:e,this._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(e){if(!this.isStopped){const t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}super.next(e)}nextTimeWindow(e){this.isStopped||(this._events.push(new mte(this._getNow(),e)),this._trimBufferThenGetEvents()),super.next(e)}_subscribe(e){const t=this._infiniteTimeWindow,i=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,s=i.length;let o;if(this.closed)throw new Gt;if(this.isStopped||this.hasError?o=Ie.EMPTY:(this.observers.push(e),o=new oi(this,e)),r&&e.add(e=new pE(e,r)),t)for(let a=0;at&&(o=Math.max(o,s-t)),o>0&&r.splice(0,o),r}}class mte{constructor(e,t){this.time=e,this.value=t}}function Ir(n,e){return"function"==typeof e?t=>t.pipe(Ir((i,r)=>li(n(i,r)).pipe(be((s,o)=>e(i,s,r,o))))):t=>t.lift(new _te(n))}class _te{constructor(e){this.project=e}call(e,t){return t.subscribe(new yte(e,this.project))}}class yte extends ei{constructor(e,t){super(e),this.project=t,this.index=0}_next(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this._innerSub(t)}_innerSub(e){const t=this.innerSubscription;t&&t.unsubscribe();const i=new $r(this),r=this.destination;r.add(i),this.innerSubscription=oo(e,i),this.innerSubscription!==i&&r.add(this.innerSubscription)}_complete(){const{innerSubscription:e}=this;(!e||e.closed)&&super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=void 0}notifyComplete(){this.innerSubscription=void 0,this.isStopped&&super._complete()}notifyNext(e){this.destination.next(e)}}const gE={schedule(n,e){const t=setTimeout(n,e);return()=>clearTimeout(t)},scheduleBeforeRender(n){if("undefined"==typeof window)return gE.schedule(n,0);if(void 0===window.requestAnimationFrame)return gE.schedule(n,16);const e=window.requestAnimationFrame(n);return()=>window.cancelAnimationFrame(e)}};let PD;function Ate(n,e,t){let i=t;return function(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}(n)&&e.some((r,s)=>!("*"===r||!function(n,e){if(!PD){const t=Element.prototype;PD=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE&&PD.call(n,e)}(n,r)||(i=s,0))),i}class Ote{constructor(e,t){this.componentFactory=t.get(ol).resolveComponentFactory(e)}create(e){return new Ite(this.componentFactory,e)}}class Ite{constructor(e,t){this.componentFactory=e,this.injector=t,this.eventEmitters=new Hg(1),this.events=this.eventEmitters.pipe(Ir(i=>ki(...i))),this.componentRef=null,this.viewChangeDetectorRef=null,this.inputChanges=null,this.hasInputChanges=!1,this.implementsOnChanges=!1,this.scheduledChangeDetectionFn=null,this.scheduledDestroyFn=null,this.initialInputValues=new Map,this.unchangedInputs=new Set(this.componentFactory.inputs.map(({propName:i})=>i)),this.ngZone=this.injector.get(lt),this.elementZone="undefined"==typeof Zone?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(null!==this.scheduledDestroyFn)return this.scheduledDestroyFn(),void(this.scheduledDestroyFn=null);null===this.componentRef&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{null===this.componentRef||null!==this.scheduledDestroyFn||(this.scheduledDestroyFn=gE.schedule(()=>{null!==this.componentRef&&(this.componentRef.destroy(),this.componentRef=null,this.viewChangeDetectorRef=null)},10))})}getInputValue(e){return this.runInZone(()=>null===this.componentRef?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){this.runInZone(()=>{null!==this.componentRef?function(n,e){return n===e||n!=n&&e!=e}(t,this.getInputValue(e))&&(void 0!==t||!this.unchangedInputs.has(e))||(this.recordInputChange(e,t),this.unchangedInputs.delete(e),this.hasInputChanges=!0,this.componentRef.instance[e]=t,this.scheduleDetectChanges()):this.initialInputValues.set(e,t)})}initializeComponent(e){const t=Tt.create({providers:[],parent:this.injector}),i=function(n,e){const t=n.childNodes,i=e.map(()=>[]);let r=-1;e.some((s,o)=>"*"===s&&(r=o,!0));for(let s=0,o=t.length;s{this.initialInputValues.has(e)&&this.setInputValue(e,this.initialInputValues.get(e))}),this.initialInputValues.clear()}initializeOutputs(e){const t=this.componentFactory.outputs.map(({propName:i,templateName:r})=>e.instance[i].pipe(be(o=>({name:r,value:o}))));this.eventEmitters.next(t)}callNgOnChanges(e){if(!this.implementsOnChanges||null===this.inputChanges)return;const t=this.inputChanges;this.inputChanges=null,e.instance.ngOnChanges(t)}markViewForCheck(e){this.hasInputChanges&&(this.hasInputChanges=!1,e.markForCheck())}scheduleDetectChanges(){this.scheduledChangeDetectionFn||(this.scheduledChangeDetectionFn=gE.scheduleBeforeRender(()=>{this.scheduledChangeDetectionFn=null,this.detectChanges()}))}recordInputChange(e,t){if(!this.implementsOnChanges)return;null===this.inputChanges&&(this.inputChanges={});const i=this.inputChanges[e];if(i)return void(i.currentValue=t);const r=this.unchangedInputs.has(e),s=r?void 0:this.getInputValue(e);this.inputChanges[e]=new h_(s,t,r)}detectChanges(){null!==this.componentRef&&(this.callNgOnChanges(this.componentRef),this.markViewForCheck(this.viewChangeDetectorRef),this.componentRef.changeDetectorRef.detectChanges())}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}}class Pte extends HTMLElement{constructor(){super(...arguments),this.ngElementEventsSubscription=null}}function Dt(n){return null!=n&&"false"!=`${n}`}function So(n,e=0){return function(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):e}function mE(n){return Array.isArray(n)?n:[n]}function jr(n){return null==n?"":"string"==typeof n?n:`${n}px`}function Hu(n){return n instanceof nt?n.nativeElement:n}const Tf=new Zl(hE);function $g(n,e=Tf){return t=>t.lift(new Nte(n,e))}class Nte{constructor(e,t){this.dueTime=e,this.scheduler=t}call(e,t){return t.subscribe(new Lte(e,this.dueTime,this.scheduler))}}class Lte extends Rt{constructor(e,t,i){super(e),this.dueTime=t,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null,this.hasValue=!1}_next(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Bte,this.dueTime,this))}_complete(){this.debouncedNext(),this.destination.complete()}debouncedNext(){if(this.clearDebounce(),this.hasValue){const{lastValue:e}=this;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}}clearDebounce(){const e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)}}function Bte(n){n.debouncedNext()}let RD=(()=>{class n{create(t){return"undefined"==typeof MutationObserver?null:new MutationObserver(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})(),W3=(()=>{class n{constructor(t){this._mutationObserverFactory=t,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((t,i)=>this._cleanupObserver(i))}observe(t){const i=Hu(t);return new oe(r=>{const o=this._observeElement(i).subscribe(r);return()=>{o.unsubscribe(),this._unobserveElement(i)}})}_observeElement(t){if(this._observedElements.has(t))this._observedElements.get(t).count++;else{const i=new we,r=this._mutationObserverFactory.create(s=>i.next(s));r&&r.observe(t,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(t,{observer:r,stream:i,count:1})}return this._observedElements.get(t).stream}_unobserveElement(t){this._observedElements.has(t)&&(this._observedElements.get(t).count--,this._observedElements.get(t).count||this._cleanupObserver(t))}_cleanupObserver(t){if(this._observedElements.has(t)){const{observer:i,stream:r}=this._observedElements.get(t);i&&i.disconnect(),r.complete(),this._observedElements.delete(t)}}}return n.\u0275fac=function(t){return new(t||n)(I(RD))},n.\u0275prov=ae({factory:function(){return new n(I(RD))},token:n,providedIn:"root"}),n})(),kD=(()=>{class n{constructor(t,i,r){this._contentObserver=t,this._elementRef=i,this._ngZone=r,this.event=new Pe,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(t){this._debounce=So(t),this._subscribe()}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?t.pipe($g(this.debounce)):t).subscribe(this.event)})}_unsubscribe(){var t;null===(t=this._currentSubscription)||void 0===t||t.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(W3),E(nt),E(lt))},n.\u0275dir=he({type:n,selectors:[["","cdkObserveContent",""]],inputs:{disabled:["cdkObserveContentDisabled","disabled"],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]}),n})(),_E=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[RD]}),n})();class sr extends we{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return t&&!t.closed&&e.next(this._value),t}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Gt;return this._value}next(e){super.next(this._value=e)}}function Yo(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}function Qd(){}function Di(n,e,t){return function(r){return r.lift(new Kte(n,e,t))}}class Kte{constructor(e,t,i){this.nextOrObserver=e,this.error=t,this.complete=i}call(e,t){return t.subscribe(new Zte(e,this.nextOrObserver,this.error,this.complete))}}class Zte extends Rt{constructor(e,t,i,r){super(e),this._tapNext=Qd,this._tapError=Qd,this._tapComplete=Qd,this._tapError=i||Qd,this._tapComplete=r||Qd,ft(t)?(this._context=this,this._tapNext=t):t&&(this._context=t,this._tapNext=t.next||Qd,this._tapError=t.error||Qd,this._tapComplete=t.complete||Qd)}_next(e){try{this._tapNext.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.next(e)}_error(e){try{this._tapError.call(this._context,e)}catch(t){return void this.destination.error(t)}this.destination.error(e)}_complete(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()}}function Tn(n,e){return function(i){return i.lift(new Qte(n,e))}}class Qte{constructor(e,t){this.predicate=e,this.thisArg=t}call(e,t){return t.subscribe(new Jte(e,this.predicate,this.thisArg))}}class Jte extends Rt{constructor(e,t,i){super(e),this.predicate=t,this.thisArg=i,this.count=0}_next(e){let t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(i){return void this.destination.error(i)}t&&this.destination.next(e)}}const K3=(()=>{function n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return n.prototype=Object.create(Error.prototype),n})();function _i(n){return e=>0===n?fE():e.lift(new ene(n))}class ene{constructor(e){if(this.total=e,this.total<0)throw new K3}call(e,t){return t.subscribe(new tne(e,this.total))}}class tne extends Rt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){const t=this.total,i=++this.count;i<=t&&(this.destination.next(e),i===t&&(this.destination.complete(),this.unsubscribe()))}}function VD(n){return e=>e.lift(new nne(n))}class nne{constructor(e){this.total=e}call(e,t){return t.subscribe(new ine(e,this.total))}}class ine extends Rt{constructor(e,t){super(e),this.total=t,this.count=0}_next(e){++this.count>this.total&&this.destination.next(e)}}function Xo(n,e){return t=>t.lift(new rne(n,e))}class rne{constructor(e,t){this.compare=e,this.keySelector=t}call(e,t){return t.subscribe(new sne(e,this.compare,this.keySelector))}}class sne extends Rt{constructor(e,t,i){super(e),this.keySelector=i,this.hasKey=!1,"function"==typeof t&&(this.compare=t)}compare(e,t){return e===t}_next(e){let t;try{const{keySelector:r}=this;t=r?r(e):e}catch(r){return this.destination.error(r)}let i=!1;if(this.hasKey)try{const{compare:r}=this;i=r(this.key,t)}catch(r){return this.destination.error(r)}else this.hasKey=!0;i||(this.key=t,this.destination.next(e))}}function zn(n){return e=>e.lift(new one(n))}class one{constructor(e){this.notifier=e}call(e,t){const i=new ane(e),r=oo(this.notifier,new $r(i));return r&&!i.seenValue?(i.add(r),t.subscribe(i)):i}}class ane extends ei{constructor(e){super(e),this.seenValue=!1}notifyNext(){this.seenValue=!0,this.complete()}notifyComplete(){}}let jD;try{jD="undefined"!=typeof Intl&&Intl.v8BreakIterator}catch(n){jD=!1}let qg,ii=(()=>{class n{constructor(t){this._platformId=t,this.isBrowser=this._platformId?xf(this._platformId):"object"==typeof document&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!(!window.chrome&&!jD)&&"undefined"!=typeof CSS&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}}return n.\u0275fac=function(t){return new(t||n)(I(cl))},n.\u0275prov=ae({factory:function(){return new n(I(cl))},token:n,providedIn:"root"}),n})(),Av=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const Z3=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function Q3(){if(qg)return qg;if("object"!=typeof document||!document)return qg=new Set(Z3),qg;let n=document.createElement("input");return qg=new Set(Z3.filter(e=>(n.setAttribute("type",e),n.type===e))),qg}let Dv,Af,UD;function Yg(n){return function(){if(null==Dv&&"undefined"!=typeof window)try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Dv=!0}))}finally{Dv=Dv||!1}return Dv}()?n:!!n.capture}function J3(){if(null==Af){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Af=!1,Af;if("scrollBehavior"in document.documentElement.style)Af=!0;else{const n=Element.prototype.scrollTo;Af=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return Af}function vE(){let n="undefined"!=typeof document&&document?document.activeElement:null;for(;n&&n.shadowRoot;){const e=n.shadowRoot.activeElement;if(e===n)break;n=e}return n}function Df(n){return n.composedPath?n.composedPath()[0]:n.target}function bE(n,e){return(n.getAttribute(e)||"").match(/\S+/g)||[]}const tV="cdk-describedby-message-container",nV="cdk-describedby-message",CE="cdk-describedby-host";let fne=0;const jc=new Map;let Ps=null,iV=(()=>{class n{constructor(t){this._document=t}describe(t,i,r){if(!this._canBeDescribed(t,i))return;const s=zD(i,r);"string"!=typeof i?(rV(i),jc.set(s,{messageElement:i,referenceCount:0})):jc.has(s)||this._createMessageElement(i,r),this._isElementDescribedByMessage(t,s)||this._addMessageReference(t,s)}removeDescription(t,i,r){if(!i||!this._isElementNode(t))return;const s=zD(i,r);if(this._isElementDescribedByMessage(t,s)&&this._removeMessageReference(t,s),"string"==typeof i){const o=jc.get(s);o&&0===o.referenceCount&&this._deleteMessageElement(s)}Ps&&0===Ps.childNodes.length&&this._deleteMessagesContainer()}ngOnDestroy(){const t=this._document.querySelectorAll(`[${CE}]`);for(let i=0;i0!=r.indexOf(nV));t.setAttribute("aria-describedby",i.join(" "))}_addMessageReference(t,i){const r=jc.get(i);(function(n,e,t){const i=bE(n,e);i.some(r=>r.trim()==t.trim())||(i.push(t.trim()),n.setAttribute(e,i.join(" ")))})(t,"aria-describedby",r.messageElement.id),t.setAttribute(CE,""),r.referenceCount++}_removeMessageReference(t,i){const r=jc.get(i);r.referenceCount--,function(n,e,t){const r=bE(n,e).filter(s=>s!=t.trim());r.length?n.setAttribute(e,r.join(" ")):n.removeAttribute(e)}(t,"aria-describedby",r.messageElement.id),t.removeAttribute(CE)}_isElementDescribedByMessage(t,i){const r=bE(t,"aria-describedby"),s=jc.get(i),o=s&&s.messageElement.id;return!!o&&-1!=r.indexOf(o)}_canBeDescribed(t,i){if(!this._isElementNode(t))return!1;if(i&&"object"==typeof i)return!0;const r=null==i?"":`${i}`.trim(),s=t.getAttribute("aria-label");return!(!r||s&&s.trim()===r)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})();function zD(n,e){return"string"==typeof n?`${e||""}/${n}`:n}function rV(n){n.id||(n.id=`${nV}-${fne++}`)}class sV{constructor(e){this._items=e,this._activeItemIndex=-1,this._activeItem=null,this._wrap=!1,this._letterKeyStream=new we,this._typeaheadSubscription=Ie.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._skipPredicateFn=t=>t.disabled,this._pressedLetters=[],this.tabOut=new we,this.change=new we,e instanceof bf&&e.changes.subscribe(t=>{if(this._activeItem){const r=t.toArray().indexOf(this._activeItem);r>-1&&r!==this._activeItemIndex&&(this._activeItemIndex=r)}})}skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){return this._typeaheadSubscription.unsubscribe(),this._typeaheadSubscription=this._letterKeyStream.pipe(Di(t=>this._pressedLetters.push(t)),$g(e),Tn(()=>this._pressedLetters.length>0),be(()=>this._pressedLetters.join(""))).subscribe(t=>{const i=this._getItemsArray();for(let r=1;r!e[s]||this._allowedModifierKeys.indexOf(s)>-1);switch(t){case 9:return void this.tabOut.next();case 40:if(this._vertical&&r){this.setNextItemActive();break}return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&r){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&r){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}return;default:return void((r||Yo(e,"shiftKey"))&&(e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))))}this._pressedLetters=[],e.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem}isTyping(){return this._pressedLetters.length>0}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._items.length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(e){const t=this._getItemsArray(),i="number"==typeof e?e:t.indexOf(e),r=t[i];this._activeItem=null==r?null:r,this._activeItemIndex=i}_setActiveItemByDelta(e){this._wrap?this._setActiveInWrapMode(e):this._setActiveInDefaultMode(e)}_setActiveInWrapMode(e){const t=this._getItemsArray();for(let i=1;i<=t.length;i++){const r=(this._activeItemIndex+e*i+t.length)%t.length;if(!this._skipPredicateFn(t[r]))return void this.setActiveItem(r)}}_setActiveInDefaultMode(e){this._setActiveItemByIndex(this._activeItemIndex+e,e)}_setActiveItemByIndex(e,t){const i=this._getItemsArray();if(i[e]){for(;this._skipPredicateFn(i[e]);)if(!i[e+=t])return;this.setActiveItem(e)}}_getItemsArray(){return this._items instanceof bf?this._items.toArray():this._items}}class oV extends sV{setActiveItem(e){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(e),this.activeItem&&this.activeItem.setActiveStyles()}}class aV extends sV{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}}let lV=(()=>{class n{constructor(t){this._platform=t}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return function(n){return!!(n.offsetWidth||n.offsetHeight||"function"==typeof n.getClientRects&&n.getClientRects().length)}(t)&&"visible"===getComputedStyle(t).visibility}isTabbable(t){if(!this._platform.isBrowser)return!1;const i=function(n){try{return n.frameElement}catch(e){return null}}(function(n){return n.ownerDocument&&n.ownerDocument.defaultView||window}(t));if(i&&(-1===uV(i)||!this.isVisible(i)))return!1;let r=t.nodeName.toLowerCase(),s=uV(t);return t.hasAttribute("contenteditable")?-1!==s:!("iframe"===r||"object"===r||this._platform.WEBKIT&&this._platform.IOS&&!function(n){let e=n.nodeName.toLowerCase(),t="input"===e&&n.type;return"text"===t||"password"===t||"select"===e||"textarea"===e}(t))&&("audio"===r?!!t.hasAttribute("controls")&&-1!==s:"video"===r?-1!==s&&(null!==s||this._platform.FIREFOX||t.hasAttribute("controls")):t.tabIndex>=0)}isFocusable(t,i){return function(n){return!function(n){return function(n){return"input"==n.nodeName.toLowerCase()}(n)&&"hidden"==n.type}(n)&&(function(n){let e=n.nodeName.toLowerCase();return"input"===e||"select"===e||"button"===e||"textarea"===e}(n)||function(n){return function(n){return"a"==n.nodeName.toLowerCase()}(n)&&n.hasAttribute("href")}(n)||n.hasAttribute("contenteditable")||cV(n))}(t)&&!this.isDisabled(t)&&((null==i?void 0:i.ignoreVisibility)||this.isVisible(t))}}return n.\u0275fac=function(t){return new(t||n)(I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(ii))},token:n,providedIn:"root"}),n})();function cV(n){if(!n.hasAttribute("tabindex")||void 0===n.tabIndex)return!1;let e=n.getAttribute("tabindex");return"-32768"!=e&&!(!e||isNaN(parseInt(e,10)))}function uV(n){if(!cV(n))return null;const e=parseInt(n.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}class Sne{constructor(e,t,i,r,s=!1){this._element=e,this._checker=t,this._ngZone=i,this._document=r,this._hasAttached=!1,this.startAnchorListener=()=>this.focusLastTabbableElement(),this.endAnchorListener=()=>this.focusFirstTabbableElement(),this._enabled=!0,s||this.attachAnchors()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}destroy(){const e=this._startAnchor,t=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.parentNode&&e.parentNode.removeChild(e)),t&&(t.removeEventListener("focus",this.endAnchorListener),t.parentNode&&t.parentNode.removeChild(t)),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let t=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);for(let i=0;i=0;i--){let r=t[i].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[i]):null;if(r)return r}return null}_createAnchor(){const e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e}_toggleAnchorTabIndex(e,t){e?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._ngZone.isStable?e():this._ngZone.onStable.pipe(_i(1)).subscribe(e)}}let dV=(()=>{class n{constructor(t,i,r){this._checker=t,this._ngZone=i,this._document=r}create(t,i=!1){return new Sne(t,this._checker,this._ngZone,this._document,i)}}return n.\u0275fac=function(t){return new(t||n)(I(lV),I(lt),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(lV),I(lt),I(rt))},token:n,providedIn:"root"}),n})();function hV(n){return 0===n.offsetX&&0===n.offsetY}function fV(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}"undefined"!=typeof Element&∈const pV=new _e("cdk-input-modality-detector-options"),Dne={ignoreKeys:[18,17,224,91,16]},Xg=Yg({passive:!0,capture:!0});let mV=(()=>{class n{constructor(t,i,r,s){this._platform=t,this._mostRecentTarget=null,this._modality=new sr(null),this._lastTouchMs=0,this._onKeydown=o=>{var a,l;(null===(l=null===(a=this._options)||void 0===a?void 0:a.ignoreKeys)||void 0===l?void 0:l.some(c=>c===o.keyCode))||(this._modality.next("keyboard"),this._mostRecentTarget=Df(o))},this._onMousedown=o=>{Date.now()-this._lastTouchMs<650||(this._modality.next(hV(o)?"keyboard":"mouse"),this._mostRecentTarget=Df(o))},this._onTouchstart=o=>{fV(o)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Df(o))},this._options=Object.assign(Object.assign({},Dne),s),this.modalityDetected=this._modality.pipe(VD(1)),this.modalityChanged=this.modalityDetected.pipe(Xo()),t.isBrowser&&i.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,Xg),r.addEventListener("mousedown",this._onMousedown,Xg),r.addEventListener("touchstart",this._onTouchstart,Xg)})}get mostRecentModality(){return this._modality.value}ngOnDestroy(){!this._platform.isBrowser||(document.removeEventListener("keydown",this._onKeydown,Xg),document.removeEventListener("mousedown",this._onMousedown,Xg),document.removeEventListener("touchstart",this._onTouchstart,Xg))}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt),I(rt),I(pV,8))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt),I(rt),I(pV,8))},token:n,providedIn:"root"}),n})();const _V=new _e("liveAnnouncerElement",{providedIn:"root",factory:function(){return null}}),yV=new _e("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let wE=(()=>{class n{constructor(t,i,r,s){this._ngZone=i,this._defaultOptions=s,this._document=r,this._liveElement=t||this._createLiveElement()}announce(t,...i){const r=this._defaultOptions;let s,o;return 1===i.length&&"number"==typeof i[0]?o=i[0]:[s,o]=i,this.clear(),clearTimeout(this._previousTimeout),s||(s=r&&r.politeness?r.politeness:"polite"),null==o&&r&&(o=r.duration),this._liveElement.setAttribute("aria-live",s),this._ngZone.runOutsideAngular(()=>new Promise(a=>{clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,a(),"number"==typeof o&&(this._previousTimeout=setTimeout(()=>this.clear(),o))},100)}))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement&&this._liveElement.parentNode&&(this._liveElement.parentNode.removeChild(this._liveElement),this._liveElement=null)}_createLiveElement(){const t="cdk-live-announcer-element",i=this._document.getElementsByClassName(t),r=this._document.createElement("div");for(let s=0;s{class n{constructor(t,i,r,s,o){this._ngZone=t,this._platform=i,this._inputModalityDetector=r,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new we,this._rootNodeFocusAndBlurListener=a=>{const l=Df(a),c="focus"===a.type?this._onFocus:this._onBlur;for(let d=l;d;d=d.parentElement)c.call(this,a,d)},this._document=s,this._detectionMode=(null==o?void 0:o.detectionMode)||0}monitor(t,i=!1){const r=Hu(t);if(!this._platform.isBrowser||1!==r.nodeType)return st(null);const s=function(n){if(function(){if(null==UD){const n="undefined"!=typeof document?document.head:null;UD=!(!n||!n.createShadowRoot&&!n.attachShadow)}return UD}()){const e=n.getRootNode?n.getRootNode():null;if("undefined"!=typeof ShadowRoot&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}(r)||this._getDocument(),o=this._elementInfo.get(r);if(o)return i&&(o.checkChildren=!0),o.subject;const a={checkChildren:i,subject:new we,rootNode:s};return this._elementInfo.set(r,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const i=Hu(t),r=this._elementInfo.get(i);r&&(r.subject.complete(),this._setClasses(i),this._elementInfo.delete(i),this._removeGlobalListeners(r))}focusVia(t,i,r){const s=Hu(t);s===this._getDocument().activeElement?this._getClosestElementsInfo(s).forEach(([a,l])=>this._originChanged(a,i,l)):(this._setOrigin(i),"function"==typeof s.focus&&s.focus(r))}ngOnDestroy(){this._elementInfo.forEach((t,i)=>this.stopMonitoring(i))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_toggleClass(t,i,r){r?t.classList.add(i):t.classList.remove(i)}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:"program"}_shouldBeAttributedToTouch(t){return 1===this._detectionMode||!!(null==t?void 0:t.contains(this._inputModalityDetector._mostRecentTarget))}_setClasses(t,i){this._toggleClass(t,"cdk-focused",!!i),this._toggleClass(t,"cdk-touch-focused","touch"===i),this._toggleClass(t,"cdk-keyboard-focused","keyboard"===i),this._toggleClass(t,"cdk-mouse-focused","mouse"===i),this._toggleClass(t,"cdk-program-focused","program"===i)}_setOrigin(t,i=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&i,0===this._detectionMode&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,i){const r=this._elementInfo.get(i),s=Df(t);!r||!r.checkChildren&&i!==s||this._originChanged(i,this._getFocusOrigin(s),r)}_onBlur(t,i){const r=this._elementInfo.get(i);!r||r.checkChildren&&t.relatedTarget instanceof Node&&i.contains(t.relatedTarget)||(this._setClasses(i),this._emitOrigin(r.subject,null))}_emitOrigin(t,i){this._ngZone.run(()=>t.next(i))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const i=t.rootNode,r=this._rootNodeFocusListenerCount.get(i)||0;r||this._ngZone.runOutsideAngular(()=>{i.addEventListener("focus",this._rootNodeFocusAndBlurListener,EE),i.addEventListener("blur",this._rootNodeFocusAndBlurListener,EE)}),this._rootNodeFocusListenerCount.set(i,r+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(zn(this._stopInputModalityDetector)).subscribe(s=>{this._setOrigin(s,!0)}))}_removeGlobalListeners(t){const i=t.rootNode;if(this._rootNodeFocusListenerCount.has(i)){const r=this._rootNodeFocusListenerCount.get(i);r>1?this._rootNodeFocusListenerCount.set(i,r-1):(i.removeEventListener("focus",this._rootNodeFocusAndBlurListener,EE),i.removeEventListener("blur",this._rootNodeFocusAndBlurListener,EE),this._rootNodeFocusListenerCount.delete(i))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,i,r){this._setClasses(t,i),this._emitOrigin(r.subject,i),this._lastFocusOrigin=i}_getClosestElementsInfo(t){const i=[];return this._elementInfo.forEach((r,s)=>{(s===t||r.checkChildren&&s.contains(t))&&i.push([s,r])}),i}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(ii),I(mV),I(rt,8),I(vV,8))},n.\u0275prov=ae({factory:function(){return new n(I(lt),I(ii),I(mV),I(rt,8),I(vV,8))},token:n,providedIn:"root"}),n})();const bV="cdk-high-contrast-black-on-white",CV="cdk-high-contrast-white-on-black",HD="cdk-high-contrast-active";let wV=(()=>{class n{constructor(t,i){this._platform=t,this._document=i}getHighContrastMode(){if(!this._platform.isBrowser)return 0;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const i=this._document.defaultView||window,r=i&&i.getComputedStyle?i.getComputedStyle(t):null,s=(r&&r.backgroundColor||"").replace(/ /g,"");switch(this._document.body.removeChild(t),s){case"rgb(0,0,0)":return 2;case"rgb(255,255,255)":return 1}return 0}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(HD),t.remove(bV),t.remove(CV),this._hasCheckedHighContrastMode=!0;const i=this.getHighContrastMode();1===i?(t.add(HD),t.add(bV)):2===i&&(t.add(HD),t.add(CV))}}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(rt))},token:n,providedIn:"root"}),n})(),Ine=(()=>{class n{constructor(t){t._applyBodyHighContrastModeCssClasses()}}return n.\u0275fac=function(t){return new(t||n)(I(wV))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Av,_E]]}),n})();const EV=new _e("cdk-dir-doc",{providedIn:"root",factory:function(){return Ac(rt)}});let Ko=(()=>{class n{constructor(t){if(this.value="ltr",this.change=new Pe,t){const r=t.documentElement?t.documentElement.dir:null,s=(t.body?t.body.dir:null)||r;this.value="ltr"===s||"rtl"===s?s:"ltr"}}ngOnDestroy(){this.change.complete()}}return n.\u0275fac=function(t){return new(t||n)(I(EV,8))},n.\u0275prov=ae({factory:function(){return new n(I(EV,8))},token:n,providedIn:"root"}),n})(),Iv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const SV=new Lu("12.2.5");class MV{}const $u="*";function Jl(n,e){return{type:7,name:n,definitions:e,options:{}}}function Mo(n,e=null){return{type:4,styles:e,timings:n}}function xV(n,e=null){return{type:2,steps:n,options:e}}function Kn(n){return{type:6,styles:n,offset:null}}function br(n,e,t){return{type:0,name:n,styles:e,options:t}}function kne(n){return{type:5,steps:n}}function Qs(n,e,t=null){return{type:1,expr:n,animation:e,options:t}}function Fne(n=null){return{type:9,options:n}}function Nne(n,e,t=null){return{type:11,selector:n,animation:e,options:t}}function TV(n){Promise.resolve(null).then(n)}class Kg{constructor(e=0,t=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){TV(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class AV{constructor(e){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;let t=0,i=0,r=0;const s=this.players.length;0==s?TV(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++i==s&&this._onDestroy()}),o.onStart(()=>{++r==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(i=>{const r=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(r)})}getPosition(){const e=this.players.reduce((t,i)=>null===t||i.totalTime>t.totalTime?i:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}function DV(){return"undefined"!=typeof window&&void 0!==window.document}function GD(){return"undefined"!=typeof process&&"[object process]"==={}.toString.call(process)}function Jd(n){switch(n.length){case 0:return new Kg;case 1:return n[0];default:return new AV(n)}}function OV(n,e,t,i,r={},s={}){const o=[],a=[];let l=-1,c=null;if(i.forEach(d=>{const f=d.offset,p=f==l,g=p&&c||{};Object.keys(d).forEach(_=>{let y=_,v=d[_];if("offset"!==_)switch(y=e.normalizePropertyName(y,o),v){case"!":v=r[_];break;case $u:v=s[_];break;default:v=e.normalizeStyleValue(_,y,v,o)}g[y]=v}),p||a.push(g),c=g,l=f}),o.length){const d="\n - ";throw new Error(`Unable to animate due to the following errors:${d}${o.join(d)}`)}return a}function WD(n,e,t,i){switch(e){case"start":n.onStart(()=>i(t&&qD(t,"start",n)));break;case"done":n.onDone(()=>i(t&&qD(t,"done",n)));break;case"destroy":n.onDestroy(()=>i(t&&qD(t,"destroy",n)))}}function qD(n,e,t){const i=t.totalTime,s=YD(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,null==i?n.totalTime:i,!!t.disabled),o=n._data;return null!=o&&(s._data=o),s}function YD(n,e,t,i,r="",s=0,o){return{element:n,triggerName:e,fromState:t,toState:i,phaseName:r,totalTime:s,disabled:!!o}}function wa(n,e,t){let i;return n instanceof Map?(i=n.get(e),i||n.set(e,i=t)):(i=n[e],i||(i=n[e]=t)),i}function IV(n){const e=n.indexOf(":");return[n.substring(1,e),n.substr(e+1)]}let XD=(n,e)=>!1,KD=(n,e)=>!1,PV=(n,e,t)=>[];const RV=GD();(RV||"undefined"!=typeof Element)&&(XD=DV()?(n,e)=>{for(;e&&e!==document.documentElement;){if(e===n)return!0;e=e.parentNode||e.host}return!1}:(n,e)=>n.contains(e),KD=(()=>{if(RV||Element.prototype.matches)return(n,e)=>n.matches(e);{const n=Element.prototype,e=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector;return e?(t,i)=>e.apply(t,[i]):KD}})(),PV=(n,e,t)=>{let i=[];if(t){const r=n.querySelectorAll(e);for(let s=0;s{const i=t.replace(/([a-z])([A-Z])/g,"$1-$2");e[i]=n[t]}),e}let NV=(()=>{class n{validateStyleProperty(t){return ZD(t)}matchesElement(t,i){return QD(t,i)}containsElement(t,i){return JD(t,i)}query(t,i,r){return eO(t,i,r)}computeStyle(t,i,r){return r||""}animate(t,i,r,s,o,a=[],l){return new Kg(r,s)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class SE{}SE.NOOP=new NV;const tO="ng-enter",ME="ng-leave",xE="ng-trigger",TE=".ng-trigger",BV="ng-animating",nO=".ng-animating";function If(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:iO(parseFloat(e[1]),e[2])}function iO(n,e){switch(e){case"s":return 1e3*n;default:return n}}function AE(n,e,t){return n.hasOwnProperty("duration")?n:function(n,e,t){let r,s=0,o="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return e.push(`The provided timing value "${n}" is invalid.`),{duration:0,delay:0,easing:""};r=iO(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(s=iO(parseFloat(l),a[4]));const c=a[5];c&&(o=c)}else r=n;if(!t){let a=!1,l=e.length;r<0&&(e.push("Duration values below 0 are not allowed for this animation step."),a=!0),s<0&&(e.push("Delay values below 0 are not allowed for this animation step."),a=!0),a&&e.splice(l,0,`The provided timing value "${n}" is invalid.`)}return{duration:r,delay:s,easing:o}}(n,e,t)}function Zg(n,e={}){return Object.keys(n).forEach(t=>{e[t]=n[t]}),e}function eh(n,e,t={}){if(e)for(let i in n)t[i]=n[i];else Zg(n,t);return t}function jV(n,e,t){return t?e+":"+t+";":""}function UV(n){let e="";for(let t=0;t{const r=sO(i);t&&!t.hasOwnProperty(i)&&(t[i]=n.style[r]),n.style[r]=e[i]}),GD()&&UV(n))}function Pf(n,e){n.style&&(Object.keys(e).forEach(t=>{const i=sO(t);n.style[i]=""}),GD()&&UV(n))}function Pv(n){return Array.isArray(n)?1==n.length?n[0]:xV(n):n}const rO=new RegExp("{{\\s*(.+?)\\s*}}","g");function zV(n){let e=[];if("string"==typeof n){let t;for(;t=rO.exec(n);)e.push(t[1]);rO.lastIndex=0}return e}function DE(n,e,t){const i=n.toString(),r=i.replace(rO,(s,o)=>{let a=e[o];return e.hasOwnProperty(o)||(t.push(`Please provide a value for the animation param ${o}`),a=""),a.toString()});return r==i?n:r}function OE(n){const e=[];let t=n.next();for(;!t.done;)e.push(t.value),t=n.next();return e}const Hne=/-+([a-z0-9])/g;function sO(n){return n.replace(Hne,(...e)=>e[1].toUpperCase())}function $ne(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function HV(n,e){return 0===n||0===e}function $V(n,e,t){const i=Object.keys(t);if(i.length&&e.length){let s=e[0],o=[];if(i.forEach(a=>{s.hasOwnProperty(a)||o.push(a),s[a]=t[a]}),o.length)for(var r=1;rfunction(n,e,t){if(":"==n[0]){const l=function(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i) *"}}(n,t);if("function"==typeof l)return void e.push(l);n=l}const i=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return t.push(`The provided transition expression "${n}" is not supported`),e;const r=i[1],s=i[2],o=i[3];e.push(GV(r,o));"<"==s[0]&&!("*"==r&&"*"==o)&&e.push(GV(o,r))}(i,t,e)):t.push(n),t}const PE=new Set(["true","1"]),RE=new Set(["false","0"]);function GV(n,e){const t=PE.has(n)||RE.has(n),i=PE.has(e)||RE.has(e);return(r,s)=>{let o="*"==n||n==r,a="*"==e||e==s;return!o&&t&&"boolean"==typeof r&&(o=r?PE.has(n):RE.has(n)),!a&&i&&"boolean"==typeof s&&(a=s?PE.has(e):RE.has(e)),o&&a}}const Yne=new RegExp("s*:selfs*,?","g");function aO(n,e,t){return new Xne(n).build(e,t)}class Xne{constructor(e){this._driver=e}build(e,t){const i=new Qne(t);return this._resetContextStyleTimingState(i),Ea(this,Pv(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles={},e.collectedStyles[""]={},e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,r=t.depCount=0;const s=[],o=[];return"@"==e.name.charAt(0)&&t.errors.push("animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),0==a.type){const l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,s.push(this.visitState(l,t))}),l.name=c}else if(1==a.type){const l=this.visitTransition(a,t);i+=l.queryCount,r+=l.depCount,o.push(l)}else t.errors.push("only state() and transition() definitions can sit inside of a trigger()")}),{type:7,name:e.name,states:s,transitions:o,queryCount:i,depCount:r,options:null}}visitState(e,t){const i=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(i.containsDynamicStyles){const s=new Set,o=r||{};if(i.styles.forEach(a=>{if(kE(a)){const l=a;Object.keys(l).forEach(c=>{zV(l[c]).forEach(d=>{o.hasOwnProperty(d)||s.add(d)})})}}),s.size){const a=OE(s.values());t.errors.push(`state("${e.name}", ...) must define default values for all the following style substitutions: ${a.join(", ")}`)}}return{type:0,name:e.name,style:i,options:r?{params:r}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const i=Ea(this,Pv(e.animation),t);return{type:1,matchers:Gne(e.expr,t.errors),animation:i,queryCount:t.queryCount,depCount:t.depCount,options:Rf(e.options)}}visitSequence(e,t){return{type:2,steps:e.steps.map(i=>Ea(this,i,t)),options:Rf(e.options)}}visitGroup(e,t){const i=t.currentTime;let r=0;const s=e.steps.map(o=>{t.currentTime=i;const a=Ea(this,o,t);return r=Math.max(r,t.currentTime),a});return t.currentTime=r,{type:3,steps:s,options:Rf(e.options)}}visitAnimate(e,t){const i=function(n,e){let t=null;if(n.hasOwnProperty("duration"))t=n;else if("number"==typeof n)return lO(AE(n,e).duration,0,"");const i=n;if(i.split(/\s+/).some(s=>"{"==s.charAt(0)&&"{"==s.charAt(1))){const s=lO(0,0,"");return s.dynamic=!0,s.strValue=i,s}return t=t||AE(i,e),lO(t.duration,t.delay,t.easing)}(e.timings,t.errors);t.currentAnimateTimings=i;let r,s=e.styles?e.styles:Kn({});if(5==s.type)r=this.visitKeyframes(s,t);else{let o=e.styles,a=!1;if(!o){a=!0;const c={};i.easing&&(c.easing=i.easing),o=Kn(c)}t.currentTime+=i.duration+i.delay;const l=this.visitStyle(o,t);l.isEmptyStep=a,r=l}return t.currentAnimateTimings=null,{type:4,timings:i,style:r,options:null}}visitStyle(e,t){const i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){const i=[];Array.isArray(e.styles)?e.styles.forEach(o=>{"string"==typeof o?o==$u?i.push(o):t.errors.push(`The provided style string value ${o} is not allowed.`):i.push(o)}):i.push(e.styles);let r=!1,s=null;return i.forEach(o=>{if(kE(o)){const a=o,l=a.easing;if(l&&(s=l,delete a.easing),!r)for(let c in a)if(a[c].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:i,easing:s,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){const i=t.currentAnimateTimings;let r=t.currentTime,s=t.currentTime;i&&s>0&&(s-=i.duration+i.delay),e.styles.forEach(o=>{"string"!=typeof o&&Object.keys(o).forEach(a=>{if(!this._driver.validateStyleProperty(a))return void t.errors.push(`The provided animation property "${a}" is not a supported CSS property for animations`);const l=t.collectedStyles[t.currentQuerySelector],c=l[a];let d=!0;c&&(s!=r&&s>=c.startTime&&r<=c.endTime&&(t.errors.push(`The CSS property "${a}" that exists between the times of "${c.startTime}ms" and "${c.endTime}ms" is also being animated in a parallel animation between the times of "${s}ms" and "${r}ms"`),d=!1),s=c.startTime),d&&(l[a]={startTime:s,endTime:r}),t.options&&function(n,e,t){const i=e.params||{},r=zV(n);r.length&&r.forEach(s=>{i.hasOwnProperty(s)||t.push(`Unable to resolve the local animation param ${s} in the given list of values`)})}(o[a],t.options,t.errors)})})}visitKeyframes(e,t){const i={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),i;let s=0;const o=[];let a=!1,l=!1,c=0;const d=e.steps.map(w=>{const C=this._makeStyleAst(w,t);let x=null!=C.offset?C.offset:function(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(kE(t)&&t.hasOwnProperty("offset")){const i=t;e=parseFloat(i.offset),delete i.offset}});else if(kE(n)&&n.hasOwnProperty("offset")){const t=n;e=parseFloat(t.offset),delete t.offset}return e}(C.styles),L=0;return null!=x&&(s++,L=C.offset=x),l=l||L<0||L>1,a=a||L0&&s{const x=p>0?C==g?1:p*C:o[C],L=x*v;t.currentTime=_+y.delay+L,y.duration=L,this._validateStyleAst(w,t),w.offset=x,i.styles.push(w)}),i}visitReference(e,t){return{type:8,animation:Ea(this,Pv(e.animation),t),options:Rf(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:9,options:Rf(e.options)}}visitAnimateRef(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:Rf(e.options)}}visitQuery(e,t){const i=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;const[s,o]=function(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(Yne,"")),[n=n.replace(/@\*/g,TE).replace(/@\w+/g,t=>TE+"-"+t.substr(1)).replace(/:animating/g,nO),e]}(e.selector);t.currentQuerySelector=i.length?i+" "+s:s,wa(t.collectedStyles,t.currentQuerySelector,{});const a=Ea(this,Pv(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:11,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:Rf(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");const i="full"===e.timings?{duration:0,delay:0,easing:"full"}:AE(e.timings,t.errors,!0);return{type:12,animation:Ea(this,Pv(e.animation),t),timings:i,options:null}}}class Qne{constructor(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}function kE(n){return!Array.isArray(n)&&"object"==typeof n}function Rf(n){return n?(n=Zg(n)).params&&(n.params=function(n){return n?Zg(n):null}(n.params)):n={},n}function lO(n,e,t){return{duration:n,delay:e,easing:t}}function cO(n,e,t,i,r,s,o=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:i,duration:r,delay:s,totalTime:r+s,easing:o,subTimeline:a}}class FE{constructor(){this._map=new Map}consume(e){let t=this._map.get(e);return t?this._map.delete(e):t=[],t}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const iie=new RegExp(":enter","g"),sie=new RegExp(":leave","g");function uO(n,e,t,i,r,s={},o={},a,l,c=[]){return(new oie).buildKeyframes(n,e,t,i,r,s,o,a,l,c)}class oie{buildKeyframes(e,t,i,r,s,o,a,l,c,d=[]){c=c||new FE;const f=new dO(e,t,c,r,s,d,[]);f.options=l,f.currentTimeline.setStyles([o],null,f.errors,l),Ea(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&Object.keys(a).length){const g=p[p.length-1];g.allowOnlyTimelineStyles()||g.setStyles([a],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[cO(t,[],[],[],0,0,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const i=t.subInstructions.consume(t.element);if(i){const r=t.createSubContext(e.options),s=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,r,r.options);s!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){const i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_visitSubInstructions(e,t,i){let s=t.currentTimeline.currentTime;const o=null!=i.duration?If(i.duration):null,a=null!=i.delay?If(i.delay):null;return 0!==o&&e.forEach(l=>{const c=t.appendInstructionToTimeline(l,o,a);s=Math.max(s,c.duration+c.delay)}),s}visitReference(e,t){t.updateOptions(e.options,!0),Ea(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const i=t.subContextCount;let r=t;const s=e.options;if(s&&(s.params||s.delay)&&(r=t.createSubContext(s),r.transformIntoNewTimeline(),null!=s.delay)){6==r.previousNode.type&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=NE);const o=If(s.delay);r.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>Ea(this,o,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>i&&r.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const i=[];let r=t.currentTimeline.currentTime;const s=e.options&&e.options.delay?If(e.options.delay):0;e.steps.forEach(o=>{const a=t.createSubContext(e.options);s&&a.delayNextStep(s),Ea(this,o,a),r=Math.max(r,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(r),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const i=e.strValue;return AE(t.params?DE(i,t.params,t.errors):i,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const i=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),r.snapshotCurrentStyles());const s=e.style;5==s.type?this.visitKeyframes(s,t):(t.incrementTime(i.duration),this.visitStyle(s,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const i=t.currentTimeline,r=t.currentAnimateTimings;!r&&i.getCurrentStyleProperties().length&&i.forwardFrame();const s=r&&r.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(s):i.setStyles(e.styles,s,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const i=t.currentAnimateTimings,r=t.currentTimeline.duration,s=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{a.forwardTime((l.offset||0)*s),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(r+s),t.previousNode=e}visitQuery(e,t){const i=t.currentTimeline.currentTime,r=e.options||{},s=r.delay?If(r.delay):0;s&&(6===t.previousNode.type||0==i&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=NE);let o=i;const a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,d)=>{t.currentQueryIndex=d;const f=t.createSubContext(e.options,c);s&&f.delayNextStep(s),c===t.element&&(l=f.currentTimeline),Ea(this,e.animation,f),f.currentTimeline.applyStylesToKeyframe(),o=Math.max(o,f.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const i=t.parentContext,r=t.currentTimeline,s=e.timings,o=Math.abs(s.duration),a=o*(t.currentQueryTotal-1);let l=o*t.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime}const d=t.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;Ea(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=r.currentTime-f+(r.startTime-i.currentTimeline.startTime)}}const NE={};class dO{constructor(e,t,i,r,s,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=r,this._leaveClassName=s,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=NE,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new LE(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const i=e;let r=this.options;null!=i.duration&&(r.duration=If(i.duration)),null!=i.delay&&(r.delay=If(i.delay));const s=i.params;if(s){let o=r.params;o||(o=this.options.params={}),Object.keys(s).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=DE(s[a],o,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const i=e.params={};Object.keys(t).forEach(r=>{i[r]=t[r]})}}return e}createSubContext(e=null,t,i){const r=t||this.element,s=new dO(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,i||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(e),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(e){return this.previousNode=NE,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){const r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=i?i:0)+e.delay,easing:""},s=new aie(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,r,s,o){let a=[];if(r&&a.push(this.element),e.length>0){e=(e=e.replace(iie,"."+this._enterClassName)).replace(sie,"."+this._leaveClassName);let c=this._driver.query(this.element,e,1!=i);0!==i&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!s&&0==a.length&&o.push(`\`query("${t}")\` returned zero elements. (Use \`query("${t}", { optional: true })\` if you wish to allow this.)`),a}}class LE{constructor(e,t,i,r){this._driver=e,this.element=t,this.startTime=i,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}}getCurrentStyleProperties(){return Object.keys(this._currentKeyframe)}get currentTime(){return this.startTime+this.duration}delayNextStep(e){const t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new LE(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(t=>{this._backFill[t]=this._globalTimelineStyles[t]||$u,this._currentKeyframe[t]=$u}),this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,r){t&&(this._previousKeyframe.easing=t);const s=r&&r.params||{},o=function(n,e){const t={};let i;return n.forEach(r=>{"*"===r?(i=i||Object.keys(e),i.forEach(s=>{t[s]=$u})):eh(r,!1,t)}),t}(e,this._globalTimelineStyles);Object.keys(o).forEach(a=>{const l=DE(o[a],s,i);this._pendingStyles[a]=l,this._localTimelineStyles.hasOwnProperty(a)||(this._backFill[a]=this._globalTimelineStyles.hasOwnProperty(a)?this._globalTimelineStyles[a]:$u),this._updateStyle(a,l)})}applyStylesToKeyframe(){const e=this._pendingStyles,t=Object.keys(e);0!=t.length&&(this._pendingStyles={},t.forEach(i=>{this._currentKeyframe[i]=e[i]}),Object.keys(this._localTimelineStyles).forEach(i=>{this._currentKeyframe.hasOwnProperty(i)||(this._currentKeyframe[i]=this._localTimelineStyles[i])}))}snapshotCurrentStyles(){Object.keys(this._localTimelineStyles).forEach(e=>{const t=this._localTimelineStyles[e];this._pendingStyles[e]=t,this._updateStyle(e,t)})}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){Object.keys(e._styleSummary).forEach(t=>{const i=this._styleSummary[t],r=e._styleSummary[t];(!i||r.time>i.time)&&this._updateStyle(t,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,i=1===this._keyframes.size&&0===this.duration;let r=[];this._keyframes.forEach((a,l)=>{const c=eh(a,!0);Object.keys(c).forEach(d=>{const f=c[d];"!"==f?e.add(d):f==$u&&t.add(d)}),i||(c.offset=l/this.duration),r.push(c)});const s=e.size?OE(e.values()):[],o=t.size?OE(t.values()):[];if(i){const a=r[0],l=Zg(a);a.offset=0,l.offset=1,r=[a,l]}return cO(this.element,r,s,o,this.duration,this.startTime,this.easing,!1)}}class aie extends LE{constructor(e,t,i,r,s,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:r}=this.timings;if(this._stretchStartingKeyframe&&t){const s=[],o=i+t,a=t/o,l=eh(e[0],!1);l.offset=0,s.push(l);const c=eh(e[0],!1);c.offset=YV(a),s.push(c);const d=e.length-1;for(let f=1;f<=d;f++){let p=eh(e[f],!1);p.offset=YV((t+p.offset*i)/o),s.push(p)}i=o,t=0,r="",e=s}return cO(this.element,e,this.preStyleProps,this.postStyleProps,i,t,r,!0)}}function YV(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}class hO{}class cie extends hO{normalizePropertyName(e,t){return sO(e)}normalizeStyleValue(e,t,i,r){let s="";const o=i.toString().trim();if(uie[t]&&0!==i&&"0"!==i)if("number"==typeof i)s="px";else{const a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&r.push(`Please provide a CSS unit value for ${e}:${i}`)}return o+s}}const uie=(()=>function(n){const e={};return n.forEach(t=>e[t]=!0),e}("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(",")))();function XV(n,e,t,i,r,s,o,a,l,c,d,f,p){return{type:0,element:n,triggerName:e,isRemovalTransition:r,fromState:t,fromStyles:s,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:d,totalTime:f,errors:p}}const fO={};class KV{constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,r){return function(n,e,t,i,r){return n.some(s=>s(e,t,i,r))}(this.ast.matchers,e,t,i,r)}buildStyles(e,t,i){const r=this._stateStyles["*"],s=this._stateStyles[e],o=r?r.buildStyles(t,i):{};return s?s.buildStyles(t,i):o}build(e,t,i,r,s,o,a,l,c,d){const f=[],p=this.ast.options&&this.ast.options.params||fO,_=this.buildStyles(i,a&&a.params||fO,f),y=l&&l.params||fO,v=this.buildStyles(r,y,f),w=new Set,C=new Map,x=new Map,L="void"===r,U={params:Object.assign(Object.assign({},p),y)},$=d?[]:uO(e,t,this.ast.animation,s,o,_,v,U,c,f);let ee=0;if($.forEach(pe=>{ee=Math.max(pe.duration+pe.delay,ee)}),f.length)return XV(t,this._triggerName,i,r,L,_,v,[],[],C,x,ee,f);$.forEach(pe=>{const ve=pe.element,$e=wa(C,ve,{});pe.preStyleProps.forEach(re=>$e[re]=!0);const Xe=wa(x,ve,{});pe.postStyleProps.forEach(re=>Xe[re]=!0),ve!==t&&w.add(ve)});const fe=OE(w.values());return XV(t,this._triggerName,i,r,L,_,v,$,fe,C,x,ee)}}class fie{constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){const i={},r=Zg(this.defaultParams);return Object.keys(e).forEach(s=>{const o=e[s];null!=o&&(r[s]=o)}),this.styles.styles.forEach(s=>{if("string"!=typeof s){const o=s;Object.keys(o).forEach(a=>{let l=o[a];l.length>1&&(l=DE(l,r,t));const c=this.normalizer.normalizePropertyName(a,t);l=this.normalizer.normalizeStyleValue(a,c,l,t),i[c]=l})}}),i}}class gie{constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,this.transitionFactories=[],this.states={},t.states.forEach(r=>{this.states[r.name]=new fie(r.style,r.options&&r.options.params||{},i)}),ZV(this.states,"true","1"),ZV(this.states,"false","0"),t.transitions.forEach(r=>{this.transitionFactories.push(new KV(e,r,this.states))}),this.fallbackTransition=function(n,e,t){return new KV(n,{type:1,animation:{type:2,steps:[],options:null},matchers:[(o,a)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,r){return this.transitionFactories.find(o=>o.match(e,t,i,r))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}}function ZV(n,e,t){n.hasOwnProperty(e)?n.hasOwnProperty(t)||(n[t]=n[e]):n.hasOwnProperty(t)&&(n[e]=n[t])}const _ie=new FE;class yie{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._animations={},this._playersById={},this.players=[]}register(e,t){const i=[],r=aO(this._driver,t,i);if(i.length)throw new Error(`Unable to build the animation due to the following errors: ${i.join("\n")}`);this._animations[e]=r}_buildPlayer(e,t,i){const r=e.element,s=OV(0,this._normalizer,0,e.keyframes,t,i);return this._driver.animate(r,s,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){const r=[],s=this._animations[e];let o;const a=new Map;if(s?(o=uO(this._driver,t,s,tO,ME,{},{},i,_ie,r),o.forEach(d=>{const f=wa(a,d.element,{});d.postStyleProps.forEach(p=>f[p]=null)})):(r.push("The requested animation doesn't exist or has already been destroyed"),o=[]),r.length)throw new Error(`Unable to create the animation due to the following errors: ${r.join("\n")}`);a.forEach((d,f)=>{Object.keys(d).forEach(p=>{d[p]=this._driver.computeStyle(f,p,$u)})});const c=Jd(o.map(d=>{const f=a.get(d.element);return this._buildPlayer(d,{},f)}));return this._playersById[e]=c,c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),delete this._playersById[e];const i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){const t=this._playersById[e];if(!t)throw new Error(`Unable to find the timeline player referenced by ${e}`);return t}listen(e,t,i,r){const s=YD(t,"","","");return WD(this._getPlayer(e),i,s,r),()=>{}}command(e,t,i,r){if("register"==i)return void this.register(e,r[0]);if("create"==i)return void this.create(e,t,r[0]||{});const s=this._getPlayer(e);switch(i){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}}const QV="ng-animate-queued",JV="ng-animate-disabled",ej=".ng-animate-disabled",wie=[],tj={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Eie={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},fl="__ng_removed";class pO{constructor(e,t=""){this.namespaceId=t;const i=e&&e.hasOwnProperty("value");if(this.value=function(n){return null!=n?n:null}(i?e.value:e),i){const s=Zg(e);delete s.value,this.options=s}else this.options={};this.options.params||(this.options.params={})}get params(){return this.options.params}absorbOptions(e){const t=e.params;if(t){const i=this.options.params;Object.keys(t).forEach(r=>{null==i[r]&&(i[r]=t[r])})}}}const Rv="void",gO=new pO(Rv);class Sie{constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,pl(t,this._hostClassName)}listen(e,t,i,r){if(!this._triggers.hasOwnProperty(t))throw new Error(`Unable to listen on the animation trigger event "${i}" because the animation trigger "${t}" doesn't exist!`);if(null==i||0==i.length)throw new Error(`Unable to listen on the animation trigger "${t}" because the provided event is undefined!`);if(!function(n){return"start"==n||"done"==n}(i))throw new Error(`The provided animation trigger event "${i}" for the animation trigger "${t}" is not supported!`);const s=wa(this._elementListeners,e,[]),o={name:t,phase:i,callback:r};s.push(o);const a=wa(this._engine.statesByElement,e,{});return a.hasOwnProperty(t)||(pl(e,xE),pl(e,xE+"-"+t),a[t]=gO),()=>{this._engine.afterFlush(()=>{const l=s.indexOf(o);l>=0&&s.splice(l,1),this._triggers[t]||delete a[t]})}}register(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)}_getTrigger(e){const t=this._triggers[e];if(!t)throw new Error(`The provided animation trigger "${e}" has not been registered!`);return t}trigger(e,t,i,r=!0){const s=this._getTrigger(t),o=new mO(this.id,t,e);let a=this._engine.statesByElement.get(e);a||(pl(e,xE),pl(e,xE+"-"+t),this._engine.statesByElement.set(e,a={}));let l=a[t];const c=new pO(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a[t]=c,l||(l=gO),c.value!==Rv&&l.value===c.value){if(!function(n,e){const t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let r=0;r{Pf(e,v),Uc(e,w)})}return}const p=wa(this._engine.playersByElement,e,[]);p.forEach(y=>{y.namespaceId==this.id&&y.triggerName==t&&y.queued&&y.destroy()});let g=s.matchTransition(l.value,c.value,e,c.params),_=!1;if(!g){if(!r)return;g=s.fallbackTransition,_=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:g,fromState:l,toState:c,player:o,isFallbackTransition:_}),_||(pl(e,QV),o.onStart(()=>{Qg(e,QV)})),o.onDone(()=>{let y=this.players.indexOf(o);y>=0&&this.players.splice(y,1);const v=this._engine.playersByElement.get(e);if(v){let w=v.indexOf(o);w>=0&&v.splice(w,1)}}),this.players.push(o),p.push(o),o}deregister(e){delete this._triggers[e],this._engine.statesByElement.forEach((t,i)=>{delete t[e]}),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(r=>r.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const i=this._engine.driver.query(e,TE,!0);i.forEach(r=>{if(r[fl])return;const s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(o=>o.triggerLeaveAnimation(r,t,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(e,t,i,r){const s=this._engine.statesByElement.get(e);if(s){const o=[];if(Object.keys(s).forEach(a=>{if(this._triggers[a]){const l=this.trigger(e,a,Rv,r);l&&o.push(l)}}),o.length)return this._engine.markElementAsRemoved(this.id,e,!0,t),i&&Jd(o).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){const r=new Set;t.forEach(s=>{const o=s.name;if(r.has(o))return;r.add(o);const l=this._triggers[o].fallbackTransition,c=i[o]||gO,d=new pO(Rv),f=new mO(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(e,t){const i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let r=!1;if(i.totalAnimations){const s=i.players.length?i.playersByQueriedElement.get(e):[];if(s&&s.length)r=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(e),r)i.markElementAsRemoved(this.id,e,!1,t);else{const s=e[fl];(!s||s===tj)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){pl(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(i=>{const r=i.player;if(r.destroyed)return;const s=i.element,o=this._elementListeners.get(s);o&&o.forEach(a=>{if(a.name==i.triggerName){const l=YD(s,i.triggerName,i.fromState.value,i.toState.value);l._data=e,WD(i.player,a.phase,l,a.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):t.push(i)}),this._queue=[],t.sort((i,r)=>{const s=i.transition.ast.depCount,o=r.transition.ast.depCount;return 0==s||0==o?s-o:this._engine.driver.containsElement(i.element,r.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}elementContainsData(e){let t=!1;return this._elementListeners.has(e)&&(t=!0),t=!!this._queue.find(i=>i.element===e)||t,t}}class Mie{constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(r,s)=>{}}_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){const i=new Sie(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){const i=this._namespaceList.length-1;if(i>=0){let r=!1;for(let s=i;s>=0;s--)if(this.driver.containsElement(this._namespaceList[s].hostElement,t)){this._namespaceList.splice(s+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let r=this._namespaceLookup[e];r&&r.register(t,i)&&this.totalAnimations++}destroy(e,t){if(!e)return;const i=this._fetchNamespace(e);this.afterFlush(()=>{this.namespacesByHostElement.delete(i.hostElement),delete this._namespaceLookup[e];const r=this._namespaceList.indexOf(i);r>=0&&this._namespaceList.splice(r,1)}),this.afterFlushAnimationsDone(()=>i.destroy(t))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,i=this.statesByElement.get(e);if(i){const r=Object.keys(i);for(let s=0;s=0&&this.collectedLeaveElements.splice(o,1)}if(e){const o=this._fetchNamespace(e);o&&o.insertNode(t,i)}r&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),pl(e,JV)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Qg(e,JV))}removeNode(e,t,i,r){if(BE(t)){const s=e?this._fetchNamespace(e):null;if(s?s.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r),i){const o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,r)}}else this._onRemovalComplete(t,r)}markElementAsRemoved(e,t,i,r){this.collectedLeaveElements.push(t),t[fl]={namespaceId:e,setForRemoval:r,hasAnimation:i,removedBeforeQueried:!1}}listen(e,t,i,r,s){return BE(t)?this._fetchNamespace(e).listen(t,i,r,s):()=>{}}_buildInstruction(e,t,i,r,s){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,r,e.fromState.options,e.toState.options,t,s)}destroyInnerAnimations(e){let t=this.driver.query(e,TE,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,nO,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Jd(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e[fl];if(t&&t.setForRemoval){if(e[fl]=tj,t.namespaceId){this.destroyInnerAnimations(e);const i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}this.driver.matchesElement(e,ej)&&this.markElementAsDisabled(e,!1),this.driver.query(e,ej,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,r)=>this._balanceNamespaceList(i,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],t.length?Jd(t).onDone(()=>{i.forEach(r=>r())}):i.forEach(r=>r())}}reportError(e){throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${e.join("\n")}`)}_flushAnimations(e,t){const i=new FE,r=[],s=new Map,o=[],a=new Map,l=new Map,c=new Map,d=new Set;this.disabledNodes.forEach(Q=>{d.add(Q);const Ue=this.driver.query(Q,".ng-animate-queued",!0);for(let ke=0;ke{const ke=tO+y++;_.set(Ue,ke),Q.forEach(ze=>pl(ze,ke))});const v=[],w=new Set,C=new Set;for(let Q=0;Qw.add(ze)):C.add(Ue))}const x=new Map,L=rj(p,Array.from(w));L.forEach((Q,Ue)=>{const ke=ME+y++;x.set(Ue,ke),Q.forEach(ze=>pl(ze,ke))}),e.push(()=>{g.forEach((Q,Ue)=>{const ke=_.get(Ue);Q.forEach(ze=>Qg(ze,ke))}),L.forEach((Q,Ue)=>{const ke=x.get(Ue);Q.forEach(ze=>Qg(ze,ke))}),v.forEach(Q=>{this.processLeaveNode(Q)})});const U=[],$=[];for(let Q=this._namespaceList.length-1;Q>=0;Q--)this._namespaceList[Q].drainQueuedTransitions(t).forEach(ke=>{const ze=ke.player,wt=ke.element;if(U.push(ze),this.collectedEnterElements.length){const fi=wt[fl];if(fi&&fi.setForMove)return void ze.destroy()}const kn=!f||!this.driver.containsElement(f,wt),Je=x.get(wt),tr=_.get(wt),Dn=this._buildInstruction(ke,i,tr,Je,kn);if(Dn.errors&&Dn.errors.length)$.push(Dn);else{if(kn)return ze.onStart(()=>Pf(wt,Dn.fromStyles)),ze.onDestroy(()=>Uc(wt,Dn.toStyles)),void r.push(ze);if(ke.isFallbackTransition)return ze.onStart(()=>Pf(wt,Dn.fromStyles)),ze.onDestroy(()=>Uc(wt,Dn.toStyles)),void r.push(ze);Dn.timelines.forEach(fi=>fi.stretchStartingKeyframe=!0),i.append(wt,Dn.timelines),o.push({instruction:Dn,player:ze,element:wt}),Dn.queriedElements.forEach(fi=>wa(a,fi,[]).push(ze)),Dn.preStyleProps.forEach((fi,gr)=>{const ra=Object.keys(fi);if(ra.length){let Bs=l.get(gr);Bs||l.set(gr,Bs=new Set),ra.forEach(ka=>Bs.add(ka))}}),Dn.postStyleProps.forEach((fi,gr)=>{const ra=Object.keys(fi);let Bs=c.get(gr);Bs||c.set(gr,Bs=new Set),ra.forEach(ka=>Bs.add(ka))})}});if($.length){const Q=[];$.forEach(Ue=>{Q.push(`@${Ue.triggerName} has failed due to:\n`),Ue.errors.forEach(ke=>Q.push(`- ${ke}\n`))}),U.forEach(Ue=>Ue.destroy()),this.reportError(Q)}const ee=new Map,fe=new Map;o.forEach(Q=>{const Ue=Q.element;i.has(Ue)&&(fe.set(Ue,Ue),this._beforeAnimationBuild(Q.player.namespaceId,Q.instruction,ee))}),r.forEach(Q=>{const Ue=Q.element;this._getPreviousPlayers(Ue,!1,Q.namespaceId,Q.triggerName,null).forEach(ze=>{wa(ee,Ue,[]).push(ze),ze.destroy()})});const pe=v.filter(Q=>oj(Q,l,c)),ve=new Map;ij(ve,this.driver,C,c,$u).forEach(Q=>{oj(Q,l,c)&&pe.push(Q)});const Xe=new Map;g.forEach((Q,Ue)=>{ij(Xe,this.driver,new Set(Q),l,"!")}),pe.forEach(Q=>{const Ue=ve.get(Q),ke=Xe.get(Q);ve.set(Q,Object.assign(Object.assign({},Ue),ke))});const re=[],le=[],Oe={};o.forEach(Q=>{const{element:Ue,player:ke,instruction:ze}=Q;if(i.has(Ue)){if(d.has(Ue))return ke.onDestroy(()=>Uc(Ue,ze.toStyles)),ke.disabled=!0,ke.overrideTotalTime(ze.totalTime),void r.push(ke);let wt=Oe;if(fe.size>1){let Je=Ue;const tr=[];for(;Je=Je.parentNode;){const Dn=fe.get(Je);if(Dn){wt=Dn;break}tr.push(Je)}tr.forEach(Dn=>fe.set(Dn,wt))}const kn=this._buildAnimation(ke.namespaceId,ze,ee,s,Xe,ve);if(ke.setRealPlayer(kn),wt===Oe)re.push(ke);else{const Je=this.playersByElement.get(wt);Je&&Je.length&&(ke.parentPlayer=Jd(Je)),r.push(ke)}}else Pf(Ue,ze.fromStyles),ke.onDestroy(()=>Uc(Ue,ze.toStyles)),le.push(ke),d.has(Ue)&&r.push(ke)}),le.forEach(Q=>{const Ue=s.get(Q.element);if(Ue&&Ue.length){const ke=Jd(Ue);Q.setRealPlayer(ke)}}),r.forEach(Q=>{Q.parentPlayer?Q.syncPlayerEvents(Q.parentPlayer):Q.destroy()});for(let Q=0;Q!kn.destroyed);wt.length?Die(this,Ue,wt):this.processLeaveNode(Ue)}return v.length=0,re.forEach(Q=>{this.players.push(Q),Q.onDone(()=>{Q.destroy();const Ue=this.players.indexOf(Q);this.players.splice(Ue,1)}),Q.play()}),re}elementContainsData(e,t){let i=!1;const r=t[fl];return r&&r.setForRemoval&&(i=!0),this.playersByElement.has(t)&&(i=!0),this.playersByQueriedElement.has(t)&&(i=!0),this.statesByElement.has(t)&&(i=!0),this._fetchNamespace(e).elementContainsData(t)||i}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,r,s){let o=[];if(t){const a=this.playersByQueriedElement.get(e);a&&(o=a)}else{const a=this.playersByElement.get(e);if(a){const l=!s||s==Rv;a.forEach(c=>{c.queued||!l&&c.triggerName!=r||o.push(c)})}}return(i||r)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||r&&r!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){const s=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:t.triggerName;for(const l of t.timelines){const c=l.element,d=c!==s,f=wa(i,c,[]);this._getPreviousPlayers(c,d,o,a,t.toState).forEach(g=>{const _=g.getRealPlayer();_.beforeDestroy&&_.beforeDestroy(),g.destroy(),f.push(g)})}Pf(s,t.fromStyles)}_buildAnimation(e,t,i,r,s,o){const a=t.triggerName,l=t.element,c=[],d=new Set,f=new Set,p=t.timelines.map(_=>{const y=_.element;d.add(y);const v=y[fl];if(v&&v.removedBeforeQueried)return new Kg(_.duration,_.delay);const w=y!==l,C=function(n){const e=[];return sj(n,e),e}((i.get(y)||wie).map(ee=>ee.getRealPlayer())).filter(ee=>!!ee.element&&ee.element===y),x=s.get(y),L=o.get(y),U=OV(0,this._normalizer,0,_.keyframes,x,L),$=this._buildPlayer(_,U,C);if(_.subTimeline&&r&&f.add(y),w){const ee=new mO(e,a,y);ee.setRealPlayer($),c.push(ee)}return $});c.forEach(_=>{wa(this.playersByQueriedElement,_.element,[]).push(_),_.onDone(()=>function(n,e,t){let i;if(n instanceof Map){if(i=n.get(e),i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&n.delete(e)}}else if(i=n[e],i){if(i.length){const r=i.indexOf(t);i.splice(r,1)}0==i.length&&delete n[e]}return i}(this.playersByQueriedElement,_.element,_))}),d.forEach(_=>pl(_,BV));const g=Jd(p);return g.onDestroy(()=>{d.forEach(_=>Qg(_,BV)),Uc(l,t.toStyles)}),f.forEach(_=>{wa(r,_,[]).push(g)}),g}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new Kg(e.duration,e.delay)}}class mO{constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i,this._player=new Kg,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(e){this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(t=>{this._queuedCallbacks[t].forEach(i=>WD(e,t,void 0,i))}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){wa(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function BE(n){return n&&1===n.nodeType}function nj(n,e){const t=n.style.display;return n.style.display=null!=e?e:"none",t}function ij(n,e,t,i,r){const s=[];t.forEach(l=>s.push(nj(l)));const o=[];i.forEach((l,c)=>{const d={};l.forEach(f=>{const p=d[f]=e.computeStyle(c,f,r);(!p||0==p.length)&&(c[fl]=Eie,o.push(c))}),n.set(c,d)});let a=0;return t.forEach(l=>nj(l,s[a++])),o}function rj(n,e){const t=new Map;if(n.forEach(a=>t.set(a,[])),0==e.length)return t;const r=new Set(e),s=new Map;function o(a){if(!a)return 1;let l=s.get(a);if(l)return l;const c=a.parentNode;return l=t.has(c)?c:r.has(c)?1:o(c),s.set(a,l),l}return e.forEach(a=>{const l=o(a);1!==l&&t.get(l).push(a)}),t}const VE="$$classes";function pl(n,e){if(n.classList)n.classList.add(e);else{let t=n[VE];t||(t=n[VE]={}),t[e]=!0}}function Qg(n,e){if(n.classList)n.classList.remove(e);else{let t=n[VE];t&&delete t[e]}}function Die(n,e,t){Jd(t).onDone(()=>n.processLeaveNode(e))}function sj(n,e){for(let t=0;tr.add(s)):e.set(n,i),t.delete(n),!0}class jE{constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(r,s)=>{},this._transitionEngine=new Mie(e,t,i),this._timelineEngine=new yie(e,t,i),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(e,t,i,r,s){const o=e+"-"+r;let a=this._triggerCache[o];if(!a){const l=[],c=aO(this._driver,s,l);if(l.length)throw new Error(`The animation trigger "${r}" has failed to build due to the following errors:\n - ${l.join("\n - ")}`);a=function(n,e,t){return new gie(n,e,t)}(r,c,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,r,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,r){this._transitionEngine.insertNode(e,t,i,r)}onRemove(e,t,i,r){this._transitionEngine.removeNode(e,t,r||!1,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,r){if("@"==i.charAt(0)){const[s,o]=IV(i);this._timelineEngine.command(s,t,o,r)}else this._transitionEngine.trigger(e,t,i,r)}listen(e,t,i,r,s){if("@"==i.charAt(0)){const[o,a]=IV(i);return this._timelineEngine.listen(o,t,a,s)}return this._transitionEngine.listen(e,t,i,r,s)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return this._transitionEngine.players.concat(this._timelineEngine.players)}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}}function aj(n,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=_O(e[0]),e.length>1&&(i=_O(e[e.length-1]))):e&&(t=_O(e)),t||i?new Jg(n,t,i):null}class Jg{constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i,this._state=0;let r=Jg.initialStylesByElement.get(e);r||Jg.initialStylesByElement.set(e,r={}),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Uc(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Uc(this._element,this._initialStyles),this._endStyles&&(Uc(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Jg.initialStylesByElement.delete(this._element),this._startStyles&&(Pf(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Pf(this._element,this._endStyles),this._endStyles=null),Uc(this._element,this._initialStyles),this._state=3)}}function _O(n){let e=null;const t=Object.keys(n);for(let i=0;ithis._handleCallback(l)}apply(){(function(n,e){const t=vO(n,"").trim();let i=0;t.length&&(function(n,e){let t=0;for(let i=0;i=this._delay&&i>=this._duration&&this.finish()}finish(){this._finished||(this._finished=!0,this._onDoneFn(),hj(this._element,this._eventFn,!0))}destroy(){this._destroyed||(this._destroyed=!0,this.finish(),function(n,e){const i=vO(n,"").split(","),r=yO(i,e);r>=0&&(i.splice(r,1),UE(n,"",i.join(",")))}(this._element,this._name))}}function uj(n,e,t){UE(n,"PlayState",t,dj(n,e))}function dj(n,e){const t=vO(n,"");return t.indexOf(",")>0?yO(t.split(","),e):yO([t],e)}function yO(n,e){for(let t=0;t=0)return t;return-1}function hj(n,e,t){t?n.removeEventListener(cj,e):n.addEventListener(cj,e)}function UE(n,e,t,i){const r=lj+e;if(null!=i){const s=n.style[r];if(s.length){const o=s.split(",");o[i]=t,t=o.join(",")}}n.style[r]=t}function vO(n,e){return n.style[lj+e]||""}class fj{constructor(e,t,i,r,s,o,a,l){this.element=e,this.keyframes=t,this.animationName=i,this._duration=r,this._delay=s,this._finalStyles=a,this._specialStyles=l,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this.currentSnapshot={},this._state=0,this.easing=o||"linear",this.totalTime=r+s,this._buildStyler()}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}destroy(){this.init(),!(this._state>=4)&&(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}_flushDoneFns(){this._onDoneFns.forEach(e=>e()),this._onDoneFns=[]}_flushStartFns(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}finish(){this.init(),!(this._state>=3)&&(this._state=3,this._styler.finish(),this._flushStartFns(),this._specialStyles&&this._specialStyles.finish(),this._flushDoneFns())}setPosition(e){this._styler.setPosition(e)}getPosition(){return this._styler.getPosition()}hasStarted(){return this._state>=2}init(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())}play(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2,this._specialStyles&&this._specialStyles.start()),this._styler.resume()}pause(){this.init(),this._styler.pause()}restart(){this.reset(),this.play()}reset(){this._state=0,this._styler.destroy(),this._buildStyler(),this._styler.apply()}_buildStyler(){this._styler=new Fie(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",()=>this.finish())}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}beforeDestroy(){this.init();const e={};if(this.hasStarted()){const t=this._state>=3;Object.keys(this._finalStyles).forEach(i=>{"offset"!=i&&(e[i]=t?this._finalStyles[i]:oO(this.element,i))})}this.currentSnapshot=e}}class Uie extends Kg{constructor(e,t){super(),this.element=e,this._startingStyles={},this.__initialized=!1,this._styles=FV(t)}init(){this.__initialized||!this._startingStyles||(this.__initialized=!0,Object.keys(this._styles).forEach(e=>{this._startingStyles[e]=this.element.style[e]}),super.init())}play(){!this._startingStyles||(this.init(),Object.keys(this._styles).forEach(e=>this.element.style.setProperty(e,this._styles[e])),super.play())}destroy(){!this._startingStyles||(Object.keys(this._startingStyles).forEach(e=>{const t=this._startingStyles[e];t?this.element.style.setProperty(e,t):this.element.style.removeProperty(e)}),this._startingStyles=null,super.destroy())}}class gj{constructor(){this._count=0}validateStyleProperty(e){return ZD(e)}matchesElement(e,t){return QD(e,t)}containsElement(e,t){return JD(e,t)}query(e,t,i){return eO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}buildKeyframeElement(e,t,i){i=i.map(a=>FV(a));let r=`@keyframes ${t} {\n`,s="";i.forEach(a=>{s=" ";const l=parseFloat(a.offset);r+=`${s}${100*l}% {\n`,s+=" ",Object.keys(a).forEach(c=>{const d=a[c];switch(c){case"offset":return;case"easing":return void(d&&(r+=`${s}animation-timing-function: ${d};\n`));default:return void(r+=`${s}${c}: ${d};\n`)}}),r+=`${s}}\n`}),r+="}\n";const o=document.createElement("style");return o.textContent=r,o}animate(e,t,i,r,s,o=[],a){const l=o.filter(v=>v instanceof fj),c={};HV(i,r)&&l.forEach(v=>{let w=v.currentSnapshot;Object.keys(w).forEach(C=>c[C]=w[C])});const d=function(n){let e={};return n&&(Array.isArray(n)?n:[n]).forEach(i=>{Object.keys(i).forEach(r=>{"offset"==r||"easing"==r||(e[r]=i[r])})}),e}(t=$V(e,t,c));if(0==i)return new Uie(e,d);const f="gen_css_kf_"+this._count++,p=this.buildKeyframeElement(e,f,t);(function(n){var e;const t=null===(e=n.getRootNode)||void 0===e?void 0:e.call(n);return"undefined"!=typeof ShadowRoot&&t instanceof ShadowRoot?t:document.head})(e).appendChild(p);const _=aj(e,t),y=new fj(e,t,f,i,r,s,d,_);return y.onDestroy(()=>function(n){n.parentNode.removeChild(n)}(p)),y}}class _j{constructor(e,t,i,r){this.element=e,this.keyframes=t,this.options=i,this._specialStyles=r,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:{},this.domPlayer.addEventListener("finish",()=>this._onFinish())}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_triggerWebAnimation(e,t,i){return e.animate(t,i)}onStart(e){this._onStartFns.push(e)}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return this.domPlayer.currentTime/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(t=>{"offset"!=t&&(e[t]=this._finished?this._finalKeyframe[t]:oO(this.element,t))}),this.currentSnapshot=e}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}}class Wie{constructor(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(yj().toString()),this._cssKeyframesDriver=new gj}validateStyleProperty(e){return ZD(e)}matchesElement(e,t){return QD(e,t)}containsElement(e,t){return JD(e,t)}query(e,t,i){return eO(e,t,i)}computeStyle(e,t,i){return window.getComputedStyle(e)[t]}overrideWebAnimationsSupport(e){this._isNativeImpl=e}animate(e,t,i,r,s,o=[],a){if(!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,i,r,s,o);const d={duration:i,delay:r,fill:0==r?"both":"forwards"};s&&(d.easing=s);const f={},p=o.filter(_=>_ instanceof _j);HV(i,r)&&p.forEach(_=>{let y=_.currentSnapshot;Object.keys(y).forEach(v=>f[v]=y[v])});const g=aj(e,t=$V(e,t=t.map(_=>eh(_,!1)),f));return new _j(e,t,d,g)}}function yj(){return DV()&&Element.prototype.animate||{}}let Yie=(()=>{class n extends MV{constructor(t,i){super(),this._nextAnimationId=0,this._renderer=t.createRenderer(i.body,{id:"0",encapsulation:Re.None,styles:[],data:{animation:[]}})}build(t){const i=this._nextAnimationId.toString();this._nextAnimationId++;const r=Array.isArray(t)?xV(t):t;return vj(this._renderer,null,i,"register",[r]),new Xie(i,this._renderer)}}return n.\u0275fac=function(t){return new(t||n)(I(_f),I(rt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Xie extends class{}{constructor(e,t){super(),this._id=e,this._renderer=t}create(e,t){return new Kie(this._id,e,t||{},this._renderer)}}class Kie{constructor(e,t,i,r){this.id=e,this.element=t,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",i)}_listen(e,t){return this._renderer.listen(this.element,`@@${this.id}:${e}`,t)}_command(e,...t){return vj(this._renderer,this.element,this.id,e,t)}onDone(e){this._listen("done",e)}onStart(e){this._listen("start",e)}onDestroy(e){this._listen("destroy",e)}init(){this._command("init")}hasStarted(){return this._started}play(){this._command("play"),this._started=!0}pause(){this._command("pause")}restart(){this._command("restart")}finish(){this._command("finish")}destroy(){this._command("destroy")}reset(){this._command("reset"),this._started=!1}setPosition(e){this._command("setPosition",e)}getPosition(){var e,t;return null!==(t=null===(e=this._renderer.engine.players[+this.id])||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}}function vj(n,e,t,i,r){return n.setProperty(e,`@@${t}:${i}`,r)}const bj="@.disabled";let Zie=(()=>{class n{constructor(t,i,r){this.delegate=t,this.engine=i,this._zone=r,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,this.promise=Promise.resolve(0),i.onRemovalComplete=(s,o)=>{o&&o.parentNode(s)&&o.removeChild(s.parentNode,s)}}createRenderer(t,i){const s=this.delegate.createRenderer(t,i);if(!(t&&i&&i.data&&i.data.animation)){let d=this._rendererCache.get(s);return d||(d=new Cj("",s,this.engine),this._rendererCache.set(s,d)),d}const o=i.id,a=i.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const l=d=>{Array.isArray(d)?d.forEach(l):this.engine.registerTrigger(o,a,t,d.name,d)};return i.data.animation.forEach(l),new Qie(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){this.promise.then(()=>{this._microtaskId++})}scheduleListenerCallback(t,i,r){t>=0&&ti(r)):(0==this._animationCallbacksBuffer.length&&Promise.resolve(null).then(()=>{this._zone.run(()=>{this._animationCallbacksBuffer.forEach(s=>{const[o,a]=s;o(a)}),this._animationCallbacksBuffer=[]})}),this._animationCallbacksBuffer.push([i,r]))}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}return n.\u0275fac=function(t){return new(t||n)(I(_f),I(jE),I(lt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Cj{constructor(e,t,i){this.namespaceId=e,this.delegate=t,this.engine=i,this.destroyNode=this.delegate.destroyNode?r=>t.destroyNode(r):null}get data(){return this.delegate.data}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.delegate.destroy()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,r=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,r)}removeChild(e,t,i){this.engine.onRemove(this.namespaceId,t,this.delegate,i)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,r){this.delegate.setAttribute(e,t,i,r)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,r){this.delegate.setStyle(e,t,i,r)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){"@"==t.charAt(0)&&t==bj?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i){return this.delegate.listen(e,t,i)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class Qie extends Cj{constructor(e,t,i,r){super(t,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){"@"==t.charAt(0)?"."==t.charAt(1)&&t==bj?this.disableAnimations(e,i=void 0===i||!!i):this.engine.process(this.namespaceId,e,t.substr(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i){if("@"==t.charAt(0)){const r=function(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let s=t.substr(1),o="";return"@"!=s.charAt(0)&&([s,o]=function(n){const e=n.indexOf(".");return[n.substring(0,e),n.substr(e+1)]}(s)),this.engine.listen(this.namespaceId,r,s,o,a=>{this.factory.scheduleListenerCallback(a._data||-1,i,a)})}return this.delegate.listen(e,t,i)}}let tre=(()=>{class n extends jE{constructor(t,i,r){super(t.body,i,r)}ngOnDestroy(){this.flush()}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(SE),I(hO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Zo=new _e("AnimationModuleType"),wj=[{provide:MV,useClass:Yie},{provide:hO,useFactory:function(){return new cie}},{provide:jE,useClass:tre},{provide:_f,useFactory:function(n,e,t){return new Zie(n,e,t)},deps:[uE,jE,lt]}],Ej=[{provide:SE,useFactory:function(){return"function"==typeof yj()?new Wie:new gj}},{provide:Zo,useValue:"BrowserAnimations"},...wj],Sj=[{provide:SE,useClass:NV},{provide:Zo,useValue:"NoopAnimations"},...wj];let bO=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?Sj:Ej}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:Ej,imports:[dE]}),n})();function are(n,e){if(1&n&&et(0,"mat-pseudo-checkbox",4),2&n){const t=bt();ie("state",t.selected?"checked":"unchecked")("disabled",t.disabled)}}function lre(n,e){if(1&n&&(F(0,"span",5),Te(1),N()),2&n){const t=bt();Y(1),Os("(",t.group.label,")")}}const cre=["*"],Mj=new Lu("12.2.5"),dre=new _e("mat-sanity-checks",{providedIn:"root",factory:function(){return!0}});let Lf,Nn=(()=>{class n{constructor(t,i,r){this._hasDoneGlobalChecks=!1,this._document=r,t._applyBodyHighContrastModeCssClasses(),this._sanityChecks=i,this._hasDoneGlobalChecks||(this._checkDoctypeIsDefined(),this._checkThemeIsPresent(),this._checkCdkVersionMatch(),this._hasDoneGlobalChecks=!0)}_getWindow(){const t=this._document.defaultView||window;return"object"==typeof t&&t?t:null}_checkIsEnabled(t){return!(!wo()||this._isTestEnv())&&("boolean"==typeof this._sanityChecks?this._sanityChecks:!!this._sanityChecks[t])}_isTestEnv(){const t=this._getWindow();return t&&(t.__karma__||t.jasmine)}_checkDoctypeIsDefined(){this._checkIsEnabled("doctype")&&!this._document.doctype&&console.warn("Current document does not have a doctype. This may cause some Angular Material components not to behave as expected.")}_checkThemeIsPresent(){if(!this._checkIsEnabled("theme")||!this._document.body||"function"!=typeof getComputedStyle)return;const t=this._document.createElement("div");t.classList.add("mat-theme-loaded-marker"),this._document.body.appendChild(t);const i=getComputedStyle(t);i&&"none"!==i.display&&console.warn("Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming"),this._document.body.removeChild(t)}_checkCdkVersionMatch(){this._checkIsEnabled("version")&&Mj.full!==SV.full&&console.warn("The Angular Material version ("+Mj.full+") does not match the Angular CDK version ("+SV.full+").\nPlease ensure the versions of these two packages exactly match.")}}return n.\u0275fac=function(t){return new(t||n)(I(wV),I(dre,8),I(rt))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Iv],Iv]}),n})();function em(n){return class extends n{constructor(...e){super(...e),this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=Dt(e)}}}function kf(n,e){return class extends n{constructor(...t){super(...t),this.defaultColor=e,this.color=e}get color(){return this._color}set color(t){const i=t||this.defaultColor;i!==this._color&&(this._color&&this._elementRef.nativeElement.classList.remove(`mat-${this._color}`),i&&this._elementRef.nativeElement.classList.add(`mat-${i}`),this._color=i)}}}function Ff(n){return class extends n{constructor(...e){super(...e),this._disableRipple=!1}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=Dt(e)}}}function Nf(n,e=0){return class extends n{constructor(...t){super(...t),this._tabIndex=e,this.defaultTabIndex=e}get tabIndex(){return this.disabled?-1:this._tabIndex}set tabIndex(t){this._tabIndex=null!=t?So(t):this.defaultTabIndex}}}function CO(n){return class extends n{constructor(...e){super(...e),this.stateChanges=new we,this.errorState=!1}updateErrorState(){const e=this.errorState,s=(this.errorStateMatcher||this._defaultErrorStateMatcher).isErrorState(this.ngControl?this.ngControl.control:null,this._parentFormGroup||this._parentForm);s!==e&&(this.errorState=s,this.stateChanges.next())}}}try{Lf="undefined"!=typeof Intl}catch(n){Lf=!1}let kv=(()=>{class n{isErrorState(t,i){return!!(t&&t.invalid&&(t.touched||i&&i.submitted))}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})();class Ere{constructor(e,t,i){this._renderer=e,this.element=t,this.config=i,this.state=3}fadeOut(){this._renderer.fadeOutRipple(this)}}const Tj={enterDuration:225,exitDuration:150},wO=Yg({passive:!0}),Aj=["mousedown","touchstart"],Dj=["mouseup","mouseleave","touchend","touchcancel"];class Oj{constructor(e,t,i,r){this._target=e,this._ngZone=t,this._isPointerDown=!1,this._activeRipples=new Set,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=Hu(i))}fadeInRipple(e,t,i={}){const r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),s=Object.assign(Object.assign({},Tj),i.animation);i.centered&&(e=r.left+r.width/2,t=r.top+r.height/2);const o=i.radius||function(n,e,t){const i=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),r=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(i*i+r*r)}(e,t,r),a=e-r.left,l=t-r.top,c=s.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=a-o+"px",d.style.top=l-o+"px",d.style.height=2*o+"px",d.style.width=2*o+"px",null!=i.color&&(d.style.backgroundColor=i.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d),function(n){window.getComputedStyle(n).getPropertyValue("opacity")}(d),d.style.transform="scale(1)";const f=new Ere(this,d,i);return f.state=0,this._activeRipples.add(f),i.persistent||(this._mostRecentTransientRipple=f),this._runTimeoutOutsideZone(()=>{const p=f===this._mostRecentTransientRipple;f.state=1,!i.persistent&&(!p||!this._isPointerDown)&&f.fadeOut()},c),f}fadeOutRipple(e){const t=this._activeRipples.delete(e);if(e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),this._activeRipples.size||(this._containerRect=null),!t)return;const i=e.element,r=Object.assign(Object.assign({},Tj),e.config.animation);i.style.transitionDuration=`${r.exitDuration}ms`,i.style.opacity="0",e.state=2,this._runTimeoutOutsideZone(()=>{e.state=3,i.parentNode.removeChild(i)},r.exitDuration)}fadeOutAll(){this._activeRipples.forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._activeRipples.forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Hu(e);!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,this._registerEvents(Aj))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._registerEvents(Dj),this._pointerUpEventsRegistered=!0)}_onMousedown(e){const t=hV(e),i=this._lastTouchStartEvent&&Date.now(){!e.config.persistent&&(1===e.state||e.config.terminateOnPointerUp&&0===e.state)&&e.fadeOut()}))}_runTimeoutOutsideZone(e,t=0){this._ngZone.runOutsideAngular(()=>setTimeout(e,t))}_registerEvents(e){this._ngZone.runOutsideAngular(()=>{e.forEach(t=>{this._triggerElement.addEventListener(t,this,wO)})})}_removeTriggerEvents(){this._triggerElement&&(Aj.forEach(e=>{this._triggerElement.removeEventListener(e,this,wO)}),this._pointerUpEventsRegistered&&Dj.forEach(e=>{this._triggerElement.removeEventListener(e,this,wO)}))}}const Ij=new _e("mat-ripple-global-options");let Qo=(()=>{class n{constructor(t,i,r,s,o){this._elementRef=t,this._animationMode=o,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=s||{},this._rippleRenderer=new Oj(this,i,t,r)}get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:Object.assign(Object.assign(Object.assign({},this._globalOptions.animation),"NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,i=0,r){return"number"==typeof t?this._rippleRenderer.fadeInRipple(t,i,Object.assign(Object.assign({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,Object.assign(Object.assign({},this.rippleConfig),t))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(lt),E(ii),E(Ij,8),E(Zo,8))},n.\u0275dir=he({type:n,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(t,i){2&t&&at("mat-ripple-unbounded",i.unbounded)},inputs:{radius:["matRippleRadius","radius"],disabled:["matRippleDisabled","disabled"],trigger:["matRippleTrigger","trigger"],color:["matRippleColor","color"],unbounded:["matRippleUnbounded","unbounded"],centered:["matRippleCentered","centered"],animation:["matRippleAnimation","animation"]},exportAs:["matRipple"]}),n})(),ec=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn,Av],Nn]}),n})(),Tre=(()=>{class n{constructor(t){this._animationMode=t,this.state="unchecked",this.disabled=!1}}return n.\u0275fac=function(t){return new(t||n)(E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:8,hostBindings:function(t,i){2&t&&at("mat-pseudo-checkbox-indeterminate","indeterminate"===i.state)("mat-pseudo-checkbox-checked","checked"===i.state)("mat-pseudo-checkbox-disabled",i.disabled)("_mat-animation-noopable","NoopAnimations"===i._animationMode)},inputs:{state:"state",disabled:"disabled"},decls:0,vars:0,template:function(t,i){},styles:['.mat-pseudo-checkbox{width:16px;height:16px;border:2px solid;border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox.mat-pseudo-checkbox-indeterminate{border-color:transparent}._mat-animation-noopable.mat-pseudo-checkbox{transition:none;animation:none}._mat-animation-noopable.mat-pseudo-checkbox::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{top:5px;left:1px;width:10px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{top:2.4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}\n'],encapsulation:2,changeDetection:0}),n})(),Are=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn]]}),n})();const $E=new _e("MAT_OPTION_PARENT_COMPONENT"),Dre=em(class{});let Ore=0,Pj=(()=>{class n extends Dre{constructor(t){var i;super(),this._labelId="mat-optgroup-label-"+Ore++,this._inert=null!==(i=null==t?void 0:t.inertGroups)&&void 0!==i&&i}}return n.\u0275fac=function(t){return new(t||n)(E($E,8))},n.\u0275dir=he({type:n,inputs:{label:"label"},features:[ht]}),n})();const GE=new _e("MatOptgroup");let Ire=0;class Rj{constructor(e,t=!1){this.source=e,this.isUserInput=t}}let Pre=(()=>{class n{constructor(t,i,r,s){this._element=t,this._changeDetectorRef=i,this._parent=r,this.group=s,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id="mat-option-"+Ire++,this.onSelectionChange=new Pe,this._stateChanges=new we}get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(t){this._disabled=Dt(t)}get disableRipple(){return this._parent&&this._parent.disableRipple}get active(){return this._active}get viewValue(){return(this._getHostElement().textContent||"").trim()}select(){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}deselect(){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent())}focus(t,i){const r=this._getHostElement();"function"==typeof r.focus&&r.focus(i)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!Yo(t)&&(this._selectViaInteraction(),t.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getAriaSelected(){return this.selected||!this.multiple&&null}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){const t=this.viewValue;t!==this._mostRecentViewValue&&(this._mostRecentViewValue=t,this._stateChanges.next())}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(t=!1){this.onSelectionChange.emit(new Rj(this,t))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(void 0),E(Pj))},n.\u0275dir=he({type:n,inputs:{id:"id",disabled:"disabled",value:"value"},outputs:{onSelectionChange:"onSelectionChange"}}),n})(),WE=(()=>{class n extends Pre{constructor(t,i,r,s){super(t,i,r,s)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E($E,8),E(GE,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-option"]],hostAttrs:["role","option",1,"mat-option","mat-focus-indicator"],hostVars:12,hostBindings:function(t,i){1&t&&ye("click",function(){return i._selectViaInteraction()})("keydown",function(s){return i._handleKeydown(s)}),2&t&&(sl("id",i.id),en("tabindex",i._getTabIndex())("aria-selected",i._getAriaSelected())("aria-disabled",i.disabled.toString()),at("mat-selected",i.selected)("mat-option-multiple",i.multiple)("mat-active",i.active)("mat-option-disabled",i.disabled))},exportAs:["matOption"],features:[ht],ngContentSelectors:cre,decls:5,vars:4,consts:[["class","mat-option-pseudo-checkbox",3,"state","disabled",4,"ngIf"],[1,"mat-option-text"],["class","cdk-visually-hidden",4,"ngIf"],["mat-ripple","",1,"mat-option-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-option-pseudo-checkbox",3,"state","disabled"],[1,"cdk-visually-hidden"]],template:function(t,i){1&t&&(Dr(),Ct(0,are,1,2,"mat-pseudo-checkbox",0),F(1,"span",1),In(2),N(),Ct(3,lre,2,1,"span",2),et(4,"div",3)),2&t&&(ie("ngIf",i.multiple),Y(3),ie("ngIf",i.group&&i.group._inert),Y(1),ie("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},directives:[Is,Qo,Tre],styles:[".mat-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative;cursor:pointer;outline:none;display:flex;flex-direction:row;max-width:100%;box-sizing:border-box;align-items:center;-webkit-tap-highlight-color:transparent}.mat-option[disabled]{cursor:default}[dir=rtl] .mat-option{text-align:right}.mat-option .mat-icon{margin-right:16px;vertical-align:middle}.mat-option .mat-icon svg{vertical-align:top}[dir=rtl] .mat-option .mat-icon{margin-left:16px;margin-right:0}.mat-option[aria-disabled=true]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:32px}[dir=rtl] .mat-optgroup .mat-option:not(.mat-option-multiple){padding-left:16px;padding-right:32px}.cdk-high-contrast-active .mat-option{margin:0 1px}.cdk-high-contrast-active .mat-option.mat-active{border:solid 1px currentColor;margin:0}.cdk-high-contrast-active .mat-option[aria-disabled=true]{opacity:.5}.mat-option-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis}.mat-option .mat-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-option-pseudo-checkbox{margin-right:8px}[dir=rtl] .mat-option-pseudo-checkbox{margin-left:8px;margin-right:0}\n"],encapsulation:2,changeDetection:0}),n})();function EO(n,e,t){if(t.length){let i=e.toArray(),r=t.toArray(),s=0;for(let o=0;o{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,bn,Nn,Are]]}),n})();function zc(n,e,t,i){return ft(t)&&(i=t,t=void 0),i?zc(n,e,t).pipe(be(r=>Fe(r)?i(...r):i(r))):new oe(r=>{Fj(n,e,function(o){r.next(arguments.length>1?Array.prototype.slice.call(arguments):o)},r,t)})}function Fj(n,e,t,i,r){let s;if(function(n){return n&&"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener}(n)){const o=n;n.addEventListener(e,t,r),s=()=>o.removeEventListener(e,t,r)}else if(function(n){return n&&"function"==typeof n.on&&"function"==typeof n.off}(n)){const o=n;n.on(e,t),s=()=>o.off(e,t)}else if(function(n){return n&&"function"==typeof n.addListener&&"function"==typeof n.removeListener}(n)){const o=n;n.addListener(e,t),s=()=>o.removeListener(e,t)}else{if(!n||!n.length)throw new TypeError("Invalid event target");for(let o=0,a=n.length;oYE(n,t,e)):t=>YE(n,t)}const Lre=["underline"],Bre=["connectionContainer"],Vre=["inputContainer"],jre=["label"];function Ure(n,e){1&n&&(ff(0),F(1,"div",14),et(2,"div",15),et(3,"div",16),et(4,"div",17),N(),F(5,"div",18),et(6,"div",15),et(7,"div",16),et(8,"div",17),N(),pf())}function zre(n,e){1&n&&(F(0,"div",19),In(1,1),N())}function Hre(n,e){if(1&n&&(ff(0),In(1,2),F(2,"span"),Te(3),N(),pf()),2&n){const t=bt(2);Y(3),Ai(t._control.placeholder)}}function $re(n,e){1&n&&In(0,3,["*ngSwitchCase","true"])}function Gre(n,e){1&n&&(F(0,"span",23),Te(1," *"),N())}function Wre(n,e){if(1&n){const t=Lr();F(0,"label",20,21),ye("cdkObserveContent",function(){return Vn(t),bt().updateOutlineGap()}),Ct(2,Hre,4,1,"ng-container",12),Ct(3,$re,1,0,"ng-content",12),Ct(4,Gre,2,0,"span",22),N()}if(2&n){const t=bt();at("mat-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-form-field-empty",t._control.empty&&!t._shouldAlwaysFloat())("mat-accent","accent"==t.color)("mat-warn","warn"==t.color),ie("cdkObserveContentDisabled","outline"!=t.appearance)("id",t._labelId)("ngSwitch",t._hasLabel()),en("for",t._control.id)("aria-owns",t._control.id),Y(2),ie("ngSwitchCase",!1),Y(1),ie("ngSwitchCase",!0),Y(1),ie("ngIf",!t.hideRequiredMarker&&t._control.required&&!t._control.disabled)}}function qre(n,e){1&n&&(F(0,"div",24),In(1,4),N())}function Yre(n,e){if(1&n&&(F(0,"div",25,26),et(2,"span",27),N()),2&n){const t=bt();Y(2),at("mat-accent","accent"==t.color)("mat-warn","warn"==t.color)}}function Xre(n,e){1&n&&(F(0,"div"),In(1,5),N()),2&n&&ie("@transitionMessages",bt()._subscriptAnimationState)}function Kre(n,e){if(1&n&&(F(0,"div",31),Te(1),N()),2&n){const t=bt(2);ie("id",t._hintLabelId),Y(1),Ai(t.hintLabel)}}function Zre(n,e){if(1&n&&(F(0,"div",28),Ct(1,Kre,2,2,"div",29),In(2,6),et(3,"div",30),In(4,7),N()),2&n){const t=bt();ie("@transitionMessages",t._subscriptAnimationState),Y(1),ie("ngIf",t.hintLabel)}}const Qre=["*",[["","matPrefix",""]],[["mat-placeholder"]],[["mat-label"]],[["","matSuffix",""]],[["mat-error"]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Jre=["*","[matPrefix]","mat-placeholder","mat-label","[matSuffix]","mat-error","mat-hint:not([align='end'])","mat-hint[align='end']"],Nj=new _e("MatError"),tse={transitionMessages:Jl("transitionMessages",[br("enter",Kn({opacity:1,transform:"translateY(0%)"})),Qs("void => enter",[Kn({opacity:0,transform:"translateY(-5px)"}),Mo("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let Nv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n}),n})();const Lj=new _e("MatHint");let Bf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-label"]]}),n})(),ise=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-placeholder"]]}),n})();const Bj=new _e("MatPrefix"),Vj=new _e("MatSuffix");let SO=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["","matSuffix",""]],features:[At([{provide:Vj,useExisting:n}])]}),n})(),jj=0;const ose=kf(class{constructor(n){this._elementRef=n}},"primary"),zj=new _e("MAT_FORM_FIELD_DEFAULT_OPTIONS"),XE=new _e("MatFormField");let tm=(()=>{class n extends ose{constructor(t,i,r,s,o,a,l,c){super(t),this._changeDetectorRef=i,this._dir=s,this._defaults=o,this._platform=a,this._ngZone=l,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new we,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+jj++,this._labelId="mat-form-field-label-"+jj++,this.floatLabel=this._getDefaultFloatLabelState(),this._animationsEnabled="NoopAnimations"!==c,this.appearance=o&&o.appearance?o.appearance:"legacy",this._hideRequiredMarker=!(!o||null==o.hideRequiredMarker)&&o.hideRequiredMarker}get appearance(){return this._appearance}set appearance(t){const i=this._appearance;this._appearance=t||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&i!==t&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Dt(t)}_shouldAlwaysFloat(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}_canLabelFloat(){return"never"!==this.floatLabel}get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}get floatLabel(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t||this._getDefaultFloatLabelState(),this._changeDetectorRef.markForCheck())}get _control(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic}set _control(t){this._explicitFormFieldControl=t}getLabelId(){return this._hasFloatingLabel()?this._labelId:null}getConnectedOverlayOrigin(){return this._connectionContainerRef||this._elementRef}ngAfterContentInit(){this._validateControlChild();const t=this._control;t.controlType&&this._elementRef.nativeElement.classList.add(`mat-form-field-type-${t.controlType}`),t.stateChanges.pipe(ns(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),t.ngControl&&t.ngControl.valueChanges&&t.ngControl.valueChanges.pipe(zn(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(zn(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),ki(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(ns(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(ns(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(zn(this._destroyed)).subscribe(()=>{"function"==typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this.updateOutlineGap())}):this.updateOutlineGap()})}ngAfterContentChecked(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}ngAfterViewInit(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_shouldForward(t){const i=this._control?this._control.ngControl:null;return i&&i[t]}_hasPlaceholder(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}_hasLabel(){return!(!this._labelChildNonStatic&&!this._labelChildStatic)}_shouldLabelFloat(){return this._canLabelFloat()&&(this._control&&this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_hideControlPlaceholder(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}_hasFloatingLabel(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_animateAndLockLabel(){this._hasFloatingLabel()&&this._canLabelFloat()&&(this._animationsEnabled&&this._label&&(this._showAlwaysAnimate=!0,zc(this._label.nativeElement,"transitionend").pipe(_i(1)).subscribe(()=>{this._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}_validatePlaceholders(){}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_getDefaultFloatLabelState(){return this._defaults&&this._defaults.floatLabel||"auto"}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&t.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const i=this._hintChildren?this._hintChildren.find(s=>"start"===s.align):null,r=this._hintChildren?this._hintChildren.find(s=>"end"===s.align):null;i?t.push(i.id):this._hintLabel&&t.push(this._hintLabelId),r&&t.push(r.id)}else this._errorChildren&&t.push(...this._errorChildren.map(i=>i.id));this._control.setDescribedByIds(t)}}_validateControlChild(){}updateOutlineGap(){const t=this._label?this._label.nativeElement:null;if(!("outline"===this.appearance&&t&&t.children.length&&t.textContent.trim()&&this._platform.isBrowser))return;if(!this._isAttachedToDOM())return void(this._outlineGapCalculationNeededImmediately=!0);let i=0,r=0;const s=this._connectionContainerRef.nativeElement,o=s.querySelectorAll(".mat-form-field-outline-start"),a=s.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const l=s.getBoundingClientRect();if(0===l.width&&0===l.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const c=this._getStartEnd(l),d=t.children,f=this._getStartEnd(d[0].getBoundingClientRect());let p=0;for(let g=0;g0?.75*p+10:0}for(let l=0;l{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn,_E],Nn]}),n})();function Bv(...n){if(1===n.length){const e=n[0];if(Fe(e))return KE(e,null);if(je(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return KE(t.map(i=>e[i]),t)}}if("function"==typeof n[n.length-1]){const e=n.pop();return KE(n=1===n.length&&Fe(n[0])?n[0]:n,null).pipe(be(t=>e(...t)))}return KE(n,null)}function KE(n,e){return new oe(t=>{const i=n.length;if(0===i)return void t.complete();const r=new Array(i);let s=0,o=0;for(let a=0;a{c||(c=!0,o++),r[a]=d},error:d=>t.error(d),complete:()=>{s++,(s===i||!c)&&(o===i&&t.next(e?e.reduce((d,f,p)=>(d[f]=r[p],d),{}):r),t.complete())}}))}})}function Sa(n){return function(t){const i=new ase(n),r=t.lift(i);return i.caught=r}}class ase{constructor(e){this.selector=e}call(e,t){return t.subscribe(new lse(e,this.selector,this.caught))}}class lse extends ei{constructor(e,t,i){super(e),this.selector=t,this.caught=i}error(e){if(!this.isStopped){let t;try{t=this.selector(e,this.caught)}catch(s){return void super.error(s)}this._unsubscribeAndRecycle();const i=new $r(this);this.add(i);const r=oo(t,i);r!==i&&this.add(r)}}}class cse{constructor(e){this.callback=e}call(e,t){return t.subscribe(new use(e,this.callback))}}class use extends Rt{constructor(e,t){super(e),this.add(new Ie(t))}}class $j{}class Gj{}class Gu{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(t=>{const i=t.indexOf(":");if(i>0){const r=t.slice(0,i),s=r.toLowerCase(),o=t.slice(i+1).trim();this.maybeSetNormalizedName(r,s),this.headers.has(s)?this.headers.get(s).push(o):this.headers.set(s,[o])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let i=e[t];const r=t.toLowerCase();"string"==typeof i&&(i=[i]),i.length>0&&(this.headers.set(r,i),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof Gu?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new Gu;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof Gu?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if("string"==typeof i&&(i=[i]),0===i.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":const s=e.value;if(s){let o=this.headers.get(t);if(!o)return;o=o.filter(a=>-1===s.indexOf(a)),0===o.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class dse{encodeKey(e){return Wj(e)}encodeValue(e){return Wj(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const fse=/%(\d[a-f0-9])/gi,pse={40:"@","3A":":",24:"$","2C":",","3B":";","2B":"+","3D":"=","3F":"?","2F":"/"};function Wj(n){return encodeURIComponent(n).replace(fse,(e,t)=>{var i;return null!==(i=pse[t])&&void 0!==i?i:e})}function qj(n){return`${n}`}class th{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new dse,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{const s=r.indexOf("="),[o,a]=-1==s?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const i=e.fromObject[t];this.map.set(t,Array.isArray(i)?i:[i])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(i=>{const r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new th({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(qj(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let i=this.map.get(e.param)||[];const r=i.indexOf(qj(e.value));-1!==r&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class gse{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}keys(){return this.map.keys()}}function Yj(n){return"undefined"!=typeof ArrayBuffer&&n instanceof ArrayBuffer}function Xj(n){return"undefined"!=typeof Blob&&n instanceof Blob}function Kj(n){return"undefined"!=typeof FormData&&n instanceof FormData}class Vv{constructor(e,t,i,r){let s;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==i?i:null,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params)),this.headers||(this.headers=new Gu),this.context||(this.context=new gse),this.params){const o=this.params.toString();if(0===o.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":ap.set(g,e.setHeaders[g]),c)),e.setParams&&(d=Object.keys(e.setParams).reduce((p,g)=>p.set(g,e.setParams[g]),d)),new Vv(i,r,o,{params:d,headers:c,context:f,reportProgress:l,responseType:s,withCredentials:a})}}var Ur=(()=>((Ur=Ur||{})[Ur.Sent=0]="Sent",Ur[Ur.UploadProgress=1]="UploadProgress",Ur[Ur.ResponseHeader=2]="ResponseHeader",Ur[Ur.DownloadProgress=3]="DownloadProgress",Ur[Ur.Response=4]="Response",Ur[Ur.User=5]="User",Ur))();class MO{constructor(e,t=200,i="OK"){this.headers=e.headers||new Gu,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class xO extends MO{constructor(e={}){super(e),this.type=Ur.ResponseHeader}clone(e={}){return new xO({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class ZE extends MO{constructor(e={}){super(e),this.type=Ur.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new ZE({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class Zj extends MO{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${e.url||"(unknown url)"}`:`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function TO(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials}}let im=(()=>{class n{constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Vv)s=t;else{let l,c;l=r.headers instanceof Gu?r.headers:new Gu(r.headers),r.params&&(c=r.params instanceof th?r.params:new th({fromObject:r.params})),s=new Vv(t,i,void 0!==r.body?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=st(s).pipe(function(n,e){return ci(n,e,1)}(l=>this.handler.handle(l)));if(t instanceof Vv||"events"===r.observe)return o;const a=o.pipe(Tn(l=>l instanceof ZE));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(be(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return l.body}));case"blob":return a.pipe(be(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new Error("Response is not a Blob.");return l.body}));case"text":return a.pipe(be(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new Error("Response is not a string.");return l.body}));case"json":default:return a.pipe(be(l=>l.body))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:(new th).append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,TO(r,i))}post(t,i,r={}){return this.request("POST",t,TO(r,i))}put(t,i,r={}){return this.request("PUT",t,TO(r,i))}}return n.\u0275fac=function(t){return new(t||n)(I($j))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class Qj{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const Jj=new _e("HTTP_INTERCEPTORS");let yse=(()=>{class n{intercept(t,i){return i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const vse=/^\)\]\}',?\n/;let eU=(()=>{class n{constructor(t){this.xhrFactory=t}handle(t){if("JSONP"===t.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new oe(i=>{const r=this.xhrFactory.build();if(r.open(t.method,t.urlWithParams),t.withCredentials&&(r.withCredentials=!0),t.headers.forEach((g,_)=>r.setRequestHeader(g,_.join(","))),t.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!t.headers.has("Content-Type")){const g=t.detectContentTypeHeader();null!==g&&r.setRequestHeader("Content-Type",g)}if(t.responseType){const g=t.responseType.toLowerCase();r.responseType="json"!==g?g:"text"}const s=t.serializeBody();let o=null;const a=()=>{if(null!==o)return o;const g=1223===r.status?204:r.status,_=r.statusText||"OK",y=new Gu(r.getAllResponseHeaders()),v=function(n){return"responseURL"in n&&n.responseURL?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):null}(r)||t.url;return o=new xO({headers:y,status:g,statusText:_,url:v}),o},l=()=>{let{headers:g,status:_,statusText:y,url:v}=a(),w=null;204!==_&&(w=void 0===r.response?r.responseText:r.response),0===_&&(_=w?200:0);let C=_>=200&&_<300;if("json"===t.responseType&&"string"==typeof w){const x=w;w=w.replace(vse,"");try{w=""!==w?JSON.parse(w):null}catch(L){w=x,C&&(C=!1,w={error:L,text:w})}}C?(i.next(new ZE({body:w,headers:g,status:_,statusText:y,url:v||void 0})),i.complete()):i.error(new Zj({error:w,headers:g,status:_,statusText:y,url:v||void 0}))},c=g=>{const{url:_}=a(),y=new Zj({error:g,status:r.status||0,statusText:r.statusText||"Unknown Error",url:_||void 0});i.error(y)};let d=!1;const f=g=>{d||(i.next(a()),d=!0);let _={type:Ur.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),"text"===t.responseType&&!!r.responseText&&(_.partialText=r.responseText),i.next(_)},p=g=>{let _={type:Ur.UploadProgress,loaded:g.loaded};g.lengthComputable&&(_.total=g.total),i.next(_)};return r.addEventListener("load",l),r.addEventListener("error",c),r.addEventListener("timeout",c),r.addEventListener("abort",c),t.reportProgress&&(r.addEventListener("progress",f),null!==s&&r.upload&&r.upload.addEventListener("progress",p)),r.send(s),i.next({type:Ur.Sent}),()=>{r.removeEventListener("error",c),r.removeEventListener("abort",c),r.removeEventListener("load",l),r.removeEventListener("timeout",c),t.reportProgress&&(r.removeEventListener("progress",f),null!==s&&r.upload&&r.upload.removeEventListener("progress",p)),r.readyState!==r.DONE&&r.abort()}})}}return n.\u0275fac=function(t){return new(t||n)(I(P3))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const AO=new _e("XSRF_COOKIE_NAME"),DO=new _e("XSRF_HEADER_NAME");class tU{}let Cse=(()=>{class n{constructor(t,i,r){this.doc=t,this.platform=i,this.cookieName=r,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=b3(t,this.cookieName),this.lastCookieString=t),this.lastToken}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(cl),I(AO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),OO=(()=>{class n{constructor(t,i){this.tokenService=t,this.headerName=i}intercept(t,i){const r=t.url.toLowerCase();if("GET"===t.method||"HEAD"===t.method||r.startsWith("http://")||r.startsWith("https://"))return i.handle(t);const s=this.tokenService.getToken();return null!==s&&!t.headers.has(this.headerName)&&(t=t.clone({headers:t.headers.set(this.headerName,s)})),i.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(tU),I(DO))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),wse=(()=>{class n{constructor(t,i){this.backend=t,this.injector=i,this.chain=null}handle(t){if(null===this.chain){const i=this.injector.get(Jj,[]);this.chain=i.reduceRight((r,s)=>new Qj(r,s),this.backend)}return this.chain.handle(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Gj),I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Ese=(()=>{class n{static disable(){return{ngModule:n,providers:[{provide:OO,useClass:yse}]}}static withOptions(t={}){return{ngModule:n,providers:[t.cookieName?{provide:AO,useValue:t.cookieName}:[],t.headerName?{provide:DO,useValue:t.headerName}:[]]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[OO,{provide:Jj,useExisting:OO,multi:!0},{provide:tU,useClass:Cse},{provide:AO,useValue:"XSRF-TOKEN"},{provide:DO,useValue:"X-XSRF-TOKEN"}]}),n})(),nU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[im,{provide:$j,useClass:wse},eU,{provide:Gj,useExisting:eU}],imports:[[Ese.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),n})();const Sse=["*"];function iU(n){return Error(`Unable to find icon with the name "${n}"`)}function rU(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function sU(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class Vf{constructor(e,t,i){this.url=e,this.svgText=t,this.options=i}}let jv=(()=>{class n{constructor(t,i,r,s){this._httpClient=t,this._sanitizer=i,this._errorHandler=s,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass="material-icons",this._document=r}addSvgIcon(t,i,r){return this.addSvgIconInNamespace("",t,i,r)}addSvgIconLiteral(t,i,r){return this.addSvgIconLiteralInNamespace("",t,i,r)}addSvgIconInNamespace(t,i,r,s){return this._addSvgIconConfig(t,i,new Vf(r,null,s))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,i,r,s){const o=this._sanitizer.sanitize(on.HTML,r);if(!o)throw sU(r);return this._addSvgIconConfig(t,i,new Vf("",o,s))}addSvgIconSet(t,i){return this.addSvgIconSetInNamespace("",t,i)}addSvgIconSetLiteral(t,i){return this.addSvgIconSetLiteralInNamespace("",t,i)}addSvgIconSetInNamespace(t,i,r){return this._addSvgIconSetConfig(t,new Vf(i,null,r))}addSvgIconSetLiteralInNamespace(t,i,r){const s=this._sanitizer.sanitize(on.HTML,i);if(!s)throw sU(i);return this._addSvgIconSetConfig(t,new Vf("",s,r))}registerFontClassAlias(t,i=t){return this._fontCssClassesByAlias.set(t,i),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const i=this._sanitizer.sanitize(on.RESOURCE_URL,t);if(!i)throw rU(t);const r=this._cachedIconsByUrl.get(i);return r?st(QE(r)):this._loadSvgIconFromConfig(new Vf(t,null)).pipe(Di(s=>this._cachedIconsByUrl.set(i,s)),be(s=>QE(s)))}getNamedSvgIcon(t,i=""){const r=oU(i,t);let s=this._svgIconConfigs.get(r);if(s)return this._getSvgFromConfig(s);if(s=this._getIconConfigFromResolvers(i,t),s)return this._svgIconConfigs.set(r,s),this._getSvgFromConfig(s);const o=this._iconSetConfigs.get(i);return o?this._getSvgFromIconSetConfigs(t,o):zg(iU(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?st(QE(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(be(i=>QE(i)))}_getSvgFromIconSetConfigs(t,i){const r=this._extractIconWithNameFromAnySet(t,i);return r?st(r):Bv(i.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(Sa(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(on.RESOURCE_URL,o.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),st(null)})))).pipe(be(()=>{const o=this._extractIconWithNameFromAnySet(t,i);if(!o)throw iU(t);return o}))}_extractIconWithNameFromAnySet(t,i){for(let r=i.length-1;r>=0;r--){const s=i[r];if(s.svgText&&s.svgText.indexOf(t)>-1){const o=this._svgElementFromConfig(s),a=this._extractSvgIconFromSet(o,t,s.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Di(i=>t.svgText=i),be(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?st(null):this._fetchIcon(t).pipe(Di(i=>t.svgText=i))}_extractSvgIconFromSet(t,i,r){const s=t.querySelector(`[id="${i}"]`);if(!s)return null;const o=s.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o,r);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o),r);const a=this._svgElementFromString("");return a.appendChild(o),this._setSvgAttributes(a,r)}_svgElementFromString(t){const i=this._document.createElement("DIV");i.innerHTML=t;const r=i.querySelector("svg");if(!r)throw Error(" tag not found");return r}_toSvgElement(t){const i=this._svgElementFromString(""),r=t.attributes;for(let s=0;se.lift(new cse(n))}(()=>this._inProgressUrlFetches.delete(a)),Vs());return this._inProgressUrlFetches.set(a,c),c}_addSvgIconConfig(t,i,r){return this._svgIconConfigs.set(oU(t,i),r),this}_addSvgIconSetConfig(t,i){const r=this._iconSetConfigs.get(t);return r?r.push(i):this._iconSetConfigs.set(t,[i]),this}_svgElementFromConfig(t){if(!t.svgElement){const i=this._svgElementFromString(t.svgText);this._setSvgAttributes(i,t.options),t.svgElement=i}return t.svgElement}_getIconConfigFromResolvers(t,i){for(let r=0;re?e.pathname+e.search:""}}}),aU=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Pse=aU.map(n=>`[${n}]`).join(", "),Rse=/^url\(['"]?#(.*?)['"]?\)$/;let Rs=(()=>{class n extends Ase{constructor(t,i,r,s,o){super(t),this._iconRegistry=i,this._location=s,this._errorHandler=o,this._inline=!1,this._currentIconFetch=Ie.EMPTY,r||t.nativeElement.setAttribute("aria-hidden","true")}get inline(){return this._inline}set inline(t){this._inline=Dt(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){const i=this._cleanupFontValue(t);i!==this._fontSet&&(this._fontSet=i,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){const i=this._cleanupFontValue(t);i!==this._fontIcon&&(this._fontIcon=i,this._updateFontIconClasses())}_splitIconName(t){if(!t)return["",""];const i=t.split(":");switch(i.length){case 1:return["",i[0]];case 2:return i;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const i=this._location.getPathname();i!==this._previousPath&&(this._previousPath=i,this._prependPathToReferences(i))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const i=t.querySelectorAll("style");for(let s=0;s{r.forEach(o=>{s.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){const i=t.querySelectorAll(Pse),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let s=0;s{const a=i[s],l=a.getAttribute(o),c=l?l.match(Rse):null;if(c){let d=r.get(a);d||(d=[],r.set(a,d)),d.push({name:o,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[i,r]=this._splitIconName(t);i&&(this._svgNamespace=i),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,i).pipe(_i(1)).subscribe(s=>this._setSvgElement(s),s=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${i}:${r}! ${s.message}`))})}}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(jv),fs("aria-hidden"),E(Dse),E(Uo))},n.\u0275cmp=Le({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:7,hostBindings:function(t,i){2&t&&(en("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet),at("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[ht],ngContentSelectors:Sse,decls:1,vars:0,template:function(t,i){1&t&&(Dr(),In(0))},styles:[".mat-icon{background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],encapsulation:2,changeDetection:0}),n})(),Pr=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn],Nn]}),n})();new class extends Zl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame(()=>e.flush(null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)}});let Lse=1;const Bse=Promise.resolve(),JE={};function lU(n){return n in JE&&(delete JE[n],!0)}const cU={setImmediate(n){const e=Lse++;return JE[e]=!0,Bse.then(()=>lU(e)&&n()),e},clearImmediate(n){lU(n)}};new class extends Zl{flush(e){this.active=!0,this.scheduled=void 0;const{actions:t}=this;let i,r=-1,s=t.length;e=e||t.shift();do{if(i=e.execute(e.state,e.delay))break}while(++r0?super.requestAsyncId(e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=cU.setImmediate(e.flush.bind(e,null))))}recycleAsyncId(e,t,i=0){if(null!==i&&i>0||null===i&&this.delay>0)return super.recycleAsyncId(e,t,i);0===e.actions.length&&(cU.clearImmediate(t),e.scheduled=void 0)}});function Uv(n){return!!n&&(n instanceof oe||"function"==typeof n.lift&&"function"==typeof n.subscribe)}class Hse{constructor(e){this.durationSelector=e}call(e,t){return t.subscribe(new $se(e,this.durationSelector))}}class $se extends ei{constructor(e,t){super(e),this.durationSelector=t,this.hasValue=!1}_next(e){if(this.value=e,this.hasValue=!0,!this.throttled){let t;try{const{durationSelector:r}=this;t=r(e)}catch(r){return this.destination.error(r)}const i=oo(t,new $r(this));!i||i.closed?this.clearThrottle():this.add(this.throttled=i)}}clearThrottle(){const{value:e,hasValue:t,throttled:i}=this;i&&(this.remove(i),this.throttled=void 0,i.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))}notifyNext(){this.clearThrottle()}notifyComplete(){this.clearThrottle()}}function IO(n){return!Fe(n)&&n-parseFloat(n)+1>=0}function Wse(n){const{index:e,period:t,subscriber:i}=n;if(i.next(e),!i.closed){if(-1===t)return i.complete();n.index=e+1,this.schedule(n,t)}}function eS(n,e=Tf){return function(n){return function(t){return t.lift(new Hse(n))}}(()=>function(n=0,e,t){let i=-1;return IO(e)?i=Number(e)<1?1:Number(e):Ln(e)&&(t=e),Ln(t)||(t=Tf),new oe(r=>{const s=IO(n)?n:+n-t.now();return t.schedule(Wse,s,{index:0,period:i,subscriber:r})})}(n,e))}function Hc(n,e,t){let i;return i=n&&"object"==typeof n?n:{bufferSize:n,windowTime:e,refCount:!1,scheduler:t},r=>r.lift(function({bufferSize:n=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:t,scheduler:i}){let r,o,s=0,a=!1,l=!1;return function(d){let f;s++,!r||a?(a=!1,r=new Hg(n,e,i),f=r.subscribe(this),o=d.subscribe({next(p){r.next(p)},error(p){a=!0,r.error(p)},complete(){l=!0,o=void 0,r.complete()}}),l&&(o=void 0)):f=r.subscribe(this),this.add(()=>{s--,f.unsubscribe(),f=void 0,o&&!l&&t&&0===s&&(o.unsubscribe(),o=void 0,r=void 0)})}}(i))}class uU{constructor(e=!1,t,i=!0){this._multiple=e,this._emitChanges=i,this._selection=new Set,this._deselectedToEmit=[],this._selectedToEmit=[],this.changed=new we,t&&t.length&&(e?t.forEach(r=>this._markSelected(r)):this._markSelected(t[0]),this._selectedToEmit.length=0)}get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}select(...e){this._verifyValueAssignment(e),e.forEach(t=>this._markSelected(t)),this._emitChangeEvent()}deselect(...e){this._verifyValueAssignment(e),e.forEach(t=>this._unmarkSelected(t)),this._emitChangeEvent()}toggle(e){this.isSelected(e)?this.deselect(e):this.select(e)}clear(){this._unmarkAll(),this._emitChangeEvent()}isSelected(e){return this._selection.has(e)}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(e){this._multiple&&this.selected&&this._selected.sort(e)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(e){this.isSelected(e)||(this._multiple||this._unmarkAll(),this._selection.add(e),this._emitChanges&&this._selectedToEmit.push(e))}_unmarkSelected(e){this.isSelected(e)&&(this._selection.delete(e),this._emitChanges&&this._deselectedToEmit.push(e))}_unmarkAll(){this.isEmpty()||this._selection.forEach(e=>this._unmarkSelected(e))}_verifyValueAssignment(e){}}let tS=(()=>{class n{constructor(){this._listeners=[]}notify(t,i){for(let r of this._listeners)r(t,i)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(i=>t!==i)}}ngOnDestroy(){this._listeners=[]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({factory:function(){return new n},token:n,providedIn:"root"}),n})(),rm=(()=>{class n{constructor(t,i,r){this._ngZone=t,this._platform=i,this._scrolled=new we,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const i=this.scrollContainers.get(t);i&&(i.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new oe(i=>{this._globalSubscription||this._addGlobalListener();const r=t>0?this._scrolled.pipe(eS(t)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):st()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(t,i){const r=this.getAncestorScrollContainers(t);return this.scrolled(i).pipe(Tn(s=>!s||r.indexOf(s)>-1))}getAncestorScrollContainers(t){const i=[];return this.scrollContainers.forEach((r,s)=>{this._scrollableContainsElement(s,t)&&i.push(s)}),i}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,i){let r=Hu(i),s=t.getElementRef().nativeElement;do{if(r==s)return!0}while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>zc(this._getWindow().document,"scroll").subscribe(()=>this._scrolled.next()))}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(ii),I(rt,8))},n.\u0275prov=ae({factory:function(){return new n(I(lt),I(ii),I(rt,8))},token:n,providedIn:"root"}),n})(),jf=(()=>{class n{constructor(t,i,r){this._platform=t,this._change=new we,this._changeListener=s=>{this._change.next(s)},this._document=r,i.runOutsideAngular(()=>{if(t.isBrowser){const s=this._getWindow();s.addEventListener("resize",this._changeListener),s.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){const t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){const t=this.getViewportScrollPosition(),{width:i,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+i,height:r,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,i=this._getWindow(),r=t.documentElement,s=r.getBoundingClientRect();return{top:-s.top||t.body.scrollTop||i.scrollY||r.scrollTop||0,left:-s.left||t.body.scrollLeft||i.scrollX||r.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(eS(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt),I(rt,8))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt),I(rt,8))},token:n,providedIn:"root"}),n})(),zv=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),gU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Iv,Av,zv],Iv,zv]}),n})();class PO{attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class sm extends PO{constructor(e,t,i,r){super(),this.component=e,this.viewContainerRef=t,this.injector=i,this.componentFactoryResolver=r}}class Uf extends PO{constructor(e,t,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class uoe extends PO{constructor(e){super(),this.element=e instanceof nt?e.nativeElement:e}}class nS{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof sm?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof Uf?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof uoe?(this._attachedPortal=e,this.attachDomPortal(e)):void 0}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class doe extends nS{constructor(e,t,i,r,s){super(),this.outletElement=e,this._componentFactoryResolver=t,this._appRef=i,this._defaultInjector=r,this.attachDomPortal=o=>{const a=o.element,l=this._document.createComment("dom-portal");a.parentNode.insertBefore(l,a),this.outletElement.appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(a,l)})},this._document=s}attachComponentPortal(e){const i=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component);let r;return e.viewContainerRef?(r=e.viewContainerRef.createComponent(i,e.viewContainerRef.length,e.injector||e.viewContainerRef.injector),this.setDisposeFn(()=>r.destroy())):(r=i.create(e.injector||this._defaultInjector),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=e,r}attachTemplatePortal(e){let t=e.viewContainerRef,i=t.createEmbeddedView(e.templateRef,e.context);return i.rootNodes.forEach(r=>this.outletElement.appendChild(r)),i.detectChanges(),this.setDisposeFn(()=>{let r=t.indexOf(i);-1!==r&&t.remove(r)}),this._attachedPortal=e,i}dispose(){super.dispose(),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let zf=(()=>{class n extends nS{constructor(t,i,r){super(),this._componentFactoryResolver=t,this._viewContainerRef=i,this._isInitialized=!1,this.attached=new Pe,this.attachDomPortal=s=>{const o=s.element,a=this._document.createComment("dom-portal");s.setAttachedHost(this),o.parentNode.insertBefore(a,o),this._getRootNode().appendChild(o),this._attachedPortal=s,super.setDisposeFn(()=>{a.parentNode&&a.parentNode.replaceChild(o,a)})},this._document=r}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedPortal=null,this._attachedRef=null}attachComponentPortal(t){t.setAttachedHost(this);const i=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,s=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),o=i.createComponent(s,i.length,t.injector||i.injector);return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(t){t.setAttachedHost(this);const i=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}}return n.\u0275fac=function(t){return new(t||n)(E(ol),E(es),E(rt))},n.\u0275dir=he({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:["cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ht]}),n})(),iS=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function _U(n,e=!1){return t=>t.lift(new hoe(n,e))}class hoe{constructor(e,t){this.predicate=e,this.inclusive=t}call(e,t){return t.subscribe(new foe(e,this.predicate,this.inclusive))}}class foe extends Rt{constructor(e,t,i){super(e),this.predicate=t,this.inclusive=i,this.index=0}_next(e){const t=this.destination;let i;try{i=this.predicate(e,this.index++)}catch(r){return void t.error(r)}this.nextOrComplete(e,i)}nextOrComplete(e,t){const i=this.destination;Boolean(t)?i.next(e):(this.inclusive&&i.next(e),i.complete())}}const yU=J3();class poe{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=jr(-this._previousScrollPosition.left),e.style.top=jr(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,i=e.style,r=this._document.body.style,s=i.scrollBehavior||"",o=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),yU&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),yU&&(i.scrollBehavior=s,r.scrollBehavior=o)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,i=this._viewportRuler.getViewportSize();return t.scrollHeight>i.height||t.scrollWidth>i.width}}class goe{constructor(e,t,i,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0);this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}class vU{enable(){}disable(){}attach(){}}function RO(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function bU(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class moe{constructor(e,t,i,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef=e}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:r}=this._viewportRuler.getViewportSize();RO(t,[{width:i,height:r,bottom:r,right:i,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let _oe=(()=>{class n{constructor(t,i,r,s){this._scrollDispatcher=t,this._viewportRuler=i,this._ngZone=r,this.noop=()=>new vU,this.close=o=>new goe(this._scrollDispatcher,this._ngZone,this._viewportRuler,o),this.block=()=>new poe(this._viewportRuler,this._document),this.reposition=o=>new moe(this._scrollDispatcher,this._viewportRuler,this._ngZone,o),this._document=s}}return n.\u0275fac=function(t){return new(t||n)(I(rm),I(jf),I(lt),I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rm),I(jf),I(lt),I(rt))},token:n,providedIn:"root"}),n})();class Hv{constructor(e){if(this.scrollStrategy=new vU,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){const t=Object.keys(e);for(const i of t)void 0!==e[i]&&(this[i]=e[i])}}}class yoe{constructor(e,t,i,r,s){this.offsetX=i,this.offsetY=r,this.panelClass=s,this.originX=e.originX,this.originY=e.originY,this.overlayX=t.overlayX,this.overlayY=t.overlayY}}class voe{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let CU=(()=>{class n{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const i=this._attachedOverlays.indexOf(t);i>-1&&this._attachedOverlays.splice(i,1),0===this._attachedOverlays.length&&this.detach()}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})(),boe=(()=>{class n extends CU{constructor(t){super(t),this._keydownListener=i=>{const r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){r[s]._keydownEvents.next(i);break}}}add(t){super.add(t),this._isAttached||(this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}}return n.\u0275fac=function(t){return new(t||n)(I(rt))},n.\u0275prov=ae({factory:function(){return new n(I(rt))},token:n,providedIn:"root"}),n})(),Coe=(()=>{class n extends CU{constructor(t,i){super(t),this._platform=i,this._cursorStyleIsSet=!1,this._clickListener=r=>{const s=Df(r),o=this._attachedOverlays.slice();for(let a=o.length-1;a>-1;a--){const l=o[a];if(!(l._outsidePointerEvents.observers.length<1)&&l.hasAttached()){if(l.overlayElement.contains(s))break;l._outsidePointerEvents.next(r)}}}}add(t){if(super.add(t),!this._isAttached){const i=this._document.body;i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(rt),I(ii))},token:n,providedIn:"root"}),n})();const nh="undefined"!=typeof window?window:{},wU=void 0!==nh.__karma__&&!!nh.__karma__||void 0!==nh.jasmine&&!!nh.jasmine||void 0!==nh.jest&&!!nh.jest||void 0!==nh.Mocha&&!!nh.Mocha;let om=(()=>{class n{constructor(t,i){this._platform=i,this._document=t}ngOnDestroy(){const t=this._containerElement;t&&t.parentNode&&t.parentNode.removeChild(t)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||wU){const r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let s=0;sthis._backdropClick.next(d),this._keydownEvents=new we,this._outsidePointerEvents=new we,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){let t=this._portalOutlet.attach(e);return!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host),this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this.hasAttached()&&this.updatePosition()}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenStable(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this.detachBackdrop(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host&&this._host.parentNode&&(this._host.parentNode.removeChild(this._host),this._host=null),this._previousHostParent=this._pane=null,e&&this._detachments.next(),this._detachments.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=Object.assign(Object.assign({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Object.assign(Object.assign({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=jr(this._config.width),e.height=jr(this._config.height),e.minWidth=jr(this._config.minWidth),e.minHeight=jr(this._config.minHeight),e.maxWidth=jr(this._config.maxWidth),e.maxHeight=jr(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),"undefined"!=typeof requestAnimationFrame?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(!e)return;let t,i=()=>{e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",i),e.parentNode&&e.parentNode.removeChild(e)),this._backdropElement==e&&(this._backdropElement=null),this._config.backdropClass&&this._toggleClasses(e,this._config.backdropClass,!1),clearTimeout(t)};e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",i)}),e.style.pointerEvents="none",t=this._ngZone.runOutsideAngular(()=>setTimeout(i,500))}_toggleClasses(e,t,i){const r=e.classList;mE(t).forEach(s=>{s&&(i?r.add(s):r.remove(s))})}_detachContentWhenStable(){this._ngZone.runOutsideAngular(()=>{const e=this._ngZone.onStable.pipe(zn(ki(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._previousHostParent.removeChild(this._host)),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}}const EU="cdk-overlay-connected-position-bounding-box",Eoe=/([A-Za-z%]+)$/;class SU{constructor(e,t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new we,this._resizeSubscription=Ie.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}get positions(){return this._preferredPositions}attach(e){this._validatePositions(),e.hostElement.classList.add(EU),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect();const e=this._originRect,t=this._overlayRect,i=this._viewportRect,r=[];let s;for(let o of this._preferredPositions){let a=this._getOriginPoint(e,o),l=this._getOverlayPoint(a,t,o),c=this._getOverlayFit(l,t,i,o);if(c.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(o,a);this._canFitWithFlexibleDimensions(c,l,i)?r.push({position:o,origin:a,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(a,o)}):(!s||s.overlayFit.visibleAreaa&&(a=c,o=l)}return this._isPushed=!1,void this._applyPosition(o.position,o.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Hf(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(EU),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(!this._isDisposed&&(!this._platform||this._platform.isBrowser)){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect();const e=this._lastPosition||this._preferredPositions[0],t=this._getOriginPoint(this._originRect,e);this._applyPosition(e,t)}}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t){let i,r;if("center"==t.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,o=this._isRtl()?e.left:e.right;i="start"==t.originX?s:o}return r="center"==t.originY?e.top+e.height/2:"top"==t.originY?e.top:e.bottom,{x:i,y:r}}_getOverlayPoint(e,t,i){let r,s;return r="center"==i.overlayX?-t.width/2:"start"===i.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,s="center"==i.overlayY?-t.height/2:"top"==i.overlayY?0:-t.height,{x:e.x+r,y:e.y+s}}_getOverlayFit(e,t,i,r){const s=xU(t);let{x:o,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(o+=l),c&&(a+=c);let p=0-a,g=a+s.height-i.height,_=this._subtractOverflows(s.width,0-o,o+s.width-i.width),y=this._subtractOverflows(s.height,p,g),v=_*y;return{visibleArea:v,isCompletelyWithinViewport:s.width*s.height===v,fitsInViewportVertically:y===s.height,fitsInViewportHorizontally:_==s.width}}_canFitWithFlexibleDimensions(e,t,i){if(this._hasFlexibleDimensions){const r=i.bottom-t.y,s=i.right-t.x,o=MU(this._overlayRef.getConfig().minHeight),a=MU(this._overlayRef.getConfig().minWidth),c=e.fitsInViewportHorizontally||null!=a&&a<=s;return(e.fitsInViewportVertically||null!=o&&o<=r)&&c}return!1}_pushOverlayOnScreen(e,t,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const r=xU(t),s=this._viewportRect,o=Math.max(e.x+r.width-s.width,0),a=Math.max(e.y+r.height-s.height,0),l=Math.max(s.top-i.top-e.y,0),c=Math.max(s.left-i.left-e.x,0);let d=0,f=0;return d=r.width<=s.width?c||-o:e.x_&&!this._isInitialRender&&!this._growAfterOpen&&(o=e.y-_/2)}if("end"===t.overlayX&&!r||"start"===t.overlayX&&r)p=i.width-e.x+this._viewportMargin,d=e.x-this._viewportMargin;else if("start"===t.overlayX&&!r||"end"===t.overlayX&&r)f=e.x,d=i.right-e.x;else{const g=Math.min(i.right-e.x+i.left,e.x),_=this._lastBoundingBoxSize.width;d=2*g,f=e.x-g,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(f=e.x-_/2)}return{top:o,left:f,bottom:a,right:p,width:d,height:s}}_setBoundingBoxStyles(e,t){const i=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));const r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{const s=this._overlayRef.getConfig().maxHeight,o=this._overlayRef.getConfig().maxWidth;r.height=jr(i.height),r.top=jr(i.top),r.bottom=jr(i.bottom),r.width=jr(i.width),r.left=jr(i.left),r.right=jr(i.right),r.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",r.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",s&&(r.maxHeight=jr(s)),o&&(r.maxWidth=jr(o))}this._lastBoundingBoxSize=i,Hf(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Hf(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Hf(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const i={},r=this._hasExactPosition(),s=this._hasFlexibleDimensions,o=this._overlayRef.getConfig();if(r){const d=this._viewportRuler.getViewportScrollPosition();Hf(i,this._getExactOverlayY(t,e,d)),Hf(i,this._getExactOverlayX(t,e,d))}else i.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),o.maxHeight&&(r?i.maxHeight=jr(o.maxHeight):s&&(i.maxHeight="")),o.maxWidth&&(r?i.maxWidth=jr(o.maxWidth):s&&(i.maxWidth="")),Hf(this._pane.style,i)}_getExactOverlayY(e,t,i){let r={top:"",bottom:""},s=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i));let o=this._overlayContainer.getContainerElement().getBoundingClientRect().top;return s.y-=o,"bottom"===e.overlayY?r.bottom=this._document.documentElement.clientHeight-(s.y+this._overlayRect.height)+"px":r.top=jr(s.y),r}_getExactOverlayX(e,t,i){let o,r={left:"",right:""},s=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(s=this._pushOverlayOnScreen(s,this._overlayRect,i)),o=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===o?r.right=this._document.documentElement.clientWidth-(s.x+this._overlayRect.width)+"px":r.left=jr(s.x),r}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:bU(e,i),isOriginOutsideView:RO(e,i),isOverlayClipped:bU(t,i),isOverlayOutsideView:RO(t,i)}}_subtractOverflows(e,...t){return t.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&mE(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof nt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+t,height:i,width:t}}}function Hf(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function MU(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(Eoe);return t&&"px"!==t?null:parseFloat(e)}return n||null}function xU(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}class Soe{constructor(e,t,i,r,s,o,a){this._preferredPositions=[],this._positionStrategy=new SU(i,r,s,o,a).withFlexibleDimensions(!1).withPush(!1).withViewportMargin(0),this.withFallbackPosition(e,t),this.onPositionChange=this._positionStrategy.positionChanges}get positions(){return this._preferredPositions}attach(e){this._overlayRef=e,this._positionStrategy.attach(e),this._direction&&(e.setDirection(this._direction),this._direction=null)}dispose(){this._positionStrategy.dispose()}detach(){this._positionStrategy.detach()}apply(){this._positionStrategy.apply()}recalculateLastPosition(){this._positionStrategy.reapplyLastPosition()}withScrollableContainers(e){this._positionStrategy.withScrollableContainers(e)}withFallbackPosition(e,t,i,r){const s=new yoe(e,t,i,r);return this._preferredPositions.push(s),this._positionStrategy.withPositions(this._preferredPositions),this}withDirection(e){return this._overlayRef?this._overlayRef.setDirection(e):this._direction=e,this}withOffsetX(e){return this._positionStrategy.withDefaultOffsetX(e),this}withOffsetY(e){return this._positionStrategy.withDefaultOffsetY(e),this}withLockedPosition(e){return this._positionStrategy.withLockedPosition(e),this}withPositions(e){return this._preferredPositions=e.slice(),this._positionStrategy.withPositions(this._preferredPositions),this}setOrigin(e){return this._positionStrategy.setOrigin(e),this}}const TU="cdk-global-overlay-wrapper";class Moe{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._leftOffset="",this._rightOffset="",this._alignItems="",this._justifyContent="",this._width="",this._height=""}attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(TU),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._rightOffset="",this._leftOffset=e,this._justifyContent="flex-start",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._leftOffset="",this._rightOffset=e,this._justifyContent="flex-end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._justifyContent="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:s,maxWidth:o,maxHeight:a}=i,l=!("100%"!==r&&"100vw"!==r||o&&"100%"!==o&&"100vw"!==o),c=!("100%"!==s&&"100vh"!==s||a&&"100%"!==a&&"100vh"!==a);e.position=this._cssPosition,e.marginLeft=l?"0":this._leftOffset,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=this._rightOffset,l?t.justifyContent="flex-start":"center"===this._justifyContent?t.justifyContent="center":"rtl"===this._overlayRef.getConfig().direction?"flex-start"===this._justifyContent?t.justifyContent="flex-end":"flex-end"===this._justifyContent&&(t.justifyContent="flex-start"):t.justifyContent=this._justifyContent,t.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,i=t.style;t.classList.remove(TU),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let xoe=(()=>{class n{constructor(t,i,r,s){this._viewportRuler=t,this._document=i,this._platform=r,this._overlayContainer=s}global(){return new Moe}connectedTo(t,i,r){return new Soe(i,r,t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}flexibleConnectedTo(t){return new SU(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}}return n.\u0275fac=function(t){return new(t||n)(I(jf),I(rt),I(ii),I(om))},n.\u0275prov=ae({factory:function(){return new n(I(jf),I(rt),I(ii),I(om))},token:n,providedIn:"root"}),n})(),Toe=0,Jo=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p){this.scrollStrategies=t,this._overlayContainer=i,this._componentFactoryResolver=r,this._positionBuilder=s,this._keyboardDispatcher=o,this._injector=a,this._ngZone=l,this._document=c,this._directionality=d,this._location=f,this._outsideClickDispatcher=p}create(t){const i=this._createHostElement(),r=this._createPaneElement(i),s=this._createPortalOutlet(r),o=new Hv(t);return o.direction=o.direction||this._directionality.value,new woe(s,i,r,o,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher)}position(){return this._positionBuilder}_createPaneElement(t){const i=this._document.createElement("div");return i.id="cdk-overlay-"+Toe++,i.classList.add("cdk-overlay-pane"),t.appendChild(i),i}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(Yd)),new doe(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}}return n.\u0275fac=function(t){return new(t||n)(I(_oe),I(om),I(ol),I(xoe),I(boe),I(Tt),I(lt),I(rt),I(Ko),I(Ug),I(Coe))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Aoe=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],AU=new _e("cdk-connected-overlay-scroll-strategy");let Doe=(()=>{class n{constructor(t){this.elementRef=t}}return n.\u0275fac=function(t){return new(t||n)(E(nt))},n.\u0275dir=he({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]}),n})(),DU=(()=>{class n{constructor(t,i,r,s,o){this._overlay=t,this._dir=o,this._hasBackdrop=!1,this._lockPosition=!1,this._growAfterOpen=!1,this._flexibleDimensions=!1,this._push=!1,this._backdropSubscription=Ie.EMPTY,this._attachSubscription=Ie.EMPTY,this._detachSubscription=Ie.EMPTY,this._positionSubscription=Ie.EMPTY,this.viewportMargin=0,this.open=!1,this.disableClose=!1,this.backdropClick=new Pe,this.positionChange=new Pe,this.attach=new Pe,this.detach=new Pe,this.overlayKeydown=new Pe,this.overlayOutsideClick=new Pe,this._templatePortal=new Uf(i,r),this._scrollStrategyFactory=s,this.scrollStrategy=this._scrollStrategyFactory()}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t,this._position&&this._updatePositionStrategy(this._position)}get hasBackdrop(){return this._hasBackdrop}set hasBackdrop(t){this._hasBackdrop=Dt(t)}get lockPosition(){return this._lockPosition}set lockPosition(t){this._lockPosition=Dt(t)}get flexibleDimensions(){return this._flexibleDimensions}set flexibleDimensions(t){this._flexibleDimensions=Dt(t)}get growAfterOpen(){return this._growAfterOpen}set growAfterOpen(t){this._growAfterOpen=Dt(t)}get push(){return this._push}set push(t){this._push=Dt(t)}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef&&this._overlayRef.dispose()}ngOnChanges(t){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),t.origin&&this.open&&this._position.apply()),t.open&&(this.open?this._attachOverlay():this._detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Aoe);const t=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=t.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=t.detachments().subscribe(()=>this.detach.emit()),t.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),27===i.keyCode&&!this.disableClose&&!Yo(i)&&(i.preventDefault(),this._detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{this.overlayOutsideClick.next(i)})}_buildConfig(){const t=this._position=this.positionStrategy||this._createPositionStrategy(),i=new Hv({direction:this._dir,positionStrategy:t,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop});return(this.width||0===this.width)&&(i.width=this.width),(this.height||0===this.height)&&(i.height=this.height),(this.minWidth||0===this.minWidth)&&(i.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(t){const i=this.positions.map(r=>({originX:r.originX,originY:r.originY,overlayX:r.overlayX,overlayY:r.overlayY,offsetX:r.offsetX||this.offsetX,offsetY:r.offsetY||this.offsetY,panelClass:r.panelClass||void 0}));return t.setOrigin(this.origin.elementRef).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const t=this._overlay.position().flexibleConnectedTo(this.origin.elementRef);return this._updatePositionStrategy(t),t}_attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(t=>{this.backdropClick.emit(t)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(_U(()=>this.positionChange.observers.length>0)).subscribe(t=>{this.positionChange.emit(t),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()}))}_detachOverlay(){this._overlayRef&&this._overlayRef.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Xs),E(es),E(AU),E(Ko,8))},n.\u0275dir=he({type:n,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{viewportMargin:["cdkConnectedOverlayViewportMargin","viewportMargin"],open:["cdkConnectedOverlayOpen","open"],disableClose:["cdkConnectedOverlayDisableClose","disableClose"],scrollStrategy:["cdkConnectedOverlayScrollStrategy","scrollStrategy"],offsetX:["cdkConnectedOverlayOffsetX","offsetX"],offsetY:["cdkConnectedOverlayOffsetY","offsetY"],hasBackdrop:["cdkConnectedOverlayHasBackdrop","hasBackdrop"],lockPosition:["cdkConnectedOverlayLockPosition","lockPosition"],flexibleDimensions:["cdkConnectedOverlayFlexibleDimensions","flexibleDimensions"],growAfterOpen:["cdkConnectedOverlayGrowAfterOpen","growAfterOpen"],push:["cdkConnectedOverlayPush","push"],positions:["cdkConnectedOverlayPositions","positions"],origin:["cdkConnectedOverlayOrigin","origin"],positionStrategy:["cdkConnectedOverlayPositionStrategy","positionStrategy"],width:["cdkConnectedOverlayWidth","width"],height:["cdkConnectedOverlayHeight","height"],minWidth:["cdkConnectedOverlayMinWidth","minWidth"],minHeight:["cdkConnectedOverlayMinHeight","minHeight"],backdropClass:["cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:["cdkConnectedOverlayPanelClass","panelClass"],transformOriginSelector:["cdkConnectedOverlayTransformOriginOn","transformOriginSelector"]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[qn]}),n})();const Ioe={provide:AU,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};let $v=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[Jo,Ioe],imports:[[Iv,iS,gU],gU]}),n})();const OU=["mat-button",""],IU=["*"],Roe=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],koe=kf(em(Ff(class{constructor(n){this._elementRef=n}})));let $f=(()=>{class n extends koe{constructor(t,i,r){super(t),this._focusMonitor=i,this._animationMode=r,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const s of Roe)this._hasHostAttributes(s)&&this._getHostElement().classList.add(s);t.nativeElement.classList.add("mat-button-base"),this.isRoundButton&&(this.color="accent")}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}focus(t,i){t?this._focusMonitor.focusVia(this._getHostElement(),t,i):this._getHostElement().focus(i)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...t){return t.some(i=>this._getHostElement().hasAttribute(i))}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-icon-button",""],["button","mat-fab",""],["button","mat-mini-fab",""],["button","mat-stroked-button",""],["button","mat-flat-button",""]],viewQuery:function(t,i){if(1&t&&ni(Qo,5),2&t){let r;Mt(r=xt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:function(t,i){2&t&&(en("disabled",i.disabled||null),at("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-button-disabled",i.disabled))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[ht],attrs:OU,ngContentSelectors:IU,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:function(t,i){1&t&&(Dr(),F(0,"span",0),In(1),N(),et(2,"span",1),et(3,"span",2)),2&t&&(Y(2),at("mat-button-ripple-round",i.isRoundButton||i.isIconButton),ie("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",i.isIconButton)("matRippleTrigger",i._getHostElement()))},directives:[Qo],styles:[".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:.04}@media(hover: none){.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-icon-button,.mat-stroked-button,.mat-flat-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-button.mat-button-disabled,.mat-icon-button.mat-button-disabled,.mat-stroked-button.mat-button-disabled,.mat-flat-button.mat-button-disabled{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button.mat-button-disabled{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}._mat-animation-noopable.mat-raised-button{transition:none;animation:none}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-ripple.mat-ripple,.mat-stroked-button .mat-button-focus-overlay{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab.mat-button-disabled{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-fab{transition:none;animation:none}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab.mat-button-disabled{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}._mat-animation-noopable.mat-mini-fab{transition:none;animation:none}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button i,.mat-icon-button .mat-icon{line-height:24px}.mat-button-ripple.mat-ripple,.mat-button-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1),background-color 200ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}\n"],encapsulation:2,changeDetection:0}),n})(),Gf=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn],Nn]}),n})();class RU extends Rt{notifyNext(e,t,i,r,s){this.destination.next(t)}notifyError(e,t){this.destination.error(e)}notifyComplete(e){this.destination.complete()}}class Foe extends Rt{constructor(e,t,i){super(),this.parent=e,this.outerValue=t,this.outerIndex=i,this.index=0}_next(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)}_error(e){this.parent.notifyError(e,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}function kU(n,e,t,i,r=new Foe(n,t,i)){if(!r.closed)return e instanceof oe?e.subscribe(r):Pi(e)(r)}const FU={};function or(...n){let e,t;return Ln(n[n.length-1])&&(t=n.pop()),"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&Fe(n[0])&&(n=n[0]),Ba(n,t).lift(new NU(e))}class NU{constructor(e){this.resultSelector=e}call(e,t){return t.subscribe(new Noe(e,this.resultSelector))}}class Noe extends RU{constructor(e,t){super(e),this.resultSelector=t,this.active=0,this.values=[],this.observables=[]}_next(e){this.values.push(FU),this.observables.push(e)}_complete(){const e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(let i=0;i{class n{constructor(t){this._platform=t,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):Boe}matchMedia(t){return this._platform.WEBKIT&&function(n){if(!LU.has(n))try{am||(am=document.createElement("style"),am.setAttribute("type","text/css"),document.head.appendChild(am)),am.sheet&&(am.sheet.insertRule(`@media ${n} {.fx-query-test{ }}`,0),LU.add(n))}catch(e){console.error(e)}}(t),this._matchMedia(t)}}return n.\u0275fac=function(t){return new(t||n)(I(ii))},n.\u0275prov=ae({factory:function(){return new n(I(ii))},token:n,providedIn:"root"}),n})();function Boe(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let kO=(()=>{class n{constructor(t,i){this._mediaMatcher=t,this._zone=i,this._queries=new Map,this._destroySubject=new we}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return VU(mE(t)).some(r=>this._registerQuery(r).mql.matches)}observe(t){let s=or(VU(mE(t)).map(o=>this._registerQuery(o).observable));return s=YE(s.pipe(_i(1)),s.pipe(VD(1),$g(0))),s.pipe(be(o=>{const a={matches:!1,breakpoints:{}};return o.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const i=this._mediaMatcher.matchMedia(t),s={observable:new oe(o=>{const a=l=>this._zone.run(()=>o.next(l));return i.addListener(a),()=>{i.removeListener(a)}}).pipe(ns(i),be(({matches:o})=>({query:t,matches:o})),zn(this._destroySubject)),mql:i};return this._queries.set(t,s),s}}return n.\u0275fac=function(t){return new(t||n)(I(BU),I(lt))},n.\u0275prov=ae({factory:function(){return new n(I(BU),I(lt))},token:n,providedIn:"root"}),n})();function VU(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}function Voe(n,e){if(1&n){const t=Lr();F(0,"div",1),F(1,"button",2),ye("click",function(){return Vn(t),bt().action()}),Te(2),N(),N()}if(2&n){const t=bt();Y(2),Ai(t.data.action)}}function joe(n,e){}const FO=new _e("MatSnackBarData");class rS{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}}const Uoe=Math.pow(2,31)-1;class NO{constructor(e,t){this._overlayRef=t,this._afterDismissed=new we,this._afterOpened=new we,this._onAction=new we,this._dismissedByAction=!1,this.containerInstance=e,this.onAction().subscribe(()=>this.dismiss()),e._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,Uoe))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}let zoe=(()=>{class n{constructor(t,i){this.snackBarRef=t,this.data=i}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}}return n.\u0275fac=function(t){return new(t||n)(E(NO),E(FO))},n.\u0275cmp=Le({type:n,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-simple-snackbar"],decls:3,vars:2,consts:[["class","mat-simple-snackbar-action",4,"ngIf"],[1,"mat-simple-snackbar-action"],["mat-button","",3,"click"]],template:function(t,i){1&t&&(F(0,"span"),Te(1),N(),Ct(2,Voe,3,1,"div",0)),2&t&&(Y(1),Ai(i.data.message),Y(1),ie("ngIf",i.hasAction))},directives:[Is,$f],styles:[".mat-simple-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.mat-simple-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.mat-simple-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .mat-simple-snackbar-action{margin-left:-8px;margin-right:8px}\n"],encapsulation:2,changeDetection:0}),n})();const Hoe={snackBarState:Jl("state",[br("void, hidden",Kn({transform:"scale(0.8)",opacity:0})),br("visible",Kn({transform:"scale(1)",opacity:1})),Qs("* => visible",Mo("150ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void, * => hidden",Mo("75ms cubic-bezier(0.4, 0.0, 1, 1)",Kn({opacity:0})))])};let $oe=(()=>{class n extends nS{constructor(t,i,r,s,o){super(),this._ngZone=t,this._elementRef=i,this._changeDetectorRef=r,this._platform=s,this.snackBarConfig=o,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new we,this._onExit=new we,this._onEnter=new we,this._animationState="void",this.attachDomPortal=a=>(this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachDomPortal(a)),this._live="assertive"!==o.politeness||o.announcementMessage?"off"===o.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._assertNotAttached(),this._applySnackBarClasses(),this._portalOutlet.attachTemplatePortal(t)}onAnimationEnd(t){const{fromState:i,toState:r}=t;if(("void"===r&&"void"!==i||"hidden"===r)&&this._completeExit(),"visible"===r){const s=this._onEnter;this._ngZone.run(()=>{s.next(),s.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._animationState="hidden",this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._onExit}ngOnDestroy(){this._destroyed=!0,this._completeExit()}_completeExit(){this._ngZone.onMicrotaskEmpty.pipe(_i(1)).subscribe(()=>{this._onExit.next(),this._onExit.complete()})}_applySnackBarClasses(){const t=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(r=>t.classList.add(r)):t.classList.add(i)),"center"===this.snackBarConfig.horizontalPosition&&t.classList.add("mat-snack-bar-center"),"top"===this.snackBarConfig.verticalPosition&&t.classList.add("mat-snack-bar-top")}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),i=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&i){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(r=document.activeElement),t.removeAttribute("aria-hidden"),i.appendChild(t),null==r||r.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}}return n.\u0275fac=function(t){return new(t||n)(E(lt),E(nt),E(Un),E(ii),E(rS))},n.\u0275cmp=Le({type:n,selectors:[["snack-bar-container"]],viewQuery:function(t,i){if(1&t&&ni(zf,7),2&t){let r;Mt(r=xt())&&(i._portalOutlet=r.first)}},hostAttrs:[1,"mat-snack-bar-container"],hostVars:1,hostBindings:function(t,i){1&t&&qy("@state.done",function(s){return i.onAnimationEnd(s)}),2&t&&Sg("@state",i._animationState)},features:[ht],decls:3,vars:2,consts:[["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(t,i){1&t&&(F(0,"div",0),Ct(1,joe,0,0,"ng-template",1),N(),et(2,"div")),2&t&&(Y(2),en("aria-live",i._live)("role",i._role))},directives:[zf],styles:[".mat-snack-bar-container{border-radius:4px;box-sizing:border-box;display:block;margin:24px;max-width:33vw;min-width:344px;padding:14px 16px;min-height:48px;transform-origin:center}.cdk-high-contrast-active .mat-snack-bar-container{border:solid 1px}.mat-snack-bar-handset{width:100%}.mat-snack-bar-handset .mat-snack-bar-container{margin:8px;max-width:100%;min-width:0;width:100%}\n"],encapsulation:2,data:{animation:[Hoe.snackBarState]}}),n})(),UU=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[$v,iS,bn,Gf,Nn],Nn]}),n})();const zU=new _e("mat-snack-bar-default-options",{providedIn:"root",factory:function(){return new rS}});let Woe=(()=>{class n{constructor(t,i,r,s,o,a){this._overlay=t,this._live=i,this._injector=r,this._breakpointObserver=s,this._parentSnackBar=o,this._defaultConfig=a,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=zoe,this.snackBarContainerComponent=$oe,this.handsetCssClass="mat-snack-bar-handset"}get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}openFromComponent(t,i){return this._attach(t,i)}openFromTemplate(t,i){return this._attach(t,i)}open(t,i="",r){const s=Object.assign(Object.assign({},this._defaultConfig),r);return s.data={message:t,action:i},s.announcementMessage===t&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,i){const s=Tt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:rS,useValue:i}]}),o=new sm(this.snackBarContainerComponent,i.viewContainerRef,s),a=t.attach(o);return a.instance.snackBarConfig=i,a.instance}_attach(t,i){const r=Object.assign(Object.assign(Object.assign({},new rS),this._defaultConfig),i),s=this._createOverlay(r),o=this._attachSnackBarContainer(s,r),a=new NO(o,s);if(t instanceof Xs){const l=new Uf(t,null,{$implicit:r.data,snackBarRef:a});a.instance=o.attachTemplatePortal(l)}else{const l=this._createInjector(r,a),c=new sm(t,void 0,l),d=o.attachComponentPortal(c);a.instance=d.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(zn(s.detachments())).subscribe(l=>{const c=s.overlayElement.classList;l.matches?c.add(this.handsetCssClass):c.remove(this.handsetCssClass)}),r.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(a,r),this._openedSnackBarRef=a,this._openedSnackBarRef}_animateSnackBar(t,i){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),i.duration&&i.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(i.duration))}_createOverlay(t){const i=new Hv;i.direction=t.direction;let r=this._overlay.position().global();const s="rtl"===t.direction,o="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!s||"end"===t.horizontalPosition&&s,a=!o&&"center"!==t.horizontalPosition;return o?r.left("0"):a?r.right("0"):r.centerHorizontally(),"top"===t.verticalPosition?r.top("0"):r.bottom("0"),i.positionStrategy=r,this._overlay.create(i)}_createInjector(t,i){return Tt.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:NO,useValue:i},{provide:FO,useValue:t.data}]})}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(wE),I(Tt),I(kO),I(n,12),I(zU))},n.\u0275prov=ae({factory:function(){return new n(I(Jo),I(wE),I(ku),I(kO),I(n,12),I(zU))},token:n,providedIn:UU}),n})();function De(n,e,t,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function bs(n,e){return function(t,i){e(t,i,n)}}function Ge(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function gl(n,e,t,i){return new(t||(t=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(f){o(f)}}function l(d){try{c(i.throw(d))}catch(f){o(f)}}function c(d){d.done?s(d.value):function(s){return s instanceof t?s:new t(function(o){o(s)})}(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function WU(n){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,t=n||e;return!!(t&&t.indexOf("Electron")>=0)}function BO(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||WU()}const qU="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source",oS=BO();class Koe{constructor(e,t,i="sessionStorage"){this.storage=function(n){try{const e=window[n],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(e){return null}}(i),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function VO(n,e,t,i=600){const r=n.src.replace(/\(/g,"%28").replace(/\)/g,"%29");n.width>i&&(t=Math.min(t,i/n.width));const s=n.width*t,o=n.height*t,a=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(r,");"),"background-size:".concat(s,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}const YU={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function XU(n){return"string"==typeof n?YU[n.toUpperCase()]||YU.WHITE:n}function aS(n,e){if(!n)throw new Error(e||"Assertion failed")}const tc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},Gv=tc.window||tc.self||tc.global,KU=tc.process||{};function lm(){let n;if(oS&&Gv.performance)n=Gv.performance.now();else if(KU.hrtime){const e=KU.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}console;const cm={debug:oS&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},iae={enabled:!0,level:0};function ml(){}const ZU={},QU={once:!0};function rae(n){for(const e in n)for(const t in n[e])return t||"untitled";return"empty"}let jO=(()=>{class n{constructor({id:t}={id:""}){this.id=t,this.VERSION=qU,this._startTs=lm(),this._deltaTs=lm(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new Koe("__probe-".concat(this.id,"__"),iae),this.userData={},this.timeStamp("".concat(this.id," started")),function(n,e=["constructor"]){const t=Object.getPrototypeOf(n),i=Object.getOwnPropertyNames(t);for(const r of i)"function"==typeof n[r]&&(e.find(s=>r===s)||(n[r]=n[r].bind(n)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((lm()-this._startTs).toPrecision(10))}getDelta(){return Number((lm()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,i){aS(t,i)}warn(t){return this._getLogFunction(0,t,cm.warn,arguments,QU)}error(t){return this._getLogFunction(0,t,cm.error,arguments)}deprecated(t,i){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(i,"` instead"))}removed(t,i){return this.error("`".concat(t,"` has been removed. Use `").concat(i,"` instead"))}probe(t,i){return this._getLogFunction(t,i,cm.log,arguments,{time:!0,once:!0})}log(t,i){return this._getLogFunction(t,i,cm.debug,arguments)}info(t,i){return this._getLogFunction(t,i,console.info,arguments)}once(t,i){return this._getLogFunction(t,i,cm.debug||cm.info,arguments,QU)}table(t,i,r){return i?this._getLogFunction(t,i,console.table||ml,r&&[r],{tag:rae(i)}):ml}image({logLevel:t,priority:i,image:r,message:s="",scale:o=1}){return this._shouldLog(t||i)?oS?function({image:n,message:e="",scale:t=1}){if("string"==typeof n){const r=new Image;return r.onload=()=>{const s=VO(r,e,t);console.log(...s)},r.src=n,ml}const i=n.nodeName||"";if("img"===i.toLowerCase())return console.log(...VO(n,e,t)),ml;if("canvas"===i.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...VO(r,e,t)),r.src=n.toDataURL(),ml}return ml}({image:r,message:s,scale:o}):function({image:n,message:e="",scale:t=1}){let i=null;try{i=Ve(307)}catch(r){}return i?()=>i(n,{fit:"box",width:"".concat(Math.round(80*t),"%")}).then(r=>console.log(r)):ml}({image:r,message:s,scale:o}):ml}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,i){this._storage.updateConfiguration({[t]:i})}time(t,i){return this._getLogFunction(t,i,console.time?console.time:console.info)}timeEnd(t,i){return this._getLogFunction(t,i,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,i){return this._getLogFunction(t,i,console.timeStamp||ml)}group(t,i,r={collapsed:!1}){r=ez({logLevel:t,message:i,opts:r});const{collapsed:s}=r;return r.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,i,r={}){return this.group(t,i,Object.assign({},r,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ml)}withGroup(t,i,r){this.group(t,i)();try{r()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=JU(t)}_getLogFunction(t,i,r,s=[],o){if(this._shouldLog(t)){o=ez({logLevel:t,message:i,args:s,opts:o}),aS(r=r||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=lm();const a=o.tag||o.message;if(o.once){if(ZU[a])return ml;ZU[a]=lm()}return i=function(n,e,t){if("string"==typeof e){const i=t.time?function(n,e=8){const t=Math.max(e-n.length,0);return"".concat(" ".repeat(t)).concat(n)}(function(n){let e;return e=n<10?"".concat(n.toFixed(2),"ms"):n<100?"".concat(n.toFixed(1),"ms"):n<1e3?"".concat(n.toFixed(0),"ms"):"".concat((n/1e3).toFixed(2),"s"),e}(t.total)):"";e=function(n,e,t){return!oS&&"string"==typeof n&&(e&&(e=XU(e),n="\x1b[".concat(e,"m").concat(n,"\x1b[39m")),t&&(e=XU(t),n="\x1b[".concat(t+10,"m").concat(n,"\x1b[49m"))),n}(e=t.time?"".concat(n,": ").concat(i," ").concat(e):"".concat(n,": ").concat(e),t.color,t.background)}return e}(this.id,o.message,o),r.bind(console,i,...o.args)}return ml}}return n.VERSION=qU,n})();function JU(n){if(!n)return 0;let e;switch(typeof n){case"number":e=n;break;case"object":e=n.logLevel||n.priority||0;break;default:return 0}return aS(Number.isFinite(e)&&e>=0),e}function ez(n){const{logLevel:e,message:t}=n;n.logLevel=JU(e);const i=n.args?Array.from(n.args):[];for(;i.length&&i.shift()!==t;);switch(n.args=i,typeof e){case"string":case"function":void 0!==t&&i.unshift(t),n.message=e;break;case"object":Object.assign(n,e)}"function"==typeof n.message&&(n.message=n.message());const r=typeof n.message;return aS("string"===r||"object"===r),Object.assign(n,n.opts)}const Zn=new jO({id:"deck"}),Hn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(Hn,"IDENTITY",{get:()=>Zn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const $c={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},tz={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},ct=new jO({id:"luma.gl"});function xo(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function lS(n){return"undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext||"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&Number.isFinite(n._version))}function Mn(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}function cS(n){return xo(lS(n),"Invalid WebGLRenderingContext"),n}function To(n){return xo(Mn(n),"Requires WebGL2"),n}var Zi=Ve(761);const Wv={};const qv=function n(e){const t=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let i=0;i{Zi.CO.console&&Zi.CO.console.log&&Zi.CO.console.log("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Wf.prototype.VERTEX_ARRAY_BINDING_OES=34229,Wf.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let i=0;iMn(n)?void 0:0,Mae={3074:n=>Mn(n)?void 0:36064,35723:n=>Mn(n)?void 0:4352,35977:Li,32937:Li,36795:(n,e)=>{const t=Mn(n)?n.getExtension("EXT_disjoint_timer_query_webgl2"):n.getExtension("EXT_disjoint_timer_query");return t&&t.GPU_DISJOINT_EXT?e(t.GPU_DISJOINT_EXT):0},37445:(n,e)=>{const t=n.getExtension(rz);return e(t&&t.UNMASKED_VENDOR_WEBGL||7936)},37446:(n,e)=>{const t=n.getExtension(rz);return e(t&&t.UNMASKED_RENDERER_WEBGL||7937)},34047:(n,e)=>{const t=n.luma.extensions.EXT_texture_filter_anisotropic;return t?e(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:Li,35071:Li,37447:Li,36063:(n,e)=>{if(!Mn(n)){const t=n.getExtension(iz);return t?e(t.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:Li,35374:Li,35377:Li,34852:n=>{if(!Mn(n)){const e=n.getExtension(iz);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:n=>n.getExtension(nz)?2147483647:65535,33001:n=>n.getExtension(nz)?16777216:65535,33e3:n=>16777216,37157:Li,35373:Li,35657:Li,36183:Li,37137:Li,34045:Li,35978:Li,35979:Li,35968:Li,35376:Li,35375:Li,35659:Li,37154:Li,35371:Li,35658:Li,35076:Li,35077:Li,35380:Li},sz="ANGLE_instanced_arrays",oz={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{xo(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[sz]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(n,e){xo(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{xo(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{xo(!1)},deleteQuery:()=>{xo(!1)},beginQuery:()=>{xo(!1)},endQuery:()=>{},getQuery(n,e){return this.getQueryObject(n,e)},getQueryParameter(n,e){return this.getQueryObject(n,e)},getQueryObject:()=>{}}},UO={readBuffer:(n,e,t)=>{Mn(n)&&e(t)},getVertexAttrib:(n,e,t,i)=>{const{webgl2:r,ext:s}=function(n,e){return{webgl2:Mn(n),ext:n.getExtension("ANGLE_instanced_arrays")}}(n);let o;switch(i){case 35069:o=!!r&&void 0;break;case 35070:o=r||s?void 0:0}return void 0!==o?o:e(t,i)},getProgramParameter:(n,e,t,i)=>{if(!Mn(n))switch(i){case 35967:return 35981;case 35971:case 35382:return 0}return e(t,i)},getInternalformatParameter:(n,e,t,i,r)=>{if(!Mn(n))switch(r){case 32937:return new Int32Array([0])}return n.getInternalformatParameter(t,i,r)},getTexParameter(n,e,t,i){switch(i){case 34046:const{extensions:r}=n.luma,s=r.EXT_texture_filter_anisotropic;i=s&&s.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(t,i)},getParameter:function(n,e,t){const i=Mae[t],r="function"==typeof i?i(n,e,t):i;return void 0!==r?r:e(t)},hint:(n,e,t,i)=>e(t,i)};function Bae(n,{extension:e,target:t,target2:i}){const r=oz[e];xo(r);const{meta:s={}}=r,{suffix:o=""}=s,a=n.getExtension(e);for(const l of Object.keys(r)){const c=`${l}${o}`;let d=null;"meta"===l||"function"==typeof n[l]||(a&&"function"==typeof a[c]?d=(...f)=>a[c](...f):"function"==typeof r[l]&&(d=r[l].bind(t))),d&&(t[l]=d,i[l]=d)}}("undefined"!=typeof global?global:window).polyfillContext=function(n){n.luma=n.luma||{};const{luma:e}=n;return e.polyfilled||(function(n){if("function"==typeof n.createVertexArray)return;const e=n.getSupportedExtensions;n.getSupportedExtensions=function(){const r=e.call(this)||[];return r.indexOf("OES_vertex_array_object")<0&&r.push("OES_vertex_array_object"),r};const t=n.getExtension;n.getExtension=function(r){return t.call(this,r)||("OES_vertex_array_object"!==r?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new Wf(this)),this.__OESVertexArrayObject))}}(n),function(n){n.luma.extensions={};const e=n.getSupportedExtensions()||[];for(const t of e)n.luma[t]=n.getExtension(t)}(n),function(n,e){for(const t of Object.getOwnPropertyNames(e))"overrides"!==t&&Bae(n,{extension:t,target:n.luma,target2:n})}(n,oz),function(n,{target:e,target2:t}){Object.keys(UO).forEach(i=>{if("function"==typeof UO[i]){const r=n[i]?n[i].bind(n):()=>{},s=UO[i].bind(null,n,r);e[i]=s,t[i]=s}})}(n,{target:e,target2:n}),e.polyfilled=!0),n};const zO={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},ih=(n,e,t)=>e?n.enable(t):n.disable(t),az=(n,e,t)=>n.hint(t,e),Ma=(n,e,t)=>n.pixelStorei(t,e);function Yv(n){return Array.isArray(n)||ArrayBuffer.isView(n)}const Uae={3042:ih,32773:(n,e)=>n.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(n,e)=>n.clearColor(...e),3107:(n,e)=>n.colorMask(...e),2884:ih,2885:(n,e)=>n.cullFace(e),2929:ih,2931:(n,e)=>n.clearDepth(e),2932:(n,e)=>n.depthFunc(e),2928:(n,e)=>n.depthRange(...e),2930:(n,e)=>n.depthMask(e),3024:ih,35723:az,36006:(n,e)=>{const t=Mn(n)?36009:36160;return n.bindFramebuffer(t,e)},2886:(n,e)=>n.frontFace(e),33170:az,2849:(n,e)=>n.lineWidth(e),32823:ih,32824:"polygonOffset",10752:"polygonOffset",35977:ih,32938:"sampleCoverage",32939:"sampleCoverage",3089:ih,3088:(n,e)=>n.scissor(...e),2960:ih,2961:(n,e)=>n.clearStencil(e),2968:(n,e)=>n.stencilMaskSeparate(1028,e),36005:(n,e)=>n.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(n,e)=>n.viewport(...e),3333:Ma,3317:Ma,37440:Ma,37441:Ma,37443:Ma,3330:Ma,3332:Ma,3331:Ma,36010:(n,e)=>n.bindFramebuffer(36008,e),3314:Ma,32878:Ma,3316:Ma,3315:Ma,32877:Ma,framebuffer:(n,e)=>n.bindFramebuffer(36160,e&&"handle"in e?e.handle:e),blend:(n,e)=>e?n.enable(3042):n.disable(3042),blendColor:(n,e)=>n.blendColor(...e),blendEquation:(n,e)=>{e=Yv(e)?e:[e,e],n.blendEquationSeparate(...e)},blendFunc:(n,e)=>{e=Yv(e)&&2===e.length?[...e,...e]:e,n.blendFuncSeparate(...e)},clearColor:(n,e)=>n.clearColor(...e),clearDepth:(n,e)=>n.clearDepth(e),clearStencil:(n,e)=>n.clearStencil(e),colorMask:(n,e)=>n.colorMask(...e),cull:(n,e)=>e?n.enable(2884):n.disable(2884),cullFace:(n,e)=>n.cullFace(e),depthTest:(n,e)=>e?n.enable(2929):n.disable(2929),depthFunc:(n,e)=>n.depthFunc(e),depthMask:(n,e)=>n.depthMask(e),depthRange:(n,e)=>n.depthRange(...e),dither:(n,e)=>e?n.enable(3024):n.disable(3024),derivativeHint:(n,e)=>{n.hint(35723,e)},frontFace:(n,e)=>n.frontFace(e),mipmapHint:(n,e)=>n.hint(33170,e),lineWidth:(n,e)=>n.lineWidth(e),polygonOffsetFill:(n,e)=>e?n.enable(32823):n.disable(32823),polygonOffset:(n,e)=>n.polygonOffset(...e),sampleCoverage:(n,e)=>n.sampleCoverage(...e),scissorTest:(n,e)=>e?n.enable(3089):n.disable(3089),scissor:(n,e)=>n.scissor(...e),stencilTest:(n,e)=>e?n.enable(2960):n.disable(2960),stencilMask:(n,e)=>{e=Yv(e)?e:[e,e];const[t,i]=e;n.stencilMaskSeparate(1028,t),n.stencilMaskSeparate(1029,i)},stencilFunc:(n,e)=>{e=Yv(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilFuncSeparate(1028,t,i,r),n.stencilFuncSeparate(1029,s,o,a)},stencilOp:(n,e)=>{e=Yv(e)&&3===e.length?[...e,...e]:e;const[t,i,r,s,o,a]=e;n.stencilOpSeparate(1028,t,i,r),n.stencilOpSeparate(1029,s,o,a)},viewport:(n,e)=>n.viewport(...e)};function Cr(n,e,t){return void 0!==e[n]?e[n]:t[n]}const zae={blendEquation:(n,e,t)=>n.blendEquationSeparate(Cr(32777,e,t),Cr(34877,e,t)),blendFunc:(n,e,t)=>n.blendFuncSeparate(Cr(32969,e,t),Cr(32968,e,t),Cr(32971,e,t),Cr(32970,e,t)),polygonOffset:(n,e,t)=>n.polygonOffset(Cr(32824,e,t),Cr(10752,e,t)),sampleCoverage:(n,e,t)=>n.sampleCoverage(Cr(32938,e,t),Cr(32939,e,t)),stencilFuncFront:(n,e,t)=>n.stencilFuncSeparate(1028,Cr(2962,e,t),Cr(2967,e,t),Cr(2963,e,t)),stencilFuncBack:(n,e,t)=>n.stencilFuncSeparate(1029,Cr(34816,e,t),Cr(36003,e,t),Cr(36004,e,t)),stencilOpFront:(n,e,t)=>n.stencilOpSeparate(1028,Cr(2964,e,t),Cr(2965,e,t),Cr(2966,e,t)),stencilOpBack:(n,e,t)=>n.stencilOpSeparate(1029,Cr(34817,e,t),Cr(34818,e,t),Cr(34819,e,t))},lz={enable:(n,e)=>n({[e]:!0}),disable:(n,e)=>n({[e]:!1}),pixelStorei:(n,e,t)=>n({[e]:t}),hint:(n,e,t)=>n({[e]:t}),bindFramebuffer:(n,e,t)=>{switch(e){case 36160:return n({36006:t,36010:t});case 36009:return n({36006:t});case 36008:return n({36010:t});default:return null}},blendColor:(n,e,t,i,r)=>n({32773:new Float32Array([e,t,i,r])}),blendEquation:(n,e)=>n({32777:e,34877:e}),blendEquationSeparate:(n,e,t)=>n({32777:e,34877:t}),blendFunc:(n,e,t)=>n({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(n,e,t,i,r)=>n({32969:e,32968:t,32971:i,32970:r}),clearColor:(n,e,t,i,r)=>n({3106:new Float32Array([e,t,i,r])}),clearDepth:(n,e)=>n({2931:e}),clearStencil:(n,e)=>n({2961:e}),colorMask:(n,e,t,i,r)=>n({3107:[e,t,i,r]}),cullFace:(n,e)=>n({2885:e}),depthFunc:(n,e)=>n({2932:e}),depthRange:(n,e,t)=>n({2928:new Float32Array([e,t])}),depthMask:(n,e)=>n({2930:e}),frontFace:(n,e)=>n({2886:e}),lineWidth:(n,e)=>n({2849:e}),polygonOffset:(n,e,t)=>n({32824:e,10752:t}),sampleCoverage:(n,e,t)=>n({32938:e,32939:t}),scissor:(n,e,t,i,r)=>n({3088:new Int32Array([e,t,i,r])}),stencilMask:(n,e)=>n({2968:e,36005:e}),stencilMaskSeparate:(n,e,t)=>n({[1028===e?2968:36005]:t}),stencilFunc:(n,e,t,i)=>n({2962:e,2967:t,2963:i,34816:e,36003:t,36004:i}),stencilFuncSeparate:(n,e,t,i,r)=>n({[1028===e?2962:34816]:t,[1028===e?2967:36003]:i,[1028===e?2963:36004]:r}),stencilOp:(n,e,t,i)=>n({2964:e,2965:t,2966:i,34817:e,34818:t,34819:i}),stencilOpSeparate:(n,e,t,i,r)=>n({[1028===e?2964:34817]:t,[1028===e?2965:34818]:i,[1028===e?2966:34819]:r}),viewport:(n,e,t,i,r)=>n({2978:[e,t,i,r]})},Gc=(n,e)=>n.isEnabled(e),cz={3042:Gc,2884:Gc,2929:Gc,3024:Gc,32823:Gc,32926:Gc,32928:Gc,3089:Gc,2960:Gc,35977:Gc};function uz(n){for(const e in n)return!1;return!0}function Hae(n,e){if(n===e)return!0;const t=Array.isArray(n)||ArrayBuffer.isView(n),i=Array.isArray(e)||ArrayBuffer.isView(e);if(t&&i&&n.length===e.length){for(let r=0;r{})}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?function(n,e){if("number"==typeof(e=e||zO)){const r=e,s=cz[r];return s?s(n,r):n.getParameter(r)}const t=Array.isArray(e)?e:Object.keys(e),i={};for(const r of t){const s=cz[r];i[r]=s?s(n,Number(r)):n.getParameter(Number(r))}return i}(e):Object.assign({},zO),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){xo(this.stateStack.length>0),Wu(this.gl,this.stateStack[this.stateStack.length-1]),this.stateStack.pop()}_updateCache(e){let i,t=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const s in e){xo(void 0!==s);const o=e[s],a=this.cache[s];Hae(o,a)||(t=!0,i=a,r&&!(s in r)&&(r[s]=a),this.cache[s]=o)}return{valueChanged:t,oldValue:i}}}function hz(n,e={}){const{enable:t=!0,copyState:i}=e;if(xo(void 0!==i),!n.state){const r="undefined"!=typeof global?global:window,{polyfillContext:s}=r;s&&s(n),n.state=new Wae(n,{copyState:i}),function(n){const e=n.useProgram.bind(n);n.useProgram=function(i){n.state.program!==i&&(e(i),n.state.program=i)}}(n);for(const o in lz)$ae(n,o,lz[o]);dz(n,"getParameter"),dz(n,"isEnabled")}return n.state.enable=t,n}function fz(n){xo(n.state),n.state.pop()}function Wu(n,e){if(xo(lS(n),"setParameters requires a WebGL context"),uz(e))return;const t={};for(const r in e){const s=Number(r),o=Uae[r];o&&("string"==typeof o?t[o]=!0:o(n,e[r],s))}const i=n.state&&n.state.cache;if(i)for(const r in t)zae[r](n,e,i)}function nc(n,e,t){if(uz(e))return t(n);const{nocatch:i=!0}=e;let r;if(function(n){n.state||hz(n,{copyState:!1}),n.state.push()}(n),Wu(n,e),i)r=t(n),fz(n);else try{r=t(n)}finally{fz(n)}return r}function um(n){const{luma:e}=n;if(n.canvas&&e){const{clientWidth:t}=e.canvasSizeInfo;return t?n.drawingBufferWidth/t:1}return 1}function HO(n,e,t=!0){return function(n,e,t,i,r){const s=pz(n[0],e,t);let o=gz(n[1],e,i,r),a=pz(n[0]+1,e,t);const l=a===t-1?a:a-1;let c;return a=gz(n[1]+1,e,i,r),r?(a=0===a?a:a+1,c=o,o=a):c=a===i-1?a:a-1,{x:s,y:o,width:Math.max(l-s+1,1),height:Math.max(c-o+1,1)}}(e,um(n),n.drawingBufferWidth,n.drawingBufferHeight,t)}function pz(n,e,t){return Math.min(Math.round(n*e),t-1)}function gz(n,e,t,i){return i?Math.max(0,t-1-Math.round(n*e)):Math.min(Math.round(n*e),t-1)}const $O=(0,Zi.jU)(),Qae=$O&&"undefined"!=typeof document,mz={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function _z(n={}){xo($O,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),n=Object.assign({},mz,n);const{width:e,height:t}=n;function i(a){if(n.throwOnError)throw new Error(a);return console.error(a),null}let r;n.onError=i;const{canvas:s}=n,o=function({canvas:n,width:e=800,height:t=600,onError:i}){let r;return"string"==typeof n?(Qae&&"complete"===document.readyState||i(`createGLContext called on canvas '${n}' before page was loaded`),r=document.getElementById(n)):n?r=n:(r=document.createElement("canvas"),r.id="lumagl-canvas",r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(t)?`${t}px`:"100%",document.body.insertBefore(r,document.body.firstChild)),r}({canvas:s,width:e,height:t,onError:i});return r=function(n,e){const{onError:t}=e;let i=null;const r=l=>i=l.statusMessage||i;n.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:s=!0,webgl2:o=!0}=e;let a=null;return o&&(a=a||n.getContext("webgl2",e),a=a||n.getContext("experimental-webgl2",e)),s&&(a=a||n.getContext("webgl",e),a=a||n.getContext("experimental-webgl",e)),n.removeEventListener("webglcontextcreationerror",r,!1),a?(e.onContextLost&&n.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&n.addEventListener("webglcontextrestored",e.onContextRestored,!1),a):t(`Failed to create ${o&&!s?"WebGL2":"WebGL"} context: ${i||"Unknown error"}`)}(o,n),r?(r=GO(r,n),function(n){const e=Mn(n)?"WebGL2":"WebGL1",t=function(n){const e=n.getParameter(7936),t=n.getParameter(7937),i=n.getExtension("WEBGL_debug_renderer_info");return{vendor:i&&n.getParameter(i.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:i&&n.getParameter(i.UNMASKED_RENDERER_WEBGL||7937)||t,vendorMasked:e,rendererMasked:t,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n);ct.info(1,`${e}${n.debug?" debug":""} context ${t?`(${t.vendor},${t.renderer})`:""}`)()}(r),r):null}function GO(n,e={}){if(!n||n._instrumented)return n;n._version=n._version||function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext?2:1}(n),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{},e=Object.assign({},mz,e);const{manageState:t,debug:i}=e;return t&&hz(n,{copyState:!1,log:(...r)=>ct.log(1,...r)()}),$O&&i&&(Zi.CO.makeDebugContext?(n=Zi.CO.makeDebugContext(n,e),ct.level=Math.max(ct.level,1)):ct.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),n._instrumented=!0,n}function yz(){let n;if("undefined"!=typeof window&&window.performance)n=window.performance.now();else if("undefined"!=typeof process&&process.hrtime){const e=process.hrtime();n=1e3*e[0]+e[1]/1e6}else n=Date.now();return n}class vz{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=yz(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(yz()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class WO{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:i}=e;return this.stats[t]||(this.stats[t]=e instanceof vz?e:new vz(t,i)),this.stats[t]}}const Xv="8.5.7",qf=new class{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new WO({id:e})),this.stats.get(e)}};if(Zi.CO.luma&&Zi.CO.luma.VERSION!==Xv)throw new Error(`luma.gl - multiple VERSIONs detected: ${Zi.CO.luma.VERSION} vs 8.5.7`);function Qe(n,e){if(!n)throw new Error(e||"luma.gl: assertion failed.")}function qO(n,e){if("string"!=typeof e)return e;const t=Number(e);if(!isNaN(t))return t;const i=n[e=e.replace(/^.*\./,"")];return Qe(void 0!==i,`Accessing undefined constant GL.${e}`),i}function rh(n,e){e=Number(e);for(const t in n)if(n[t]===e)return`GL.${t}`;return String(e)}Zi.CO.luma||((0,Zi.jU)()&&ct.log(1,"luma.gl 8.5.7 - set luma.log.level=1 (or higher) to trace rendering")(),Zi.CO.luma=Zi.CO.luma||{VERSION:Xv,version:Xv,log:ct,stats:qf,globals:{modules:{},nodeIO:{}}});const YO={};function Wc(n="id"){return YO[n]=YO[n]||1,`${n}-${YO[n]++}`}function bz(n){return Qe("number"==typeof n,"Input must be a number"),n&&0==(n&n-1)}function dm(n){let e=!0;for(const t in n){e=!1;break}return e}function Cz(n,e,t,i){const r=`See luma.gl ${t} Upgrade Guide at https://luma.gl/docs/upgrade-guide`,s=Object.getPrototypeOf(n);i.forEach(o=>{s.methodName||(s[o]=()=>{throw ct.removed(`Calling removed method ${e}.${o}: `,r)(),new Error(o)})})}const hm="Resource subclass must define virtual methods";class qu{constructor(e,t={}){cS(e);const{id:i,userData:r={}}=t;this.gl=e,this.gl2=e,this.id=i||Wc(this.constructor.name),this.userData=r,this._bound=!1,this._handle=t.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return`${this.constructor.name}(${this.id})`}get handle(){return this._handle}delete({deleteChildren:e=!1}={}){const t=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,t&&e&&t.filter(Boolean).forEach(i=>i.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){Qe(e=qO(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Mn(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension)){const a=r.webgl1,l="webgl2"in r?r.webgl2:r.webgl1;return s?l:a}}return this._getParameter(e,t)}getParameters(e={}){const{parameters:t,keys:i}=e,r=this.constructor.PARAMETERS||{},s=Mn(this.gl),o={},a=t||Object.keys(r);for(const l of a){const c=r[l];if(c&&(!("webgl2"in c)||s)&&(!("extension"in c)||this.gl.getExtension(c.extension))){const f=i?rh(this.gl,l):l;o[f]=this.getParameter(l,e),i&&"GLenum"===c.type&&(o[f]=rh(this.gl,o[f]))}}return o}setParameter(e,t){Qe(e=qO(this.gl,e));const r=(this.constructor.PARAMETERS||{})[e];if(r){const s=Mn(this.gl);if("webgl2"in r&&!s||"extension"in r&&!this.gl.getExtension(r.extension))throw new Error("Parameter not available on this platform");"GLenum"===r.type&&(t=qO(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,i){return Cz(this,e,t,i)}initialize(e){}_createHandle(){throw new Error(hm)}_deleteHandle(){throw new Error(hm)}_bindHandle(e){throw new Error(hm)}_getOptsFromHandle(){throw new Error(hm)}_getParameter(e,t){throw new Error(hm)}_setParameter(e,t){throw new Error(hm)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const e=this.constructor.name,t=qf.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(`${e}s Created`).incrementCount(),t.get(`${e}s Active`).incrementCount()}_removeStats(){const e=this.constructor.name;qf.get("Resource Counts").get(`${e}s Active`).decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const i=qf.get("Memory Usage");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=qf.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(`${e} Memory`).subtractCount(this.byteLength),this.byteLength=0}}function XO(n){switch(ArrayBuffer.isView(n)?n.constructor:n){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function Kv(n,{clamped:e=!0}={}){switch(n){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function ule({data:n,width:e,height:t}){const i=Math.round(e/2),r=Math.round(t/2),s=new Uint8Array(i*r*4);for(let o=0;othis._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return ea.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return ea.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=KO("Accessor",e,hle)).type&&(this.type=e.type,(5124===e.type||5125===e.type)&&(this.integer=!0)),void 0!==e.size&&(this.size=e.size),void 0!==e.offset&&(this.offset=e.offset),void 0!==e.stride&&(this.stride=e.stride),void 0!==e.normalized&&(this.normalized=e.normalized),void 0!==e.integer&&(this.integer=e.integer),void 0!==e.divisor&&(this.divisor=e.divisor),void 0!==e.buffer&&(this.buffer=e.buffer),void 0!==e.index&&(this.index="boolean"==typeof e.index?e.index?1:0:e.index),void 0!==e.instanced&&(this.divisor=e.instanced?1:0),void 0!==e.isInstanced&&(this.divisor=e.isInstanced?1:0),this}}const Ez={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},fle={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Ez},ple={removedProps:Ez};class Si extends qu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/ea.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/ea.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=KO("Buffer",e,fle),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=KO("Buffer",e,ple))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new ea(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){ArrayBuffer.isView(e)&&(e={data:e});const{data:t,offset:i=0,srcOffset:r=0}=e,s=e.byteLength||e.length;Qe(t);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==s?(To(this.gl),this.gl.bufferSubData(this.target,i,t,r,s)):this.gl.bufferSubData(o,i,t),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:i=0,size:r}){const{gl:s}=this;return To(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,t,i,r),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:i=0,length:r=0}={}){To(this.gl);const s=Kv(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(t),a=i;let l,c;e?(c=e.length,l=c-a):(l=Math.min(o,r||o),c=a+l);const d=Math.min(o,l);return Qe((r=r||d)<=d),e=e||new s(c),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,i,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:i=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,i,r):(Qe(0===i),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,i=e.byteLength+t){Qe(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();const r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=XO(e);return Qe(s),this.setAccessor(new ea(this.accessor,{type:s})),this}_setByteLength(e,t=this.usage){Qe(e>=0),this._trackDeallocatedMemory();let i=e;0===e&&(i=new Float32Array(0));const r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,i,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){const i=e/Kv(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-i}_inferType(e){this.accessor.type||this.setAccessor(new ea(this.accessor,{type:XO(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);const t=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),t}get type(){return ct.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return ct.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return ct.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return ct.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new ea(this.accessor,e),this}}const ZO={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},Sz={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},Mz={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1},_le=[9729,9728],xz=Zi.CO.WebGLBuffer||function(){};class fm extends qu{static isSupported(e,t={}){const{format:i,linearFiltering:r}=t;let s=!0;return i&&(s=s&&function(n,e){const t=ZO[e];if(!t)return!1;if(void 0===t.gl1&&void 0===t.gl2)return!0;const i=Mn(n)&&t.gl2||t.gl1;return"string"==typeof i?n.getExtension(i):i}(e,i),s=s&&(!r||function(n,e){const t=ZO[e];switch(t&&t.types[0]){case 5126:return n.getExtension("OES_texture_float_linear");case 5131:return n.getExtension("OES_texture_half_float_linear");default:return!0}}(e,i))),s}constructor(e,t){const{id:i=Wc("texture"),handle:r,target:s}=t;super(e,{id:i,handle:r}),this.target=s,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return`Texture(${this.id},${this.width}x${this.height})`}initialize(e={}){let t=e.data;if(t instanceof Promise)return t.then(C=>this.initialize(Object.assign({},e,{pixels:C,data:C}))),this;const i="undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement;if(i&&t.readyStatethis.initialize(e)),this;const{pixels:r=null,format:s=6408,border:o=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:d}=e;t||(t=r);let{width:f,height:p,dataFormat:g,type:_,compressed:y=!1,mipmaps:v=!0}=e;const{depth:w=0}=e;return({width:f,height:p,compressed:y,dataFormat:g,type:_}=this._deduceParameters({format:s,type:_,dataFormat:g,compressed:y,data:t,width:f,height:p})),this.width=f,this.height=p,this.depth=w,this.format=s,this.type=_,this.dataFormat=g,this.border=o,this.textureUnit=d,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),v&&this._isNPOT()&&(ct.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),v=!1,this._updateForNPOT(l)),this.mipmaps=v,this.setImageData({data:t,width:f,height:p,depth:w,format:s,type:_,dataFormat:g,border:o,mipmaps:v,parameters:c,compressed:y}),v&&this.generateMipmap(),this.setParameters(l),a&&(this.data=t),i&&(this._video={video:t,parameters:l,lastTime:t.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?t.currentTime:-1}),this}update(){if(this._video){const{video:e,parameters:t,lastTime:i}=this._video;if(i===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:t=this.target,pixels:i=null,level:r=0,format:s=this.format,border:o=this.border,offset:a=0,parameters:l={}}=e;let{data:c=null,type:d=this.type,width:f=this.width,height:p=this.height,dataFormat:g=this.dataFormat,compressed:_=!1}=e;c||(c=i),({type:d,dataFormat:g,compressed:_,width:f,height:p}=this._deduceParameters({format:s,type:d,dataFormat:g,compressed:_,data:c,width:f,height:p}));const{gl:y}=this;y.bindTexture(this.target,this.handle);let w,v=null;return({data:c,dataType:v}=this._getDataType({data:c,compressed:_})),nc(this.gl,l,()=>{switch(v){case"null":y.texImage2D(t,r,s,f,p,o,g,d,c);break;case"typed-array":y.texImage2D(t,r,s,f,p,o,g,d,c,a);break;case"buffer":w=To(y),w.bindBuffer(35052,c.handle||c),w.texImage2D(t,r,s,f,p,o,g,d,a),w.bindBuffer(35052,null);break;case"browser-object":Mn(y)?y.texImage2D(t,r,s,f,p,o,g,d,c):y.texImage2D(t,r,s,g,d,c);break;case"compressed":for(const[C,x]of c.entries())y.compressedTexImage2D(t,C,x.format,x.width,x.height,o,x.data);break;default:Qe(!1,"Unknown image data type")}}),this._trackAllocatedMemory(c&&c.byteLength?c.byteLength:this.width*this.height*(Sz[this.dataFormat]||4)*(Mz[this.type]||1),"Texture"),this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:t=null,data:i=null,x:r=0,y:s=0,width:o=this.width,height:a=this.height,level:l=0,format:c=this.format,type:d=this.type,dataFormat:f=this.dataFormat,compressed:p=!1,offset:g=0,border:_=this.border,parameters:y={}}){if(({type:d,dataFormat:f,compressed:p,width:o,height:a}=this._deduceParameters({format:c,type:d,dataFormat:f,compressed:p,data:i,width:o,height:a})),Qe(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=t),i&&i.data){const v=i;i=v.data,o=v.shape[0],a=v.shape[1]}i instanceof Si&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),nc(this.gl,y,()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,s,o,a,c,i);else if(null===i)this.gl.texSubImage2D(e,l,r,s,o,a,f,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,l,r,s,o,a,f,d,i,g);else if(i instanceof xz){const v=To(this.gl);v.bindBuffer(35052,i),v.texSubImage2D(e,l,r,s,o,a,f,d,g),v.bindBuffer(35052,null)}else Mn(this.gl)?To(this.gl).texSubImage2D(e,l,r,s,o,a,f,d,i):this.gl.texSubImage2D(e,l,r,s,f,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return ct.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const{gl:t}=this;return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof Si?{data:e.handle,dataType:"buffer"}:e instanceof xz?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){const{format:t,data:i}=e;let{width:r,height:s,dataFormat:o,type:a,compressed:l}=e;const c=ZO[t];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:r,height:s}=this._deduceImageSize(i,r,s)),{dataFormat:o,type:a,compressed:l,width:r,height:s,format:t,data:i}}_deduceImageSize(e,t,i){let r;return r="undefined"!=typeof ImageData&&e instanceof ImageData?{width:e.width,height:e.height}:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?{width:e.width,height:e.height}:"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e?{width:t,height:i}:{width:t>=0?t:1,height:i>=0?i:1},Qe(r,"Could not deduced texture size"),Qe(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),Qe(void 0===i||r.height===i,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(e){switch(e){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const t=this.gl.getTexParameter(this.target,e);return this.gl.bindTexture(this.target,null),t}}_setParameter(e,t){switch(this.gl.bindTexture(this.target,this.handle),t=this._getNPOTParam(e,t),e){case 33082:case 33083:this.gl.texParameterf(this.handle,e,t);break;case 4096:case 4097:Qe(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(Mn(this.gl)||!this.width||!this.height||bz(this.width)&&bz(this.height))}_updateForNPOT(e){void 0===e[this.gl.TEXTURE_MIN_FILTER]&&(e[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===e[this.gl.TEXTURE_WRAP_S]&&(e[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===e[this.gl.TEXTURE_WRAP_T]&&(e[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===_le.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}function yle(n,e){return Qe("string"==typeof n),n=""+n,new Promise((t,i)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>i(new Error(`Could not load image ${n}.`)),r.crossOrigin=e&&e.crossOrigin||"anonymous",r.src=n}catch(r){i(r)}})}class xa extends fm{static isSupported(e,t){return fm.isSupported(e,t)}constructor(e,t={}){cS(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:yle(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}const Yf="EXT_color_buffer_float",Tz={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:Yf,bpp:2},33327:{gl2:Yf,bpp:4},34842:{gl2:Yf,bpp:8},33326:{gl2:Yf,bpp:4},33328:{gl2:Yf,bpp:8},34836:{gl2:Yf,bpp:16},35898:{gl2:Yf,bpp:4}};class pm extends qu{static isSupported(e,{format:t}={format:null}){return!t||function(n,e,t){const i=t[e];if(!i)return!1;const r=Mn(n)&&i.gl2||i.gl1;return"string"==typeof r?n.getExtension(r):r}(e,t,Tz)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:i=1,samples:r=0}){return Qe(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Mn(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,i):this.gl.renderbufferStorage(36161,e,t,i),this.format=e,this.width=t,this.height=i,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*Tz[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,e)}}const Pz="clear: bad arguments";function JO(n,{framebuffer:e=null,color:t=null,depth:i=null,stencil:r=null}={}){const s={};e&&(s.framebuffer=e);let o=0;t&&(o|=16384,!0!==t&&(s.clearColor=t)),i&&(o|=256,!0!==i&&(s.clearDepth=i)),r&&(o|=1024,!0!==i&&(s.clearStencil=i)),Qe(0!==o,Pz),nc(n,s,()=>{n.clear(o)})}function Rz(n,e,t,i,r,s,o){try{var a=n[s](o),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(i,r)}function un(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var s=n.apply(e,t);function o(l){Rz(s,i,r,o,a,"next",l)}function a(l){Rz(s,i,r,o,a,"throw",l)}o(void 0)})}}const eI=[34069,34070,34071,34072,34073,34074];let Mle=(()=>{class n extends fm{constructor(t,i={}){cS(t),super(t,Object.assign({},i,{target:34067})),this.initialize(i),Object.seal(this)}initialize(t={}){const{mipmaps:i=!0,parameters:r={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,i&&this.generateMipmap(t),this.setParameters(r)}),this}subImage({face:t,data:i,x:r=0,y:s=0,mipmapLevel:o=0}){return this._subImage({target:t,data:i,x:r,y:s,mipmapLevel:o})}setCubeMapImageData({width:t,height:i,pixels:r,data:s,border:o=0,format:a=6408,type:l=5121}){var c=this;return un(function*(){const{gl:d}=c,f=r||s,p=yield Promise.all(eI.map(g=>{const _=f[g];return Promise.all(Array.isArray(_)?_:[_])}));c.bind(),eI.forEach((g,_)=>{p[_].length>1&&!1!==c.opts.mipmaps&&ct.warn(`${c.id} has mipmap and multiple LODs.`)(),p[_].forEach((y,v)=>{t&&i?d.texImage2D(g,v,a,t,i,o,a,l,y):d.texImage2D(g,v,a,a,l,y)})}),c.unbind()})()}setImageDataForFace(t){const{face:i,width:r,height:s,pixels:o,data:a,border:l=0,format:c=6408,type:d=5121}=t,{gl:f}=this,p=o||a;return this.bind(),p instanceof Promise?p.then(g=>this.setImageDataForFace(Object.assign({},t,{face:i,data:g,pixels:g}))):this.width||this.height?f.texImage2D(i,0,c,r,s,l,c,d,p):f.texImage2D(i,0,c,c,d,p),this}}return n.FACES=eI,n})();class xle extends fm{static isSupported(e){return Mn(e)}constructor(e,t={}){To(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:i,height:r,depth:s=1,border:o=0,format:a,type:l=5121,offset:c=0,data:d,parameters:f={}}){return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),nc(this.gl,f,()=>{ArrayBuffer.isView(d)&&this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,d),d instanceof Si&&(this.gl.bindBuffer(35052,d.handle),this.gl.texImage3D(this.target,e,t,i,r,s,o,a,l,c))}),this._trackAllocatedMemory(d&&d.byteLength?d.byteLength:this.width*this.height*this.depth*(Sz[this.dataFormat]||4)*(Mz[this.type]||1),"Texture"),this.loaded=!0,this}}function Ale(n,e){const{gl:t,width:i,height:r,id:s}=n;return new is(t,Object.assign({},e,{id:`framebuffer-for-${s}`,width:i,height:r,attachments:{36064:n}}))}function uS(n,e={}){const{sourceX:t=0,sourceY:i=0,sourceFormat:r=6408}=e;let{sourceAttachment:s=36064,target:o=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:d,deleteFramebuffer:f}=function(n){return n instanceof is?{framebuffer:n,deleteFramebuffer:!1}:{framebuffer:Ale(n),deleteFramebuffer:!0}}(n);Qe(d);const{gl:p,handle:g,attachments:_}=d;a=a||d.width,l=l||d.height,36064===s&&null===g&&(s=1028),Qe(_[s]),c=c||_[s].type,o=function(n,e,t,i,r){if(n)return n;return new(Kv(e=e||5121,{clamped:!1}))(i*r*function(n){switch(n){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Qe(!1),0}}(t))}(o,c,r,a,l),c=c||XO(o);const y=p.bindFramebuffer(36160,g);return p.readPixels(t,i,a,l,r,c,o),p.bindFramebuffer(36160,y||null),f&&d.delete(),o}function tI(n,{sourceAttachment:e=36064,targetMaxHeight:t=Number.MAX_SAFE_INTEGER}={}){let i=uS(n,{sourceAttachment:e}),{width:r,height:s}=n;for(;s>t;)({data:i,width:r,height:s}=ule({data:i,width:r,height:s}));!function({data:n,width:e,height:t,bytesPerPixel:i=4,temp:r}){const s=e*i;r=r||new Uint8Array(s);for(let o=0;o=0&&t>=0,"Width and height need to be integers"),this.width=e,this.height=t,i)for(const d in i){const f=i[d];(Array.isArray(f)?f[0]:f).resize({width:e,height:t})}else i=this._createDefaultAttachments(r,s,o,e,t);this.update({clearAttachments:!0,attachments:i,readBuffer:l,drawBuffers:c}),i&&a&&this.checkStatus()}delete(){for(const e of this.ownResources)e.delete();return super.delete(),this}update({attachments:e={},readBuffer:t,drawBuffers:i,clearAttachments:r=!1,resizeAttachments:s=!0}){this.attach(e,{clearAttachments:r,resizeAttachments:s});const{gl:o}=this,a=o.bindFramebuffer(36160,this.handle);return t&&this._setReadBuffer(t),i&&this._setDrawBuffers(i),o.bindFramebuffer(36160,a||null),this}resize(e={}){let{width:t,height:i}=e;if(null===this.handle)return Qe(void 0===t&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===t&&(t=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),t!==this.width&&i!==this.height&&ct.log(2,`Resizing framebuffer ${this.id} to ${t}x${i}`)();for(const r in this.attachments)this.attachments[r].resize({width:t,height:i});return this.width=t,this.height=i,this}attach(e,{clearAttachments:t=!1,resizeAttachments:i=!0}={}){const r={};t&&Object.keys(this.attachments).forEach(o=>{r[o]=null}),Object.assign(r,e);const s=this.gl.bindFramebuffer(36160,this.handle);for(const o in r){Qe(void 0!==o,"Misspelled framebuffer binding point?");const a=Number(o),l=r[a];let c=l;if(c)if(c instanceof pm)this._attachRenderbuffer({attachment:a,renderbuffer:c});else if(Array.isArray(l)){const[d,f=0,p=0]=l;c=d,this._attachTexture({attachment:a,texture:d,layer:f,level:p})}else this._attachTexture({attachment:a,texture:c,layer:0,level:0});else this._unattach(a);i&&c&&c.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,s||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(o=>!this.attachments[o]).forEach(o=>{delete this.attachments[o]})}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(n){return(is.STATUS||{})[n]||`Framebuffer error ${n}`}(t));return this}getStatus(){const{gl:e}=this,t=e.bindFramebuffer(36160,this.handle),i=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),i}clear(e={}){const{color:t,depth:i,stencil:r,drawBuffers:s=[]}=e,o=this.gl.bindFramebuffer(36160,this.handle);return(t||i||r)&&JO(this.gl,{color:t,depth:i,stencil:r}),s.forEach((a,l)=>{!function(n,{framebuffer:e=null,buffer:t=6144,drawBuffer:i=0,value:r=[0,0,0,0]}={}){To(n),nc(n,{framebuffer:e},()=>{switch(t){case 6144:switch(r.constructor){case Int32Array:n.clearBufferiv(t,i,r);break;case Uint32Array:n.clearBufferuiv(t,i,r);break;case Float32Array:default:n.clearBufferfv(t,i,r)}break;case 6145:n.clearBufferfv(6145,0,[r]);break;case 6146:n.clearBufferiv(6146,0,[r]);break;case 34041:const[s,o]=r;n.clearBufferfi(34041,0,s,o);break;default:Qe(!1,Pz)}})}(this.gl,{drawBuffer:l,value:a})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(e={}){return ct.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e={}){return ct.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e={}){return ct.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e={}){return ct.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e={}){return ct.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e={}){return ct.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:i=0,width:r,height:s}){const o=To(this.gl),a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===i&&void 0===r&&void 0===s?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,i,r,s),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,i){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),i&&r>1e3&&(r=rh(this.gl,r)),r}getAttachmentParameters(e=36064,t,i=this.constructor.ATTACHMENT_PARAMETERS||[]){const r={};for(const s of i)r[t?rh(this.gl,s):s]=this.getAttachmentParameter(e,s,t);return r}getParameters(e=!0){const t=Object.keys(this.attachments),i={};for(const r of t){const s=Number(r);i[e?rh(this.gl,s):s]=this.getAttachmentParameters(s,e)}return i}show(){return"undefined"!=typeof window&&window.open(tI(this),"luma-debug-texture"),this}log(e=0,t=""){if(e>ct.level||"undefined"==typeof window)return this;t=t||`Framebuffer ${this.id}`;const i=tI(this,{targetMaxHeight:100});return ct.image({logLevel:e,message:t,image:i},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,i,r,s){let o=null;return e&&(o=o||{},o[36064]=new xa(this.gl,{id:`${this.id}-color0`,pixels:null,format:6408,type:5121,width:r,height:s,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&i?(o=o||{},o[33306]=new pm(this.gl,{id:`${this.id}-depth-stencil`,format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?(o=o||{},o[36096]=new pm(this.gl,{id:`${this.id}-depth`,format:33189,width:r,height:s}),this.ownResources.push(o[36096])):i&&Qe(!1),o}_unattach(e){const t=this.attachments[e];!t||(t instanceof pm?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const{gl:i}=this;i.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:i,level:r}){const{gl:s}=this;switch(s.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:To(s).framebufferTextureLayer(36160,e,t.target,r,i);break;case 34067:const a=function(n){return n<34069?n+34069:n}(i);s.framebufferTexture2D(36160,e,a,t.handle,r);break;case 3553:s.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:Qe(!1,"Illegal texture type")}s.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=function(n){return Mn(n)?n:null}(this.gl);t?t.readBuffer(e):Qe(36064===e||1029===e,kz),this.readBuffer=e}_setDrawBuffers(e){const{gl:t}=this,i=To(t);if(i)i.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):Qe(1===e.length&&(36064===e[0]||1029===e[0]),kz)}this.drawBuffers=e}_getAttachmentParameterFallback(e){const t=function(n){n.luma=n.luma||{},n.luma.caps=n.luma.caps||{};for(const e in Fz)void 0===n.luma.caps[e]&&(n.luma.caps[e]=Lz(n,e));return n.luma.caps}(this.gl);switch(e){case 36052:return t.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return t.WEBGL2?null:8;case 33297:return t.WEBGL2?null:5125;case 33296:return t.WEBGL2||t.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}is.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const Fz={WEBGL2:[!1,!0],VERTEX_ARRAY_OBJECT:["OES_vertex_array_object",!0],TIMER_QUERY:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],INSTANCED_RENDERING:["ANGLE_instanced_arrays",!0],MULTIPLE_RENDER_TARGETS:["WEBGL_draw_buffers",!0],ELEMENT_INDEX_UINT32:["OES_element_index_uint",!0],BLEND_EQUATION_MINMAX:["EXT_blend_minmax",!0],FLOAT_BLEND:["EXT_float_blend"],COLOR_ENCODING_SRGB:["EXT_sRGB",!0],TEXTURE_DEPTH:["WEBGL_depth_texture",!0],TEXTURE_FLOAT:["OES_texture_float",!0],TEXTURE_HALF_FLOAT:["OES_texture_half_float",!0],TEXTURE_FILTER_LINEAR_FLOAT:["OES_texture_float_linear"],TEXTURE_FILTER_LINEAR_HALF_FLOAT:["OES_texture_half_float_linear"],TEXTURE_FILTER_ANISOTROPIC:["EXT_texture_filter_anisotropic"],COLOR_ATTACHMENT_RGBA32F:[function(n){const e=new xa(n,{format:6408,type:5126,dataFormat:6408}),t=new is(n,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),i=t.getStatus();return e.delete(),t.delete(),36053===i},"EXT_color_buffer_float"],COLOR_ATTACHMENT_FLOAT:[!1,"EXT_color_buffer_float"],COLOR_ATTACHMENT_HALF_FLOAT:["EXT_color_buffer_half_float"],GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]};function nI(n,e){return Nz(n,e)}function Nz(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>Lz(n,t))}function Lz(n,e){return n.luma=n.luma||{},n.luma.caps=n.luma.caps||{},void 0===n.luma.caps[e]&&(n.luma.caps[e]=function(n,e){const t=Fz[e];let i;Qe(t,e);const r=Mn(n)&&t[1]||t[0];if("function"==typeof r)i=r(n);else if(Array.isArray(r)){i=!0;for(const s of r)i=i&&Boolean(n.getExtension(s))}else"string"==typeof r?i=Boolean(n.getExtension(r)):"boolean"==typeof r?i=r:Qe(!1);return i}(n,e)),n.luma.caps[e]||ct.log(2,`Feature: ${e} not supported`)(),n.luma.caps[e]}class iI{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){const e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];const{value:i}=this.source,{size:r}=t;let s=i;if(i&&i.length!==r){s=new Float32Array(r);const o=t.elementOffset||0;for(let a=0;ar&&(s=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*s,l=o.findIndex(c=>c.byteLength>=a);if(l>=0){const c=new e(o.splice(l,1)[0],0,s);return i&&c.fill(0),c}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:i}=e,{byteLength:r}=i,s=t.findIndex(o=>o.byteLength>=r);s<0?t.push(i):(s>0||t.lengththis.props.poolSize&&t.shift()}},jle=(Math,1/180*Math.PI),Qi={};function zle(n,{precision:e=Qi.precision||4}={}){return n=function(n){return Math.round(n/Qi.EPSILON)*Qi.EPSILON}(n),`${parseFloat(n.toPrecision(e))}`}function sh(n){return Array.isArray(n)||ArrayBuffer.isView(n)&&!(n instanceof DataView)}function Yu(n,e,t){if(sh(n)){t=t||function(n){return n.clone?n.clone():new Array(n.length)}(n);for(let i=0;it*jle,void 0)}(n)}function Xf(n,e,t){return Yu(n,i=>Math.max(e,Math.min(t,i)))}function dS(n,e,t){return sh(n)?n.map((i,r)=>dS(i,e[r],t)):t*e+(1-t)*n}function eb(n,e,t){const i=Qi.EPSILON;t&&(Qi.EPSILON=t);try{if(n===e)return!0;if(sh(n)&&sh(e)){if(n.length!==e.length)return!1;for(let r=0;r0?", ":"")+zle(this[i],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t=0&&e=0&&e0&&(Yz.length=n.length,i=Yz):i=qz,(e>0||Number.isFinite(t))&&(i=(Array.isArray(i)?i:Array.from(i)).slice(e,t),r.index=e-1),{iterable:i,objectInfo:r}}function Kz(n){return n&&n[Symbol.asyncIterator]}function lI(n,e=(()=>!0)){return Array.isArray(n)?Zz(n,e,[]):e(n)?[n]:[]}function Zz(n,e,t){let i=-1;for(;++ia)return void e.set(n.subarray(0,a),t);if(e.set(n,t),!s)return;let l=o;for(;ln},spring:{stiffness:.05,damping:.5}};function Qz(n,e){return n?(Number.isFinite(n)&&(n={duration:n}),n.type=n.type||"interpolation",J(J(J({},Mce[n.type]),e),n)):null}function Jz(n,e){return e.getBuffer()?[e.getBuffer(),{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function e4(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(n,'"'))}}function t4(n){n.push(n.shift())}function uI(n,e){const{doublePrecision:t,settings:i,value:r,size:s}=n,o=t&&r instanceof Float64Array?2:1;return(i.noAlloc?r.length:e*s)*o}function n4({buffer:n,numInstances:e,attribute:t,fromLength:i,fromStartIndices:r,getData:s=(o=>o)}){const o=t.doublePrecision&&t.value instanceof Float64Array?2:1,a=t.size*o,l=t.byteOffset,c=t.startIndices,d=r&&c,f=uI(t,e),p=t.state.constant;if(!d&&i>=f)return;const g=p?t.value:t.getBuffer().getData({srcByteOffset:l});if(t.settings.normalized&&!p){const w=s;s=(C,x)=>t._normalizeConstant(w(C,x))}const _=p?(w,C)=>s(g,C):(w,C)=>s(g.subarray(w,w+a),C),y=n.getData({length:i}),v=new Float32Array(f);(function({source:n,target:e,size:t,getData:i,sourceStartIndices:r,targetStartIndices:s}){if(!Array.isArray(s))return cI({source:n,target:e,size:t,getData:i}),e;let o=0,a=0;const l=i&&((d,f)=>i(d+a,f)),c=Math.min(r.length,s.length);for(let d=1;d(t+128)/255*2-1);case 5122:return new Float32Array(e).map(t=>(t+32768)/65535*2-1);case 5121:return new Float32Array(e).map(t=>t/255);case 5123:return new Float32Array(e).map(t=>t/65535);default:return e}}_normalizeValue(e,t,i){const{defaultValue:r,size:s}=this.settings;if(Number.isFinite(e))return t[i]=e,t;if(!e)return t[i]=r[0],t;switch(s){case 4:t[i+3]=Number.isFinite(e[3])?e[3]:r[3];case 3:t[i+2]=Number.isFinite(e[2])?e[2]:r[2];case 2:t[i+1]=Number.isFinite(e[1])?e[1]:r[1];case 1:t[i+0]=Number.isFinite(e[0])?e[0]:r[0];break;default:let o=s;for(;--o>=0;)t[i+o]=Number.isFinite(e[o])?e[o]:r[o]}return t}_areValuesEqual(e,t){if(!e||!t)return!1;const{size:i}=this;for(let r=0;re[s])]:e[t],i)}setNeedsUpdate(e=this.id,t){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t){const{startRow:i=0,endRow:r=1/0}=t;this.state.updateRanges=function(n,e){if(n===gS||(e[0]<0&&(e[0]=0),e[0]>=e[1]))return n;const t=[],i=n.length;let r=0;for(let s=0;se[1]?t.push(o):e=[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}return t.splice(r,0,e),t}(this.state.updateRanges,[i,r])}else this.state.updateRanges=gS}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=wce}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){const{state:t,settings:i}=this;return!i.noAlloc&&!!i.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==gS}),!0)}updateBuffer({numInstances:e,data:t,props:i,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:o,noAlloc:a}}=this;let l=!0;if(o){for(const[c,d]of s)o.call(r,this,{data:t,startRow:c,endRow:d,props:i,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength{if(!r){const v=f*a+l;for(let w=0;wd?c.set(x,y):(e._normalizeValue(x,w.target,0),Cce({target:c,source:w.target,start:y,count:L}));y+=L*d}else e._normalizeValue(x,c,y),y+=d}}_validateAttributeUpdaters(){const{settings:e}=this;if(!e.noAlloc&&"function"!=typeof e.update)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:e}=this,t=Math.min(4,this.size);if(e&&e.length>=t){let i=!0;switch(t){case 4:i=i&&Number.isFinite(e[3]);case 3:i=i&&Number.isFinite(e[2]);case 2:i=i&&Number.isFinite(e[1]);case 1:i=i&&Number.isFinite(e[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}let hI={};function eo(n){Zn.level>0&&hI[n]&&hI[n].call(...arguments)}function Ta(n,e){if(!n)throw new Error(e||"shadertools: assertion failed.")}const i4="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Ace=`#version 300 es\n${i4}`;function r4(n,e){e=Array.isArray(e)?e:[e];const t=n.replace(/^\s+/,"").split(/\s+/),[i,r,s]=t;return e.includes(i)&&r&&s?{qualifier:i,type:r,name:s.split(";")[0]}:null}function s4(n={}){const{version:e=100,input:t,inputType:i,output:r}=n;if(!t)return 300===e?Ace:e>300?`#version ${e}\n${i4}`:"void main() {gl_FragColor = vec4(0);}";const s=function(n,e){switch(e){case"float":return`vec4(${n}, 0.0, 0.0, 1.0)`;case"vec2":return`vec4(${n}, 0.0, 1.0)`;case"vec3":return`vec4(${n}, 1.0)`;case"vec4":return n;default:return Ta(!1),null}}(t,i);return e>=300?`#version ${e} ${300===e?"es":""}\nin ${i} ${t};\nout vec4 ${r};\nvoid main() {\n ${r} = ${s};\n}`:`varying ${i} ${t};\nvoid main() {\n gl_FragColor = ${s};\n}`}class o4 extends qu{static isSupported(e){return Mn(e)}constructor(e,t={}){To(e),super(e,t),this.initialize(t),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(e={}){return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,dm(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(e),this}setProps(e){"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"bindOnUse"in e&&(e=e.bindOnUse),"buffers"in e&&this.setBuffers(e.buffers)}setBuffers(e={}){return this.bind(()=>{for(const t in e)this.setBuffer(t,e[t])}),this}setBuffer(e,t){const i=this._getVaryingIndex(e),{buffer:r,byteSize:s,byteOffset:o}=this._getBufferParams(t);return i<0?(this.unused[e]=r,ct.warn(()=>`${this.id} unused varying buffer ${e}`)(),this):(this.buffers[i]=t,this.bindOnUse||this._bindBuffer(i,r,o,s),this)}begin(e=0){return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(e),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(e){let t,i,r;return e instanceof Si?r=e:(r=e.buffer,i=e.byteSize,t=e.byteOffset),(void 0!==t||void 0!==i)&&(t=t||0,i=i||r.byteLength-t),{buffer:r,byteOffset:t,byteSize:i}}_getVaryingInfo(e){return this.configuration&&this.configuration.getVaryingInfo(e)}_getVaryingIndex(e){if(this.configuration)return this.configuration.getVaryingInfo(e).location;const t=Number(e);return Number.isFinite(t)?t:-1}_bindBuffers(){if(this.bindOnUse)for(const e in this.buffers){const{buffer:t,byteSize:i,byteOffset:r}=this._getBufferParams(this.buffers[e]);this._bindBuffer(e,t,r,i)}}_unbindBuffers(){if(this.bindOnUse)for(const e in this.buffers)this._bindBuffer(e,null)}_bindBuffer(e,t,i=0,r){const s=t&&t.handle;return s&&void 0!==r?this.gl.bindBufferRange(35982,e,s,i,r):this.gl.bindBufferBase(35982,e,s),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(e){this.gl.bindTransformFeedback(36386,this.handle)}}class Pce{constructor(e,t={}){this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}setupResources(e){for(const t of this.bindings)this._setupTransformFeedback(t,e)}updateModelProps(e={}){const{varyings:t}=this;return t.length>0&&(e=Object.assign({},e,{varyings:t})),e}getDrawOptions(e={}){const t=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:r}=t;return{attributes:Object.assign({},i,e.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupBuffers(e)}getBuffer(e){const{feedbackBuffers:t}=this.bindings[this.currentIndex],i=e?t[e]:null;return i?i instanceof Si?i:i.buffer:null}getData(e={}){const{varyingName:t}=e,i=this.getBuffer(t);return i?i.getData():null}delete(){for(const e in this.resources)this.resources[e].delete()}_initialize(e={}){this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Qe(Mn(this.gl))}_getFeedbackBuffers(e){const{sourceBuffers:t={}}=e,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const r in this.feedbackMap){const s=this.feedbackMap[r];r in t&&(i[s]=r)}Object.assign(i,e.feedbackBuffers);for(const r in i){const s=i[r];if("string"==typeof s){const o=t[s],{byteLength:a,usage:l,accessor:c}=o;i[r]=this._createNewBuffer(r,{byteLength:a,usage:l,accessor:c})}}return i}_setupBuffers(e={}){const{sourceBuffers:t=null}=e;Object.assign(this.feedbackMap,e.feedbackMap);const i=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:t,feedbackBuffers:i})}_setupTransformFeedback(e,{model:t}){const{program:i}=t;e.transformFeedback=new o4(this.gl,{program:i,buffers:e.feedbackBuffers})}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:i}=this._swapBuffers(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceBuffers:t,feedbackBuffers:i})}}_updateBinding(e,t){return e?(Object.assign(e.sourceBuffers,t.sourceBuffers),Object.assign(e.feedbackBuffers,t.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},t.sourceBuffers),feedbackBuffers:Object.assign({},t.feedbackBuffers)}}_swapBuffers(e){if(!this.feedbackMap)return null;const t=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(const r in this.feedbackMap){const s=this.feedbackMap[r];t[r]=e.feedbackBuffers[s],i[s]=e.sourceBuffers[r],Qe(i[s]instanceof Si)}return{sourceBuffers:t,feedbackBuffers:i}}_createNewBuffer(e,t){const i=new Si(this.gl,t);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}function a4(n){let e=100;const t=n.match(/[^\s]+/g);if(t.length>=2&&"#version"===t[0]){const i=parseInt(t[1],10);Number.isFinite(i)&&(e=i)}return e}const ib="vs",Fce={[ib]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",fs:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},mS="__LUMA_INJECT_DECLARATIONS__",l4=/void\s+main\s*\([^)]*\)\s*\{\n?/,c4=/}\n?[^{}]*$/,pI=[];function u4(n,e,t,i=!1){const r=e===ib;for(const s in t){const o=t[s];o.sort((l,c)=>l.order-c.order),pI.length=o.length;for(let l=0,c=o.length;ll+a));break;case"vs:#main-end":r&&(n=n.replace(c4,l=>a+l));break;case"fs:#decl":r||(n=n.replace(mS,a));break;case"fs:#main-start":r||(n=n.replace(l4,l=>l+a));break;case"fs:#main-end":r||(n=n.replace(c4,l=>a+l));break;default:n=n.replace(s,l=>l+a)}}return n=n.replace(mS,""),i&&(n=n.replace(/\}\s*$/,s=>s+Fce[e])),n}function gI(n){const e={};return Ta(Array.isArray(n)&&n.length>1),n.forEach(t=>{for(const i in t)e[i]=e[i]?`${e[i]}\n${t[i]}`:t[i]}),e}const Nce={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null},_S="transform_uSize_",d4="transform_position";const $ce={10241:9728,10240:9728,10242:33071,10243:33071};class Wce{constructor(e,t={}){this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(t),Object.seal(this)}updateModelProps(e={}){const t=this._processVertexShader(e);return Object.assign({},e,t)}getDrawOptions(e={}){const{sourceBuffers:t,sourceTextures:i,framebuffer:r,targetTexture:s}=this.bindings[this.currentIndex],o=Object.assign({},t,e.attributes),a=Object.assign({},e.uniforms),l=Object.assign({},e.parameters);let c=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const f in this.samplerTextureMap)a[f]=i[this.samplerTextureMap[f]];this._setSourceTextureParameters();const d=function({sourceTextureMap:n,targetTextureVarying:e,targetTexture:t}){const i={};let r,s;e&&(({width:r,height:s}=t),i[`${_S}${e}`]=[r,s]);for(const o in n)({width:r,height:s}=n[o]),i[`${_S}${o}`]=[r,s];return i}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(a,d)}return this.hasTargetTexture&&(c=!1,l.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:c,parameters:l}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(e={}){this._setupTextures(e)}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getData({packed:e=!1}={}){const{framebuffer:t}=this.bindings[this.currentIndex],i=uS(t);if(!e)return i;const r=i.constructor,s=function(n){switch(n){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Ta(!1),null}}(this.targetTextureType),o=new r(i.length*s/4);let a=0;for(let l=0;l0,this._updateBindings({sourceBuffers:t,sourceTextures:i,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}_updateElementIDBuffer(e){if("number"!=typeof e||this.elementCount>=e)return;const t=new Float32Array(e);t.forEach((i,r,s)=>{s[r]=r}),this.elementIDBuffer?this.elementIDBuffer.setData({data:t}):this.elementIDBuffer=new Si(this.gl,{data:t,accessor:{size:1}}),this.elementCount=e}_updateBindings(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){const{sourceTextures:t,targetTexture:i}=this._swapTextures(this.bindings[this.currentIndex]),r=this._getNextIndex();this.bindings[r]=this._updateBinding(this.bindings[r],{sourceTextures:t,targetTexture:i})}}_updateBinding(e,t){const{sourceBuffers:i,sourceTextures:r,targetTexture:s}=t;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,r),Object.assign(e.sourceBuffers,i),s){e.targetTexture=s;const{width:o,height:a}=s,{framebuffer:l}=e;l?(l.update({attachments:{36064:s},resizeAttachments:!1}),l.resize({width:o,height:a})):e.framebuffer=new is(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:{36064:s}})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const i in t)t[i].setParameters($ce)}_swapTextures(e){if(!this._swapTexture)return null;const t=Object.assign({},e.sourceTextures);return t[this._swapTexture]=e.targetTexture,{sourceTextures:t,targetTexture:e.sourceTextures[this._swapTexture]}}_createNewTexture(e){const t=function(n,e){Qe(n instanceof xa||n instanceof Mle||n instanceof xle);const t=n.constructor,{gl:i,width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d}=n;return new t(i,Object.assign({width:r,height:s,format:o,type:a,dataFormat:l,border:c,mipmaps:d},{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}}))}(e);return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=t,t}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(e={}){const{sourceTextures:t,targetTexture:i}=this.bindings[this.currentIndex],{vs:r,uniforms:s,targetTextureType:o,inject:a,samplerTextureMap:l}=function({vs:n,sourceTextureMap:e,targetTextureVarying:t,targetTexture:i}){let s=Object.keys(e).length,o=null;const a={};let l=n,c={};if(s>0||t){const d=l.split("\n"),f=d.slice();if(d.forEach((p,g,_)=>{if(s>0){const y=function(n,e){const t={},i=function(n){return r4(n,["attribute","in"])}(n);if(!i)return null;const{type:r,name:s}=i;if(s&&e[s]){const o=`// ${n} => Replaced by Transform with a sampler`,{samplerName:a,sizeName:l,uniformDeclerations:c}=function(n){const e=`transform_uSampler_${n}`,t=`${_S}${n}`;return{samplerName:e,sizeName:t,uniformDeclerations:` uniform sampler2D ${e};\n uniform vec2 ${t};`}}(s),f=` ${r} ${s} = transform_getInput(${a}, ${l}).${function(n){switch(n){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Ta(!1),null}}(r)};\n`;return t[a]=s,{updatedLine:o,inject:{"vs:#decl":c,"vs:#main-start":f},samplerTextureMap:t}}return null}(p,e);if(y){const{updatedLine:v,inject:w}=y;f[g]=v,c=gI([c,w]),Object.assign(a,y.samplerTextureMap),s--}}t&&!o&&(o=function(n,e){const t=r4(n,["varying","out"]);return t&&t.name===e?t.type:null}(p,t))}),t){Qe(i);const p=`${_S}${t}`;c=gI([c,{"vs:#decl":`uniform vec2 ${p};\n`,"vs:#main-start":` vec2 ${d4} = transform_getPos(${p});\n gl_Position = vec4(${d4}, 0, 1.);\n`}])}l=f.join("\n")}return{vs:l,targetTextureType:o,inject:c,samplerTextureMap:a}}({vs:e.vs,sourceTextureMap:t,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=gI([e.inject||{},a]);return this.targetTextureType=o,this.samplerTextureMap=l,{vs:r,fs:e._fs||s4({version:a4(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Nce].concat(e.modules||[]):e.modules,uniforms:s,inject:c}}}const mI={number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},array:{validate:(n,e)=>Array.isArray(n)||ArrayBuffer.isView(n)}};function Yce(n){let e=h4(n);return"object"===e?n?"type"in n?Object.assign({},n,mI[n.type]):"value"in n?(e=h4(n.value),Object.assign({type:e},n,mI[e])):{type:"object",value:n}:{type:"object",value:null}:Object.assign({type:e,value:n},mI[e])}function h4(n){return Array.isArray(n)||ArrayBuffer.isView(n)?"array":typeof n}class _I{constructor({name:e,vs:t,fs:i,dependencies:r=[],uniforms:s,getUniforms:o,deprecations:a=[],defines:l={},inject:c={},vertexShader:d,fragmentShader:f}){Ta("string"==typeof e),this.name=e,this.vs=t||d,this.fs=i||f,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(n){const e={vs:{},fs:{}};for(const t in n){let i=n[t];const r=t.slice(0,2);"string"==typeof i&&(i={order:0,injection:i}),e[r][t]=i}return e}(c),s&&(this.uniforms=function(n){const e={};for(const t in n){const r=Yce(n[t]);e[t]=r}return e}(s))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Ta(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")}\n${t}// END MODULE_${this.name}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach(i=>{i.regex.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())})}_parseDeprecationDefinitions(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&Ta(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function Qce(n){return function(n){const e={},t={};return yI({modules:n,level:0,moduleMap:e,moduleDepth:t}),Object.keys(t).sort((i,r)=>t[r]-t[i]).map(i=>e[i])}(p4(n))}function yI({modules:n,level:e,moduleMap:t,moduleDepth:i}){if(e>=5)throw new Error("Possible loop in shader dependency graph");for(const r of n)t[r.name]=r,(void 0===i[r.name]||i[r.name](t instanceof _I||(Ta("string"!=typeof t,`Shader module use by name is deprecated. Import shader module '${t}' and use it directly.`),Ta(t.name,"shader module has no name"),(t=new _I(t)).dependencies=p4(t.dependencies)),t))}const vI={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},Kf={};function oue(n,e){return n.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":n.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":n.match(/Apple/i)||e.match(/Apple/i)?"APPLE":n.match(/AMD/i)||e.match(/AMD/i)||n.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN"}Object.keys(vI).forEach(n=>{Kf[n]=n});const bI={};function g4(n,e,t={}){const i=vI[e];if(Ta(i,e),!function(n={}){const e="undefined"!=typeof window&&window.navigator||{},t=n.userAgent||e.userAgent||"",i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r}(t))return!0;if(e in bI)return bI[e];const o=`#extension GL_${i[0]} : ${t.behavior||"enable"}\nvoid main(void) {}`,a=n.createShader(35633);n.shaderSource(a,o),n.compileShader(a);const l=n.getShaderParameter(a,35713);return n.deleteShader(a),bI[e]=l,l}function yS(n,e){return(e=Array.isArray(e)?e:[e]).every(t=>function(n,e){const t=vI[e];Ta(t,e);const i=function(n){return"undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||Boolean(n&&2===n._version)}(n)&&t[1]||t[0],r="string"==typeof i?Boolean(n.getExtension(i)):i;return Ta(!1===r||!0===r),r}(n,t))}function mm(n){return new RegExp(`\\b${n}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}const m4=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],uue=[...m4,[mm("attribute"),"in $1"],[mm("varying"),"out $1"]],due=[...m4,[mm("varying"),"in $1"]],_4=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],hue=[..._4,[mm("in"),"attribute $1"],[mm("out"),"varying $1"]],fue=[..._4,[mm("in"),"varying $1"]],CI="gl_FragColor",wI=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,pue=/void\s+main\s*\([^)]*\)\s*\{\n?/;function vS(n,e){for(const[t,i]of e)n=n.replace(t,i);return n}const yue=`\n\n${mS}\n\n`,y4={[ib]:"vertex",fs:"fragment"};function v4(n,{id:e,source:t,type:i,modules:r,defines:s={},hookFunctions:o=[],inject:a={},transpileToGLSL100:l=!1,prologue:c=!0,log:d}){Ta("string"==typeof t,"shader source must be a string");const f=i===ib,p=t.split("\n");let g=100,_="",y=t;0===p[0].indexOf("#version ")?(g=300,_=p[0],y=p.slice(1).join("\n")):_=`#version ${g}`;const v={};r.forEach($=>{Object.assign(v,$.getDefines())}),Object.assign(v,s);let w=c?`${_}\n${function({id:n,source:e,type:t}){return n&&"string"==typeof n&&-1===e.indexOf("SHADER_NAME")?`\n#define SHADER_NAME ${n}_${y4[t]}\n\n`:""}({id:e,source:t,type:i})}\n${function({type:n}){return`\n#define SHADER_TYPE_${y4[n].toUpperCase()}\n`}({type:i})}\n${function(n){switch(function(n){const e=n.getExtension("WEBGL_debug_renderer_info"),t=n.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),i=n.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:oue(t,i),vendor:t,renderer:i,version:n.getParameter(7938),shadingLanguageVersion:n.getParameter(35724)}}(n).gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n"}}(n)}\n${function(n,e,t){let i="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return yS(n,Kf.GLSL_FRAG_DEPTH)&&(i+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),yS(n,Kf.GLSL_DERIVATIVES)&&g4(n,Kf.GLSL_DERIVATIVES)&&(i+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),yS(n,Kf.GLSL_FRAG_DATA)&&g4(n,Kf.GLSL_FRAG_DATA,{behavior:"require"})&&(i+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),yS(n,Kf.GLSL_TEXTURE_LOD)&&(i+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),i}(n)}\n${function(n={}){let e=0,t="";for(const i in n){0===e&&(t+="\n// APPLICATION DEFINES\n"),e++;const r=n[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${n[i]}\n`)}return 0===e&&(t+="\n"),t}(v)}\n${f?"":"precision highp float;\n\n"}\n`:`${_}\n`;const C=function(n){const e={vs:{},fs:{}};return n.forEach(t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[r,s]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(i,{signature:s})}),e}(o),x={},L={},U={};for(const $ in a){const ee="string"==typeof a[$]?{injection:a[$],order:0}:a[$],fe=$.match(/^(v|f)s:(#)?([\w-]+)$/);if(fe){const ve=fe[3];fe[2]?"decl"===ve?L[$]=[ee]:U[$]=[ee]:x[$]=[ee]}else U[$]=[ee]}for(const $ of r){d&&$.checkDeprecations(y,d),w+=$.getModuleSource(i,g);const fe=$.injections[i];for(const pe in fe){const ve=pe.match(/^(v|f)s:#([\w-]+)$/);if(ve){const Xe="decl"===ve[2]?L:U;Xe[pe]=Xe[pe]||[],Xe[pe].push(fe[pe])}else x[pe]=x[pe]||[],x[pe].push(fe[pe])}}return w+=yue,w=u4(w,i,L),w+=function(n,e){let t="";for(const i in n){const r=n[i];if(t+=`void ${r.signature} {\n`,r.header&&(t+=` ${r.header}`),e[i]){const s=e[i];s.sort((o,a)=>o.order-a.order);for(const o of s)t+=` ${o.injection}\n`}r.footer&&(t+=` ${r.footer}`),t+="}\n"}return t}(C[i],x),w+=y,w=u4(w,i,U),w=function(n,e,t){switch(e){case 300:return t?vS(n,uue):function(n){const e=(n=vS(n,due)).match(wI);if(e){const t=e[1];n=n.replace(new RegExp(`\\b${CI}\\b`,"g"),t)}else{const t="fragmentColor";n=n.replace(pue,i=>`out vec4 ${t};\n${i}`).replace(new RegExp(`\\b${CI}\\b`,"g"),t)}return n}(n);case 100:return t?vS(n,hue):function(n){const e=(n=vS(n,fue)).match(wI);if(e){const t=e[1];n=n.replace(wI,"").replace(new RegExp(`\\b${t}\\b`,"g"),CI)}return n}(n);default:throw new Error(`unknown GLSL version ${e}`)}}(w,l?100:g,f),w}function Cue(n){return function(t){const i={};for(const r of n){const s=r.getUniforms(t,i);Object.assign(i,s)}return i}}const Tue={5126:Ji.bind(null,"uniform1fv",Aa,1,to),35664:Ji.bind(null,"uniform2fv",Aa,2,to),35665:Ji.bind(null,"uniform3fv",Aa,3,to),35666:Ji.bind(null,"uniform4fv",Aa,4,to),5124:Ji.bind(null,"uniform1iv",oh,1,to),35667:Ji.bind(null,"uniform2iv",oh,2,to),35668:Ji.bind(null,"uniform3iv",oh,3,to),35669:Ji.bind(null,"uniform4iv",oh,4,to),35670:Ji.bind(null,"uniform1iv",oh,1,to),35671:Ji.bind(null,"uniform2iv",oh,2,to),35672:Ji.bind(null,"uniform3iv",oh,3,to),35673:Ji.bind(null,"uniform4iv",oh,4,to),35674:Ji.bind(null,"uniformMatrix2fv",Aa,4,Ku),35675:Ji.bind(null,"uniformMatrix3fv",Aa,9,Ku),35676:Ji.bind(null,"uniformMatrix4fv",Aa,16,Ku),35678:Fs,35680:Fs,5125:Ji.bind(null,"uniform1uiv",bS,1,to),36294:Ji.bind(null,"uniform2uiv",bS,2,to),36295:Ji.bind(null,"uniform3uiv",bS,3,to),36296:Ji.bind(null,"uniform4uiv",bS,4,to),35685:Ji.bind(null,"uniformMatrix2x3fv",Aa,6,Ku),35686:Ji.bind(null,"uniformMatrix2x4fv",Aa,8,Ku),35687:Ji.bind(null,"uniformMatrix3x2fv",Aa,6,Ku),35688:Ji.bind(null,"uniformMatrix3x4fv",Aa,12,Ku),35689:Ji.bind(null,"uniformMatrix4x2fv",Aa,8,Ku),35690:Ji.bind(null,"uniformMatrix4x3fv",Aa,12,Ku),35678:Fs,35680:Fs,35679:Fs,35682:Fs,36289:Fs,36292:Fs,36293:Fs,36298:Fs,36299:Fs,36300:Fs,36303:Fs,36306:Fs,36307:Fs,36308:Fs,36311:Fs},Aue={},Due={},Oue={},b4=[0];function EI(n,e,t,i){1===e&&"boolean"==typeof n&&(n=n?1:0),Number.isFinite(n)&&(b4[0]=n,n=b4);const r=n.length;if(r%e&&ct.warn(`Uniform size should be multiples of ${e}`,n)(),n instanceof t)return n;let s=i[r];s||(s=new t(r),i[r]=s);for(let o=0;o{const r=n!==i;return r&&(e.uniform1i(t,i),n=i),r}}function Ji(n,e,t,i){let r=null,s=null;return(o,a,l)=>{const c=e(l,t),d=c.length;let f=!1;if(null===r)r=new Float32Array(d),s=d,f=!0;else{Qe(s===d,"Uniform length cannot change.");for(let p=0;p{const a=String(o+e);return S4(a,r-a.length)+t+s})}(e);return{shaderName:l,errors:E4(s,c),warnings:E4(o,c)}}(i,this.source,this.shaderType,this.id);throw ct.error(`GLSL compilation errors in ${r}\n${s}`)(),ct.warn(`GLSL compilation warnings in ${r}\n${o}`)(),new Error(`GLSL compilation errors in ${r}`)}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class SI extends rb{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class MI extends rb{constructor(e,t){"string"==typeof t&&(t={source:t}),super(e,Object.assign({},t,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const rs=5126,sb=5124,ob=5125,xI={[rs]:[rs,1,"float"],35664:[rs,2,"vec2"],35665:[rs,3,"vec3"],35666:[rs,4,"vec4"],[sb]:[sb,1,"int"],35667:[sb,2,"ivec2"],35668:[sb,3,"ivec3"],35669:[sb,4,"ivec4"],[ob]:[ob,1,"uint"],36294:[ob,2,"uvec2"],36295:[ob,3,"uvec3"],36296:[ob,4,"uvec4"],35670:[rs,1,"bool"],35671:[rs,2,"bvec2"],35672:[rs,3,"bvec3"],35673:[rs,4,"bvec4"],35674:[rs,8,"mat2"],35685:[rs,8,"mat2x3"],35686:[rs,8,"mat2x4"],35675:[rs,12,"mat3"],35687:[rs,12,"mat3x2"],35688:[rs,12,"mat3x4"],35676:[rs,16,"mat4"],35689:[rs,16,"mat4x2"],35690:[rs,16,"mat4x3"]};function O4(n){const e=xI[n];if(!e)return null;const[t,i]=e;return{type:t,components:i}}function I4(n,e){switch(n){case 5120:case 5121:case 5122:case 5123:n=rs}for(const t in xI){const[i,r,s]=xI[t];if(i===n&&r===e)return{glType:t,name:s}}return null}class pde{constructor(e){this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}getAttributeInfo(e){const t=Number(e);return Number.isFinite(t)?this.attributeInfosByLocation[t]:this.attributeInfosByName[e]||null}getAttributeLocation(e){const t=this.getAttributeInfo(e);return t?t.location:-1}getAttributeAccessor(e){const t=this.getAttributeInfo(e);return t?t.accessor:null}getVaryingInfo(e){const t=Number(e);return Number.isFinite(t)?this.varyingInfos[t]:this.varyingInfosByName[e]||null}getVaryingIndex(e){const t=this.getVaryingInfo();return t?t.location:-1}getVaryingAccessor(e){const t=this.getVaryingInfo();return t?t.accessor:null}_readAttributesFromProgram(e){const{gl:t}=e,i=t.getProgramParameter(e.handle,35721);for(let r=0;r=0&&this._addAttribute(l,s,o,a)}this.attributeInfos.sort((r,s)=>r.location-s.location)}_readVaryingsFromProgram(e){const{gl:t}=e;if(!Mn(t))return;const i=t.getProgramParameter(e.handle,35971);for(let r=0;rr.location-s.location)}_addAttribute(e,t,i,r){const{type:s,components:o}=O4(i),a={type:s,size:r*o};this._inferProperties(e,t,a);const l={location:e,name:t,accessor:new ea(a)};this.attributeInfos.push(l),this.attributeInfosByLocation[e]=l,this.attributeInfosByName[l.name]=l}_inferProperties(e,t,i){/instance/i.test(t)&&(i.divisor=1)}_addVarying(e,t,i,r){const{type:s,components:o}=O4(i),l={location:e,name:t,accessor:new ea({type:s,size:r*o})};this.varyingInfos.push(l),this.varyingInfosByName[l.name]=l}}const gde=35981,mde=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class R4 extends qu{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Program","v6.0",mde),this._isCached=!1,this.initialize(t),Object.seal(this),this._setId(t.id)}initialize(e={}){const{hash:t,vs:i,fs:r,varyings:s,bufferMode:o=gde}=e;return this.hash=t||"",this.vs="string"==typeof i?new SI(this.gl,{id:`${e.id}-vs`,source:i}):i,this.fs="string"==typeof r?new MI(this.gl,{id:`${e.id}-fs`,source:r}):r,Qe(this.vs instanceof SI),Qe(this.fs instanceof MI),this.uniforms={},this._textureUniforms={},s&&s.length>0&&(To(this.gl),this.varyings=s,this.gl2.transformFeedbackVaryings(this.handle,s,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new pde(this),this.setProps(e)}delete(e={}){return this._isCached?this:super.delete(e)}setProps(e){return"uniforms"in e&&this.setUniforms(e.uniforms),this}draw({logPriority:e,drawMode:t=4,vertexCount:i,offset:r=0,start:s,end:o,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:d=c>0,vertexArray:f=null,transformFeedback:p,framebuffer:g,parameters:_={},uniforms:y,samplers:v}){if((y||v)&&(ct.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(y||{})),ct.priority>=e){const w=g?g.id:"default",C=`mode=${rh(this.gl,t)} verts=${i} instances=${c} indexType=${rh(this.gl,l)} isInstanced=${d} isIndexed=${a} Framebuffer=${w}`;ct.log(e,C)()}return Qe(f),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===i||d&&0===c||(f.bindForDraw(i,c,()=>{if(void 0!==g&&(_=Object.assign({},_,{framebuffer:g})),p){const w=function(n){switch(n){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Qe(!1),0}}(t);p.begin(w)}this._bindTextures(),nc(this.gl,_,()=>{a&&d?this.gl2.drawElementsInstanced(t,i,l,r,c):a&&Mn(this.gl)&&!isNaN(s)&&!isNaN(o)?this.gl2.drawRangeElements(t,s,o,i,l,r):a?this.gl.drawElements(t,i,l,r):d?this.gl2.drawArraysInstanced(t,r,i,c):this.gl.drawArrays(t,r,i)}),p&&p.end()}),0))}setUniforms(e={}){ct.priority>=2&&function(n,e,t){for(const i in n){const r=n[i];if((!t||Boolean(t[i]))&&!Rue(r))throw e=e?`${e} `:"",console.error(`${e} Bad uniform ${i}`,r),new Error(`${e} Bad uniform ${i}`)}}(e,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const t in e){const i=e[t],r=this._uniformSetters[t];if(r){let s=i,o=!1;if(s instanceof is&&(s=s.texture),s instanceof fm)if(o=this.uniforms[t]!==i,o){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const a=s,{textureIndex:l}=r;a.bind(l),s=l,this._textureUniforms[t]=a}else s=r.textureIndex;else this._textureUniforms[t]&&delete this._textureUniforms[t];(r(s)||o)&&kue(this.uniforms,t,i)}}return this}_areTexturesRenderable(){let e=!0;for(const t in this._textureUniforms){const i=this._textureUniforms[t];i.update(),e=e&&i.loaded}return e}_bindTextures(){for(const e in this._textureUniforms)this._textureUniforms[e].bind(this._uniformSetters[e].textureIndex)}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(e){const t=this.gl.getAttachedShaders(e),i={};for(const r of t)switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new SI({handle:r});break;case 35632:i.fs=new MI({handle:r})}return i}_getParameter(e){return this.gl.getProgramParameter(this.handle,e)}_setId(e){if(!e){const t=this._getName();this.id=Wc(t)}}_getName(){let e=this.vs.getName()||this.fs.getName();return e=e.replace(/shader/i,""),e=e?`${e}-program`:"program",e}_compileAndLink(){const{gl:e}=this;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),ct.time(4,`linkProgram for ${this._getName()}`)(),e.linkProgram(this.handle),ct.timeEnd(4,`linkProgram for ${this._getName()}`)(),e.debug||ct.level>0){if(!e.getProgramParameter(this.handle,35714))throw new Error(`Error linking: ${e.getProgramInfoLog(this.handle)}`);if(e.validateProgram(this.handle),!e.getProgramParameter(this.handle,35715))throw new Error(`Error validating: ${e.getProgramInfoLog(this.handle)}`)}}_readUniformLocationsFromLinkedProgram(){const{gl:e}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let t=0;t1)for(let o=0;ot.name===e.name)||this._defaultModules.push(e),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(i=>i.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:i="",defines:r={},inject:s={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=e,c=this._getModuleList(e.modules),d=this._getHash(t),f=this._getHash(i),p=c.map(x=>this._getHash(x.name)).sort(),g=o.map(x=>this._getHash(x)),_=Object.keys(r).sort(),y=Object.keys(s).sort(),v=[],w=[];for(const x of _)v.push(this._getHash(x)),v.push(this._getHash(r[x]));for(const x of y)w.push(this._getHash(x)),w.push(this._getHash(s[x]));const C=`${d}/${f}D${v.join("/")}M${p.join("/")}I${w.join("/")}V${g.join("/")}H${this.stateHash}B${a}${l?"T":""}`;if(!this._programCache[C]){const x=function(n,e){const{vs:t,fs:i}=e,r=Qce(e.modules||[]);return{gl:n,vs:v4(n,Object.assign({},e,{source:t,type:ib,modules:r})),fs:v4(n,Object.assign({},e,{source:i,type:"fs",modules:r})),getUniforms:Cue(r)}}(this.gl,{vs:t,fs:i,modules:c,inject:s,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[C]=new R4(this.gl,{hash:C,vs:x.vs,fs:x.fs,varyings:o,bufferMode:a}),this._getUniforms[C]=x.getUniforms||(L=>{}),this._useCounts[C]=0}return this._useCounts[C]++,this._programCache[C]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){const t=e.hash;this._useCounts[t]--,0===this._useCounts[t]&&(this._programCache[t].delete(),delete this._programCache[t],delete this._getUniforms[t],delete this._useCounts[t])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let s=0,o=this._defaultModules.length;s-1)return"Edge";const i=-1!==t.indexOf("MSIE "),r=-1!==t.indexOf("Trident/");return i||r?"IE":Gv.chrome?"Chrome":Gv.safari?"Safari":Gv.mozInnerScreenX?"Firefox":"Unknown"}()}static getDefaultArray(e){return e.luma=e.luma||{},e.luma.defaultVertexArray||(e.luma.defaultVertexArray=new Da(e,{handle:null,isDefaultArray:!0})),e.luma.defaultVertexArray}static getMaxAttributes(e){return Da.MAX_ATTRIBUTES=Da.MAX_ATTRIBUTES||e.getParameter(34921),Da.MAX_ATTRIBUTES}static setConstant(e,t,i){switch(i.constructor){case Float32Array:Da._setConstantFloatArray(e,t,i);break;case Int32Array:Da._setConstantIntArray(e,t,i);break;case Uint32Array:Da._setConstantUintArray(e,t,i);break;default:Qe(!1)}}constructor(e,t={}){super(e,Object.assign({},t,{id:t.id||t.program&&t.program.id})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=t.isDefaultArray||!1,this.gl2=e,this.initialize(t),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Da.getMaxAttributes(this.gl)}initialize(e={}){return this.setProps(e)}setProps(e){return this}setElementBuffer(e=null,t={}){return Qe(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,i){if(34963===t.target)return this.setElementBuffer(t,i);const{size:r,type:s,stride:o,offset:a,normalized:l,integer:c,divisor:d}=i,{gl:f,gl2:p}=this;return e=Number(e),this.bind(()=>{f.bindBuffer(34962,t.handle),c?(Qe(Mn(f)),p.vertexAttribIPointer(e,r,s,o,a)):f.vertexAttribPointer(e,r,s,l,o,a),f.enableVertexAttribArray(e),p.vertexAttribDivisor(e,d||0)}),this}enable(e,t=!0){return!t&&0===e&&!Da.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){const i=this._normalizeConstantArrayValue(t),r=i.byteLength*e,s=i.length*e;let o=!this.buffer;if(this.buffer=this.buffer||new Si(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const a=function(n,e){return new n(function(n){return(!ES||ES.byteLength{switch(e){case 34373:return this.gl.getVertexAttribOffset(t,e);default:return this.gl.getVertexAttrib(t,e)}})}}const Ede=/^(.+)__LOCATION_([0-9]+)$/,Sde=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Mde{constructor(e,t={}){this.id=t.id||t.program&&t.program.id,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Da(e),Cz(this,"VertexArray","v6.0",Sde),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:e}=this.vertexArrayObject;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}setProps(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(e){return Object.assign(this.attributes,e),this.vertexArrayObject.bind(()=>{for(const t in e)this._setAttribute(t,e[t]);this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,i={}){if(34963===t.target)return this.setElementBuffer(t,i);const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,t.accessor,i);return r>=0&&(this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,t,s)),this}setConstant(e,t,i={}){const{location:r,accessor:s}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},i));return r>=0&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[r]=t,this.accessors[r]=s,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new Si(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=i()}),r}_resolveLocationAndAccessor(e,t,i,r){const s={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,ct.once(3,()=>`unused value ${e} in ${this.id}`)(),s;const l=this._getAttributeInfo(a||o);if(!l)return s;const d=ea.resolve(l.accessor,this.accessors[o]||{},i,r),{size:f,type:p}=d;return Qe(Number.isFinite(f)&&Number.isFinite(p)),{location:o,accessor:d}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){const t=Number(e);if(Number.isFinite(t))return{location:t};const i=Ede.exec(e),r=i?i[1]:e,s=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+s,name:r}:{location:-1}}_setAttribute(e,t){if(t instanceof Si)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof Si)this.setBuffer(e,t[0],t[1]);else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof Si))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){const i=Math.max(0|e,0|t);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,i);for(let s=1;s0;if(e.isInstanced=e.isInstanced||o,i instanceof Si){const a=i;if(o){const l=a.getVertexCount(r);e.instanceCount=Math.min(e.instanceCount,l)}else{const l=a.getVertexCount(r);e.vertexCount=Math.min(e.vertexCount,l)}}}setElements(e=null,t={}){return ct.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,t)}}function lb(n,e={}){const{isInteger:i=!1}=e;if(Array.isArray(n)||ArrayBuffer.isView(n))return function(n,e){const{maxElts:t=16,size:i=1}=e;let r="[";for(let o=0;o0&&(r+=","+(o%i==0?" ":"")),r+=lb(n[o],e);return`${r}${n.length>t?"...":"]"}`}(n,e);if(!Number.isFinite(n))return String(n);if(Math.abs(n)<1e-16)return i?"0":"0.";if(i||Math.abs(n)>100&&Math.abs(n)<1e4)return n.toFixed(0);const r=n.toPrecision(2);return r.indexOf(".0")===r.length-2?r.slice(0,-1):r}function k4(n,e,t,i){const{gl:r}=n;if(!e)return{[i]:"null","Format ":"N/A"};let c,d,f,s="NOT PROVIDED",o=1,a=0,l=0;if(t&&(s=t.type,o=t.size,s=String(s).replace("Array",""),c=-1!==s.indexOf("nt")),e instanceof Si){const p=e,{data:g,changed:_}=p.getDebugData();let y;return d=_?"*":"",f=g,l=p.byteLength,a=l/g.BYTES_PER_ELEMENT/o,t?y=`${t.divisor>0?"I ":"P "} ${a} (x${o}=${l} bytes ${rh(r,s)})`:(c=!0,y=`${l} bytes`),{[i]:`${d}${lb(f,{size:o,isInteger:c})}`,"Format ":y}}return f=e,o=e.length,s=String(e.constructor.name).replace("Array",""),c=-1!==s.indexOf("nt"),{[i]:`${lb(f,{size:o,isInteger:c})} (constant)`,"Format ":`${o}x${s} (constant)`}}function Ade(n,e){const{type:t,size:i}=e,r=I4(t,i);return r?`${n} (${r.name})`:n}function F4({header:n="Uniforms",program:e,uniforms:t,undefinedOnly:i=!1}){Qe(e);const s=".*Matrix",a={},l=Object.keys(e._uniformSetters).sort();let c=0;for(const p of l)!p.match(".*_.*")&&!p.match(s)&&TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)p.match(s)&&TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;for(const p of l)a[p]||TI({table:a,header:n,uniforms:t,uniformName:p,undefinedOnly:i})&&c++;let d=0;const f={};if(!i)for(const p in t){const g=t[p];a[p]||(d++,f[p]={Type:`NOT USED: ${g}`,[n]:lb(g)})}return{table:a,count:c,unusedTable:f,unusedCount:d}}function TI({table:n,header:e,uniforms:t,uniformName:i,undefinedOnly:r}){const s=t[i],o=function(n){return null!=n}(s);return!(r&&o||(n[i]={[e]:o?lb(s):"N/A","Uniform Type":o?s:"NOT PROVIDED"},0))}function N4(n){const{type:e,size:t}=n.accessor,i=I4(e,t);return i?`${i.name} ${n.name}`:n.name}const Ide={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Rde(n,e){const{attributeMap:t=Ide}=e||{};return t&&t[n]||n}function kde(n,e){let t;switch(n){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":t="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":t="vectors"}switch(t){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Qe(Number.isFinite(e.size),`attribute ${n} needs size`)}const L4=()=>{},Lde={};class SS{constructor(e,t={}){const{id:i=Wc("model")}=t;Qe(lS(e)),this.id=i,this.gl=e,this.id=t.id||Wc("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||ab.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:t=null,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},Qe(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(e){this._setModelProps(e)}delete(){for(const e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(e){const{program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=e;this.programProps={program:t,vs:i,fs:r,modules:s,defines:o,inject:a,varyings:l,bufferMode:c,transpileToGLSL100:d},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(e){return this.drawMode=e,this}setVertexCount(e){return Qe(Number.isFinite(e)),this.vertexCount=e,this}setInstanceCount(e){return Qe(Number.isFinite(e)),this.instanceCount=e,this}setGeometry(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(n,e,t){const i={};let r=e.indices;for(const s in e.attributes){const o=e.attributes[s],a=Rde(s,undefined);if("indices"===s)r=o;else if(o.constant)i[a]=o.value;else{const l=o.value,c=J({},o);delete c.value,i[a]=[new Si(n,l),c],kde(s,c)}}if(r){const s=r.value||r;Qe(s instanceof Uint16Array||s instanceof Uint32Array,'attribute array for "indices" must be of integer type');const o={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};i.indices=[new Si(n,{data:s,target:34963}),o]}return i}(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(e={}){if(dm(e))return this;const t={};for(const i in e){const r=e[i];t[i]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(t),this}setUniforms(e={}){return Object.assign(this.uniforms,e),this}getModuleUniforms(e){this._checkProgram();const t=this.programManager.getUniforms(this.program);return t?t(e):{}}updateModuleSettings(e){const t=this.getModuleUniforms(e||{});return this.setUniforms(t)}clear(e){return JO(this.program.gl,e),this}draw(e={}){this._checkProgram();const{moduleSettings:t=null,framebuffer:i,uniforms:r={},attributes:s={},transformFeedback:o=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=e;let c;this.setAttributes(s),this.updateModuleSettings(t),this.setUniforms(r),ct.priority>=2&&(c=this._logDrawCallStart(2));const d=this.vertexArray.getDrawParams(),{isIndexed:f=d.isIndexed,indexType:p=d.indexType,indexOffset:g=d.indexOffset,vertexArrayInstanced:_=d.isInstanced}=this.props;_&&!this.isInstanced&&ct.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:y,instanceCount:v}=this,{onBeforeRender:w=L4,onAfterRender:C=L4}=this.props;w(),this.program.setUniforms(this.uniforms);const x=this.program.draw(Object.assign(Lde,e,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:o,isIndexed:f,indexType:p,isInstanced:y,instanceCount:v,offset:f?g:0}));return C(),ct.priority>=2&&this._logDrawCallEnd(c,l,i),x}transform(e={}){const{discard:t=!0,feedbackBuffers:i,unbindModels:r=[]}=e;let{parameters:s}=e;i&&this._setFeedbackBuffers(i),t&&(s=Object.assign({},s,{35977:t})),r.forEach(o=>o.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:s}))}finally{r.forEach(o=>o.vertexArray.bindBuffers())}return this}render(e={}){return ct.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){if(!this._programDirty&&this.programManager.stateHash===this._programManagerState)return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}=this.programProps;t=this.programManager.get({vs:i,fs:r,modules:s,inject:o,defines:a,varyings:l,bufferMode:c,transpileToGLSL100:d}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Qe(t instanceof R4,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new Mde(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof Si&&t.delete()}}_setAnimationProps(e){this.animated&&Qe(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(dm(e))return this;const{gl:t}=this.program;return this.transformFeedback=this.transformFeedback||new o4(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){const t=e>3?0:1e4;if(!(Date.now()-this.lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:ct.level<=2})(),e}_logDrawCallEnd(e,t,i,r){if(void 0===e)return;const s=function({vertexArray:n,header:e="Attributes"}){if(!n.configuration)return{};const t={};n.elements&&(t.ELEMENT_ARRAY_BUFFER=k4(n,n.elements,null,e));const i=n.values;for(const r in i){const s=n._getAttributeInfo(r);if(s){let o=`${r}: ${s.name}`;const a=n.accessors[s.location];a&&(o=`${r}: ${Ade(s.name,a)}`),t[o]=k4(n,i[r],a,e)}}return t}({vertexArray:t,header:`${this.id} attributes`,attributes:this._attributes}),{table:o,unusedTable:a,unusedCount:l}=F4({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:d}=F4({header:`${this.id} uniforms`,program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});d>0&&ct.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&ct.log("UNUSED UNIFORMS",Object.keys(a))();const f=function(n){const e={},t=`Accessors for ${n.id}`;for(const i of n.attributeInfos)i&&(e[`in ${N4(i)}`]={[t]:JSON.stringify(i.accessor)});for(const i of n.varyingInfos)i&&(e[`out ${N4(i)}`]={[t]:JSON.stringify(i.accessor)});return e}(this.vertexArray.configuration);ct.table(e,s)(),ct.table(e,o)(),ct.table(e+1,f)(),r&&r.log({logLevel:2,message:`Rendered to ${r.id}`}),ct.groupEnd(2,`>>> DRAWING MODEL ${this.id}`)()}}class AI{static isSupported(e){return Mn(e)}constructor(e,t={}){this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(t),Object.seal(this)}delete(){const{model:e,bufferTransform:t,textureTransform:i}=this;e&&e.delete(),t&&t.delete(),i&&i.delete()}run(e={}){const{clearRenderTarget:t=!0}=e,i=this._updateDrawOptions(e);t&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let e=!1;const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)e=e||i.swap();Qe(e,"Nothing to swap")}getBuffer(e=null){return this.bufferTransform&&this.bufferTransform.getBuffer(e)}getData(e={}){const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t){const r=i.getData(e);if(r)return r}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(e={}){"elementCount"in e&&this.model.setVertexCount(e.elementCount);const t=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of t)i.update(e)}_initialize(e={}){const{gl:t}=this;this._buildResourceTransforms(t,e),e=this._updateModelProps(e),this.model=new SS(t,Object.assign({},e,{fs:e.fs||s4({version:a4(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=r.updateModelProps(t);return t}_buildResourceTransforms(e,t){(function(n){return!(dm(n.feedbackBuffers)&&dm(n.feedbackMap)&&!(n.varyings&&n.varyings.length>0))})(t)&&(this.bufferTransform=new Pce(e,t)),function(n){return!(dm(n._sourceTextures)&&!n._targetTexture&&!n._targetTextureVarying)}(t)&&(this.textureTransform=new Wce(e,t)),Qe(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(e){let t=Object.assign({},e);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const r of i)t=Object.assign(t,r.getDrawOptions(t));return t}}function MS(){}const jde={onStart:MS,onUpdate:MS,onInterrupt:MS,onEnd:MS};class cb{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings=J(J({},jde),e),this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const Yde={interpolation:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="interpolation",this.transition=new cb(i),this.attribute=t,this.attributeInTransition=new dI(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function(n,e){const t=e4(e.size);return new AI(n,{vs:"\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n",defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);const r={byteLength:0,usage:35050};this.buffers=[new Si(e,r),new Si(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)return void this.transition.cancel();const{buffers:r,attribute:s}=this;t4(r);const o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)n4(J({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=uI(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aFrom:r[0],aTo:Jz(0,s)},feedbackBuffers:{vCurrent:r[1]}})}update(){const e=this.transition.update();if(e){const{time:t,settings:{duration:i,easing:r}}=this.transition,s=r(t/i);this.transform.run({uniforms:{time:s}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class{constructor({gl:e,attribute:t,timeline:i}){this.gl=e,this.type="spring",this.transition=new cb(i),this.attribute=t,this.attributeInTransition=new dI(e,an(J({},t.settings),{normalized:!1})),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function(n){return new xa(n,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(n,e){return new is(n,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(n,e,t){const i=e4(e.size);return new AI(n,{framebuffer:t,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:i},varyings:["vNext"]})}(e,t,this.framebuffer);const r={byteLength:0,usage:35050};this.buffers=[new Si(e,r),new Si(e,r),new Si(e,r)]}get inProgress(){return this.transition.inProgress}start(e,t){const{buffers:r,attribute:s}=this,o={numInstances:t,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)n4(J({buffer:a},o));this.currentStartIndices=s.startIndices,this.currentLength=uI(s,t),this.attributeInTransition.update({buffer:r[1],value:s.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:Jz(0,s)}})}update(){const{buffers:e,transform:t,framebuffer:i,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),t4(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),uS(i)[0]>0||r.end(),!0)}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete();this.texture.delete(),this.texture=null,this.framebuffer.delete(),this.framebuffer=null}}};class Xde{constructor(e,{id:t,timeline:i}){this.id=t,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=AI.isSupported(e)}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:t,numInstances:i}){this.numInstances=i||1;for(const r in e){const s=e[r],o=s.getTransitionSetting(t);!o||this._updateAttribute(r,s,o)}for(const r in this.transitions){const s=e[r];(!s||!s.getTransitionSetting(t))&&this._removeTransition(r)}}hasAttribute(e){const t=this.transitions[e];return t&&t.inProgress}getAttributes(){const e={};for(const t in this.transitions){const i=this.transitions[t];i.inProgress&&(e[t]=i.attributeInTransition)}return e}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions)this.transitions[t].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].cancel(),delete this.transitions[e]}_updateAttribute(e,t,i){const r=this.transitions[e];let s=!r||r.type!==i.type;if(s){if(!this.isSupported)return void Zn.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();r&&this._removeTransition(e);const o=Yde[i.type];o?this.transitions[e]=new o({attribute:t,timeline:this.timeline,gl:this.gl}):(Zn.error("unsupported transition type '".concat(i.type,"'"))(),s=!1)}(s||t.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}const B4="attributeManager.invalidate";class the{constructor(e,{id:t="attribute-manager",stats:i,timeline:r}={}){this.id=t,this.gl=e,this.attributes={},this.updateTriggers={},this.accessors={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new Xde(e,{id:"".concat(t,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const t=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,t&&this.id}setNeedsRedraw(e=!0){return this.needsRedraw=!0,this}add(e,t){this._add(e,t)}addInstanced(e,t){this._add(e,t,{instanced:1})}remove(e){for(let t=0;t{e[r]||(e[r]=[]),e[r].push(t)});this.updateTriggers=e}_invalidateTrigger(e,t){const{attributes:i,updateTriggers:r}=this,s=r[e];return s&&s.forEach(o=>{const a=i[o];a&&a.setNeedsUpdate(a.id,t)}),s}_updateAttribute(e){const{attribute:t,numInstances:i}=e;eo("attribute.updateStart",t),t.allocate(i)&&eo("attribute.allocate",t,i),t.updateBuffer(e)&&(this.needsRedraw=!0,eo("attribute.updateEnd",t,i))}}function j4(n,e,t,i,r){const s=e-n;return(t-e)*r+-s*i+s+e}function U4(n,e){if(Array.isArray(n)){let t=0;for(let i=0;i0}add(e,t,i,r){const{transitions:s}=this;if(s.has(e)){const l=s.get(e),{value:c=l.settings.fromValue}=l;t=c,this.remove(e)}if(!(r=Qz(r)))return;const o=she[r.type];if(!o)return void Zn.error("unsupported transition type '".concat(r.type,"'"))();const a=new o(this.timeline);a.start(an(J({},r),{fromValue:t,toValue:i})),s.set(e,a)}remove(e){const{transitions:t}=this;t.has(e)&&(t.get(e).cancel(),t.delete(e))}update(){const e={};for(const[t,i]of this.transitions)i.update(),e[t]=i.value,i.inProgress||this.remove(t);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}const xS={COMPONENT:Symbol.for("component"),ASYNC_DEFAULTS:Symbol.for("asyncPropDefaults"),ASYNC_ORIGINAL:Symbol.for("asyncPropOriginal"),ASYNC_RESOLVED:Symbol.for("asyncPropResolved")},{COMPONENT:ahe}=xS;function uhe(n,e){if(!n.transitions)return null;const t={},i=OI(n);for(const r in n.transitions){const s=i[r],o=s&&s.type;("number"===o||"color"===o||"array"===o)&&DI(n[r],e[r],s)&&(t[r]=!0)}return t}function z4({newProps:n,oldProps:e,ignoreProps:t={},propTypes:i={},triggerName:r="props"}={}){if(e===n)return null;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const s of Object.keys(n))if(!(s in t)){if(!(s in e))return"".concat(r,".").concat(s," added");const o=DI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}for(const s of Object.keys(e))if(!(s in t)){if(!(s in n))return"".concat(r,".").concat(s," dropped");if(!Object.hasOwnProperty.call(n,s)){const o=DI(n[s],e[s],i[s]);if(o)return"".concat(r,".").concat(s," ").concat(o)}}return null}function DI(n,e,t){let i=t&&t.equal;return i&&!i(n,e,t)||!i&&(i=n&&e&&n.equals,i&&!i.call(n,e))?"changed deeply":i||e===n?null:"changed shallowly"}function fhe(n,e){if(null===e)return"oldProps is null, initial diff";const t=e.extensions,{extensions:i}=n;if(i===t)return!1;if(i.length!==t.length)return!0;for(let r=0;r{for(const r in i)if(!vhe(i[r],e[r])){t=n(i),e=i;break}return t}}function bhe(n,e){if(!e)return n;const t=J(J({},n),e);if("defines"in e&&(t.defines=J(J({},n.defines),e.defines)),"modules"in e&&(t.modules=(n.modules||[]).concat(e.modules),e.modules.some(i=>"project64"===i.name))){const i=t.modules.findIndex(r=>"project32"===r.name);i>=0&&t.modules.splice(i,1)}if("inject"in e)if(n.inject){const i=J({},n.inject);for(const r in e.inject)i[r]=(i[r]||"")+e.inject[r];t.inject=i}else t.inject=e.inject;return t}function AS(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],f=e[9],p=e[10],g=e[11],_=e[12],y=e[13],v=e[14],w=e[15],C=t*a-i*o,x=t*l-r*o,L=t*c-s*o,U=i*l-r*a,$=i*c-s*a,ee=r*c-s*l,fe=d*y-f*_,pe=d*v-p*_,ve=d*w-g*_,$e=f*v-p*y,Xe=f*w-g*y,re=p*w-g*v,le=C*re-x*Xe+L*$e+U*ve-$*pe+ee*fe;return le?(n[0]=(a*re-l*Xe+c*$e)*(le=1/le),n[1]=(r*Xe-i*re-s*$e)*le,n[2]=(y*ee-v*$+w*U)*le,n[3]=(p*$-f*ee-g*U)*le,n[4]=(l*ve-o*re-c*pe)*le,n[5]=(t*re-r*ve+s*pe)*le,n[6]=(v*L-_*ee-w*x)*le,n[7]=(d*ee-p*L+g*x)*le,n[8]=(o*Xe-a*ve+c*fe)*le,n[9]=(i*ve-t*Xe-s*fe)*le,n[10]=(_*$-y*L+w*C)*le,n[11]=(f*L-d*$-g*C)*le,n[12]=(a*pe-o*$e-l*fe)*le,n[13]=(t*$e-i*pe+r*fe)*le,n[14]=(y*x-_*U-v*C)*le,n[15]=(d*U-f*x+p*C)*le,n):null}function qc(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],f=e[8],p=e[9],g=e[10],_=e[11],y=e[12],v=e[13],w=e[14],C=e[15],x=t[0],L=t[1],U=t[2],$=t[3];return n[0]=x*i+L*a+U*f+$*y,n[1]=x*r+L*l+U*p+$*v,n[2]=x*s+L*c+U*g+$*w,n[3]=x*o+L*d+U*_+$*C,n[4]=(x=t[4])*i+(L=t[5])*a+(U=t[6])*f+($=t[7])*y,n[5]=x*r+L*l+U*p+$*v,n[6]=x*s+L*c+U*g+$*w,n[7]=x*o+L*d+U*_+$*C,n[8]=(x=t[8])*i+(L=t[9])*a+(U=t[10])*f+($=t[11])*y,n[9]=x*r+L*l+U*p+$*v,n[10]=x*s+L*c+U*g+$*w,n[11]=x*o+L*d+U*_+$*C,n[12]=(x=t[12])*i+(L=t[13])*a+(U=t[14])*f+($=t[15])*y,n[13]=x*r+L*l+U*p+$*v,n[14]=x*s+L*c+U*g+$*w,n[15]=x*o+L*d+U*_+$*C,n}function ub(n,e,t){var o,a,l,c,d,f,p,g,_,y,v,w,i=t[0],r=t[1],s=t[2];return e===n?(n[12]=e[0]*i+e[4]*r+e[8]*s+e[12],n[13]=e[1]*i+e[5]*r+e[9]*s+e[13],n[14]=e[2]*i+e[6]*r+e[10]*s+e[14],n[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[1],l=e[2],c=e[3],d=e[4],f=e[5],p=e[6],g=e[7],_=e[8],y=e[9],v=e[10],w=e[11],n[0]=o=e[0],n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=f,n[6]=p,n[7]=g,n[8]=_,n[9]=y,n[10]=v,n[11]=w,n[12]=o*i+d*r+_*s+e[12],n[13]=a*i+f*r+y*s+e[13],n[14]=l*i+p*r+v*s+e[14],n[15]=c*i+g*r+w*s+e[15]),n}function db(n,e,t){var i=t[0],r=t[1],s=t[2];return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*i,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11]*s,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function $4(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],d=e[9],f=e[10],p=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=s*r+c*i,n[5]=o*r+d*i,n[6]=a*r+f*i,n[7]=l*r+p*i,n[8]=c*r-s*i,n[9]=d*r-o*i,n[10]=f*r-a*i,n[11]=p*r-l*i,n}function G4(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],f=e[6],p=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r+c*i,n[1]=o*r+d*i,n[2]=a*r+f*i,n[3]=l*r+p*i,n[4]=c*r-s*i,n[5]=d*r-o*i,n[6]=f*r-a*i,n[7]=p*r-l*i,n}function W4(n,e,t,i,r){var o,s=1/Math.tan(e/2);return n[0]=s/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,null!=r&&r!==1/0?(n[10]=(r+i)*(o=1/(i-r)),n[14]=2*r*i*o):(n[10]=-1,n[14]=-2*i),n}function q4(n,e){var t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=n[6],c=n[7],d=n[8],f=n[9],p=n[10],g=n[11],_=n[12],y=n[13],v=n[14],w=n[15],C=e[0],x=e[1],L=e[2],U=e[3],$=e[4],ee=e[5],fe=e[6],pe=e[7],ve=e[8],$e=e[9],Xe=e[10],re=e[11],le=e[12],Oe=e[13],Q=e[14],Ue=e[15];return Math.abs(t-C)<=Vi*Math.max(1,Math.abs(t),Math.abs(C))&&Math.abs(i-x)<=Vi*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(r-L)<=Vi*Math.max(1,Math.abs(r),Math.abs(L))&&Math.abs(s-U)<=Vi*Math.max(1,Math.abs(s),Math.abs(U))&&Math.abs(o-$)<=Vi*Math.max(1,Math.abs(o),Math.abs($))&&Math.abs(a-ee)<=Vi*Math.max(1,Math.abs(a),Math.abs(ee))&&Math.abs(l-fe)<=Vi*Math.max(1,Math.abs(l),Math.abs(fe))&&Math.abs(c-pe)<=Vi*Math.max(1,Math.abs(c),Math.abs(pe))&&Math.abs(d-ve)<=Vi*Math.max(1,Math.abs(d),Math.abs(ve))&&Math.abs(f-$e)<=Vi*Math.max(1,Math.abs(f),Math.abs($e))&&Math.abs(p-Xe)<=Vi*Math.max(1,Math.abs(p),Math.abs(Xe))&&Math.abs(g-re)<=Vi*Math.max(1,Math.abs(g),Math.abs(re))&&Math.abs(_-le)<=Vi*Math.max(1,Math.abs(_),Math.abs(le))&&Math.abs(y-Oe)<=Vi*Math.max(1,Math.abs(y),Math.abs(Oe))&&Math.abs(v-Q)<=Vi*Math.max(1,Math.abs(v),Math.abs(Q))&&Math.abs(w-Ue)<=Vi*Math.max(1,Math.abs(w),Math.abs(Ue))}function Y4(n,e,t){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n}function DS(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3];return n[0]=t[0]*i+t[4]*r+t[8]*s+t[12]*o,n[1]=t[1]*i+t[5]*r+t[9]*s+t[13]*o,n[2]=t[2]*i+t[6]*r+t[10]*s+t[14]*o,n[3]=t[3]*i+t[7]*r+t[11]*s+t[15]*o,n}!function(){var n=new ta(4);ta!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0)}();const X4=[0,0,0,0],Whe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],qhe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Yhe=[0,0,0],Xhe=[0,0,0],Khe=TS(function({viewport:n,devicePixelRatio:e,coordinateSystem:t,coordinateOrigin:i}){const{projectionCenter:r,viewProjectionMatrix:s,originCommon:o,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(n,e,t){const{viewMatrixUncentered:i,projectionMatrix:r}=n;let{viewMatrix:s,viewProjectionMatrix:o}=n,a=X4,l=X4,c=n.cameraPosition;const{geospatialOrigin:d,shaderCoordinateOrigin:f,offsetMode:p}=K4(n,e,t);return p&&(l=n.projectPosition(d||f),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=DS([],l,o),s=i||s,o=qc([],r,s),o=qc([],o,Whe)),{viewMatrix:s,viewProjectionMatrix:o,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}}(n,t,i),d=n.getDistanceScales(),f=[n.width*e,n.height*e],p=n.projectionMatrix.transform([0,0,-n.focalDistance,1])[3]||1,g={project_uCoordinateSystem:t,project_uProjectionMode:n.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:o.slice(0,3),project_uCenter:r,project_uViewportSize:f,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit:d.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:Yhe,project_uScale:n.scale,project_uViewProjectionMatrix:s,project_uCameraPosition:a};if(c){const _=n.getDistanceScales(c);switch(t){case Hn.METER_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerMeter,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerMeter2;break;case Hn.LNGLAT:case Hn.LNGLAT_OFFSETS:g.project_uCommonUnitsPerWorldUnit=_.unitsPerDegree,g.project_uCommonUnitsPerWorldUnit2=_.unitsPerDegree2;break;case Hn.CARTESIAN:g.project_uCommonUnitsPerWorldUnit=[1,1,_.unitsPerMeter[2]],g.project_uCommonUnitsPerWorldUnit2=[0,0,_.unitsPerMeter2[2]]}}return g});function K4(n,e,t=Xhe){let r,i=t,s=!0;switch(r=e===Hn.LNGLAT_OFFSETS||e===Hn.METER_OFFSETS?t:n.isGeospatial?[Math.fround(n.longitude),Math.fround(n.latitude),0]:null,n.projectionMode){case $c.WEB_MERCATOR:(e===Hn.LNGLAT||e===Hn.CARTESIAN)&&(s=!1);break;case $c.WEB_MERCATOR_AUTO_OFFSET:e===Hn.LNGLAT?i=r:e===Hn.CARTESIAN&&(i=[Math.fround(n.center[0]),Math.fround(n.center[1]),0],r=n.unprojectPosition(i),i[0]-=t[0],i[1]-=t[1],i[2]-=t[2]);break;case $c.IDENTITY:i=n.position.map(Math.fround);break;case $c.GLOBE:s=!1,r=null;break;default:s=!1}return i[2]=i[2]||0,{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:s}}class efe extends rI{get ELEMENTS(){return Xu(!1),0}get RANK(){return Xu(!1),0}toString(){let e="[";if(Qi.printRowMajor){e+="row-major:";for(let t=0;t2*Math.PI)throw Error("radians");const a=i*Math.tan(e/2),l=a*t;return(new Lt).ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:s})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:i=1,near:r=.1,far:s=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return W4(this,e,i,r,s),this.check()}determinant(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3],s=n[4],o=n[5],a=n[6],l=n[7],c=n[8],d=n[9],f=n[10],p=n[11],g=n[12],_=n[13],y=n[14],v=n[15];return(e*o-t*s)*(f*v-p*y)-(e*a-i*s)*(d*v-p*_)+(e*l-r*s)*(d*y-f*_)+(t*a-i*o)*(c*v-p*g)-(t*l-r*o)*(c*y-f*g)+(i*l-r*a)*(c*_-d*g)}(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*s,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*s,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const i=this.getScale(t||[-0,-0,-0]),r=1/i[0],s=1/i[1],o=1/i[2];return e[0]=this[0]*r,e[1]=this[1]*s,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*s,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*s,e[8]=this[10]*o,e}transpose(){return function(n,e){if(n===e){var t=e[1],i=e[2],r=e[3],s=e[6],o=e[7],a=e[11];n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=t,n[6]=e[9],n[7]=e[13],n[8]=i,n[9]=s,n[11]=e[14],n[12]=r,n[13]=o,n[14]=a}else n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=e[1],n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=e[2],n[9]=e[6],n[10]=e[10],n[11]=e[14],n[12]=e[3],n[13]=e[7],n[14]=e[11],n[15]=e[15]}(this,this),this.check()}invert(){return AS(this,this),this.check()}multiplyLeft(e){return qc(this,e,this),this.check()}multiplyRight(e){return qc(this,this,e),this.check()}rotateX(e){return $4(this,this,e),this.check()}rotateY(e){return function(n,e,t){var i=Math.sin(t),r=Math.cos(t),s=e[0],o=e[1],a=e[2],l=e[3],c=e[8],d=e[9],f=e[10],p=e[11];e!==n&&(n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=s*r-c*i,n[1]=o*r-d*i,n[2]=a*r-f*i,n[3]=l*r-p*i,n[8]=s*i+c*r,n[9]=o*i+d*r,n[10]=a*i+f*r,n[11]=l*i+p*r}(this,this,e),this.check()}rotateZ(e){return G4(this,this,e),this.check()}rotateXYZ([e,t,i]){return this.rotateX(e).rotateY(t).rotateZ(i)}rotateAxis(e,t){return function(n,e,t,i){var l,c,d,f,p,g,_,y,v,w,C,x,L,U,$,ee,fe,pe,ve,$e,Xe,re,le,Oe,r=i[0],s=i[1],o=i[2],a=Math.hypot(r,s,o);a=-90&&e<=90,"invalid latitude"),[512*(n*sc+rc)/(2*rc),512*(rc+Math.log(Math.tan(e5+e*sc*.5)))/(2*rc)]}function ah([n,e]){const t=n/512*(2*rc)-rc,i=2*(Math.atan(Math.exp(e/512*(2*rc)-rc))-e5);return[t*RI,i*RI]}function IS({latitude:n,longitude:e,highPrecision:t=!1}){Zu(Number.isFinite(n)&&Number.isFinite(e));const i={},s=Math.cos(n*sc),o=512/360,a=o/s,l=512/kI/s;if(i.unitsPerMeter=[l,l,l],i.metersPerUnit=[1/l,1/l,1/l],i.unitsPerDegree=[o,a,l],i.degreesPerUnit=[1/o,1/a,1/l],t){const c=sc*Math.tan(n*sc)/s,f=512/kI*c,p=f/a*l;i.unitsPerDegree2=[0,o*c/2,f],i.unitsPerMeter2=[p,0,p]}return i}function n5(n,e){const[t,i,r]=n,[s,o,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=IS({longitude:t,latitude:i,highPrecision:!0}),d=Sm(n);d[0]+=s*(l[0]+c[0]*o),d[1]+=o*(l[1]+c[1]*o);const f=ah(d),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[f[0],f[1],p]:f}function i5({height:n,pitch:e,bearing:t,altitude:i,scale:r,center:s=null}){const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return ub(o,o,[0,0,-i]),$4(o,o,-e*sc),G4(o,o,t*sc),db(o,o,[r/=n,r,r]),s&&ub(o,o,function(n,e){return n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n}([],s)),o}function r5({width:n,height:e,fovy:t=PS(1.5),altitude:i,pitch:r=0,nearZMultiplier:s=1,farZMultiplier:o=1}){void 0!==i&&(t=PS(i));const a=.5*t*sc,l=s5(t),c=r*sc,d=Math.sin(a)*l/Math.sin(Math.min(Math.max(Math.PI/2-c-a,.01),Math.PI-.01));return{fov:2*a,aspect:n/e,focalDistance:l,near:s,far:(Math.sin(c)*d+l)*o}}function PS(n){return 2*Math.atan(.5/n)*RI}function s5(n){return.5/Math.tan(.5*n*sc)}function FI(n,e){const[t,i,r=0]=n;return Zu(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(r)),Em(e,[t,i,r,1])}function Zf(n,e,t=0){const[i,r,s]=n;if(Zu(Number.isFinite(i)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s))return Em(e,[i,r,s,1]);const o=Em(e,[i,r,0,1]),a=Em(e,[i,r,1,1]),l=o[2],c=a[2];return Z4([],o,a,l===c?0:((t||0)-l)/(c-l))}function o5({width:n,height:e,bounds:t,minExtent:i=0,maxZoom:r=24,padding:s=0,offset:o=[0,0]}){const[[a,l],[c,d]]=t;Number.isFinite(s)?s={top:s,bottom:s,left:s,right:s}:Zu(Number.isFinite(s.top)&&Number.isFinite(s.bottom)&&Number.isFinite(s.left)&&Number.isFinite(s.right));const f=new RS({width:n,height:e,longitude:0,latitude:0,zoom:0}),p=f.project([a,d]),g=f.project([c,l]),_=[Math.max(Math.abs(g[0]-p[0]),i),Math.max(Math.abs(g[1]-p[1]),i)],y=[n-s.left-s.right-2*Math.abs(o[0]),e-s.top-s.bottom-2*Math.abs(o[1])];Zu(y[0]>0&&y[1]>0);const v=y[0]/_[0],w=y[1]/_[1],U=f.unproject([(g[0]+p[0])/2+(s.right-s.left)/2/v,(g[1]+p[1])/2+(s.bottom-s.top)/2/w]),$=Math.min(r,f.zoom+PI(Math.abs(Math.min(v,w))));return Zu(Number.isFinite($)),{longitude:U[0],latitude:U[1],zoom:$}}const a5=Math.PI/180;function l5(n,e=0){const{width:t,height:i,unproject:r}=n,s={targetZ:e},o=r([0,i],s),a=r([t,i],s);let l,c;return(n.fovy?.5*n.fovy*a5:Math.atan(.5/n.altitude))>(90-n.pitch)*a5-.01?(l=c5(n,0,e),c=c5(n,t,e)):(l=r([0,0],s),c=r([t,0],s)),[o,a,c,l]}function c5(n,e,t){const{pixelUnprojectionMatrix:i}=n,r=Em(i,[e,0,1,1]),s=Em(i,[e,n.height,1,1]),c=ah(Z4([],r,s,(t*n.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2])));return c[2]=t,c}class RS{constructor({width:e,height:t,latitude:i=0,longitude:r=0,zoom:s=0,pitch:o=0,bearing:a=0,altitude:l=null,fovy:c=null,position:d=null,nearZMultiplier:f=.02,farZMultiplier:p=1.01}={width:1,height:1}){e=e||1,t=t||1,null===c&&null===l?c=PS(l=1.5):null===c?c=PS(l):null===l&&(l=s5(c));const g=function(n){return Math.pow(2,n)}(s);l=Math.max(.75,l);const _=IS({longitude:r,latitude:i}),y=Sm([r,i]);y[2]=0,d&&function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2]}(y,y,function(n,e,t){return n[0]=e[0]*t[0],n[1]=e[1]*t[1],n[2]=e[2]*t[2],n}([],d,_.unitsPerMeter)),this.projectionMatrix=function({width:n,height:e,pitch:t,altitude:i,fovy:r,nearZMultiplier:s,farZMultiplier:o}){const{fov:a,aspect:l,near:c,far:d}=r5({width:n,height:e,altitude:i,fovy:r,pitch:t,nearZMultiplier:s,farZMultiplier:o});return W4([],a,l,c,d)}({width:e,height:t,pitch:o,fovy:c,nearZMultiplier:f,farZMultiplier:p}),this.viewMatrix=i5({height:t,scale:g,center:y,pitch:o,bearing:a,altitude:l}),this.width=e,this.height=t,this.scale=g,this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=l,this.fovy=c,this.center=y,this.meterOffset=d||[0,0,0],this.distanceScales=_,this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}_initMatrices(){const{width:e,height:t,projectionMatrix:i,viewMatrix:r}=this,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];qc(s,s,i),qc(s,s,r),this.viewProjectionMatrix=s;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];db(o,o,[e/2,-t/2,1]),ub(o,o,[1,-1,0]),qc(o,o,s);const a=AS([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}equals(e){return e instanceof RS&&e.width===this.width&&e.height===this.height&&q4(e.projectionMatrix,this.projectionMatrix)&&q4(e.viewMatrix,this.viewMatrix)}project(e,{topLeft:t=!0}={}){const r=FI(this.projectPosition(e),this.pixelProjectionMatrix),[s,o]=r,a=t?o:this.height-o;return 2===e.length?[s,a]:[s,a,r[2]]}unproject(e,{topLeft:t=!0,targetZ:i}={}){const[r,s,o]=e,c=Zf([r,t?s:this.height-s,o],this.pixelUnprojectionMatrix,i&&i*this.distanceScales.unitsPerMeter[2]),[d,f,p]=this.unprojectPosition(c);return Number.isFinite(o)?[d,f,p]:Number.isFinite(i)?[d,f,i]:[d,f]}projectPosition(e){const[t,i]=Sm(e);return[t,i,(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(e){const[t,i]=ah(e);return[t,i,(e[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(e){return Sm(e)}unprojectFlat(e){return ah(e)}getMapCenterByLngLatPosition({lngLat:e,pos:t}){const i=Zf(t,this.pixelUnprojectionMatrix),s=Cm([],Sm(e),II([],i));return ah(Cm([],this.center,s))}getLocationAtPoint({lngLat:e,pos:t}){return this.getMapCenterByLngLatPosition({lngLat:e,pos:t})}fitBounds(e,t={}){const{width:i,height:r}=this,{longitude:s,latitude:o,zoom:a}=o5(Object.assign({width:i,height:r,bounds:e},t));return new RS({width:i,height:r,longitude:s,latitude:o,zoom:a})}getBounds(e){const t=this.getBoundingRegion(e),i=Math.min(...t.map(a=>a[0])),r=Math.max(...t.map(a=>a[0]));return[[i,Math.min(...t.map(a=>a[1]))],[r,Math.max(...t.map(a=>a[1]))]]}getBoundingRegion(e={}){return l5(this,e.z||0)}}const hfe=Math.PI/180,ffe=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],NI=[0,0,0],gfe={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};let Mm=(()=>{class n{constructor(t={}){const{id:i=null,x:r=0,y:s=0,width:o=1,height:a=1}=t;this.id=i||this.constructor.displayName||"viewport",this.x=r,this.y=s,this.width=o||1,this.height=a||1,this._frustumPlanes={},this._initViewMatrix(t),this._initProjectionMatrix(t),this._initPixelMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?$c.WEB_MERCATOR:$c.WEB_MERCATOR_AUTO_OFFSET:$c.IDENTITY}equals(t){return t instanceof n&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&eb(t.projectionMatrix,this.projectionMatrix)&&eb(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:i=!0}={}){const s=FI(this.projectPosition(t),this.pixelProjectionMatrix),[o,a]=s,l=i?a:this.height-a;return 2===t.length?[o,l]:[o,l,s[2]]}unproject(t,{topLeft:i=!0,targetZ:r}={}){const[s,o,a]=t,d=Zf([s,i?o:this.height-o,a],this.pixelUnprojectionMatrix,r&&r*this.distanceScales.unitsPerMeter[2]),[f,p,g]=this.unprojectPosition(d);return Number.isFinite(a)?[f,p,g]:Number.isFinite(r)?[f,p,r]:[f,p]}projectPosition(t){const[i,r]=this.projectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[i,r]=this.unprojectFlat(t);return[i,r,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){return this.isGeospatial?Sm(t):t}unprojectFlat(t){return this.isGeospatial?ah(t):t}getBounds(t={}){const i={targetZ:t.z||0},r=this.unproject([0,0],i),s=this.unproject([this.width,0],i),o=this.unproject([0,this.height],i),a=this.unproject([this.width,this.height],i);return[Math.min(r[0],s[0],o[0],a[0]),Math.min(r[1],s[1],o[1],a[1]),Math.max(r[0],s[0],o[0],a[0]),Math.max(r[1],s[1],o[1],a[1])]}getDistanceScales(t=null){return t?IS({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:i,width:r=1,height:s=1}){return t{class n extends Mm{constructor(t={}){const{latitude:i=0,longitude:r=0,zoom:s=11,pitch:o=0,bearing:a=0,nearZMultiplier:l=.1,farZMultiplier:c=1.01,orthographic:d=!1,repeat:f=!1,worldOffset:p=0}=t;let{width:g,height:_,altitude:y=1.5}=t;const v=Math.pow(2,s);g=g||1,_=_||1,y=Math.max(.75,y);const{fov:w,aspect:C,focalDistance:x,near:L,far:U}=r5({width:g,height:_,pitch:o,altitude:y,nearZMultiplier:l,farZMultiplier:c});let $=i5({height:_,pitch:o,bearing:a,scale:v,altitude:y});p&&($=(new Lt).translate([512*p,0,0]).multiplyLeft($)),super(an(J({},t),{width:g,height:_,viewMatrix:$,longitude:r,latitude:i,zoom:s,orthographic:d,fovyRadians:w,aspect:C,focalDistance:x,near:L,far:U})),this.latitude=i,this.longitude=r,this.zoom=s,this.pitch=o,this.bearing=a,this.altitude=y,this.orthographic=d,this._subViewports=f?[]:null,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),i=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360);for(let s=i;s<=r;s++){const o=s?new n(an(J({},this),{worldOffset:s})):this;this._subViewports.push(o)}}return this._subViewports}addMetersToLngLat(t,i){return n5(t,i)}panByPosition(t,i){const r=Zf(i,this.pixelUnprojectionMatrix),o=Cm([],this.projectFlat(t),II([],r)),a=Cm([],this.center,o),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(t={}){const i=l5(this,t.z||0);return[Math.min(i[0][0],i[1][0],i[2][0],i[3][0]),Math.min(i[0][1],i[1][1],i[2][1],i[3][1]),Math.max(i[0][0],i[1][0],i[2][0],i[3][0]),Math.max(i[0][1],i[1][1],i[2][1],i[3][1])]}fitBounds(t,i={}){const{width:r,height:s}=this,{longitude:o,latitude:a,zoom:l}=o5(J({width:r,height:s,bounds:t},i));return new n({width:r,height:s,longitude:o,latitude:a,zoom:l})}}return n.displayName="WebMercatorViewport",n})();function LI(n,e,t=!1){const i=e.projectPosition(n);if(t&&e instanceof p5){const[r,s,o=0]=n,a=e.getDistanceScales([r,s]);i[2]=o*a.unitsPerMeter[2]}return i}function g5(n,{viewport:e,modelMatrix:t,coordinateSystem:i,coordinateOrigin:r,offsetMode:s}){let[o,a,l=0]=n;switch(t&&([o,a,l]=DS([],[o,a,l,1],t)),i){case Hn.LNGLAT:return LI([o,a,l],e,s);case Hn.LNGLAT_OFFSETS:return LI([o+r[0],a+r[1],l+(r[2]||0)],e,s);case Hn.METER_OFFSETS:return LI(n5(r,[o,a,l]),e,s);case Hn.CARTESIAN:default:return e.isGeospatial?[o+r[0],a+r[1],l+r[2]]:e.projectPosition([o,a,l])}}const yfe={10241:9987,10240:9729,10242:33071,10243:33071},BI={},Cfe={boolean:{validate:(n,e)=>!0,equal:(n,e,t)=>Boolean(n)===Boolean(e)},number:{validate:(n,e)=>Number.isFinite(n)&&(!("max"in e)||n<=e.max)&&(!("min"in e)||n>=e.min)},color:{validate:(n,e)=>e.optional&&!n||pb(n)&&(3===n.length||4===n.length),equal:(n,e,t)=>VI(n,e)},accessor:{validate(n,e){const t=kS(n);return"function"===t||t===kS(e.value)},equal:(n,e,t)=>"function"==typeof e||VI(n,e)},array:{validate:(n,e)=>e.optional&&!n||pb(n),equal:(n,e,t)=>t.compare?VI(n,e):n===e},function:{validate:(n,e)=>e.optional&&!n||"function"==typeof n,equal:(n,e,t)=>!t.compare||n===e},data:{transform:(n,e,t)=>{const{dataTransform:i}=t?t.props:{};return i&&n?i(n):n}},image:{transform:(n,e,t)=>function(n,e){const t=n.context&&n.context.gl;if(!t||!e)return null;if(e instanceof xa)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let i=null;e.compressed&&(i={10241:e.data.length>1?9985:9729});const r=new xa(t,an(J({},e),{parameters:J(J(J({},yfe),i),n.props.textureParameters)}));return BI[r.id]=!0,r}(t,n),release:n=>{!function(n){!n||!(n instanceof xa)||BI[n.id]&&(n.delete(),delete BI[n.id])}(n)}}};function VI(n,e){if(n===e)return!0;if(!pb(n)||!pb(e))return!1;const t=n.length;if(t!==e.length)return!1;for(let i=0;i{},this.oldProps=kfe,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const t=this.asyncProps[e];return t&&t.resolvedValue}isAsyncPropLoading(e){if(e){const t=this.asyncProps[e];return Boolean(t&&t.pendingLoadCount>0&&t.pendingLoadCount!==t.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(e,t){this._watchPromise(e,Promise.resolve(t))}setAsyncProps(e){const t=e[Pfe]||{},i=e[Ife]||e,r=e[Rfe]||{};for(const s in t){const o=t[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o),t[s]=this.getAsyncProp(s)}for(const s in i){const o=i[s];this._createAsyncPropData(s,r[s]),this._updateAsyncProp(s,o)}}_updateAsyncProp(e,t){if(this._didAsyncInputValueChange(e,t)){if("string"==typeof t){var i;const r=null===(i=this.layer)||void 0===i?void 0:i.props.fetch;r&&(t=r(t,{propName:e,layer:this.layer}))}if(t instanceof Promise)return void this._watchPromise(e,t);if(Kz(t))return void this._resolveAsyncIterable(e,t);this._setPropValue(e,t)}}_didAsyncInputValueChange(e,t){const i=this.asyncProps[e];return t!==i.resolvedValue&&t!==i.lastValue&&(i.lastValue=t,!0)}_setPropValue(e,t){const i=this.asyncProps[e];t=this._postProcessValue(i,t),i.resolvedValue=t,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount}_setAsyncPropValue(e,t,i){const r=this.asyncProps[e];r&&i>=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=i,this.onAsyncPropUpdated(e,t))}_watchPromise(e,t){const i=this.asyncProps[e];i.pendingLoadCount++;const r=i.pendingLoadCount;t.then(s=>{var o;s=this._postProcessValue(i,s),this._setAsyncPropValue(e,s,r);const a=null===(o=this.layer)||void 0===o?void 0:o.props.onDataLoad;"data"===e&&a&&a(s,{propName:e,layer:this.layer})}).catch(s=>{var o;null===(o=this.layer)||void 0===o||o.raiseError(s,"loading ".concat(e," of ").concat(this.layer))})}_resolveAsyncIterable(e,t){var i=this;return un(function*(){var r;"data"!==e&&i._setPropValue(e,t);const s=i.asyncProps[e];s.pendingLoadCount++;const o=s.pendingLoadCount;let a=[],l=0;var f,c=!0,d=!1;try{for(var g,_,p=UI(t);c=(g=yield p.next()).done,_=yield g.value,!c;c=!0){const v=_,{dataTransform:w}=i.component?i.component.props:{};a=w?w(v,a):a.concat(v),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,i._setAsyncPropValue(e,a,o)}}catch(v){d=!0,f=v}finally{try{!c&&null!=p.return&&(yield p.return())}finally{if(d)throw f}}const y=null===(r=i.layer)||void 0===r?void 0:r.props.onDataLoad;y&&y(a,{propName:e,layer:i.layer})})()}_postProcessValue(e,t){const i=e.type;return i&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(t,i,this.component):t}_createAsyncPropData(e,t){if(!this.asyncProps[e]){const r=this.component&&this.component.constructor._propTypes;this.asyncProps[e]={type:r&&r[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0}}}}const{ASYNC_ORIGINAL:v5,ASYNC_RESOLVED:b5,ASYNC_DEFAULTS:Ffe}=xS,Nfe={};let Lfe=0,Bfe=(()=>{class n{constructor(){this.props=Sfe.apply(this,arguments),this.id=this.props.id,this.count=Lfe++,this.lifecycle="Awaiting state",this.parent=null,this.context=null,this.state=null,this.internalState=null,Object.seal(this)}clone(t){const{props:i}=this,r={};for(const s in i[Ffe])s in i[b5]?r[s]=i[b5][s]:s in i[v5]&&(r[s]=i[v5][s]);return new this.constructor(J(J(J({},i),r),t))}get stats(){return this.internalState.stats}_initState(){this.internalState=new y5({})}}return n.componentName="Component",n.defaultProps=Nfe,n})();class Vfe extends y5{constructor({attributeManager:e,layer:t}){super(t),this.attributeManager=e,this.model=null,this.needsRedraw=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(e){this.component=e}}const oc=n=>"function"==typeof n,lh=n=>null!==n&&"object"==typeof n,w5=n=>lh(n)&&n.constructor==={}.constructor,jfe=n=>n&&"function"==typeof n[Symbol.iterator],Ufe=n=>n&&"function"==typeof n[Symbol.asyncIterator],mb=n=>"undefined"!=typeof Response&&n instanceof Response||n&&n.arrayBuffer&&n.text&&n.json,xm=n=>"undefined"!=typeof Blob&&n instanceof Blob,E5=n=>(n=>"undefined"!=typeof ReadableStream&&n instanceof ReadableStream||lh(n)&&oc(n.tee)&&oc(n.cancel)&&oc(n.getReader))(n)||(n=>lh(n)&&oc(n.read)&&oc(n.pipe)&&(n=>"boolean"==typeof n)(n.readable))(n);function Qf(n,e){if(!n)throw new Error(e||"loader assertion failed.")}function zI(n){var e;return!!n&&(Array.isArray(n)&&(n=n[0]),Array.isArray(null===(e=n)||void 0===e?void 0:e.extensions))}function HI(n){var e,t;let i;return Qf(n,"null loader"),Qf(zI(n),"invalid loader"),Array.isArray(n)&&(i=n[1],n=an(J({},n=n[0]),{options:J(J({},n.options),i)})),(null!==(e=n)&&void 0!==e&&e.parseTextSync||null!==(t=n)&&void 0!==t&&t.parseText)&&(n.text=!0),n.text||(n.binary=!0),n}const Yc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},$I=Yc.global||Yc.self||Yc.window||{},qfe="object"!=typeof process||"[object process]"!==String(process)||process.browser,S5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);S5&&parseFloat(S5[1]);const WI={};function Yfe(n){for(const e in WI)n.startsWith(e)&&(n=n.replace(e,WI[e]));return!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`${n}`),n}const Xfe=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Kfe=/^([-\w.]+\/[-\w.+]+)/;function Zfe(n){const e=Kfe.exec(n);return e?e[1]:n}function M5(n){const e=Xfe.exec(n);return e?e[1]:""}const Qfe=/\?.*/;function BS(n){if(mb(n)){const e=qI(n.url||"");return{url:e,type:Zfe(n.headers.get("content-type")||"")||M5(e)}}return xm(n)?{url:qI(n.name||""),type:n.type||""}:"string"==typeof n?{url:qI(n),type:M5(n)}:{url:"",type:""}}function Jfe(n){return mb(n)?n.headers["content-length"]||-1:xm(n)?n.size:"string"==typeof n?n.length:n instanceof ArrayBuffer||ArrayBuffer.isView(n)?n.byteLength:-1}function qI(n){return n.replace(Qfe,"")}function x5(n){return YI.apply(this,arguments)}function YI(){return(YI=un(function*(n){if(mb(n))return n;const e={},t=Jfe(n);t>=0&&(e["content-length"]=String(t));const{url:i,type:r}=BS(n);r&&(e["content-type"]=r);const s=yield npe(n);s&&(e["x-first-bytes"]=s),"string"==typeof n&&(n=(new TextEncoder).encode(n));const o=new Response(n,{headers:e});return Object.defineProperty(o,"url",{value:i}),o})).apply(this,arguments)}function epe(n){return XI.apply(this,arguments)}function XI(){return(XI=un(function*(n){if(!n.ok){const e=yield tpe(n);throw new Error(e)}})).apply(this,arguments)}function tpe(n){return KI.apply(this,arguments)}function KI(){return(KI=un(function*(n){let e=`Failed to fetch resource ${n.url} (${n.status}): `;try{const t=n.headers.get("Content-Type");let i=n.statusText;t.includes("application/json")&&(i+=` ${yield n.text()}`),e+=i,e=e.length>60?`${e.slice(60)}...`:e}catch(t){}return e})).apply(this,arguments)}function npe(n){return ZI.apply(this,arguments)}function ZI(){return(ZI=un(function*(n){if("string"==typeof n)return`data:,${n.slice(0,5)}`;if(n instanceof Blob){const t=n.slice(0,5);return yield new Promise(i=>{const r=new FileReader;r.onload=s=>{var o;return i(null==s||null===(o=s.target)||void 0===o?void 0:o.result)},r.readAsDataURL(t)})}return n instanceof ArrayBuffer?`data:base64,${ipe(n.slice(0,5))}`:null})).apply(this,arguments)}function ipe(n){let e="";const t=new Uint8Array(n);for(let i=0;i{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const D5={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Yt(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},ope={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function JI(){$I.loaders=$I.loaders||{};const{loaders:n}=$I;return n._state=n._state||{},n._state}const eP=()=>{const n=JI();return n.globalOptions=n.globalOptions||J({},D5),n.globalOptions};function ape(n,e,t,i){return t=t||[],function(n,e){I5(n,null,D5,ope,e);for(const t of e)I5(n&&n[t.id]||{},t.id,t.options&&t.options[t.id]||{},t.deprecatedOptions&&t.deprecatedOptions[t.id]||{},e)}(n,t=Array.isArray(t)?t:[t]),function(n,e,t){const r=J({},n.options||{});return function(n,e){e&&!("baseUri"in n)&&(n.baseUri=e)}(r,t),null===r.log&&(r.log=new rpe),R5(r,eP()),R5(r,e),r}(e,n,i)}function O5(n,e){const t=eP(),i=n||t;return"function"==typeof i.fetch?i.fetch:lh(i.fetch)?r=>T5(r,i):null!=e&&e.fetch?null==e?void 0:e.fetch:T5}function I5(n,e,t,i,r){const s=e||"Top level",o=e?`${e}.`:"";for(const a in n){const l=!e&&lh(n[a]),c="baseUri"===a&&!e,d="workerUrl"===a&&e;if(!(a in t)&&!c&&!d)if(a in i)A5.warn(`${s} loader option '${o}${a}' no longer supported, use '${i[a]}'`)();else if(!l){const f=cpe(a,r);A5.warn(`${s} loader option '${o}${a}' not recognized. ${f}`)()}}}function cpe(n,e){const t=n.toLowerCase();let i="";for(const r of e)for(const s in r.options){if(n===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${r.id}.${s}'?`)}return i}function R5(n,e){for(const t in e)t in e&&(n[t]=w5(e[t])&&w5(n[t])?J(J({},n[t]),e[t]):e[t])}function Xc(n,e){if(!n)throw new Error(e||"loaders.gl assertion failed.")}function hpe(n,e="3.0.12"){return Xc(n,"no worker provided"),!(!e||!n.version)}const Kc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},fpe=Kc.global||Kc.self||Kc.window||{},tP="object"!=typeof process||"[object process]"!==String(process)||process.browser,nP="function"==typeof importScripts,ppe="undefined"!=typeof window&&void 0!==window.orientation,k5="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),iP=(k5&&parseFloat(k5[1]),new Map);function F5(n){const e=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(e)}function N5(n,e=!0,t){const i=t||new Set;if(n)if(L5(n))i.add(n);else if(L5(n.buffer))i.add(n.buffer);else if(!ArrayBuffer.isView(n)&&e&&"object"==typeof n)for(const r in n)N5(n[r],e,i);return void 0===t?Array.from(i):[]}function L5(n){return!!n&&(n instanceof ArrayBuffer||"undefined"!=typeof MessagePort&&n instanceof MessagePort||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&n instanceof OffscreenCanvas)}const rP=()=>{};class B5{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Yt(this,"name",void 0),Yt(this,"source",void 0),Yt(this,"url",void 0),Yt(this,"terminated",!1),Yt(this,"worker",void 0),Yt(this,"onMessage",void 0),Yt(this,"onError",void 0),Yt(this,"_loadableURL","");const{name:t,source:i,url:r}=e;Xc(i||r),this.name=t,this.source=i,this.url=r,this.onMessage=rP,this.onError=s=>console.log(s),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=rP,this.onError=rP,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||N5(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=function(n){Xc(n.source&&!n.url||!n.source&&n.url);let e=iP.get(n.source||n.url);return e||(n.url&&(e=function(n){return n.startsWith("http")?F5(function(n){return`try {\n importScripts('${n}');\n} catch (error) {\n console.error(error);\n throw error;\n}`}(n)):n}(n.url),iP.set(n.url,e)),n.source&&(e=F5(n.source),iP.set(n.source,e))),Xc(e),e}({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}}class ype{constructor(e,t){Yt(this,"name",void 0),Yt(this,"workerThread",void 0),Yt(this,"isRunning",void 0),Yt(this,"result",void 0),Yt(this,"_resolve",void 0),Yt(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((i,r)=>{this._resolve=i,this._reject=r})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Xc(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Xc(this.isRunning),this.isRunning=!1,this._reject(e)}}class vpe{constructor(e){Yt(this,"name","unnamed"),Yt(this,"source",void 0),Yt(this,"url",void 0),Yt(this,"maxConcurrency",1),Yt(this,"maxMobileConcurrency",1),Yt(this,"onDebug",()=>{}),Yt(this,"reuseWorkers",!0),Yt(this,"props",{}),Yt(this,"jobQueue",[]),Yt(this,"idleQueue",[]),Yt(this,"count",0),Yt(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props=J(J({},this.props),e),void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}startJob(e,t=((r,s,o)=>r.done(o)),i=((r,s)=>r.error(s))){var r=this;return un(function*(){const s=new Promise(o=>(r.jobQueue.push({name:e,onMessage:t,onError:i,onStart:o}),r));return r._startQueuedJob(),yield s})()}_startQueuedJob(){var e=this;return un(function*(){if(!e.jobQueue.length)return;const t=e._getAvailableWorker();if(!t)return;const i=e.jobQueue.shift();if(i){e.onDebug({message:"Starting job",name:i.name,workerThread:t,backlog:e.jobQueue.length});const r=new ype(i.name,t);t.onMessage=s=>i.onMessage(r,s.type,s.payload),t.onError=s=>i.onError(r,s),i.onStart(r);try{yield r.result}finally{e.returnWorkerToQueue(t)}}})()}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class Qu{static isSupported(){return B5.isSupported()}static getWorkerFarm(e={}){return Qu._workerFarm=Qu._workerFarm||new Qu({}),Qu._workerFarm.setProps(e),Qu._workerFarm}constructor(e){Yt(this,"props",void 0),Yt(this,"workerPools",new Map),this.props=J({},bpe),this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props=J(J({},this.props),e);for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:i,url:r}=e;let s=this.workerPools.get(t);return s||(s=new vpe({name:t,source:i,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function wpe(n,e={}){const i=`${n.id}-worker.js`;let r=(e[n.id]||{}).workerUrl;if("test"===e._workerType&&(r=`modules/${n.module}/dist/${i}`),!r){let s=n.version;"latest"===s&&(s="latest"),r=`https://unpkg.com/@loaders.gl/${n.module}${s?`@${s}`:""}/dist/${i}`}return Xc(r),r}function Epe(n,e){return!!Qu.isSupported()&&n.worker&&(null==e?void 0:e.worker)}function Spe(n,e,t,i,r){return sP.apply(this,arguments)}function sP(){return(sP=un(function*(n,e,t,i,r){const s=n.id,o=wpe(n,t),l=Qu.getWorkerFarm(t).getWorkerPool({name:s,url:o});t=JSON.parse(JSON.stringify(t));const c=yield l.startJob("process-on-worker",Mpe.bind(null,r));return c.postMessage("process",{input:e,options:t}),yield(yield c.result).result})).apply(this,arguments)}function Mpe(n,e,t,i){return oP.apply(this,arguments)}function oP(){return(oP=un(function*(n,e,t,i){switch(t){case"done":e.done(i);break;case"error":e.error(i.error);break;case"process":const{id:r,input:s,options:o}=i;try{const a=yield n(s,o);e.postMessage("done",{id:r,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:r,error:l})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}})).apply(this,arguments)}Yt(Qu,"_workerFarm",void 0);var j5=Ve(521);function U5(n){if(function(n){return n&&"object"==typeof n&&n.isBuffer}(n)&&(n=function(n){return j5.toArrayBuffer?j5.toArrayBuffer(n):n}(n)),n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n))return 0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);if("string"==typeof n){const e=n;return(new TextEncoder).encode(e).buffer}if(n&&"object"==typeof n&&n._toArrayBuffer)return n._toArrayBuffer();throw new Error("toArrayBuffer")}function Dpe(...n){const e=n.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),t=e.reduce((s,o)=>s+o.byteLength,0),i=new Uint8Array(t);let r=0;for(const s of e)i.set(s,r),r+=s.byteLength;return i.buffer}function z5(n,e,t){const i=void 0!==t?new Uint8Array(n).subarray(e,e+t):new Uint8Array(n).subarray(e);return new Uint8Array(i).buffer}function Ope(n){return lP.apply(this,arguments)}function lP(){return(lP=un(function*(n){const e=[];var r,t=!0,i=!1;try{for(var o,a,s=UI(n);t=(o=yield s.next()).done,a=yield o.value,!t;t=!0)e.push(a)}catch(l){i=!0,r=l}finally{try{!t&&null!=s.return&&(yield s.return())}finally{if(i)throw r}}return Dpe(...e)})).apply(this,arguments)}const Rpe=262144;function H5(n){this.wrapped=n}function _b(n){return new H5(n)}function yb(n){var e,t;function r(o,a){try{var l=n[o](a),c=l.value,d=c instanceof H5;Promise.resolve(d?c.wrapped:c).then(function(f){d?r("return"===o?"return":"next",f):s(l.done?"return":"normal",f)},function(f){r("throw",f)})}catch(f){s("throw",f)}}function s(o,a){switch(o){case"return":e.resolve({value:a,done:!0});break;case"throw":e.reject(a);break;default:e.resolve({value:a,done:!1})}(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(o,a){return new Promise(function(l,c){var d={key:o,arg:a,resolve:l,reject:c,next:null};t?t=t.next=d:(e=t=d,r(o,a))})},"function"!=typeof n.return&&(this.return=void 0)}function uP(n){return function(){return new yb(n.apply(this,arguments))}}function dP(){return(dP=uP(function*(n,e){const t=(null==e?void 0:e.chunkSize)||1048576;let i=0;for(;in&&"object"==typeof n&&n.isBuffer)(n)&&(n=n.buffer),n instanceof ArrayBuffer){const i=n;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(n)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(n);let i=n.buffer;const r=n.byteLength||n.length;return(0!==n.byteOffset||r!==i.byteLength)&&(i=i.slice(n.byteOffset,n.byteOffset+r)),i}throw new Error(pP)}function Upe(n,e,t){return gP.apply(this,arguments)}function gP(){return(gP=un(function*(n,e,t){const i=n instanceof ArrayBuffer||ArrayBuffer.isView(n);if("string"==typeof n||i)return jpe(n,e);if(xm(n)&&(n=yield x5(n)),mb(n)){const r=n;return yield epe(r),e.binary?yield r.arrayBuffer():yield r.text()}if(E5(n)&&(n=Vpe(n,t)),jfe(n)||Ufe(n))return Ope(n);throw new Error(pP)})).apply(this,arguments)}function Hpe(n,e,t=null){if(t)return t;const i=J({fetch:O5(e,n)},n);return Array.isArray(i.loaders)||(i.loaders=null),i}function $pe(n,e){if(!e&&n&&!Array.isArray(n))return n;let t;if(n&&(t=Array.isArray(n)?n:[n]),e&&e.loaders){const i=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...i]:i}return t&&t.length?t:null}const G5=()=>{const n=JI();return n.loaderRegistry=n.loaderRegistry||[],n.loaderRegistry};function W5(n){const e=G5();n=Array.isArray(n)?n:[n];for(const t of n){const i=HI(t);e.find(r=>i===r)||e.unshift(i)}}const Wpe=/\.([^.]+)$/;function qpe(n){return yP.apply(this,arguments)}function yP(){return(yP=un(function*(n,e=[],t,i){if(!Y5(n))return null;let r=q5(n,e,an(J({},t),{nothrow:!0}),i);if(r)return r;if(xm(n)&&(r=q5(n=yield n.slice(0,10).arrayBuffer(),e,t,i)),!(r||null!=t&&t.nothrow))throw new Error(X5(n));return r})).apply(this,arguments)}function q5(n,e=[],t,i){if(!Y5(n))return null;if(e&&!Array.isArray(e))return HI(e);let r=[];e&&(r=r.concat(e)),null!=t&&t.ignoreRegisteredLoaders||r.push(...G5()),function(n){for(const e of n)HI(e)}(r);const s=function(n,e,t,i){const{url:r,type:s}=BS(n),o=r||(null==i?void 0:i.url);let a=null;return null!=t&&t.mimeType&&(a=vP(e,null==t?void 0:t.mimeType)),a=a||function(n,e){const t=e&&Wpe.exec(e),i=t&&t[1];return i?function(n,e){e=e.toLowerCase();for(const t of n)for(const i of t.extensions)if(i.toLowerCase()===e)return t;return null}(n,i):null}(e,o),a=a||vP(e,s),a=a||function(n,e){if(!e)return null;for(const t of n)if("string"==typeof e){if(Jpe(e,t))return t}else if(ArrayBuffer.isView(e)){if(K5(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&K5(e,0,t))return t;return null}(e,n),a=a||vP(e,null==t?void 0:t.fallbackMimeType),a}(n,r,t,i);if(!(s||null!=t&&t.nothrow))throw new Error(X5(n));return s}function Y5(n){return!(n instanceof Response&&204===n.status)}function X5(n){const{url:e,type:t}=BS(n);let i="No valid loader found";return n&&(i+=` data: "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?bP(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?bP(n,0,e):""}(n)}", contentType: "${t}"`),e&&(i+=` url: ${e}`),i}function vP(n,e){for(const t of n)if(t.mimeTypes&&t.mimeTypes.includes(e)||e===`application/x.${t.id}`)return t;return null}function Jpe(n,e){return e.testText?e.testText(n):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>n.startsWith(i))}function K5(n,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(r=>function(n,e,t,i){if(i instanceof ArrayBuffer)return function(n,e,t){if(n.byteLength<(t=t||n.byteLength)||e.byteLengthn.equals(e));let Zc=new Uint8ClampedArray(0);const uge={data:{type:"data",value:lge,async:!0},dataComparator:null,_dataDiff:{type:"function",value:n=>n&&n.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(n,{propName:e,layer:t,loaders:i,loadOptions:r,signal:s})=>{const{resourceManager:o}=t.context;var a;r=r||t.getLoadOptions(),i=i||t.props.loaders,s&&(r=an(J({},r),{fetch:an(J({},null===(a=r)||void 0===a?void 0:a.fetch),{signal:s})}));let l=o.contains(n);return!l&&!r&&(o.add({resourceId:n,data:jS(n,i),persistent:!1}),l=!0),l?o.subscribe({resourceId:n,onChange:c=>t.internalState.reloadAsyncProp(e,c),consumerId:t.id,requestId:e}):jS(n,i,r)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:Hn.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:n})=>[0,100*-n],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};let SP=(()=>{class n extends Bfe{toString(){return"".concat(this.constructor.layerName||this.constructor.name,"({id: '").concat(this.props.id,"'})")}raiseError(t,i){var r,s,o,a;i&&(t.message="".concat(i,": ").concat(t.message)),(null===(r=(s=this.props).onError)||void 0===r?void 0:r.call(s,t))||null===(o=this.context)||void 0===o||null===(a=o.onError)||void 0===a||a.call(o,t,this)}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(t=!0){this.internalState&&(this.internalState.needsRedraw=t)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(t){const{viewport:i}=this.context,r=g5(t,{viewport:i,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[s,o,a]=FI(r,i.pixelProjectionMatrix);return 2===t.length?[s,o]:[s,o,a]}unproject(t){const{viewport:i}=this.context;return i.unproject(t)}projectPosition(t){return function(n,e){const{viewport:t,coordinateSystem:i,coordinateOrigin:r,modelMatrix:s,fromCoordinateSystem:o,fromCoordinateOrigin:a}=function(n){const e=J({},n);let{coordinateSystem:t}=n;const{viewport:i,coordinateOrigin:r,fromCoordinateSystem:s,fromCoordinateOrigin:o}=n;return t===Hn.DEFAULT&&(t=i.isGeospatial?Hn.LNGLAT:Hn.CARTESIAN),void 0===s&&(e.fromCoordinateSystem=t),void 0===o&&(e.fromCoordinateOrigin=r),e.coordinateSystem=t,e}(e),{geospatialOrigin:l,shaderCoordinateOrigin:c,offsetMode:d}=K4(t,i,r),f=g5(n,{viewport:t,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a,offsetMode:d});d&&function(n,e,t){n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2]}(f,f,t.projectPosition(l||c));return f}(t,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===Hn.DEFAULT||t===Hn.LNGLAT||t===Hn.CARTESIAN}onHover(t,i){return!!this.props.onHover&&this.props.onHover(t,i)}onClick(t,i){return!!this.props.onClick&&this.props.onClick(t,i)}nullPickingColor(){return[0,0,0]}encodePickingColor(t,i=[]){return i[0]=t+1&255,i[1]=t+1>>8&255,i[2]=t+1>>8>>8&255,i}decodePickingColor(t){ic(t instanceof Uint8Array);const[i,r,s]=t;return i+256*r+65536*s-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(t){for(const i of this.props.extensions)t=bhe(t,i.getShaders.call(this,i));return t}shouldUpdateState({changeFlags:s}){return s.propsOrDataChanged}updateState({oldProps:t,props:i,changeFlags:s}){const o=this.getAttributeManager();if(s.dataChanged&&o){const{dataChanged:c}=s;if(Array.isArray(c))for(const d of c)o.invalidateAll(d);else o.invalidateAll()}const l=i.highlightedObjectIndex>=0||i.pickable;if((t.highlightedObjectIndex>=0||t.pickable)!==l&&o){const{pickingColors:c,instancePickingColors:d}=o.attributes,f=c||d;f&&(l&&f.constant&&(f.constant=!1,o.invalidate(f.id)),!f.value&&!l&&(f.constant=!0,f.value=[0,0,0]))}}finalizeState(){for(const i of this.getModels())i.delete();const t=this.getAttributeManager();t&&t.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(t){for(const i of this.getModels())i.draw(t)}getPickingInfo({info:t}){const{index:r}=t;return r>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[r]),t}activateViewport(t){const i=this.internalState.viewport;this.internalState.viewport=t,(!i||!cge({oldViewport:i,viewport:t}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all",i=""){const r=this.getAttributeManager();!r||("all"===t?r.invalidateAll():r.invalidate(t))}updateAttributes(t){for(const i of this.getModels())this._setModelAttributes(i,t)}_updateAttributes(t){const i=this.getAttributeManager();if(!i)return;const r=this.getNumInstances(t),s=this.getStartIndices(t);i.update({data:t.data,numInstances:r,startIndices:s,props:t,transitions:t.transitions,buffers:t.data.attributes,context:this,ignoreUnknownAttributes:!0});const o=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(o)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const i=t.update(),r=Object.create(this.props);for(const s in i)Object.defineProperty(r,s,{value:i[s]});return r}return this.props}calculateInstancePickingColors(t,{numInstances:i}){if(t.constant)return;const r=Math.floor(Zc.length/3);if(this.internalState.usesPickingColorCache=!0,rZ5&&Zn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Zc=Qv.allocate(Zc,i,{size:3,copy:!0,maxCount:Math.max(i,Z5)});const s=Math.floor(Zc.length/3),o=[];for(let a=r;a{const c={moduleParameters:t,uniforms:i,parameters:r,context:this.context};for(const d of this.props.extensions)d.draw.call(this,c,d);this.draw(c)})}finally{this.props=s}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const{changeFlags:i}=this.internalState;for(const s in t)if(t[s]){let o=!1;switch(s){case"dataChanged":Array.isArray(i[s])&&(i[s]=Array.isArray(t[s])?i[s].concat(t[s]):t[s],o=!0);default:i[s]||(i[s]=t[s],o=!0)}o&&eo("layer.changeFlag",this,s,t)}const r=i.dataChanged||i.updateTriggersChanged||i.propsChanged||i.extensionsChanged;i.propsOrDataChanged=r,i.somethingChanged=r||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(t,i){const r=function(n,e){const t=z4({newProps:n,oldProps:e,propTypes:OI(n),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),i=function(n,e){if(null===e)return"oldProps is null, initial diff";let t=null;const{dataComparator:i,_dataDiff:r}=n;return i?i(n.data,e.data)||(t="Data comparator detected a change"):n.data!==e.data&&(t="A new data container was supplied"),t&&r&&(t=r(n.data,e.data)||t),t}(n,e);let r=!1;return i||(r=function(n,e){if(null===e)return"oldProps is null, initial diff";if("all"in n.updateTriggers&&H4(n,e,"all"))return{all:!0};const t={};let i=!1;for(const r in n.updateTriggers)"all"!==r&&H4(n,e,r)&&(t[r]=!0,i=t);return i}(n,e)),{dataChanged:i,propsChanged:t,updateTriggersChanged:r,extensionsChanged:fhe(n,e),transitionsChanged:uhe(n,e)}}(t,i);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,i[s],t[s],t.transitions[s]);return this.setChangeFlags(r)}validateProps(){!function(n){const e=OI(n);for(const t in e){const i=e[t],{validate:r}=i;if(r&&!r(n[t],i))throw new Error("Invalid prop ".concat(t,": ").concat(n[t]))}}(this.props)}setModuleParameters(t){for(const i of this.getModels())i.updateModuleSettings(t)}updateAutoHighlight(t){this.props.autoHighlight&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const i={pickingSelectedColor:t.picked?t.color:null},{highlightColor:r}=this.props;t.picked&&"function"==typeof r&&(i.pickingHighlightColor=r(t)),this.setModuleParameters(i),this.setNeedsRedraw()}_updateModules({props:t,oldProps:i},r){const{autoHighlight:s,highlightedObjectIndex:o,highlightColor:a}=t;if(r||i.autoHighlight!==s||i.highlightedObjectIndex!==o||i.highlightColor!==a){const l={};s||(l.pickingSelectedColor=null),Array.isArray(a)&&(l.pickingHighlightColor=a),Number.isInteger(o)&&(l.pickingSelectedColor=o>=0?this.encodePickingColor(o):null),this.setModuleParameters(l)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let i=!1;i=i||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const r=this.getAttributeManager(),s=r&&r.getNeedsRedraw(t);return i=i||s,i}_getAttributeManager(){return new the(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){ic(!this.internalState&&!this.state),ic(isFinite(this.props.coordinateSystem));const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Vfe({attributeManager:t,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(Zn.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new ohe(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(t){eo("layer.matched",this,this===t);const{state:i,internalState:r}=t;this!==t&&(this.internalState=r,this.internalState.layer=this,this.state=i,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}return n.layerName="Layer",n.defaultProps=uge,n})(),hge=(()=>{class n extends SP{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(t=>t.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:i}=t;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id&&(t.object=i.__source.object,t.index=i.__source.index),t}renderLayers(){return null}filterSubLayer(t){return!0}shouldRenderSubLayer(t,i){return i&&i.length}getSubLayerClass(t,i){const{_subLayerProps:r}=this.props;return r&&r[t]&&r[t].type||i}getSubLayerRow(t,i,r){return t.__source={parent:this,object:i,index:r},t}getSubLayerAccessor(t){if("function"==typeof t){const i={data:this.props.data,target:[]};return(r,s)=>r&&r.__source?(i.index=r.__source.index,t(r.__source.object,i)):t(r,s)}return t}getSubLayerProps(t={}){const{opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:w,_subLayerProps:C}=this.props,x={opacity:i,pickable:r,visible:s,parameters:o,getPolygonOffset:a,highlightedObjectIndex:l,autoHighlight:c,highlightColor:d,coordinateSystem:f,coordinateOrigin:p,wrapLongitude:g,positionFormat:_,modelMatrix:y,extensions:v,fetch:w},L=C&&C[t.id],U=L&&L.updateTriggers,$=t.id||"sublayer";if(L){const ee=this.constructor._propTypes,fe=t.type?t.type._propTypes:{};for(const pe in L){const ve=fe[pe]||ee[pe];ve&&"accessor"===ve.type&&(L[pe]=this.getSubLayerAccessor(L[pe]))}}Object.assign(x,t,L),x.id="".concat(this.props.id,"-").concat($),x.updateTriggers=J(J({all:this.props.updateTriggers.all},t.updateTriggers),U);for(const ee of v){const fe=ee.getSubLayerProps.call(this,ee);fe&&Object.assign(x,fe,{updateTriggers:Object.assign(x.updateTriggers,fe.updateTriggers)})}return x}_updateAutoHighlight(t){for(const i of this.getSubLayers())i.updateAutoHighlight(t)}_getAttributeManager(){return null}_renderLayers(){let{subLayers:t}=this.internalState;const i=!t||this.needsUpdate();i&&(t=this.renderLayers(),t=lI(t,Boolean),this.internalState.subLayers=t),eo("compositeLayer.renderLayers",this,i,t);for(const r of t)r.parent=this}}return n.layerName="CompositeLayer",n})();const fge=/([0-9]+\.?[0-9]*)(%|px)/;function US(n){switch(typeof n){case"number":return{position:n,relative:!1};case"string":const e=n.match(fge);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(n))}}function zS(n,e){return n.relative?Math.round(n.position*e):n.position}function vb(n,e){if(n===e)return!0;if(!n||!e)return!1;for(const t in n){const i=n[t],r=e[t];if(!(i===r||Array.isArray(i)&&Array.isArray(r)&&vb(i,r)))return!1}return!0}class MP{constructor(e={}){const{id:t=null,x:i=0,y:r=0,width:s="100%",height:o="100%",projectionMatrix:a=null,fovy:l=50,near:c=.1,far:d=1e3,modelMatrix:f=null,viewportInstance:p=null,type:g=Mm}=e;ic(!p||p instanceof Mm),this.viewportInstance=p,this.id=t||this.constructor.displayName||"view",this.type=g,this.props=an(J({},e),{id:this.id,projectionMatrix:a,fovy:l,near:c,far:d,modelMatrix:f}),this._parseDimensions({x:i,y:r,width:s,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):vb(this.props,e.props))}makeViewport({width:e,height:t,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const r=this.getDimensions({width:e,height:t});return this._getViewport(i,r)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t=J({},e);for(const i in this.props.viewState)"id"!==i&&(t[i]=this.props.viewState[i]);return t}return e}getDimensions({width:e,height:t}){return{x:zS(this._x,e),y:zS(this._y,t),width:zS(this._width,e),height:zS(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),J(J({},e),t)):null}_getViewport(e,t){const{type:i}=this;return new i(J(J(J({},e),this.props),t))}_parseDimensions({x:e,y:t,width:i,height:r}){this._x=US(e),this._y=US(t),this._width=US(i),this._height=US(r)}}const bb=()=>{},Q5={transitionEasing:n=>n,transitionInterruption:1,onTransitionStart:bb,onTransitionInterrupt:bb,onTransitionEnd:bb};class pge{constructor(e,t={}){this.ControllerState=e,this.props=J(J({},Q5),t),this.propsInTransition=null,this.transition=new cb(t.timeline),this.onViewStateChange=t.onViewStateChange||bb,this.onStateChange=t.onStateChange||bb,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;const i=this.props;if(e=J(J({},Q5),e),this.props=e,this._shouldIgnoreViewportChange(i,e))return t;if(this._isTransitionEnabled(e)){const{interruption:r,endProps:s}=this.transition.settings,o=J(J({},i),2===r?s:this.propsInTransition||i);this._triggerTransition(o,e),t=!0}else this.transition.cancel();return t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:t,transitionInterpolator:i}=e;return(t>0||"auto"===t)&&Boolean(i)}_isUpdateDueToCurrentTransition(e){return!!this.transition.inProgress&&this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition)}_shouldIgnoreViewportChange(e,t){return this.transition.inProgress?3===this.transition.settings.interruption||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t)}_triggerTransition(e,t){const i=new this.ControllerState(e),r=new this.ControllerState(t).shortestPathFrom(i),{transitionInterpolator:s}=t,o=s.getDuration?s.getDuration(e,t):t.transitionDuration;if(0===o)return;const a=t.transitionInterpolator.initializeProps(e,r);this.propsInTransition={},this.duration=o,this.transition.start({duration:o,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startProps:a.start,endProps:a.end,onStart:t.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(t.onTransitionInterrupt),onEnd:this._onTransitionEnd(t.onTransitionEnd)}),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return t=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e(t)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:i,startProps:r,endProps:s,duration:o,easing:a}}=e,l=a(t/o),c=i.interpolateProps(r,s,l);this.propsInTransition=new this.ControllerState(J(J({},this.props),c)).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}const J5=["longitude","latitude","zoom","bearing","pitch"],mge=["longitude","latitude","zoom"];class eH extends class{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:i,required:r}=e;this._propsToCompare=t,this._propsToExtract=i,this._requiredProps=r}arePropsEqual(e,t){for(const i of this._propsToCompare||Object.keys(t))if(!(i in e)||!(i in t)||!eb(e[i],t[i]))return!1;return!0}initializeProps(e,t){let i;if(this._propsToExtract){const r={},s={};for(const o of this._propsToExtract)r[o]=e[o],s[o]=t[o];i={start:r,end:s}}else i={start:e,end:t};return this._checkRequiredProps(i.start),this._checkRequiredProps(i.end),i}interpolateProps(e,t,i){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){!this._requiredProps||this._requiredProps.forEach(t=>{const i=e[t];ic(Number.isFinite(i)||Array.isArray(i),"".concat(t," is required for transition"))})}}{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:J5,extract:J5,required:mge}),this.opts=e}initializeProps(e,t){const i=super.initializeProps(e,t),{makeViewport:r,around:s}=this.opts;if(r&&s){const o=r(e),a=r(t),l=o.unproject(s);i.start.around=s,Object.assign(i.end,{around:a.project(l),aroundPosition:l,width:t.width,height:t.height})}return i}interpolateProps(e,t,i){const r={};for(const s of this._propsToExtract)r[s]=dS(e[s]||0,t[s]||0,i);if(t.aroundPosition){const s=this.opts.makeViewport(J(J({},t),r));Object.assign(r,s.panByPosition(t.aroundPosition,dS(e.around,t.around,i)))}return r}}const ch={transitionDuration:0},_ge={transitionDuration:300,transitionEasing:n=>n,transitionInterruption:1},$S=n=>1-(1-n)*(1-n),Tm_WHEEL=["wheel"],Tm_PAN=["panstart","panmove","panend"],Tm_PINCH=["pinchstart","pinchmove","pinchend"],Tm_TRIPLE_PAN=["tripanstart","tripanmove","tripanend"],Tm_DOUBLE_TAP=["doubletap"],Tm_KEYBOARD=["keydown"];class xP{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new pge(e,an(J({},t),{onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}));const i=this.linearTransitionProps;this._transition=i&&an(J({},_ge),{transitionInterpolator:new eH({transitionProps:i})}),this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const{ControllerState:t}=this;this.controllerState=new t(J(J({makeViewport:this.makeViewport},this.controllerStateProps),this._state));const i=this._eventStartBlocked;switch(e.type){case"panstart":return!i&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!i&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!i&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){const{x:t,y:i}=this.controllerStateProps,{offsetCenter:r}=e;return[r.x-t,r.y-i]}isPointInBounds(e,t){const{width:i,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;const s=e[0]>=0&&e[0]<=i&&e[1]>=0&&e[1]<=r;return s&&t&&t.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:t}=e;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),this.controllerStateProps=e,"eventManager"in e&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let{inertia:t}=e;!0===t&&(t=300),this.inertia=t;const{scrollZoom:i=!0,dragPan:r=!0,dragRotate:s=!0,doubleClickZoom:o=!0,touchZoom:a=!0,touchRotate:l=!1,keyboard:c=!0}=e,d=Boolean(this.onViewStateChange);this.toggleEvents(Tm_WHEEL,d&&i),this.toggleEvents(Tm_PAN,d&&(r||s)),this.toggleEvents(Tm_PINCH,d&&(a||l)),this.toggleEvents(Tm_TRIPLE_PAN,d&&l),this.toggleEvents(Tm_DOUBLE_TAP,d&&o),this.toggleEvents(Tm_KEYBOARD,d&&c),this.scrollZoom=i,this.dragPan=r,this.dragRotate=s,this.doubleClickZoom=o,this.touchZoom=a,this.touchRotate=l,this.keyboard=c}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(i=>{this._events[i]!==t&&(this._events[i]=t,t?this.eventManager.on(i,this.handleEvent):this.eventManager.off(i,this.handleEvent))})}updateViewport(e,t={},i={}){const r=J(J({},e.getViewportProps()),t),s=this.controllerState!==e;if(this._state=e.getState(),this._setInteractionState(i),s){const o=this.controllerState?this.controllerState.getViewportProps():null;this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let i=this.isFunctionKeyPressed(e)||e.rightButton;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const r=this.controllerState[i?"panStart":"rotateStart"]({pos:t});return this._panMove=i,this.updateViewport(r,ch,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;const t=this.getCenter(e),i=this.controllerState.pan({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:t}=this;if(this.dragPan&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.pan({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).panEnd();this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isPanning:!0})}else{const i=this.controllerState.panEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const t=this.getCenter(e),i=this.controllerState.rotate({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:t}=this;if(this.dragRotate&&t&&e.velocity){const i=this.getCenter(e),s=this.controllerState.rotate({pos:[i[0]+e.velocityX*t/2,i[1]+e.velocityY*t/2]}).rotateEnd();this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isRotating:!0})}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const{speed:i=.01,smooth:r=!1}=this.scrollZoom,{delta:s}=e;let o=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==o&&(o=1/o);const a=this.controllerState.zoom({pos:t,scale:o});return this.updateViewport(a,an(J({},this._getTransitionProps({around:t})),{transitionDuration:r?250:1}),{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.rotateStart({pos:t});return this.updateViewport(i,ch,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate||!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;const i=this.controllerState.rotate({pos:t});return this.updateViewport(i,ch,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;const{inertia:t}=this;if(this.touchRotate&&t&&e.velocityY){const i=this.getCenter(e),r=[i[0],i[1]+=e.velocityY*t/2],s=this.controllerState.rotate({pos:r});this.updateViewport(s,an(J({},this._getTransitionProps()),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{const i=this.controllerState.rotateEnd();this.updateViewport(i,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(i,ch,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let t=this.controllerState;if(this.touchZoom){const{scale:i}=e,r=this.getCenter(e);t=t.zoom({pos:r,scale:i})}if(this.touchRotate){const{rotation:i}=e;t=t.rotate({deltaAngleX:this._startPinchRotation-i})}return this.updateViewport(t,ch,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:t,_lastPinchEvent:i}=this;if(this.touchZoom&&t&&i&&e.scale!==i.scale){const r=this.getCenter(e);let s=this.controllerState.rotateEnd();const o=Math.log2(e.scale),a=(o-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,o+a*t/2);s=s.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(s,an(J({},this._getTransitionProps({around:r})),{transitionDuration:t,transitionEasing:$S}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(t)}else{const r=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,this._lastPinchEvent=null,!0}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;const t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;const i=this.isFunctionKeyPressed(e),r=this.controllerState.zoom({pos:t,scale:i?.5:2});return this.updateViewport(r,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const t=this.isFunctionKeyPressed(e),{zoomSpeed:i,moveSpeed:r,rotateSpeedX:s,rotateSpeedY:o}=this.keyboard,{controllerState:a}=this;let l;const c={};switch(e.srcEvent.code){case"Minus":l=t?a.zoomOut(i).zoomOut(i):a.zoomOut(i),c.isZooming=!0;break;case"Equal":l=t?a.zoomIn(i).zoomIn(i):a.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":t?(l=a.rotateLeft(s),c.isRotating=!0):(l=a.moveLeft(r),c.isPanning=!0);break;case"ArrowRight":t?(l=a.rotateRight(s),c.isRotating=!0):(l=a.moveRight(r),c.isPanning=!0);break;case"ArrowUp":t?(l=a.rotateUp(o),c.isRotating=!0):(l=a.moveUp(r),c.isPanning=!0);break;case"ArrowDown":t?(l=a.rotateDown(o),c.isRotating=!0):(l=a.moveDown(r),c.isPanning=!0);break;default:return!1}return this.updateViewport(l,this._getTransitionProps(),c),!0}_getTransitionProps(e){const{_transition:t}=this;return t?e?an(J({},t),{transitionInterpolator:new eH(an(J({},e),{transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport}))}):t:ch}}class tH{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}const uh_target=[0,0,0];class GS extends tH{constructor({makeViewport:e,width:t,height:i,rotationX:r=0,rotationOrbit:s=0,target:o=uh_target,zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:d=-(1/0),maxZoom:f=Infinity,startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:w}){super({width:t,height:i,rotationX:r,rotationOrbit:s,target:o,zoom:a,minRotationX:l,maxRotationX:c,minZoom:d,maxZoom:f}),this._state={startPanPosition:p,startRotatePos:g,startRotationX:_,startRotationOrbit:y,startZoomPosition:v,startZoom:w},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const i=this._state.startPanPosition||t;if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startRotationX:s,startRotationOrbit:o}=this._state,{width:a,height:l}=this._viewportProps;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let c;if(e){let d=(e[0]-r[0])/a;(s<-90||s>90)&&(d*=-1),c={rotationX:s+(e[1]-r[1])/l*180,rotationOrbit:o+180*d}}else c={rotationX:s+i,rotationOrbit:o+t};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),i=J({},this._viewportProps),{rotationOrbit:r}=i;return Math.abs(r-t.rotationOrbit)>180&&(i.rotationOrbit=r<0?r+360:r-360),i}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){const{zoom:r}=this._viewportProps;let{startZoom:s,startZoomPosition:o}=this._state;Number.isFinite(s)||(s=r,o=this._unproject(t)||this._unproject(e));const a=this._calculateNewZoom({scale:i,startZoom:s}),l=this.makeViewport(an(J({},this._viewportProps),{zoom:a}));return this._getUpdatedState(J({zoom:a},l.panByPosition(o,e)))}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Number.isFinite(t)||(t=this._viewportProps.zoom),Xf(t+Math.log2(e),r,i)}_panFromCenter(e){const{width:t,height:i,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new GS(J(J(J({},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r,maxRotationX:s,minRotationX:o,rotationOrbit:a}=e;return e.zoom=Xf(r,i,t),e.rotationX=Xf(e.rotationX,o,s),(a<-180||a>180)&&(e.rotationOrbit=function(n,e){const t=n%360;return t<0?360+t:t}(a+180)-180),e}}class vge extends xP{constructor(e){super(GS,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}class bge extends xP{constructor(e){e.dragMode=e.dragMode||"pan",super(GS,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}const Cge=(new Lt).lookAt({eye:[0,0,1]});function wge({width:n,height:e,near:t,far:i}){return n=n||1,e=e||1,(new Lt).ortho({left:-n/2,right:n/2,bottom:-e/2,top:e/2,near:t,far:i})}class Ege extends Mm{constructor(e){const{width:t,height:i,near:r=.1,far:s=1e3,zoom:o=0,target:a=[0,0,0],flipY:l=!0}=e,c=Math.pow(2,o);super(an(J({},e),{longitude:null,position:a,viewMatrix:Cge.clone().scale([c,c*(l?-1:1),c]),projectionMatrix:wge({width:t,height:i,near:r,far:s}),zoom:o}))}panByPosition(e,t){const r=Cm([],e,II([],Zf(t,this.pixelUnprojectionMatrix)));return{target:Cm([],this.center,r)}}}let Sge=(()=>{class n extends MP{constructor(t){super(an(J({},t),{type:Ege}))}get controller(){return this._getControllerProps({type:bge})}}return n.displayName="OrthographicView",n})();const WS=Math.PI/180;function Mge({height:n,fovy:e,orbitAxis:t,rotationX:i,rotationOrbit:r,zoom:s}){const o=.5/Math.tan(e*WS/2),a="Z"===t?[0,0,1]:[0,1,0],l="Z"===t?[0,-o,0]:[0,0,o],c=(new Lt).lookAt({eye:l,up:a});c.rotateX(i*WS),"Z"===t?c.rotateZ(r*WS):c.rotateY(r*WS);const d=Math.pow(2,s)/(n||1);return c.scale(d),c}class xge extends Mm{constructor(e){const{height:t,fovy:i,orbitAxis:r,target:s=[0,0,0],rotationX:o=0,rotationOrbit:a=0,zoom:l=0}=e;super(an(J({},e),{longitude:null,viewMatrix:Mge({height:t,fovy:i,orbitAxis:r,rotationX:o,rotationOrbit:a,zoom:l}),fovy:i,position:s,zoom:l})),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[i,r,s=this.projectedCenter[2]]=e,o=t?r:this.height-r,[a,l,c]=Zf([i,o,s],this.pixelUnprojectionMatrix);return[a,l,c]}panByPosition(e,t){const i=this.project(e);return{target:this.unproject([this.width/2+i[0]-t[0],this.height/2+i[1]-t[1],this.projectedCenter[2]])}}}let Tge=(()=>{class n extends MP{constructor(t={}){const{orbitAxis:i="Z"}=t;super(an(J({},t),{orbitAxis:i,type:xge}))}get controller(){return this._getControllerProps({type:vge})}}return n.displayName="OrbitView",n})();const Age=[255,255,255],Dge=1;let Oge=0;class nH{constructor(e={}){const{color:t=Age}=e,{intensity:i=Dge}=e;this.id=e.id||"ambient-".concat(Oge++),this.color=t,this.intensity=i,this.type="ambient"}}const Ige=[255,255,255],Pge=1,Rge=[0,0,-1];let kge=0;class iH{constructor(e={}){const{color:t=Ige}=e,{intensity:i=Pge}=e,{direction:r=Rge}=e,{_shadow:s=!1}=e;this.id=e.id||"directional-".concat(kge++),this.color=t,this.intensity=i,this.type="directional",this.direction=new Js(r).normalize().toArray(),this.shadow=s}getProjectedLight(){return this}}class rH{constructor(e={}){const{id:t="effect"}=e;this.id=t,this.props=J({},e)}preRender(){}getModuleParameters(){}cleanup(){}}class TP extends class{constructor(e,t={}){const{id:i="pass"}=t;this.id=i,this.gl=e,this.props=J({},t)}setProps(e){Object.assign(this.props,e)}render(){}cleanup(){}}{render(e){return Wu(this.gl,{framebuffer:e.target}),this._drawLayers(e)}_drawLayers(e){const{viewports:t,views:i,onViewportActive:r,clearCanvas:s=!0}=e;e.pass=e.pass||"unknown";const o=this.gl;s&&function(n){Wu(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),n.clear(16640)}(o);const a=[];for(const l of t){const c=l.viewport||l,d=i&&i[c.id];r(c);const f=this._getDrawLayerParams(c,e);e.view=d;const p=c.subViewports||[c];for(const g of p){e.viewport=g;const _=this._drawLayersInViewport(o,e,f);a.push(_)}}return a}_getDrawLayerParams(e,{layers:t,pass:i,layerFilter:r,effects:s,moduleParameters:o}){const a=[],l=sH(),c={viewport:e,isPicking:i.startsWith("picking"),renderPass:i};for(let d=0;dJO(e,c))}const l={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Wu(e,{viewport:a});for(let c=0;c{const o=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&i(r.parent,!1),l in t){const d=t[l]=t[l]||sH(e[l],e);c=d(r,s),t[a]=d}else Number.isFinite(o)?(c=o+(e[l]||0),t[a]=null):c=n;return s&&c>=n&&(n=c+1),e[a]=c,c};return i}class Bge extends TP{constructor(e,t){super(e,t),this.shadowMap=new xa(e,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new pm(e,{format:33189,width:1,height:1}),this.fbo=new is(e,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(e){const t=this.fbo;nc(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{const i=e.viewports[0],r=um(this.gl),s=i.width*r,o=i.height*r;(s!==t.width||o!==t.height)&&t.resize({width:s,height:o}),super.render(an(J({},e),{target:t,pass:"shadow"}))})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const jge=Object.keys(Hn).map(n=>"const int COORDINATE_SYSTEM_".concat(n," = ").concat(Hn[n],";")).join(""),Uge=Object.keys($c).map(n=>"const int PROJECTION_MODE_".concat(n," = ").concat($c[n],";")).join(""),zge="".concat(jge,"\n").concat(Uge,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z;\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy;\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter;\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n return normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),Hge={},AP={name:"project",dependencies:[{name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}],vs:zge,getUniforms:function(n=Hge){return n.viewport?function({viewport:n,devicePixelRatio:e=1,modelMatrix:t=null,coordinateSystem:i=Hn.DEFAULT,coordinateOrigin:r,autoWrapLongitude:s=!1}={}){i===Hn.DEFAULT&&(i=n.isGeospatial?Hn.LNGLAT:Hn.CARTESIAN);const o=Khe({viewport:n,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:r});return o.project_uWrapLongitude=s,o.project_uModelMatrix=t||qhe,o}(n):{}}},qge=TS(function({viewport:n,center:e}){return new Lt(n.viewProjectionMatrix).invert().transform(e)}),Yge=TS(function({viewport:n,shadowMatrices:e}){const t=[],i=n.pixelUnprojectionMatrix,r=n.isGeospatial?void 0:1,s=[[0,0,r],[n.width,0,r],[0,n.height,r],[n.width,n.height,r],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map(o=>function(n,e){const[t,i,r]=n,s=Zf([t,i,r],e);return Number.isFinite(r)?s:[s[0],s[1],0]}(o,i));for(const o of e){const a=o.clone().translate(new Js(n.center).negate()),l=s.map(d=>a.transform(d)),c=(new Lt).ortho({left:Math.min(...l.map(d=>d[0])),right:Math.max(...l.map(d=>d[0])),bottom:Math.min(...l.map(d=>d[1])),top:Math.max(...l.map(d=>d[1])),near:Math.min(...l.map(d=>-d[2])),far:Math.max(...l.map(d=>-d[2]))});t.push(c.multiplyRight(o))}return t}),Xge=[0,0,0,1],Kge=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],DP={name:"shadow",dependencies:[AP],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(n={},e={})=>{if(n.drawToShadowMap||n.shadowMaps&&n.shadowMaps.length>0){const{shadowEnabled:t=!0}=n;return t&&n.shadowMatrices&&n.shadowMatrices.length>0?function(n={},e={}){const t={shadow_uDrawShadowMap:Boolean(n.drawToShadowMap),shadow_uUseShadowMap:!!n.shadowMaps&&n.shadowMaps.length>0,shadow_uColor:n.shadowColor||Xge,shadow_uLightId:n.shadowLightId||0,shadow_uLightCount:n.shadowMatrices.length},i=qge({viewport:n.viewport,center:e.project_uCenter}),r=[],s=Yge({shadowMatrices:n.shadowMatrices,viewport:n.viewport}).slice();for(let o=0;o0?n.shadowMaps[o]:n.dummyShadowMap;return t}(n,e):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}},tme={color:[255,255,255],intensity:1},oH=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],nme=[0,0,0,200/255];class OP extends rH{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=nme,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const t in e){const i=e[t];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow)}preRender(e,{layers:t,layerFilter:i,viewports:r,onViewportActive:s,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=ab.getDefaultProgramManager(e),DP&&this.programManager.addDefaultModule(DP)),this.dummyShadowMap||(this.dummyShadowMap=new xa(e,{width:1,height:1}));for(let a=0;ai.getProjectedLight({layer:e})),pointLights:this.pointLights.map(i=>i.getProjectedLight({layer:e}))},t}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(DP),this.programManager=null)}_createLightMatrix(){const e=[];for(const t of this.directionalLights){const i=(new Lt).lookAt({eye:new Js(t.direction).negate()});e.push(i)}return e}_createShadowPasses(e){for(let t=0;t=t.delay+t.duration*t.repeat}getTime(e){if(void 0===e)return this.time;const t=this.channels.get(e);return void 0===t?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const r of t)this._setChannelTime(r,this.time);const i=this.animations.values();for(const r of i){const{animation:s,channel:o}=r;s.setTime(this.getTime(o))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const i=rme++;return this.animations.set(i,{animation:e,channel:t}),e.setTime(this.getTime(t)),i}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const i=t-e.delay;i>=e.duration*e.repeat?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}class sme{constructor(e,t,i){this.id=e,this.context=i,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,t){if(e===this._data&&!t)return;this._data=e;const i=++this._loadCount;let r=e;"string"==typeof e&&(r=jS(e)),r instanceof Promise?(this.isLoaded=!1,this._loader=r.then(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=null,this._content=s)}).catch(s=>{this._loadCount===i&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=null,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class ome{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:i=!1,persistent:r=!0}){let s=this._resources[e];s?s.setData(t,i):(s=new sme(e,t,this._context),this._resources[e]=s),s.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const t=this._consumers[e];if(t){for(const i in t){const r=t[i];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:i,requestId:r="default"}){const{_resources:s,protocol:o}=this;e.startsWith(o)&&(s[e=e.replace(o,"")]||this.add({resourceId:e,data:null,persistent:!1}));const a=s[e];if(this._track(i,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,i,r){const s=this._consumers,o=s[e]=s[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),i&&(o[t]=a,a.onChange=r,a.resource=i,i.subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];!t.persistent&&!t.inUse()&&(t.delete(),delete this._resources[e])}}}const ame=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},AP],lme=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function cme(n){const e=ab.getDefaultProgramManager(n);for(const t of ame)e.addDefaultModule(t);for(const t of lme)e.addShaderHook(t);return e}const hme=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class fme{constructor(e,{deck:t,stats:i,viewport:r,timeline:s}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new ome({gl:e,protocol:"deck://"}),this.context=an(J({},hme),{layerManager:this,gl:e,deck:t,programManager:e&&cme(e),stats:i||new WO({id:"deck.gl"}),viewport:r||new Mm({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new aH,resourceManager:this.resourceManager}),this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const r=i.getNeedsRedraw(e);t=t||r}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(i=>0===t.id.indexOf(i))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){eo("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e,e=lI(e,Boolean);for(const i of e)i.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return eo("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,i){i.raiseError(t,"".concat(e," of ").concat(i))}_updateLayers(e,t){const i={};for(const o of e)i[o.id]?Zn.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const r=[];this._updateSublayersRecursively(t,i,r),this._finalizeOldLayers(i);let s=!1;for(const o of r)if(o.hasUniformTransition()){s=!0;break}this._needsUpdate=s,this.layers=r}_updateSublayersRecursively(e,t,i){for(const r of e){r.context=this.context;const s=t[r.id];null===s&&Zn.warn("Multiple new layers with same id ".concat(r.id))(),t[r.id]=null;let o=null;try{this._debug&&s!==r&&r.validateProps(),s?(this._transferLayerState(s,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite&&r.getSubLayers()}catch(a){this._handleError("matching",a,r)}o&&this._updateSublayersRecursively(o,t,i)}}_finalizeOldLayers(e){for(const t in e){const i=e[t];i&&this._finalizeLayer(i)}}_initializeLayer(e){try{e._initialize(),e.lifecycle="Initialized"}catch(t){this._handleError("initialization",t,e)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle="Matched. State transferred from previous layer",t!==e&&(e.lifecycle="Discarded. Awaiting garbage collection")}_updateLayer(e){try{e._update()}catch(t){this._handleError("update",t,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle="No longer matched. Awaiting garbage collection";try{e._finalize(),e.lifecycle="Finalized! Awaiting garbage collection"}catch(t){this._handleError("finalization",t,e)}}}class pme{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(e){return e?this._viewports.filter(t=>t.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(t=>{e[t.id]=t}),e}getView(e){return"string"==typeof e?this.views.find(t=>t.id===e):e}getViewState(e){const t=this.getView(e),i=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(i):i}getViewport(e){return this._viewportMap[e]}unproject(e,t){const i=this.getViewports(),r={x:e[0],y:e[1]};for(let s=i.length-1;s>=0;--s){const o=i[s];if(o.containsPixel(r)){const a=e.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,t)}}return null}setProps(e){"views"in e&&this._setViews(e.views),"viewState"in e&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){(e!==this.width||t!==this.height)&&(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=lI(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!vb(e,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Zn.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(e,t){return new(0,t.type)(J({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,t.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>e._getViewport(s,{width:s.width,height:s.height})},t))}_updateController(e,t,i,r){let s=e.controller;return s?(s=an(J(J(J({},t),e.props),s),{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height}),r?r.setProps(s):r=this._createController(e,s),r):null}_rebuildViewports(){const{width:e,height:t,views:i}=this,r=this.controllers;this._viewports=[],this.controllers={};let s=!1;for(let o=i.length;o--;){const a=i[o],l=this.getViewState(a),c=a.makeViewport({width:e,height:t,viewState:l});let d=r[a.id];a.controller&&!d&&(s=!0),(s||!a.controller)&&d&&(d.finalize(),d=null),this.controllers[a.id]=this._updateController(a,l,c,d),this._viewports.unshift(c)}for(const o in r)r[o]&&!this.controllers[o]&&r[o].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,t){return e.length!==t.length||e.some((i,r)=>!e[r].equals(t[r]))}}class mme extends tH{constructor({makeViewport:e,width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a=0,pitch:l=0,altitude:c=1.5,maxZoom:d=20,minZoom:f=0,maxPitch:p=60,minPitch:g=0,startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:w,startPitch:C,startZoom:x,normalize:L}={}){ic(Number.isFinite(s)),ic(Number.isFinite(r)),ic(Number.isFinite(o)),super({width:t,height:i,latitude:r,longitude:s,zoom:o,bearing:a,pitch:l,altitude:c,maxZoom:d,minZoom:f,maxPitch:p,minPitch:g,normalize:L}),this._state={startPanLngLat:_,startZoomLngLat:y,startRotatePos:v,startBearing:w,startPitch:C,startZoom:x},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const i=this._state.startPanLngLat||this._unproject(t);if(!i)return this;const s=this.makeViewport(this._viewportProps).panByPosition(i,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:i=0}){const{startRotatePos:r,startBearing:s,startPitch:o}=this._state;if(!r||!Number.isFinite(s)||!Number.isFinite(o))return this;let a;return a=e?this._calculateNewPitchAndBearing(an(J({},this._getRotationParams(e,r)),{startBearing:s,startPitch:o})):{bearing:s+t,pitch:o+i},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:i}){let{startZoom:r,startZoomLngLat:s}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,s=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:i,startZoom:r}),a=this.makeViewport(an(J({},this._viewportProps),{zoom:o}));return this._getUpdatedState(J({zoom:o},a.panByPosition(s,e)))}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),i=J({},this._viewportProps),{bearing:r,longitude:s}=i;return Math.abs(r-t.bearing)>180&&(i.bearing=r<0?r+360:r-360),Math.abs(s-t.longitude)>180&&(i.longitude=s<0?s+360:s-360),i}_zoomFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.zoom({pos:[t/2,i/2],scale:e})}_panFromCenter(e){const{width:t,height:i}=this._viewportProps;return this.pan({startPos:[t/2,i/2],pos:[t/2+e[0],i/2+e[1]]})}_getUpdatedState(e){return new this.constructor(J(J(J({makeViewport:this.makeViewport},this._viewportProps),this._state),e))}_applyConstraints(e){const{maxZoom:t,minZoom:i,zoom:r}=e;e.zoom=Xf(r,i,t);const{maxPitch:s,minPitch:o,pitch:a}=e;e.pitch=Xf(a,o,s);const{normalize:l=!0}=e;return l&&Object.assign(e,function({width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s=0,bearing:o=0}){(t<-180||t>180)&&(t=J4(t+180,360)-180),(o<-180||o>180)&&(o=J4(o+180,360)-180);const a=PI(e/512);if(r<=a)r=a,i=0;else{const l=e/2/Math.pow(2,r),c=ah([0,l])[1];if(id&&(i=d)}}return{width:n,height:e,longitude:t,latitude:i,zoom:r,pitch:s,bearing:o}}(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:i,minZoom:r}=this._viewportProps;return Xf(t+Math.log2(e),r,i)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:i,startPitch:r}){t=Xf(t,-1,1);const{minPitch:s,maxPitch:o}=this._viewportProps;let l=r;return t>0?l=r+t*(o-r):t<0&&(l=r-t*(s-r)),{pitch:l,bearing:i+180*e}}_getRotationParams(e,t){const i=e[0]-t[0],r=e[1]-t[1],s=e[1],o=t[1],{width:a,height:l}=this._viewportProps,c=i/a;let d=0;return r>0?Math.abs(l-o)>5&&(d=r/(o-l)*1.2):r<0&&o>5&&(d=1-s/o),d=Math.min(1,Math.max(-1,d)),{deltaScaleX:c,deltaScaleY:d}}}class _me extends xP{constructor(e){e.dragMode=e.dragMode||"pan",super(mme,e)}setProps(e){const t=this.controllerStateProps;super.setProps(e),(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState(J(J({makeViewport:this.makeViewport},this.controllerStateProps),this._state)))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch"]}}let yme=(()=>{class n extends MP{constructor(t){super(an(J({},t),{type:p5}))}get controller(){return this._getControllerProps({type:_me})}}return n.displayName="MapView",n})();const vme=new OP;class bme{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length!==this.effects.length||!vb(e.effects,this.effects))&&(this.setEffects(e.effects),this._needsRedraw="effects changed")}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const e of this._internalEffects)e.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof OP)||this._internalEffects.push(vme)}}class Cme extends TP{}const cH={blendFunc:[1,0,32771,0],blendEquation:32774};class uH extends TP{render(e){e.pickingFBO?(this.useAlpha=!0,this._drawPickingBuffer(e)):(this.useAlpha=!1,super.render(e))}_drawPickingBuffer({layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pickingFBO:o,deviceRect:{x:a,y:l,width:c,height:d},pass:f="picking",redrawReason:p,pickZ:g}){const _=this.gl;return this.pickZ=g,nc(_,an(J({scissorTest:!0,scissor:[a,l,c,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},cH),{blend:!g}),()=>{super.render({target:o,layers:e,layerFilter:t,views:i,viewports:r,onViewportActive:s,pass:f,redrawReason:p})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){const i=this.pickZ?{blend:!1}:an(J({},cH),{blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]});return J(J({},e.props.parameters),i)}}class Eme{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Cme(e),this.pickLayersPass=new uH(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"layerFilter"in e&&this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in e&&this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||is.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);const i=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,r=t.render(an(J({},e),{target:i}));this._postRender(e.effects,e),this.renderCount++,eo("deckRenderer.renderLayers",this,r,e)}needsRedraw(e={clearRedrawFlags:!1}){const t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const{renderBuffers:e}=this;for(const t of e)t.delete();e.length=0}_preRender(e,t){let i=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(i=r);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:e}=this;0===e.length&&e.push(new is(this.gl),new is(this.gl));for(const t of e)t.resize()}_postRender(e,t){const{renderBuffers:i}=this,r={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const s of e)if(s.postRender){if(s===this.lastPostProcessEffect){r.target=t.target,s.postRender(this.gl,r);break}const o=s.postRender(this.gl,r);r.inputBuffer=o,r.swapBuffer=o===i[0]?i[1]:i[0]}}}const Sme={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function Mme({pickedColors:n,layers:e,deviceX:t,deviceY:i,deviceRadius:r,deviceRect:s}){if(n){const{x:o,y:a,width:l,height:c}=s;let d=r*r,f=-1,p=0;for(let g=0;gd)p+=4*l;else for(let v=0;v=0){const C=v+o-t,x=C*C+y;x<=d&&(d=x,f=p)}p+=4}}if(f>=0){const g=n[f+3]-1,_=n.slice(f,f+4),y=e[g];if(y){const v=y.decodePickingColor(_),w=Math.floor(f/4/l);return{pickedColor:_,pickedLayer:y,pickedObjectIndex:v,pickedX:o+(f/4-w*l),pickedY:a+w}}Zn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Sme}function dH({pickInfo:n,mode:e,viewports:t,layerFilter:i,pixelRatio:r,x:s,y:o,z:a}){const l=n&&n.pickedLayer,d=function(n,e,t){for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.containsPixel(e)&&(!t||t(r)))return r}return n[0]}(t,{x:s,y:o},i&&l&&(p=>i({layer:l,viewport:p,isPicking:!0,renderPass:"picking:".concat(e)}))),f=d&&d.unproject([s-d.x,o-d.y],{targetZ:a});return{color:null,layer:null,viewport:d,index:-1,picked:!1,x:s,y:o,pixel:[s,o],coordinate:f,devicePixel:n&&[n.pickedX,n.pickedY],pixelRatio:r}}function Tme(n){const{pickInfo:e,lastPickedInfo:t,mode:i,layers:r}=n,{pickedColor:s,pickedLayer:o,pickedObjectIndex:a}=e,l=o?[o]:[];if("hover"===i){const f=t.index,p=t.layerId,g=o&&o.props.id;if(g!==p||a!==f){if(g!==p){const _=r.find(y=>y.props.id===p);_&&l.unshift(_)}t.layerId=g,t.index=a,t.info=null}}const c=dH(n),d=new Map;return d.set(null,c),l.forEach(f=>{let p=J({},c);f===o&&(p.color=s,p.index=a,p.picked=!0),p=hH({layer:f,info:p,mode:i}),f===o&&"hover"===i&&(t.info=p),d.set(p.layer.id,p),"hover"===i&&p.layer.updateAutoHighlight(p)}),d}function hH({layer:n,info:e,mode:t}){for(;n&&e;){const i=e.layer||null;e.sourceLayer=i,e.layer=n,e=n.getPickingInfo({info:e,mode:t,sourceLayer:i}),n=n.parent}return e}class Dme{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new uH(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:i,viewports:r},s=this.lastPickedInfo.info){const o=s&&s.layer&&s.layer.id,a=s&&s.viewport&&s.viewport.id,l=o?i.find(p=>p.id===o):null,c=a&&r.find(p=>p.id===a)||r[0],d=c&&c.unproject([e-c.x,t-c.y]),f={x:e,y:t,viewport:c,coordinate:d,layer:l};return l?J(J({},s),f):Object.assign(f,{color:null,object:null,index:-1})}_resizeBuffer(){const{gl:e}=this;return this.pickingFBO||(this.pickingFBO=new is(e),is.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new is(e),this.depthFBO.attach({36064:new xa(e,{format:Mn(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(i=>i.isPickable()&&!i.isComposite);return t.length>255?(Zn.warn("Too many pickable layers, only picking the first 255")(),t.slice(0,255)):t.length?t:null}_pickClosestObject({layers:e,views:t,viewports:i,x:r,y:s,radius:o=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:d}){if(!(e=this._getPickable(e)))return{result:[],emptyInfo:dH({viewports:i,x:r,y:s})};this._resizeBuffer();const f=um(this.gl),p=HO(this.gl,[r,s],!0),g=[p.x+Math.floor(p.width/2),p.y+Math.floor(p.height/2)],_=Math.round(o*f),{width:y,height:v}=this.pickingFBO,w=this._getPickingRect({deviceX:g[0],deviceY:g[1],deviceRadius:_,deviceWidth:y,deviceHeight:v});let C;const x=[],L={};for(let U=0;U=0){const s=n.slice(i,i+4),o=s.join(",");if(!t.has(o)){const a=e[r];a?t.set(o,{pickedColor:s,pickedLayer:a,pickedObjectIndex:a.decodePickingColor(s)}):Zn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(t.values())}({pickedColors:this._drawAndSample({layers:e,views:t,viewports:i,onViewportActive:d,deviceRect:{x:g,y:w,width:y.x+y.width-g,height:_-w},pass:"picking:".concat(l),redrawReason:l}),layers:e}),U=new Map,$=Number.isFinite(c);for(let ee=0;ee=c);ee++){const fe=L[ee];let pe={color:fe.pickedColor,layer:null,index:fe.pickedObjectIndex,picked:!0,x:r,y:s,width:o,height:a,pixelRatio:f};pe=hH({layer:fe.pickedLayer,info:pe,mode:l}),U.has(pe.object)||U.set(pe.object,pe)}return Array.from(U.values())}_drawAndSample({layers:e,views:t,viewports:i,onViewportActive:r,deviceRect:s,pass:o,redrawReason:a,pickZ:l}){if(e.length<1)return null;const c=l?this.depthFBO:this.pickingFBO;this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:i,onViewportActive:r,pickingFBO:c,deviceRect:s,pass:o,redrawReason:a,pickZ:l});const{x:d,y:f,width:p,height:g}=s,_=new(l?Float32Array:Uint8Array)(p*g*4);return uS(c,{sourceX:d,sourceY:f,sourceWidth:p,sourceHeight:g,target:_}),_}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:i,deviceWidth:r,deviceHeight:s}){const o=Math.max(0,e-i),a=Math.max(0,t-i),l=Math.min(r,e+i+1)-o,c=Math.min(s,t+i+1)-a;return l<=0||c<=0?null:{x:o,y:a,width:l,height:c}}}const Ome={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Ime{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,Ome),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,i){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(i,"px)")}remove(){this.el&&this.el.remove()}}function fH(n,e){if(!n)throw new Error(e)}const Qc={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},pH=Qc.global||Qc.self||Qc.window,Rme="object"!=typeof process||"[object process]"!==String(process)||process.browser,gH="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:kme}=(gH&&parseFloat(gH[1]),pH),IP="undefined"!=typeof Image,PP="undefined"!=typeof ImageBitmap,Fme=Boolean(kme),RP=!!Rme||Fme;function mH(n){const e=function(n){return"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&n instanceof Image?"image":n&&"object"==typeof n&&n.data&&n.width&&n.height?"data":null}(n);if(!e)throw new Error("Not an image");return e}function _H(n){switch(mH(n)){case"data":return n;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=n.width,e.height=n.height,t.drawImage(n,0,0),t.getImageData(0,0,n.width,n.height);default:throw new Error("getImageData")}}const Bme=/^data:image\/svg\+xml/,Vme=/\.svg((\?|#).*)?$/;function kP(n){return n&&(Bme.test(n)||Vme.test(n))}function jme(n,e){if(kP(e)){let i=(new TextDecoder).decode(n);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(i=unescape(encodeURIComponent(i)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return vH(n,e)}function vH(n,e){if(kP(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(n)])}function bH(n,e,t){return FP.apply(this,arguments)}function FP(){return(FP=un(function*(n,e,t){const i=jme(n,t),r=self.URL||self.webkitURL,s="string"!=typeof i&&r.createObjectURL(i);try{return yield Ume(s||i,e)}finally{s&&r.revokeObjectURL(s)}})).apply(this,arguments)}function Ume(n,e){return NP.apply(this,arguments)}function NP(){return(NP=un(function*(n,e){const t=new Image;return t.src=n,e.image&&e.image.decode&&t.decode?(yield t.decode(),t):yield new Promise((i,r)=>{try{t.onload=()=>i(t),t.onerror=s=>r(new Error(`Could not load image ${n}: ${s}`))}catch(s){r(s)}})})).apply(this,arguments)}const zme={};let CH=!0;function Hme(n,e,t){return LP.apply(this,arguments)}function LP(){return(LP=un(function*(n,e,t){let i;i=kP(t)?yield bH(n,e,t):vH(n,t);const r=e&&e.imagebitmap;return yield $me(i,r)})).apply(this,arguments)}function $me(n){return BP.apply(this,arguments)}function BP(){return(BP=un(function*(n,e=null){if((Gme(e)||!CH)&&(e=null),e)try{return yield createImageBitmap(n,e)}catch(t){console.warn(t),CH=!1}return yield createImageBitmap(n)})).apply(this,arguments)}function Gme(n){for(const e in n||zme)return!1;return!0}const Jc=!1,Cb=!0;function VP(n){const e=wb(n);return function(n){const e=wb(n);return e.byteLength>=24&&2303741511===e.getUint32(0,Jc)?{mimeType:"image/png",width:e.getUint32(16,Jc),height:e.getUint32(20,Jc)}:null}(e)||function(n){const e=wb(n);if(!(e.byteLength>=3&&65496===e.getUint16(0,Jc)&&255===e.getUint8(2)))return null;const{tableMarkers:i,sofMarkers:r}=function(){const n=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)n.add(t);return{tableMarkers:n,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}();let s=2;for(;s+9=10&&1195984440===e.getUint32(0,Jc)?{mimeType:"image/gif",width:e.getUint16(6,Cb),height:e.getUint16(8,Cb)}:null}(e)||function(n){const e=wb(n);return e.byteLength>=14&&16973===e.getUint16(0,Jc)&&e.getUint32(2,Cb)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Cb),height:e.getUint32(22,Cb)}:null}(e)}function wb(n){if(n instanceof DataView)return n;if(ArrayBuffer.isView(n))return new DataView(n.buffer);if(n instanceof ArrayBuffer)return new DataView(n);throw new Error("toDataView")}function Zme(n,e){const{mimeType:t}=VP(n)||{},{_parseImageNode:i}=pH;return fH(i),i(n,t,e)}function jP(){return(jP=un(function*(n,e,t){const r=((e=e||{}).image||{}).type||"auto",{url:s}=t||{};let a;switch(Jme(r)){case"imagebitmap":a=yield Hme(n,e,s);break;case"image":a=yield bH(n,e,s);break;case"data":a=yield Zme(n,e);break;default:fH(!1)}return"data"===r&&(a=_H(a)),a})).apply(this,arguments)}function Jme(n){switch(n){case"auto":case"data":return function(){if(PP)return"imagebitmap";if(IP)return"image";if(RP)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(n){switch(n){case"auto":return PP||IP||RP;case"imagebitmap":return PP;case"image":return IP;case"data":return RP;default:throw new Error(`@loaders.gl/images: image ${n} not supported in this environment`)}}(n),n}}const wH={id:"image",module:"images",name:"Images",version:"3.0.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(n,e,t){return jP.apply(this,arguments)},tests:[n=>Boolean(VP(new DataView(n)))],options:{image:{type:"auto",decode:!0}}},t_e={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(n){const e=n[0],t=n[n.length-1];return"{"===e&&"}"===t||"["===e&&"]"===t},parseTextSync:JSON.parse},Eb="8.5.8",qS=Zi.CO.deck&&Zi.CO.deck.VERSION;if(qS&&qS!==Eb)throw new Error("deck.gl - multiple versions detected: ".concat(qS," vs ").concat(Eb));qS||(Zn.log(1,"deck.gl ".concat(Eb))(),Zi.CO.deck=Object.assign(Zi.CO.deck||{},{VERSION:Eb,version:Eb,log:Zn,_registerLoggers:function(n){hI=n}}),W5([t_e,[wH,{imagebitmap:{premultiplyAlpha:"none"}}]]));const n_e=Zi.CO.deck;class YS extends qu{static isSupported(e,t=[]){const i=Mn(e),r=Nz(e,"TIMER_QUERY");let s=i||r;for(const o of t)switch(o){case"queries":s=s&&i;break;case"timers":s=s&&r;break;default:Qe(!1)}return s}constructor(e,t={}){super(e,t),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery({conservative:e=!1}={}){return this.begin(e?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(e){return this._queryPending||(this.target=e,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const e=this.gl2.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((i,r)=>{const s=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):t++>e?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(s)};requestAnimationFrame(s)}),this._pollingPromise}_createHandle(){return YS.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const EH=(0,Zi.jU)()&&"undefined"!=typeof document;let h_e=0;class f_e{constructor(e={}){const{onCreateContext:t=(v=>_z(v)),onAddHTML:i=null,onInitialize:r=(()=>{}),onRender:s=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:l=null,glOptions:c={},debug:d=!1,createFramebuffer:f=!1,autoResizeViewport:p=!0,autoResizeDrawingBuffer:g=!0,stats:_=qf.get("animation-loop-"+h_e++)}=e;let{useDevicePixels:y=!0}=e;"useDevicePixelRatio"in e&&(ct.deprecated("useDevicePixelRatio","useDevicePixels")(),y=e.useDevicePixelRatio),this.props={onCreateContext:t,onAddHTML:i,onInitialize:r,onRender:s,onFinalize:o,onError:a,gl:l,glOptions:c,debug:d,createFramebuffer:f},this.gl=l,this.needsRedraw=null,this.timeline=null,this.stats=_,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:p,autoResizeDrawingBuffer:g,useDevicePixels:y}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(e){return Qe("string"==typeof e),this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}start(e={}){if(this._running)return this;this._running=!0;const t=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(e),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=YS.isSupported(this.gl,["timers"])?new YS(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(i=>{this._running&&(this._addCallbackData(i||{}),!1!==i&&this._startLoop())});return this.props.onError&&t.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}toDataURL(){var e=this;return un(function*(){return e.setNeedsRedraw("toDataURL"),yield e.waitForRender(),e.gl.canvas.toDataURL()})()}isContextLost(){return this.gl.isContextLost()}onCreateContext(...e){return this.props.onCreateContext(...e)}onInitialize(...e){return this.props.onInitialize(...e)}onRender(...e){return this.props.onRender(...e)}onFinalize(...e){return this.props.onFinalize(...e)}getHTMLControlValue(e,t=1){const i=document.getElementById(e);return i?Number(i.value):t}setViewParameters(){return ct.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const e=()=>{!this._running||(this.redraw(),this._animationFrameId=this._requestAnimationFrame(e))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(e)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=EH?new Promise((e,t)=>{EH&&"complete"===document.readyState?e(document):window.addEventListener("load",()=>{e(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_cancelAnimationFrame(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(n):clearTimeout(n)}(e)}_requestAnimationFrame(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):function(n){return"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(n):setTimeout(n,1e3/60)}(e)}_renderFrame(...e){this.display?this.display._renderFrame(...e):this.onRender(...e)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:e,height:t,aspect:i}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(e){"object"==typeof e&&null!==e&&(this.animationProps=Object.assign({},this.animationProps,e))}_createWebGLContext(e){if(this.offScreen=e.canvas&&"undefined"!=typeof OffscreenCanvas&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?GO(this.props.gl,e):this.onCreateContext(e),!lS(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(function(n){Wu(n,zO)})(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(t);const i=this.props.onAddHTML(t);i&&(t.innerHTML=i)}}_getSizeAndAspect(){const e=this.gl.drawingBufferWidth,t=this.gl.drawingBufferHeight;let i=1;const{canvas:r}=this.gl;return r&&r.clientHeight?i=r.clientWidth/r.clientHeight:e>0&&t>0&&(i=e/t),{width:e,height:t,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&function(n,e={}){if(n.canvas)return void function(n,e,t){let i="width"in t?t.width:n.canvas.clientWidth,r="height"in t?t.height:n.canvas.clientHeight;(!i||!r)&&(ct.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=n.canvas.width||1,r=n.canvas.height||1),n.luma=n.luma||{},n.luma.canvasSizeInfo=n.luma.canvasSizeInfo||{};const s=n.luma.canvasSizeInfo;if(s.clientWidth!==i||s.clientHeight!==r||s.devicePixelRatio!==e){let o=e;const a=Math.floor(i*o),l=Math.floor(r*o);n.canvas.width=a,n.canvas.height=l,(n.drawingBufferWidth!==a||n.drawingBufferHeight!==l)&&(ct.warn("Device pixel ratio clamped")(),o=Math.min(n.drawingBufferWidth/i,n.drawingBufferHeight/r),n.canvas.width=Math.floor(i*o),n.canvas.height=Math.floor(r*o)),Object.assign(n.luma.canvasSizeInfo,{clientWidth:i,clientHeight:r,devicePixelRatio:e})}}(n,function(n){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(n)?n<=0?1:n:n?e:1}(e.useDevicePixels),e);const t=n.getExtension("STACKGL_resize_drawingbuffer");t&&"width"in e&&"height"in e&&t.resize(e.width,e.height)}(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new is(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:e}=this.gl;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}_onMouseleave(e){this.animationProps._mousePosition=null}}var p_e=Ve(524),XS=Ve.n(p_e);const g_e={mousedown:1,mousemove:2,mouseup:4};(function(n){const e=n.prototype.handler;n.prototype.handler=function(i){const r=this.store;i.button>0&&"pointerdown"===i.type&&(function(n,e){for(let t=0;t=0&&(this.pressed=!0),2&i&&0===t.which&&(i=4),this.pressed&&(4&i&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}}(XS().MouseInput);const v_e=XS().Manager,eu=XS(),b_e=eu?[[eu.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[eu.Rotate,{enable:!1}],[eu.Pinch,{enable:!1}],[eu.Swipe,{enable:!1}],[eu.Pan,{threshold:0,enable:!1}],[eu.Press,{enable:!1}],[eu.Tap,{event:"doubletap",taps:2,enable:!1}],[eu.Tap,{event:"anytap",enable:!1}],[eu.Tap,{enable:!1}]]:null,xH={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},C_e={doubletap:["tap"]},w_e={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},zP={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},E_e={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},TH={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},S_e="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",Am="undefined"!=typeof window?window:global;"undefined"!=typeof global?global:window,"undefined"!=typeof document&&document;let AH=!1;try{const n={get passive(){return AH=!0,!0}};Am.addEventListener("test",n,n),Am.removeEventListener("test",n,n)}catch(n){}const M_e=-1!==S_e.indexOf("firefox"),{WHEEL_EVENTS:x_e}=zP,OH=4.000244140625;class D_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.events=x_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent,!!AH&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(e){if(!this.options.enable)return;let t=e.deltaY;Am.WheelEvent&&(M_e&&e.deltaMode===Am.WheelEvent.DOM_DELTA_PIXEL&&(t/=Am.devicePixelRatio),e.deltaMode===Am.WheelEvent.DOM_DELTA_LINE&&(t*=40));const i={x:e.clientX,y:e.clientY};0!==t&&t%OH==0&&(t=Math.floor(t/OH)),e.shiftKey&&t&&(t*=.25),this._onWheel(e,-t,i)}_onWheel(e,t,i){this.callback({type:"wheel",center:i,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const{MOUSE_EVENTS:O_e}=zP,IH="pointermove",PH="pointerover",RH="pointerout",kH="pointerleave";class I_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.pressed=!1,this.options=Object.assign({enable:!0},i),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=O_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===IH&&(this.enableMoveEvent=t),e===PH&&(this.enableOverEvent=t),e===RH&&(this.enableOutEvent=t),e===kH&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:PH,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:RH,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:kH,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:IH,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const{KEY_EVENTS:P_e}=zP,FH="keydown";class R_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=P_e.concat(i.events||[]),this.handleEvent=this.handleEvent.bind(this),e.tabIndex=i.tabIndex||0,e.style.outline="none",this.events.forEach(r=>e.addEventListener(r,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===FH&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(e){const t=e.target||e.srcElement;"INPUT"===t.tagName&&"text"===t.type||"TEXTAREA"===t.tagName||(this.enableDownEvent&&"keydown"===e.type&&this.callback({type:FH,srcEvent:e,key:e.key,target:e.target}),this.enableUpEvent&&"keyup"===e.type&&this.callback({type:"keyup",srcEvent:e,key:e.key,target:e.target}))}}const LH="contextmenu";class k_e{constructor(e,t,i={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},i),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===LH&&(this.options.enable=t)}handleEvent(e){!this.options.enable||this.callback({type:LH,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const F_e={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4},BH={srcElement:"root",priority:0};class q_e{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,i,r=!1,s=!1){const{handlers:o,handlersByElement:a}=this;i&&("object"!=typeof i||i.addEventListener)&&(i={srcElement:i}),i=i?Object.assign({},BH,i):BH;let l=a.get(i.srcElement);l||(l=[],a.set(i.srcElement,l));const c={type:e,handler:t,srcElement:i.srcElement,priority:i.priority};r&&(c.once=!0),s&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let d=l.length-1;for(;d>=0&&!(l[d].priority>=c.priority);)d--;l.splice(d+1,0,c)}remove(e,t){const{handlers:i,handlersByElement:r}=this;for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.type===e&&o.handler===t){i.splice(s,1);const a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=i.some(s=>!s.passive)}handleEvent(e){if(this.isEmpty())return;const t=this._normalizeEvent(e);let i=e.srcEvent.target;for(;i&&i!==t.rootElement;){if(this._emit(t,i),t.handled)return;i=i.parentNode}this._emit(t,"root")}_emit(e,t){const i=this.handlersByElement.get(t);if(i){let r=!1;const s=()=>{e.handled=!0},o=()=>{e.handled=!0,r=!0},a=[];for(let l=0;l{const s=this.manager.get(r);s&&xH[r].forEach(o=>{s.recognizeWith(o)})});for(const r in t.recognizerOptions){const s=this.manager.get(r);if(s){const o=t.recognizerOptions[r];delete o.enable,s.set(o)}}this.wheelInput=new D_e(e,this._onOtherEvent,{enable:!1}),this.moveInput=new I_e(e,this._onOtherEvent,{enable:!1}),this.keyInput=new R_e(e,this._onOtherEvent,{enable:!1,tabIndex:t.tabIndex}),this.contextmenuInput=new k_e(e,this._onOtherEvent,{enable:!1});for(const[r,s]of this.events)s.isEmpty()||(this._toggleRecognizer(s.recognizerName,!0),this.manager.on(r,s.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,i){this._addEventHandler(e,t,i,!1)}once(e,t,i){this._addEventHandler(e,t,i,!0)}watch(e,t,i){this._addEventHandler(e,t,i,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(e,t){const{manager:i}=this;if(!i)return;const r=i.get(e);if(r&&r.options.enable!==t){r.set({enable:t});const s=C_e[e];s&&!this.options.recognizers&&s.forEach(o=>{const a=i.get(o);t?(a.requireFailure(e),r.dropRequireFailure(o)):a.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,t),this.moveInput.enableEventType(e,t),this.keyInput.enableEventType(e,t),this.contextmenuInput.enableEventType(e,t)}_addEventHandler(e,t,i,r,s){if("string"!=typeof e){i=t;for(const d in e)this._addEventHandler(d,e[d],i,r,s);return}const{manager:o,events:a}=this,l=TH[e]||e;let c=a.get(l);c||(c=new q_e(this),a.set(l,c),c.recognizerName=E_e[l]||l,o&&o.on(l,c.handleEvent)),c.add(e,t,i,r,s),c.isEmpty()||this._toggleRecognizer(c.recognizerName,!0)}_removeEventHandler(e,t){if("string"!=typeof e){for(const o in e)this._removeEventHandler(o,e[o]);return}const{events:i}=this,s=i.get(TH[e]||e);if(s&&(s.remove(e,t),s.isEmpty())){const{recognizerName:o}=s;let a=!1;for(const l of i.values())if(l.recognizerName===o&&!l.isEmpty()){a=!0;break}a||this._toggleRecognizer(o,!1)}}_onBasicInput(e){const{srcEvent:t}=e,i=w_e[t.type];i&&this.manager.emit(i,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}function ep(){}const VH={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:ep,onResize:ep,onViewStateChange:ep,onInteractionStateChange:ep,onBeforeRender:ep,onAfterRender:ep,onLoad:ep,onError:(n,e)=>Zn.error(n)(),_onMetrics:null,getCursor:({isDragging:n})=>n?"grabbing":"grab",debug:!1,drawPickingColors:!1};class ZS{constructor(e){e=J(J({},VH),e),this.props={},this.width=0,this.height=0,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this._needsRedraw=!0,this._pickRequest={},this._lastPointerDownInfo=null,this.viewState=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&Zn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,Zi.qs)()&&Zn.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new WO({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&Qv.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),!this.props.canvas&&!this.props.gl&&this.canvas&&(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Zn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Zn.removed("onLayerClick","onClick")(),e.initialViewState&&!vb(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const t=Object.create(this.props);Object.assign(t,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(t),this.layerManager&&(this.viewManager.setProps(t),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(t),this.effectManager.setProps(t),this.deckRenderer.setProps(t),this.deckPicker.setProps(t)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(e),r=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),o=this.deckRenderer.needsRedraw(e);return t=t||i||r||s||o,t}redraw(e){if(!this.layerManager)return;const t=e||this.needsRedraw({clearRedrawFlags:!0});!t||(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(t):this._drawLayers(t))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){const t=this._pick("pickObject","pickObject Time",e).result;return t.length?t[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,i){const{stats:r}=this;r.get("Pick Count").incrementCount(),r.get(t).timeStart();const s=this.deckPicker[e](J({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport},i));return r.get(t).timeEnd(),s}_createCanvas(e){let t=e.canvas;return"string"==typeof t&&(t=document.getElementById(t),ic(t)),t||(t=document.createElement("canvas"),t.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(t)),Object.assign(t.style,e.style),t}_setCanvasSize(e){if(!this.canvas)return;let{width:t,height:i}=e;(t||0===t)&&(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.width=t),(i||0===i)&&(i=Number.isFinite(i)?"".concat(i,"px"):i,this.canvas.style.position="absolute",this.canvas.style.height=i)}_updateCanvasSize(){if(this._checkForCanvasSizeChange()){const{width:e,height:t}=this;this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height})}}_checkForCanvasSizeChange(){const{canvas:e}=this;if(!e)return!1;const t=e.clientWidth||e.width,i=e.clientHeight||e.height;return(t!==this.width||i!==this.height)&&(this.width=t,this.height=i,!0)}_createAnimationLoop(e){const{width:t,height:i,gl:r,glOptions:s,debug:o,onError:a,onBeforeRender:l,onAfterRender:c,useDevicePixels:d,autoResizeDrawingBuffer:f}=e;return new f_e({width:t,height:i,useDevicePixels:d,autoResizeDrawingBuffer:f,autoResizeViewport:!1,gl:r,onCreateContext:p=>_z(an(J(J({},s),p),{canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()})),onInitialize:p=>this._setGLContext(p.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new yme({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const{_pickRequest:t}=this;if("pointerleave"===e.type)t.x=-1,t.y=-1,t.radius=0;else{if(e.leftButton||e.rightButton)return;{const i=e.offsetCenter;if(!i)return;t.x=i.x,t.y=i.y,t.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:t.x,y:t.y}),t.event=e,t.mode="hover"}_pickAndCallback(){const{_pickRequest:e}=this;if(e.event){const{result:t,emptyInfo:i}=this._pick("pickObject","pickObject Time",e);this.interactiveState.isHovering=t.length>0;let r=i,s=!1;for(const o of t)r=o,s=o.layer.onHover(o,e.event);if(!s&&this.props.onHover&&this.props.onHover(r,e.event),this.props.getTooltip){const o=this.props.getTooltip(r);this.tooltip.setTooltip(o,r.x,r.y)}e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.interactiveState))}_setGLContext(e){if(this.layerManager)return;this.canvas||(this.canvas=e.canvas,GO(e,{enable:!0,copyState:!0})),this.tooltip=new Ime(this.canvas),Wu(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);const t=new aH;t.play(),this.animationLoop.attachTimeline(t),this.eventManager=new X_e(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const r in tz)this.eventManager.on(r,this._onEvent);this.viewManager=new pme({timeline:t,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new fme(e,{deck:this,stats:this.stats,viewport:i,timeline:t}),this.effectManager=new bme,this.deckRenderer=new Eme(e),this.deckPicker=new Dme(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,t){const{gl:i}=this.layerManager.context;Wu(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(J({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:e,effects:this.effectManager.getEffects()},t)),this.props.onAfterRender({gl:i})}_onRenderFrame(e){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),Zn.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(!1),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const t=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=an(J({},this.viewState),{[e.viewId]:t}),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.interactiveState.isDragging=e.isDragging,this.props.onInteractionStateChange(e)}_onEvent(e){const t=tz[e.type],i=e.offsetCenter;if(!t||!i)return;const r=this.layerManager.getLayers(),s=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:r,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=s,a=o&&(o[t.handler]||o.props[t.handler]),l=this.props[t.handler];let c=!1;a&&(c=a.call(o,s,e)),!c&&l&&l(s,e)}_onPointerDown(e){const t=e.offsetCenter;this._lastPointerDownInfo=this.pickObject({x:t.x,y:t.y,radius:this.props.pickingRadius})}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const t=this.animationLoop.stats;e.get("GPU Time").addTime(t.get("GPU Time").lastTiming),e.get("CPU Time").addTime(t.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:t}=this;e.fps=t.get("frameRate").getHz(),e.setPropsTime=t.get("setProps Time").time,e.updateAttributesTime=t.get("Update Attributes").time,e.framesRedrawn=t.get("Redraw Count").count,e.pickTime=t.get("pickObject Time").time+t.get("pickMultipleObjects Time").time+t.get("pickObjects Time").time,e.pickCount=t.get("Pick Count").count,e.gpuTime=t.get("GPU Time").time,e.cpuTime=t.get("CPU Time").time,e.gpuTimePerFrame=t.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=t.get("CPU Time").getAverageTime();const i=qf.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}ZS.getPropTypes=function(n){return{id:n.string,width:n.oneOfType([n.number,n.string]),height:n.oneOfType([n.number,n.string]),layers:n.oneOfType([n.object,n.array]),layerFilter:n.func,views:n.oneOfType([n.object,n.array]),viewState:n.object,effects:n.arrayOf(n.instanceOf(rH)),controller:n.oneOfType([n.func,n.bool,n.object]),gl:n.object,glOptions:n.object,parameters:n.object,pickingRadius:n.number,useDevicePixels:n.oneOfType([n.bool,n.number]),touchAction:n.string,eventRecognizerOptions:n.object,onWebGLInitialized:n.func,onResize:n.func,onViewStateChange:n.func,onInteractionStateChange:n.func,onBeforeRender:n.func,onAfterRender:n.func,onLoad:n.func,onError:n.func,debug:n.bool,drawPickingColors:n.bool,_framebuffer:n.object,_animate:n.bool,_pickable:n.bool,_typedArrayManagerProps:n.object}},ZS.defaultProps=VH,ZS.VERSION=n_e.VERSION;const jH={name:"project32",dependencies:[AP],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},UH="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",Q_e={lightSources:{}};function GP({color:n=[0,0,0],intensity:e=1}={}){return n.map(t=>t*e/255)}const WP={name:"lights",vs:UH,fs:UH,getUniforms:function zH(n=Q_e){if("lightSources"in n){const{ambientLight:e,pointLights:t,directionalLights:i}=n.lightSources||{};return e||t&&t.length>0||i&&i.length>0?Object.assign({},function({ambientLight:n,pointLights:e=[],directionalLights:t=[]}){const i={};return i["lighting_uAmbientLight.color"]=n?GP(n):[0,0,0],e.forEach((r,s)=>{i[`lighting_uPointLight[${s}].color`]=GP(r),i[`lighting_uPointLight[${s}].position`]=r.position,i[`lighting_uPointLight[${s}].attenuation`]=r.attenuation||[1,0,0]}),i.lighting_uPointLightCount=e.length,t.forEach((r,s)=>{i[`lighting_uDirectionalLight[${s}].color`]=GP(r),i[`lighting_uDirectionalLight[${s}].direction`]=r.direction}),i.lighting_uDirectionalLightCount=t.length,i}({ambientLight:e,pointLights:t,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in n){const e={pointLights:[],directionalLights:[]};for(const t of n.lights||[])switch(t.type){case"ambient":e.ambientLight=t;break;case"directional":e.directionalLights.push(t);break;case"point":e.pointLights.push(t)}return zH({lightSources:e})}return{}},defines:{MAX_LIGHTS:3}},eye={};const nye={name:"phong-lighting",dependencies:[WP],fs:"\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n",defines:{LIGHTING_FRAGMENT:1},getUniforms:function(n=eye){if(!("material"in n))return{};const{material:e}=n;return e?function(n){const{ambient:e=.35,diffuse:t=.6,shininess:i=32,specularColor:r=[30,30,30]}=n;return{lighting_uAmbient:e,lighting_uDiffuse:t,lighting_uShininess:i,lighting_uSpecularColor:r.map(s=>s/255)}}(e):{lighting_uEnabled:!1}}},rye={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1},GH=J({inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}}},{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(n=rye){const e={};if(void 0!==n.pickingSelectedColor)if(n.pickingSelectedColor){const t=n.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=t}else e.picking_uSelectedColorValid=0;if(n.pickingHighlightColor){const t=Array.from(n.pickingHighlightColor,i=>i/255);Number.isFinite(t[3])||(t[3]=1),e.picking_uHighlightColor=t}return void 0!==n.pickingActive&&(e.picking_uActive=Boolean(n.pickingActive),e.picking_uAttribute=Boolean(n.pickingAttribute)),e}}),WH={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class QS{static get DRAW_MODE(){return WH}constructor(e={}){const{id:t=Wc("geometry"),drawMode:i=WH.TRIANGLES,attributes:r={},indices:s=null,vertexCount:o=null}=e;this.id=t,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?J({indices:this.indices},this.attributes):this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){t&&(this.indices=ArrayBuffer.isView(t)?{value:t,size:1}:t);for(const i in e){let r=e[i];r=ArrayBuffer.isView(r)?{value:r}:r,Qe(ArrayBuffer.isView(r.value),`${this._print(i)}: must be typed array or object with value as typed array`),("POSITION"===i||"positions"===i)&&!r.size&&(r.size=3),"indices"===i?(Qe(!this.indices),this.indices=r):this.attributes[i]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const r in e){const s=e[r],{value:o,size:a,constant:l}=s;!l&&o&&a>=1&&(i=Math.min(i,o.length/a))}return Qe(Number.isFinite(i)),i}}const qP=Math.PI/180,JS=new Float32Array(16),qH=new Float32Array(12);function YH(n,e,t){const i=e[0]*qP,r=e[1]*qP,s=e[2]*qP,o=Math.sin(s),a=Math.sin(i),l=Math.sin(r),c=Math.cos(s),d=Math.cos(i),f=Math.cos(r),p=t[0],g=t[1],_=t[2];n[0]=p*f*d,n[1]=p*l*d,n[2]=p*-a,n[3]=g*(-l*c+f*a*o),n[4]=g*(f*c+l*a*o),n[5]=g*d*o,n[6]=_*(l*o+f*a*c),n[7]=_*(-f*o+l*a*c),n[8]=_*d*c}function XH(n){return n[0]=n[0],n[1]=n[1],n[2]=n[2],n[3]=n[4],n[4]=n[5],n[5]=n[6],n[6]=n[8],n[7]=n[9],n[8]=n[10],n[9]=n[12],n[10]=n[13],n[11]=n[14],n.subarray(0,12)}const KH={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:t}){const{data:i,getOrientation:r,getScale:s,getTranslation:o,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,d=Array.isArray(s),f=Array.isArray(r),p=Array.isArray(o),g=c||!l&&Boolean(a(i[0]));n.constant=g?c:f&&d&&p;const _=n.value;if(n.constant){let y;g?(JS.set(a),y=XH(JS)):(y=qH,YH(y,r,s),y.set(o,9)),n.value=new Float32Array(y)}else{let y=e*n.size;const{iterable:v,objectInfo:w}=Xz(i,e,t);for(const C of v){let x;w.index++,g?(JS.set(c?a:a(C,w)),x=XH(JS)):(x=qH,YH(x,f?r:r(C,w),d?s:s(C,w)),x.set(p?o:o(C,w),9)),_[y++]=x[0],_[y++]=x[1],_[y++]=x[2],_[y++]=x[3],_[y++]=x[4],_[y++]=x[5],_[y++]=x[6],_[y++]=x[7],_[y++]=x[8],_[y++]=x[9],_[y++]=x[10],_[y++]=x[11]}}}};function ZH(n,e){return e===Hn.CARTESIAN||e===Hn.METER_OFFSETS||e===Hn.DEFAULT&&!n.isGeospatial}function QH(n,e){(n.COLOR_0||n.colors)&&e||(n.colors={constant:!0,value:new Float32Array([1,1,1])}),Zn.assert(n.positions||n.POSITION,'no "postions" or "POSITION" attribute in mesh')}function lye(n,e){if(n.attributes)return QH(n.attributes,e),n instanceof QS?n:new QS(n);if(n.positions||n.POSITION)return QH(n,e),new QS({attributes:n});throw Error("Invalid mesh")}const cye={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};let uye=(()=>{class n extends SP{getShaders(){const t=!Mn(this.context.gl),i={};return nI(this.context.gl,"GLSL_DERIVATIVES")&&(i.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[jH,nye,GH],transpileToGLSL100:t,defines:i})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:KH}),this.setState({emptyTexture:new xa(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:t,oldProps:i,changeFlags:r}){if(super.updateState({props:t,oldProps:i,changeFlags:r}),t.mesh!==i.mesh||r.extensionsChanged){var s;if(null===(s=this.state.model)||void 0===s||s.delete(),t.mesh){this.state.model=this.getModel(t.mesh);const o=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(o.NORMAL||o.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&this.setTexture(t.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:r,coordinateSystem:s,_instanced:o}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:r,composeModelMatrix:!o||ZH(i,s),flatShading:!this.state.hasNormals}).draw()}getModel(t){const i=new SS(this.context.gl,an(J({},this.getShaders()),{id:this.props.id,geometry:lye(t,this.props._useMeshColors),isInstanced:!0})),{texture:r}=this.props,{emptyTexture:s}=this.state;return i.setUniforms({sampler:r||s,hasTexture:Boolean(r)}),i}setTexture(t){const{emptyTexture:i,model:r}=this.state;null==r||r.setUniforms({sampler:t||i,hasTexture:Boolean(t)})}}return n.layerName="SimpleMeshLayer",n.defaultProps=cye,n})();const JH={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[WP]};class Dm{constructor(e={}){const{id:t}=e;this.id=t||Wc(this.constructor.name),this.display=!0,this.position=new Js,this.rotation=new Js,this.scale=new Js(1,1,1),this.matrix=new Lt,this.userData={},this.props={},this._setScenegraphNodeProps(e)}delete(){}setProps(e){return this._setScenegraphNodeProps(e),this}toString(){return`{type: ScenegraphNode, id: ${this.id})}`}setPosition(e){return Qe(3===e.length,"setPosition requires vector argument"),this.position=e,this}setRotation(e){return Qe(3===e.length,"setRotation requires vector argument"),this.rotation=e,this}setScale(e){return Qe(3===e.length,"setScale requires vector argument"),this.scale=e,this}setMatrix(e,t=!0){t?this.matrix.copy(e):this.matrix=e}setMatrixComponents({position:e,rotation:t,scale:i,update:r=!0}){return e&&this.setPosition(e),t&&this.setRotation(t),i&&this.setScale(i),r&&this.updateMatrix(),this}updateMatrix(){const e=this.position,t=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(t),this.matrix.scale(i),this}update(e={}){const{position:t,rotation:i,scale:r}=e;return t&&this.setPosition(t),i&&this.setRotation(i),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(e,t){Qe(e),t=t||this.matrix;const i=new Lt(e).multiplyRight(t),r=i.invert(),s=r.transpose();return{viewMatrix:e,modelMatrix:t,objectMatrix:t,worldMatrix:i,worldInverseMatrix:r,worldInverseTransposeMatrix:s}}_setScenegraphNodeProps(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}class Sb extends Dm{constructor(e={}){e=Array.isArray(e)?{children:e}:e;const{children:t=[]}=e;ct.assert(t.every(i=>i instanceof Dm),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children,i=t.indexOf(e);return i>-1&&t.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(e=>e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new Lt}={}){const i=new Lt(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof Sb?r.traverse(e,{worldMatrix:i}):e(r,{worldMatrix:i})}}function e8(){var n=new ta(4);return ta!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function t8(n,e,t){t*=.5;var i=Math.sin(t);return n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=Math.cos(t),n}function n8(n,e,t){var i=e[0],r=e[1],s=e[2],o=e[3],a=t[0],l=t[1],c=t[2],d=t[3];return n[0]=i*d+o*a+r*c-s*l,n[1]=r*d+o*l+s*a-i*c,n[2]=s*d+o*c+i*l-r*a,n[3]=o*d-i*a-r*l-s*c,n}var r8=Y4,Mye=function(){var n=Vz(),e=jz(1,0,0),t=jz(0,1,0);return function(i,r,s){var o=Uz(r,s);return o<-.999999?(fS(n,e,r),function(n){return Math.hypot(n[0],n[1],n[2])}(n)<1e-6&&fS(n,t,r),function(n,e){var t=e[0],i=e[1],r=e[2],s=t*t+i*i+r*r;s>0&&(s=1/Math.sqrt(s)),n[0]=e[0]*s,n[1]=e[1]*s,n[2]=e[2]*s}(n,n),t8(i,n,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(fS(n,r,s),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=1+o,function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),n[0]=t*o,n[1]=i*o,n[2]=r*o,n[3]=s*o,n}(i,i))}}();e8(),e8(),function(){var n=new ta(9);ta!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1}();const xye=[0,0,0,1],Aye={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Dye={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function a8(n){if(!n._animation){const e=Dye[n.componentType],t=Aye[n.type],i=t*n.count,{buffer:r,byteOffset:s}=n.bufferView.data,o=new e(r,s+(n.byteOffset||0),i);if(1===t)n._animation=Array.from(o);else{const a=[];for(let l=0;l0)i=Math.sqrt(t+1),n[3]=.5*i,n[0]=(e[5]-e[7])*(i=.5/i),n[1]=(e[6]-e[2])*i,n[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,o=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*o+o]+1),n[r]=.5*i,n[3]=(e[3*s+o]-e[3*o+s])*(i=.5/i),n[s]=(e[3*s+r]+e[3*r+s])*i,n[o]=(e[3*o+r]+e[3*r+o])*i}}(this,e),this.check()}identity(){return function(n){n[0]=0,n[1]=0,n[2]=0,n[3]=1}(this),this.check()}fromAxisRotation(e,t){return t8(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=ks(e)}get y(){return this[1]}set y(e){this[1]=ks(e)}get z(){return this[2]}set z(e){this[2]=ks(e)}get w(){return this[3]}set w(e){this[3]=ks(e)}len(){return function(n){return Math.hypot(n[0],n[1],n[2],n[3])}(this)}lengthSquared(){return function(n){var e=n[0],t=n[1],i=n[2],r=n[3];return e*e+t*t+i*i+r*r}(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]}(this,e)}rotationTo(e,t){return Mye(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return function(n,e,t){n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3]}(this,this,e),this.check()}calculateW(){return function(n,e){var t=e[0],i=e[1],r=e[2];n[0]=t,n[1]=i,n[2]=r,n[3]=Math.sqrt(Math.abs(1-t*t-i*i-r*r))}(this,this),this.check()}conjugate(){return function(n,e){n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=e[3]}(this,this),this.check()}invert(){return function(n,e){var t=e[0],i=e[1],r=e[2],s=e[3],o=t*t+i*i+r*r+s*s,a=o?1/o:0;n[0]=-t*a,n[1]=-i*a,n[2]=-r*a,n[3]=s*a}(this,this),this.check()}lerp(e,t,i){return function(n,e,t,i){var r=e[0],s=e[1],o=e[2],a=e[3];n[0]=r+i*(t[0]-r),n[1]=s+i*(t[1]-s),n[2]=o+i*(t[2]-o),n[3]=a+i*(t[3]-a)}(this,e,t,i),this.check()}multiplyRight(e,t){return Xu(!t),n8(this,this,e),this.check()}multiplyLeft(e,t){return Xu(!t),n8(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+o*a,n[1]=r*l+s*a,n[2]=s*l-r*a,n[3]=o*l-i*a}(this,this,e),this.check()}rotateY(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l-s*a,n[1]=r*l+o*a,n[2]=s*l+i*a,n[3]=o*l-r*a}(this,this,e),this.check()}rotateZ(e){return function(n,e,t){t*=.5;var i=e[0],r=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);n[0]=i*l+r*a,n[1]=r*l-i*a,n[2]=s*l+o*a,n[3]=o*l-s*a}(this,this,e),this.check()}scale(e){return r8(this,this,e),this.check()}slerp(e,t,i){switch(arguments.length){case 1:({start:e=xye,target:t,ratio:i}=arguments[0]);break;case 2:[t,i]=arguments,e=this}return function(n,e,t,i){var p,g,_,y,v,r=e[0],s=e[1],o=e[2],a=e[3],l=t[0],c=t[1],d=t[2],f=t[3];(g=r*l+s*c+o*d+a*f)<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>Vi?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-i)*p)/_,v=Math.sin(i*p)/_):(y=1-i,v=i),n[0]=y*r+v*l,n[1]=y*s+v*c,n[2]=y*o+v*d,n[3]=y*a+v*f}(this,e,t,i),this.check()}transformVector4(e,t=e){return function(n,e,t){var i=e[0],r=e[1],s=e[2],o=t[0],a=t[1],l=t[2],c=t[3],d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;n[0]=d*c+g*-o+f*-l-p*-a,n[1]=f*c+g*-a+p*-o-d*-l,n[2]=p*c+g*-l+d*-a-f*-o,n[3]=e[3]}(t,e,this),hS(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}};class Nye{constructor(e){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}animate(e){if(!this.playing)return;const i=(e/1e3-this.startTime)*this.speed;this.channels.forEach(({sampler:r,target:s,path:o})=>{(function(n,{input:e,interpolation:t,output:i},r,s){const a=n%e[e.length-1],l=e.findIndex(p=>p>=a),c=Math.max(0,l-1);if(!Array.isArray(r[s]))switch(s){case"translation":r[s]=[0,0,0];break;case"rotation":r[s]=[0,0,0,1];break;case"scale":r[s]=[1,1,1];break;default:ct.warn(`Bad animation path ${s}`)()}Qe(r[s].length===i[c].length);const d=e[c],f=e[l];switch(t){case"STEP":!function(n,e,t){for(let i=0;id&&function(n,e,t,i,r){if("rotation"===e){YP.slerp({start:t,target:i,ratio:r});for(let s=0;sd&&function(n,e,{p0:t,outTangent0:i,inTangent1:r,p1:s,tDiff:o,ratio:a}){for(let l=0;l{const r=t.name||`Animation-${i}`,s=t.samplers.map(({input:a,interpolation:l="LINEAR",output:c})=>({input:a8(e.accessors[a]),interpolation:l,output:a8(e.accessors[c])})),o=t.channels.map(({sampler:a,target:l})=>({sampler:s[a],target:e.nodes[l.node],path:l.path}));return new Nye({name:r,channels:o})})}animate(e){this.setTime(e)}setTime(e){this.animations.forEach(t=>t.animate(e))}getAnimations(){return this.animations}}class Bye extends Dm{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof SS?(this.model=e,this._setModelNodeProps(t)):this.model=new SS(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}class Vye{constructor(e,{attributes:t,material:i,pbrDebug:r,imageBasedLightingEnvironment:s,lights:o,useTangents:a}){this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},nI(e,"GLSL_TEXTURE_LOD")&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(t.NORMAL,"HAS_NORMALS"),this.defineIfPresent(t.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(t.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(o,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),i&&this.parseMaterial(i)}defineIfPresent(e,t){e&&(this.defines[t]=1)}parseTexture(e,t,i=null){const s=e.texture.source.image;let o,a={};s.compressed?(o=s,a={[this.gl.TEXTURE_MIN_FILTER]:s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:s};const l=new xa(this.gl,J({id:e.name||e.id,parameters:J(J({},e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{}),a),pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1}},o));this.uniforms[t]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:t=1,roughnessFactor:i=1}=e;this.uniforms.u_MetallicRoughnessValues=[t,i]}parseMaterial(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:t=1}=e.normalTexture;this.uniforms.u_NormalScale=t}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:t=1}=e.occlusionTexture;this.uniforms.u_OcclusionStrength=t}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),"MASK"===e.alphaMode){const{alphaCutoff:t=.5}=e;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=t}else"BLEND"===e.alphaMode&&(ct.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}}function l8(n,e){return Mn(n)?`#version 300 es\n${e}`:e}const Hye={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$ye={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class Gye{constructor(e,t={}){this.gl=e,this.options=Object.assign({},$ye,t)}instantiate(e){return this.gltf=e,(e.scenes||[]).map(i=>this.createScene(i))}createAnimator(){return Array.isArray(this.gltf.animations)?new Lye(this.gltf):null}createScene(e){const i=(e.nodes||[]).map(s=>this.createNode(s));return new Sb({id:e.name||e.id,children:i})}createNode(e){if(!e._node){const i=(e.children||[]).map(s=>this.createNode(s));e.mesh&&i.push(this.createMesh(e.mesh));const r=new Sb({id:e.name||e.id,children:i});if(e.matrix)r.setMatrix(e.matrix);else{if(r.matrix.identity(),e.translation&&r.matrix.translate(e.translation),e.rotation){const s=(new Lt).fromQuaternion(e.rotation);r.matrix.multiplyRight(s)}e.scale&&r.matrix.scale(e.scale)}e._node=r}return e._node}createMesh(e){if(!e._mesh){const i=(e.primitives||[]).map((s,o)=>this.createPrimitive(s,o,e)),r=new Sb({id:e.name||e.id,children:i});e._mesh=r}return e._mesh}getVertexCount(e){ct.warn("getVertexCount() not found")()}createPrimitive(e,t,i){return function(n,e){const{id:t,drawMode:i,vertexCount:r,attributes:s,modelOptions:o}=e,a=new Vye(n,e);ct.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(s).map(d=>d.buffer));const c=new Bye(n,Object.assign({id:t,drawMode:i,vertexCount:r,modules:[JH],defines:a.defines,parameters:a.parameters,vs:l8(n,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:l8(n,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l},o));return c.setProps({attributes:s}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:e.name||`${i.name||i.id}-primitive-${t}`,drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options))}createAttributes(e,t){const i={};return Object.keys(e).forEach(r=>{i[r]=this.createAccessor(e[r],this.createBuffer(e[r],this.gl.ARRAY_BUFFER))}),t&&(i.indices=this.createAccessor(t,this.createBuffer(t,this.gl.ELEMENT_ARRAY_BUFFER))),ct.info(4,"glTF Attributes",{attributes:e,indices:t,generated:i})(),i}createBuffer(e,t){e.bufferView||(e.bufferView={});const{bufferView:i}=e;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[t]||(i.lumaBuffers[t]=new Si(this.gl,{id:`from-${i.id}`,data:i.data||e.value,target:t})),i.lumaBuffers[t]}createAccessor(e,t){return new ea({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Hye[e.type]})}createSampler(e){return e}needsPOT(){return!1}}function c8(n,e,t){if(n.byteLength<=e+t)return"";const i=new DataView(n);let r="";for(let s=0;st[r.name]);return new Om(i,this.metadata)}selectAt(...e){const t=e.map(i=>this.fields[i]).filter(Boolean);return new Om(t,this.metadata)}assign(e){let t,i=this.metadata;if(e instanceof Om){const o=e;t=o.fields,i=f8(f8(new Map,this.metadata),o.metadata)}else t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const o of t)r[o.name]=o;const s=Object.values(r);return new Om(s,i)}}function f8(n,e){return new Map([...n||new Map,...e||new Map])}let ar,p8,g8,m8,_8,y8,v8,b8;!function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"}(ar||(ar={}));class XP{static isNull(e){return e&&e.typeId===ar.Null}static isInt(e){return e&&e.typeId===ar.Int}static isFloat(e){return e&&e.typeId===ar.Float}static isBinary(e){return e&&e.typeId===ar.Binary}static isUtf8(e){return e&&e.typeId===ar.Utf8}static isBool(e){return e&&e.typeId===ar.Bool}static isDecimal(e){return e&&e.typeId===ar.Decimal}static isDate(e){return e&&e.typeId===ar.Date}static isTime(e){return e&&e.typeId===ar.Time}static isTimestamp(e){return e&&e.typeId===ar.Timestamp}static isInterval(e){return e&&e.typeId===ar.Interval}static isList(e){return e&&e.typeId===ar.List}static isStruct(e){return e&&e.typeId===ar.Struct}static isUnion(e){return e&&e.typeId===ar.Union}static isFixedSizeBinary(e){return e&&e.typeId===ar.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===ar.FixedSizeList}static isMap(e){return e&&e.typeId===ar.Map}static isDictionary(e){return e&&e.typeId===ar.Dictionary}get typeId(){return ar.NONE}compareTo(e){return this===e}}Symbol,Symbol,p8=Symbol.toStringTag;class Im extends XP{constructor(e,t){super(),Yt(this,"isSigned",void 0),Yt(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return ar.Int}get[p8](){return"Int"}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}class tve extends Im{constructor(){super(!0,8)}}class nve extends Im{constructor(){super(!0,16)}}class ive extends Im{constructor(){super(!0,32)}}class rve extends Im{constructor(){super(!1,8)}}class sve extends Im{constructor(){super(!1,16)}}class ove extends Im{constructor(){super(!1,32)}}g8=Symbol.toStringTag;class C8 extends XP{constructor(e){super(),Yt(this,"precision",void 0),this.precision=e}get typeId(){return ar.Float}get[g8](){return"Float"}toString(){return`Float${this.precision}`}}class ave extends C8{constructor(){super(32)}}class lve extends C8{constructor(){super(64)}}Symbol,Symbol,m8=Symbol.toStringTag,_8=Symbol.toStringTag,y8=Symbol.toStringTag,v8=Symbol.toStringTag,b8=Symbol.toStringTag;class cve extends XP{constructor(e,t){super(),Yt(this,"listSize",void 0),Yt(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return ar.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[b8](){return"FixedSizeList"}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}class tM{constructor(e,t,i=!1,r=new Map){Yt(this,"name",void 0),Yt(this,"type",void 0),Yt(this,"nullable",void 0),Yt(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=i,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new tM(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return`${this.type}${this.nullable?", nullable":""}${this.metadata?`, metadata: ${this.metadata}`:""}`}}function w8(n,e,t){const i=t?E8(t.metadata):void 0,r=function(n){switch(n.constructor){case Int8Array:return new tve;case Uint8Array:return new rve;case Int16Array:return new nve;case Uint16Array:return new sve;case Int32Array:return new ive;case Uint32Array:return new ove;case Float32Array:return new ave;case Float64Array:return new lve;default:throw new Error("array type not supported")}}(e.value);return new tM(n,new cve(e.size,new tM("value",r)),!1,i)}function E8(n){const e=new Map;for(const t in n)e.set(`${t}.string`,JSON.stringify(n[t]));return e}const S8={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},fve={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class gve{constructor(e){Yt(this,"draco",void 0),Yt(this,"decoder",void 0),Yt(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const r=this.decoder.GetEncodedGeometryType(i),s=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,s);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!s.ptr){const p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}const a=this._getDracoLoaderData(s,r,t),l=this._getMeshData(s,a,t),c=function(n){let e=1/0,t=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;const a=n.POSITION?n.POSITION.value:[],l=a&&a.length;for(let c=0;cr?d:r,s=f>s?f:s,o=p>o?p:o}return[[e,t,i],[r,s,o]]}(l.attributes),d=function(n,e,t){const i=E8(e.metadata),r=[],s=function(n){const e={};for(const t in n){const i=n[t];e[i.name||"undefined"]=i}return e}(e.attributes);for(const o in n){const l=w8(o,n[o],s[o]);r.push(l)}if(t){const o=w8("indices",t);r.push(o)}return new Om(r,i)}(l.attributes,a,l.indices);return an(J({loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c}},l),{schema:d})}finally{this.draco.destroy(i),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,t,i){const r=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,i);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:s}}_getDracoAttributes(e,t){const i={};for(let r=0;rthis.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(a=>o.min_value(a))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:i=[]}=t,r=e.attribute_type();if(i.map(o=>this.decoder[o]).includes(r)){const o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}var nM=Ve(125);const JP={};function eR(n){return tR.apply(this,arguments)}function tR(){return(tR=un(function*(n,e=null,t={}){return e&&(n=bve(n,e,t)),JP[n]=JP[n]||Cve(n),yield JP[n]})).apply(this,arguments)}function bve(n,e,t){if(n.startsWith("http"))return n;const i=t.modules||{};return i[n]?i[n]:tP?t.CDN?(Xc(t.CDN.startsWith("http")),`${t.CDN}/${e}@3.0.12/dist/libs/${n}`):nP?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}function Cve(n){return nR.apply(this,arguments)}function nR(){return(nR=un(function*(n){return n.endsWith("wasm")?yield(yield fetch(n)).arrayBuffer():tP?nP?importScripts(n):wve(yield(yield fetch(n)).text(),n):nM.requireFromFile&&(yield nM.requireFromFile(n))})).apply(this,arguments)}function wve(n,e){if(!tP)return nM.requireFromString&&nM.requireFromString(n,e);if(nP)return eval.call(fpe,n),null;const t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(n))}catch(i){t.text=n}return document.body.appendChild(t),null}const Eve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.js",Sve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_wasm_wrapper.js",Mve="https://www.gstatic.com/draco/versioned/decoders/1.4.1/draco_decoder.wasm";let Mb;function Tve(n){return iR.apply(this,arguments)}function iR(){return(iR=un(function*(n){const e=n.modules||{};return Mb=e.draco3d?Mb||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):Mb||Ave(n),yield Mb})).apply(this,arguments)}function Ave(n){return sR.apply(this,arguments)}function sR(){return(sR=un(function*(n){let e,t;switch(n.draco&&n.draco.decoderType){case"js":e=yield eR(Eve,"draco",n);break;case"wasm":default:[e,t]=yield Promise.all([yield eR(Sve,"draco",n),yield eR(Mve,"draco",n)])}return e=e||globalThis.DracoDecoderModule,yield Dve(e,t)})).apply(this,arguments)}function Dve(n,e){const t={};return e&&(t.wasmBinary=e),new Promise(i=>{n(an(J({},t),{onModuleLoaded:r=>i({draco:r})}))})}const aR=an(J({},h8),{parse:function(n,e){return lR.apply(this,arguments)}});function lR(){return(lR=un(function*(n,e){const{draco:t}=yield Tve(e),i=new gve(t);try{return i.parseSync(n,null==e?void 0:e.draco)}finally{i.destroy()}})).apply(this,arguments)}function Tb(n,e){return Qf(n>=0),Qf(e>0),n+(e-1)&~(e-1)}function Pve(n,e,t){let i;return i=n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer||n.arrayBuffer,n.byteOffset,n.byteLength),e.set(i,t),t+Tb(i.byteLength,4)}const M8=["SCALAR","VEC2","VEC3","VEC4"],Rve=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],kve=new Map(Rve),Fve={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nve={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lve={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function x8(n){return M8[n-1]||M8[0]}function T8(n){const e=kve.get(n.constructor);if(!e)throw new Error("Illegal typed array");return e}function A8(n,e){const t=Lve[n.componentType],i=Fve[n.type],s=n.count*i,o=n.count*i*Nve[n.componentType];return Oa(o>=0&&o<=e.byteLength),{ArrayType:t,length:s,byteLength:o}}const Bve={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class hh{constructor(e){Yt(this,"gltf",void 0),Yt(this,"sourceBuffers",void 0),Yt(this,"byteLength",void 0),this.gltf=e||{json:J({},Bve),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){return this.getUsedExtensions().find(r=>r===e)?(this.json.extensions||{})[e]||!0:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];if(!i)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return i}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=this.gltf.buffers[e.buffer];return Oa(i),new Uint8Array(i.arrayBuffer,(e.byteOffset||0)+i.byteOffset,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:s,length:o}=A8(e,t);return new s(r,t.byteOffset+e.byteOffset,o)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data;return new Uint8Array(r,t.byteOffset||0,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,i){return e.extensions=e.extensions||{},e.extensions[t]=i,this.registerUsedExtension(t),this}setObjectExtension(e,t,i){(e.extensions||{})[t]=i}removeObjectExtension(e,t){const i=e.extensions||{},r=i[t];return delete i[t],r}addExtension(e,t={}){return Oa(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Oa(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:i}=e;this.json.nodes=this.json.nodes||[];const r={mesh:t};return i&&(r.matrix=i),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:i,material:r,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:s}]};if(i){const l=this._addIndices(i);a.primitives[0].indices=l}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,t){const i=VP(e),r=t||(null==i?void 0:i.mimeType),o={bufferView:this.addBufferView(e),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Oa(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const i={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=Tb(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){const i={bufferView:e,type:x8(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const i=this.addBufferView(e);let r={min:t.min,max:t.max};(!r.min||!r.max)&&(r=this._getAccessorMinMax(e,t.size));const s={size:t.size,componentType:T8(e),count:Math.round(e.length/t.size),min:r.min,max:r.max};return this.addAccessor(i,Object.assign(s,t))}addTexture(e){const{imageIndex:t}=e,i={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const i=this.byteLength,r=new ArrayBuffer(i),s=new Uint8Array(r);let o=0;for(const a of this.sourceBuffers||[])o=Pve(a,s,o);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(e,t){let i=!0;for(;i;){const r=e.indexOf(t);r>-1?e.splice(r,1):i=!1}}_addAttributes(e={}){const t={};for(const i in e){const r=e[i],s=this._getGltfAttributeName(i),o=this.addBinaryBuffer(r.value,r);t[s]=o}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const i={min:null,max:null};if(e.length0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Xve(n){for(const e of n.json.meshes||[])for(const t of e.primitives)yield t}function Kve(n){return dR.apply(this,arguments)}function dR(){return(dR=un(function*(n){const e=new hh(n),{json:t}=e;e.removeExtension(rM);for(const i of t.materials||[])i.extensions&&i.extensions.KHR_materials_unlit&&(i.unlit=!0),e.removeObjectExtension(i,rM)})).apply(this,arguments)}function Zve(n){const e=new hh(n),{json:t}=e;if(e.materials)for(const i of t.materials||[])i.unlit&&(delete i.unlit,e.addObjectExtension(i,rM,{}),e.addExtension(rM))}function Qve(n){return hR.apply(this,arguments)}function hR(){return(hR=un(function*(n){const e=new hh(n),{json:t}=e,i=e.getExtension(Pm);i&&(e.json.lights=i.lights,e.removeExtension(Pm));for(const r of t.nodes||[]){const s=e.getObjectExtension(r,Pm);s&&(r.light=s.light),e.removeObjectExtension(r,Pm)}})).apply(this,arguments)}function Jve(n){return fR.apply(this,arguments)}function fR(){return(fR=un(function*(n){const e=new hh(n),{json:t}=e;if(t.lights){const i=e.addExtension(Pm);Oa(!i.lights),i.lights=t.lights,delete t.lights}if(e.json.lights){for(const i of e.json.lights)e.addObjectExtension(i.node,Pm,i);delete e.json.lights}})).apply(this,arguments)}function ebe(n){return pR.apply(this,arguments)}function pR(){return(pR=un(function*(n){const e=new hh(n),{json:t}=e,i=e.getExtension(sM);if(i){const r=nbe(i,e);for(const s of t.materials||[]){const o=e.getObjectExtension(s,sM);o&&(s.technique=Object.assign({},o,r[o.technique]),s.technique.values=ibe(s.technique,e)),e.removeObjectExtension(s,sM)}e.removeExtension(sM)}})).apply(this,arguments)}function tbe(n,e){return gR.apply(this,arguments)}function gR(){return(gR=un(function*(n,e){})).apply(this,arguments)}function nbe(n,e){const{programs:t=[],shaders:i=[],techniques:r=[]}=n,s=new TextDecoder;return i.forEach(o=>{if(!Number.isFinite(o.bufferView))throw new Error("KHR_techniques_webgl: no shader code");o.code=s.decode(e.getTypedArrayForBufferView(o.bufferView))}),t.forEach(o=>{o.fragmentShader=i[o.fragmentShader],o.vertexShader=i[o.vertexShader]}),r.forEach(o=>{o.program=t[o.program]}),r}function ibe(n,e){const t=Object.assign({},n.values);return Object.keys(n.uniforms||{}).forEach(i=>{n.uniforms[i].value&&!(i in t)&&(t[i]=n.uniforms[i].value)}),Object.keys(t).forEach(i=>{"object"==typeof t[i]&&void 0!==t[i].index&&(t[i].texture=e.getTexture(t[i].index))}),t}const I8={KHR_draco_mesh_compression:_t,KHR_materials_unlit:k,KHR_lights_punctual:It,KHR_techniques_webgl:Pt};function rbe(n){return mR.apply(this,arguments)}function mR(){return(mR=un(function*(n,e={},t){for(const r in I8){var i;const s=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};r in s&&!s[r]||(yield I8[r].decode(n,e,t))}})).apply(this,arguments)}const P8={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},obe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class abe{constructor(e){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}normalize(e,t){this.json=e.json;const i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn(`glTF: Unknown version ${i.asset.version}`)}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(n){const e=new hh(n),{json:t}=e;for(const i of t.images||[]){const r=e.removeObjectExtension(i,D8);r&&Object.assign(i,r)}t.buffers&&t.buffers[0]&&delete t.buffers[0].uri,e.removeExtension(D8)}(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in P8)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const i=e[t];if(i&&!Array.isArray(i)){e[t]=[];for(const r in i){const s=i[r];s.id=s.id||r;const o=e[t].length;e[t].push(s),this.idToIndexMap[t][r]=o}}}_convertObjectIdsToArrayIndices(e){for(const t in P8)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:i,indices:r,material:s}=t;for(const o in i)i[o]=this._convertIdToIndex(i[o],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),s&&(t.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(console.warn(`gltf v1: json doesn't contain attribute ${t}`),e[t]=[]);for(const i of e[t])for(const r in i){const o=this._convertIdToIndex(i[r],r);i[r]=o}}_convertIdToIndex(e,t){const i=obe[t];if(i in this.idToIndexMap){const r=this.idToIndexMap[i][e];if(!Number.isFinite(r))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return r}return e}_updateObjects(e){for(const t of this.json.buffers)delete t.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const i=t.values&&t.values.tex,r=e.textures.findIndex(s=>s.id===i);-1!==r&&(t.pbrMetallicRoughness.baseColorTexture={index:r})}}}function lbe(n,e={}){return(new abe).normalize(n,e)}const cbe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ube={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_l={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},dbe={magFilter:_l.TEXTURE_MAG_FILTER,minFilter:_l.TEXTURE_MIN_FILTER,wrapS:_l.TEXTURE_WRAP_S,wrapT:_l.TEXTURE_WRAP_T},hbe={[_l.TEXTURE_MAG_FILTER]:_l.LINEAR,[_l.TEXTURE_MIN_FILTER]:_l.NEAREST_MIPMAP_LINEAR,[_l.TEXTURE_WRAP_S]:_l.REPEAT,[_l.TEXTURE_WRAP_]:_l.REPEAT};class gbe{postProcess(e,t={}){const{json:i,buffers:r=[],images:s=[],baseUri:o=""}=e;return Oa(i),this.baseUri=o,this.json=i,this.buffers=r,this.images=s,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map((i,r)=>this._resolveBufferView(i,r))),e.images&&(e.images=e.images.map((i,r)=>this._resolveImage(i,r))),e.samplers&&(e.samplers=e.samplers.map((i,r)=>this._resolveSampler(i,r))),e.textures&&(e.textures=e.textures.map((i,r)=>this._resolveTexture(i,r))),e.accessors&&(e.accessors=e.accessors.map((i,r)=>this._resolveAccessor(i,r))),e.materials&&(e.materials=e.materials.map((i,r)=>this._resolveMaterial(i,r))),e.meshes&&(e.meshes=e.meshes.map((i,r)=>this._resolveMesh(i,r))),e.nodes&&(e.nodes=e.nodes.map((i,r)=>this._resolveNode(i,r))),e.skins&&(e.skins=e.skins.map((i,r)=>this._resolveSkin(i,r))),e.scenes&&(e.scenes=e.scenes.map((i,r)=>this._resolveScene(i,r))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const i=this.json[e]&&this.json[e][t];return i||console.warn(`glTF file error: Could not find ${e}[${t}]`),i}_resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(i=>this.getNode(i)),e}_resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(i=>this.getNode(i))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((i,r)=>{const s=this.getMesh(r);return i.id=s.id,i.primitives=i.primitives.concat(s.primitives),i},{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map(i=>{const r=(i=J({},i)).attributes;i.attributes={};for(const s in r)i.attributes[s]=this.getAccessor(r[s]);return void 0!==i.indices&&(i.indices=this.getAccessor(i.indices)),void 0!==i.material&&(i.material=this.getMaterial(i.material)),i})),e}_resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,e.normalTexture&&(e.normalTexture=J({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=J({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=J({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=J({},e.pbrMetallicRoughness);const i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=J({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=J({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=function(n){return ube[n]}(e.componentType),e.components=function(n){return cbe[n]}(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const i=e.bufferView.buffer,{ArrayType:r,byteLength:s}=A8(e,e.bufferView),o=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,a=i.arrayBuffer.slice(o,o+s);e.value=new r(a)}return e}_resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.getSampler(e.sampler):hbe,e.source=this.getImage(e.source),e}_resolveSampler(e,t){e.id=e.id||`sampler-${t}`,e.parameters={};for(const i in e){const r=this._enumSamplerParameter(i);void 0!==r&&(e.parameters[r]=e[i])}return e}_enumSamplerParameter(e){return dbe[e]}_resolveImage(e,t){e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView));const i=this.images[t];return i&&(e.image=i),e}_resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const i=e.buffer;e.buffer=this.buffers[i];let s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),e.data=new Uint8Array(this.buffers[i].arrayBuffer,s,e.byteLength),e}_resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}}function mbe(n,e){return(new gbe).postProcess(n,e)}const R8=1735152710,Rm=!0;function yR(n,e,t,i){const r=new Uint8Array(e.buffer,t,i),o=new TextDecoder("utf8").decode(r);return n.json=JSON.parse(o),Tb(i,4)}function vR(n,e,t,i){return n.header.hasBinChunk=!0,n.binChunks.push({byteOffset:t,byteLength:i,arrayBuffer:e.buffer}),Tb(i,4)}function Abe(n,e){return bR.apply(this,arguments)}function bR(){return(bR=un(function*(n,e,t=0,i,r){var s,o,a,l;Dbe(n,e,t,i),lbe(n,{normalize:null==i||null===(s=i.gltf)||void 0===s?void 0:s.normalize});const c=[];if(null!=i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&n.json.buffers&&(yield Obe(n,i,r)),null!=i&&null!==(a=i.gltf)&&void 0!==a&&a.loadImages){const f=Ibe(n,i,r);c.push(f)}const d=rbe(n,i,r);return c.push(d),yield Promise.all(c),null!=i&&null!==(l=i.gltf)&&void 0!==l&&l.postProcess?mbe(n,i):n})).apply(this,arguments)}function Dbe(n,e,t,i){if(i.uri&&(n.baseUri=i.uri),e instanceof ArrayBuffer&&!function(n,e=0,t={}){const i=new DataView(n),{magic:r=R8}=t,s=i.getUint32(e,!1);return s===r||s===R8}(e,t,i)&&(e=(new TextDecoder).decode(e)),"string"==typeof e)n.json=function(n){try{return JSON.parse(n)}catch(e){throw new Error(`Failed to parse JSON from data starting with "${function(n,e=5){return"string"==typeof n?n.slice(0,e):ArrayBuffer.isView(n)?c8(n.buffer,n.byteOffset,e):n instanceof ArrayBuffer?c8(n,0,e):""}(n)}"`)}}(e);else if(e instanceof ArrayBuffer){const o={};t=function(n,e,t=0,i={}){const r=new DataView(e),s=function(n,e=0){return`${String.fromCharCode(n.getUint8(e+0))}${String.fromCharCode(n.getUint8(e+1))}${String.fromCharCode(n.getUint8(e+2))}${String.fromCharCode(n.getUint8(e+3))}`}(r,t+0),o=r.getUint32(t+4,Rm),a=r.getUint32(t+8,Rm);switch(Object.assign(n,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:s,version:o,json:{},binChunks:[]}),t+=12,n.version){case 1:return function(n,e,t){Qf(n.header.byteLength>20);const i=e.getUint32(t+0,Rm),r=e.getUint32(t+4,Rm);return t+=8,Qf(0===r),yR(n,e,t,i),(t+=i)+vR(n,e,t,n.header.byteLength)}(n,r,t);case 2:return function(n,e,t,i){return Qf(n.header.byteLength>20),function(n,e,t,i){for(;t+8<=n.header.byteLength;){const r=e.getUint32(t+0,Rm),s=e.getUint32(t+4,Rm);switch(t+=8,s){case 1313821514:yR(n,e,t,r);break;case 5130562:vR(n,e,t,r);break;case 0:i.strict||yR(n,e,t,r);break;case 1:i.strict||vR(n,e,t,r)}t+=Tb(r,4)}}(n,e,t,{}),t+n.header.byteLength}(n,r,t);default:throw new Error(`Invalid GLB version ${n.version}. Only supports v1 and v2.`)}}(o,e,t,i.glb),Oa("glTF"===o.type,`Invalid GLB magic string ${o.type}`),n._glb=o,n.json=o.json}else Oa(!1,"GLTF: must be ArrayBuffer or string");if(n.buffers=new Array((n.json.buffers||[]).length).fill(null),n._glb&&n._glb.header.hasBinChunk){const{binChunks:o}=n._glb;n.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}n.images=new Array((n.json.images||[]).length).fill({})}function Obe(n,e,t){return CR.apply(this,arguments)}function CR(){return(CR=un(function*(n,e,t){for(let s=0;s{t.traverse(i=>{Object.values(i.model.getUniforms()).forEach(r=>{!1===r.loaded&&e.push(r)})})}),yield Fbe(()=>e.some(t=>!t.loaded))})).apply(this,arguments)}function Fbe(n){return xR.apply(this,arguments)}function xR(){return(xR=un(function*(n){for(;n();)yield new Promise(e=>requestAnimationFrame(e))})).apply(this,arguments)}const k8=[255,255,255,255],Bbe={scenegraph:{type:"object",value:null,async:!0},getScene:n=>n&&n.scenes?"object"==typeof n.scene?n.scene:n.scenes[n.scene||0]:n,getAnimator:n=>n&&n.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:n=>n.position},getColor:{type:"accessor",value:k8},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[km]};let Vbe=(()=>{class n extends SP{getShaders(){const t=[jH,GH];return"pbr"===this.props._lighting&&t.push(JH),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:k8,transition:!0},instanceModelMatrix:KH})}updateState(t){super.updateState(t);const{props:i,oldProps:r}=t;i.scenegraph!==r.scenegraph?this._updateScenegraph(i):i._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,i._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(t){const{gl:i}=this.context;let r=null;if(t.scenegraph instanceof Dm)r={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const l=t.scenegraph,c=function(n,e,t){const i=new Gye(n,t);return{scenes:i.instantiate(e),animator:i.createAnimator()}}(i,l,this._getModelOptions());r=J({gltf:l},c),function(n){return MR.apply(this,arguments)}(c).then(()=>this.setNeedsRedraw())}else t.scenegraph&&(Zn.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=t.scenegraph);const s={layer:this,gl:i},o=t.getScene(r,s),a=t.getAnimator(r,s);o instanceof Dm?(this._deleteScenegraph(),this._applyAllAttributes(o),this._applyAnimationsProp(o,a,t._animations),this.setState({scenegraph:o,animator:a})):null!==o&&Zn.warn("invalid scenegraph:",o)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const i=this.getAttributeManager().getAttributes();t.traverse(r=>{this._setModelAttributes(r.model,i)})}}_applyAnimationsProp(t,i,r){if(!t||!i||!r)return;const s=i.getAnimations();Object.keys(r).sort().forEach(o=>{const a=r[o];if("*"===o)s.forEach(l=>{Object.assign(l,a)});else if(Number.isFinite(Number(o))){const l=Number(o);l>=0&&lc===o);l?Object.assign(l,a):Zn.warn("animation ".concat(o," not found"))()}})}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof Dm&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let i=null;return t&&(i="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:i,modelOptions:J({isInstanced:!0,transpileToGLSL100:!Mn(this.context.gl)},this.getShaders()),useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(i=>{this._setModelAttributes(i.model,t)})}draw({moduleParameters:t=null,parameters:i={},context:r}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(r.timeline.getTime()),this.setNeedsRedraw());const{viewport:s}=this.context,{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:l,opacity:c,coordinateSystem:d}=this.props,f=this.getNumInstances();this.state.scenegraph.traverse((p,{worldMatrix:g})=>{p.model.setInstanceCount(f),p.updateModuleSettings(t),p.draw({parameters:i,uniforms:{sizeScale:o,opacity:c,sizeMinPixels:a,sizeMaxPixels:l,composeModelMatrix:ZH(s,d),sceneModelMatrix:g,u_Camera:p.model.getUniforms().project_uCameraPosition}})})}}return n.layerName="ScenegraphLayer",n.defaultProps=Bbe,n})();const jbe=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Ube=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),zbe=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Hbe=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),$be={POSITION:{size:3,value:new Float32Array(Ube)},NORMAL:{size:3,value:new Float32Array(zbe)},TEXCOORD_0:{size:2,value:new Float32Array(Hbe)}};class Gbe extends QS{constructor(e={}){const{id:t=Wc("cube-geometry")}=e;super(an(J({},e),{id:t,indices:{size:1,value:new Uint16Array(jbe)},attributes:J(J({},$be),e.attributes)}))}}class tu{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){const e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){const e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){const t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new S){const t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new S){const i=this.elements,r=e.x,s=e.y,o=e.z;return t.x=i[0]*r+i[1]*s+i[2]*o,t.y=i[3]*r+i[4]*s+i[5]*o,t.z=i[6]*r+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){const s=1/r;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return r}unit(e=new S){const t=this.x,i=this.y,r=this.z;let s=Math.sqrt(t*t+i*i+r*r);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=r*s):(e.x=1,e.y=0,e.z=0),e}length(){const e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r))}distanceSquared(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-r)*(a-r)}scale(e,t=new S){const r=this.y,s=this.z;return t.x=e*this.x,t.y=e*r,t.z=e*s,t}vmul(e,t=new S){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new S){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(e=new S){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){const i=this.length();if(i>0){const r=qbe,s=1/i;r.set(this.x*s,this.y*s,this.z*s);const o=Ybe;Math.abs(r.x)<.9?(o.set(1,0,0),r.cross(o,e)):(o.set(0,1,0),r.cross(o,e)),r.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){const r=this.x,s=this.y,o=this.z;i.x=r+(e.x-r)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(F8),F8.almostEquals(e,t)}clone(){return new S(this.x,this.y,this.z)}}S.ZERO=void 0,S.UNIT_X=void 0,S.UNIT_Y=void 0,S.UNIT_Z=void 0,S.ZERO=new S(0,0,0),S.UNIT_X=new S(1,0,0),S.UNIT_Y=new S(0,1,0),S.UNIT_Z=new S(0,0,1);const qbe=new S,Ybe=new S,F8=new S;class Mi{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new S,this.upperBound=new S,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,r){const s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=r.y&&i.y>=s.y&&t.z<=r.z&&i.z>=s.z}getCorners(e,t,i,r,s,o,a,l){const c=this.lowerBound,d=this.upperBound;e.copy(c),t.set(d.x,c.y,c.z),i.set(d.x,d.y,c.z),r.set(c.x,d.y,d.z),s.set(d.x,c.y,d.z),o.set(c.x,d.y,c.z),a.set(c.x,c.y,d.z),l.copy(d)}toLocalFrame(e,t){const i=L8;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToLocal(g,g)}return t.setFromPoints(i)}toWorldFrame(e,t){const i=L8;this.getCorners(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]);for(let p=0;8!==p;p++){const g=i[p];e.pointToWorld(g,g)}return t.setFromPoints(i)}overlapsRay(e){const{direction:t,from:i}=e,r=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*r,l=(this.upperBound.x-i.x)*r,c=(this.lowerBound.y-i.y)*s,d=(this.upperBound.y-i.y)*s,f=(this.lowerBound.z-i.z)*o,p=(this.upperBound.z-i.z)*o,g=Math.max(Math.max(Math.min(a,l),Math.min(c,d)),Math.min(f,p)),_=Math.min(Math.min(Math.max(a,l),Math.max(c,d)),Math.max(f,p));return!(_<0||g>_)}}const N8=new S,L8=[new S,new S,new S,new S,new S,new S,new S,new S];class Rr{constructor(e=0,t=0,i=0,r=1){this.x=void 0,this.y=void 0,this.z=void 0,this.w=void 0,this.x=e,this.y=t,this.z=i,this.w=r}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}toString(){return this.x+","+this.y+","+this.z+","+this.w}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(e,t){const i=Math.sin(.5*t);return this.x=e.x*i,this.y=e.y*i,this.z=e.z*i,this.w=Math.cos(.5*t),this}toAxisAngle(e=new S){this.normalize();const t=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/i,e.y=this.y/i,e.z=this.z/i),[e,t]}setFromVectors(e,t){if(e.isAntiparallelTo(t)){const i=Kbe;e.tangents(i,Zbe),this.setFromAxisAngle(i,Math.PI)}else{const i=e.cross(t);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(zi(e.length(),2)*zi(t.length(),2))+e.dot(t),this.normalize()}return this}mult(e,t=new Rr){const i=this.x,r=this.y,s=this.z,o=this.w,a=e.x,l=e.y,c=e.z,d=e.w;return t.x=i*d+o*a+r*c-s*l,t.y=r*d+o*l+s*a-i*c,t.z=s*d+o*c+i*l-r*a,t.w=o*d-i*a-r*l-s*c,t}inverse(e=new Rr){const t=this.x,i=this.y,r=this.z,s=this.w;this.conjugate(e);const o=1/(t*t+i*i+r*r+s*s);return e.x*=o,e.y*=o,e.z*=o,e.w*=o,e}conjugate(e=new Rr){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e}normalize(){let e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}normalizeFast(){const e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e),this}vmult(e,t=new S){const i=e.x,r=e.y,s=e.z,o=this.x,a=this.y,l=this.z,c=this.w,d=c*i+a*s-l*r,f=c*r+l*i-o*s,p=c*s+o*r-a*i,g=-o*i-a*r-l*s;return t.x=d*c+g*-o+f*-l-p*-a,t.y=f*c+g*-a+p*-o-d*-l,t.z=p*c+g*-l+d*-a-f*-o,t}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}toEuler(e,t="YZX"){let i,r,s;const o=this.x,a=this.y,l=this.z,c=this.w;switch(t){case"YZX":const d=o*a+l*c;if(d>.499&&(i=2*Math.atan2(o,c),r=Math.PI/2,s=0),d<-.499&&(i=-2*Math.atan2(o,c),r=-Math.PI/2,s=0),void 0===i){const f=o*o,g=l*l;i=Math.atan2(2*a*c-2*o*l,1-a*a*2-2*g),r=Math.asin(2*d),s=Math.atan2(2*o*c-2*a*l,1-2*f-2*g)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=r,e.x=s}setFromEuler(e,t,i,r="XYZ"){const s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),d=Math.sin(i/2);return"XYZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"YXZ"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"ZXY"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a-l*c*d):"ZYX"===r?(this.x=l*o*a-s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a+l*c*d):"YZX"===r?(this.x=l*o*a+s*c*d,this.y=s*c*a+l*o*d,this.z=s*o*d-l*c*a,this.w=s*o*a-l*c*d):"XZY"===r&&(this.x=l*o*a-s*c*d,this.y=s*c*a-l*o*d,this.z=s*o*d+l*c*a,this.w=s*o*a+l*c*d),this}clone(){return new Rr(this.x,this.y,this.z,this.w)}slerp(e,t,i=new Rr){const r=this.x,s=this.y,o=this.z,a=this.w;let p,g,_,y,v,l=e.x,c=e.y,d=e.z,f=e.w;return g=r*l+s*c+o*d+a*f,g<0&&(g=-g,l=-l,c=-c,d=-d,f=-f),1-g>1e-6?(p=Math.acos(g),_=Math.sin(p),y=Math.sin((1-t)*p)/_,v=Math.sin(t*p)/_):(y=1-t,v=t),i.x=y*r+v*l,i.y=y*s+v*c,i.z=y*o+v*d,i.w=y*a+v*f,i}integrate(e,t,i,r=new Rr){const s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,d=this.z,f=this.w,p=.5*t;return r.x+=p*(s*f+o*d-a*c),r.y+=p*(o*f+a*l-s*d),r.z+=p*(a*f+s*c-o*l),r.w+=p*(-s*l-o*c-a*d),r}}const Kbe=new S,Zbe=new S,Qbe={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};let ut=(()=>{class n{constructor(t={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=n.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,i){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,i,r,s){throw"calculateWorldAABB() not implemented for shape type "+this.type}}return n.idCounter=0,n.types=Qbe,n})();class Qn{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new S,this.quaternion=new Rr,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return Qn.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return Qn.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,r=new S){return i.vsub(e,r),t.conjugate(V8),V8.vmult(r,r),r}static pointToWorldFrame(e,t,i,r=new S){return t.vmult(i,r),r.vadd(e,r),r}static vectorToWorldFrame(e,t,i=new S){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,r=new S){return t.w*=-1,t.vmult(i,r),t.w*=-1,r}}const V8=new Rr;class tp extends ut{constructor(e={}){const{vertices:t=[],faces:i=[],normals:r=[],axes:s,boundingSphereRadius:o}=e;super({type:ut.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=r,0===this.faceNormals.length&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;const r=new S;for(let s=0;s!==e.length;s++){const o=e[s],a=o.length;for(let l=0;l!==a;l++){t[o[l]].vsub(t[o[(l+1)%a]],r),r.normalize();let d=!1;for(let f=0;f!==i.length;f++)if(i[f].almostEquals(r)||i[f].almostEquals(r)){d=!0;break}d||i.push(r.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ep&&(p=y,f=_)}const g=[];for(let _=0;_=0&&this.clipFaceAgainstHull(o,e,t,g,a,l,c)}findSeparatingAxis(e,t,i,r,s,o,a,l){const c=new S,d=new S,f=new S,p=new S,g=new S,_=new S;let y=Number.MAX_VALUE;const v=this;if(v.uniqueAxes)for(let w=0;w!==v.uniqueAxes.length;w++){i.vmult(v.uniqueAxes[w],c);const C=v.testSepAxis(c,e,t,i,r,s);if(!1===C)return!1;C0&&o.negate(o),!0}testSepAxis(e,t,i,r,s,o){tp.project(this,e,i,r,TR),tp.project(t,e,s,o,AR);const l=TR[0],c=TR[1],d=AR[0],f=AR[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=t<=0?dt.STATIC:dt.DYNAMIC,typeof e.type==typeof dt.STATIC&&(this.type=e.type),this.allowSleep=void 0===e.allowSleep||e.allowSleep,this.sleepState=dt.AWAKE,this.sleepSpeedLimit=void 0!==e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new S,this.quaternion=new Rr,this.initQuaternion=new Rr,this.previousQuaternion=new Rr,this.interpolatedQuaternion=new Rr,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new S,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new S,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new S,this.invInertia=new S,this.invInertiaWorld=new tu,this.invMassSolve=0,this.invInertiaSolve=new S,this.invInertiaWorldSolve=new tu,this.fixedRotation=void 0!==e.fixedRotation&&e.fixedRotation,this.angularDamping=void 0!==e.angularDamping?e.angularDamping:.01,this.linearFactor=new S(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new S(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new Mi,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new S,this.isTrigger=Boolean(e.isTrigger),e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){const e=this.sleepState;this.sleepState=dt.AWAKE,this.wakeUpAfterNarrowphase=!1,e===dt.SLEEPING&&this.dispatchEvent(dt.wakeupEvent)}sleep(){this.sleepState=dt.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){const t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),r=zi(this.sleepSpeedLimit,2);t===dt.AWAKE&&ir?this.wakeUp():t===dt.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(dt.sleepEvent))}}updateSolveMassProperties(){this.sleepState===dt.SLEEPING||this.type===dt.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new S){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new S){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new S){return this.quaternion.vmult(e,t),t}addShape(e,t,i){const r=new S,s=new Rr;return t&&r.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(r),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){const t=this.shapes.indexOf(e);return-1===t?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){const e=this.shapes,t=this.shapeOffsets,i=e.length;let r=0;for(let s=0;s!==i;s++){const o=e[s];o.updateBoundingSphereRadius();const a=t[s].length(),l=o.boundingSphereRadius;a+l>r&&(r=a+l)}this.boundingRadius=r}updateAABB(){const e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,r=e.length,s=t0e,o=n0e,a=this.quaternion,l=this.aabb,c=i0e;for(let d=0;d!==r;d++){const f=e[d];a.vmult(t[d],s),s.vadd(this.position,s),a.mult(i[d],o),f.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),0===d?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){const t=this.invInertia;if(t.x!==t.y||t.y!==t.z||e){const i=r0e,r=s0e;i.setRotationFromQuaternion(this.quaternion),i.transpose(r),i.scale(t,i),i.mmult(r,this.invInertiaWorld)}}applyForce(e,t=new S){if(this.type!==dt.DYNAMIC)return;this.sleepState===dt.SLEEPING&&this.wakeUp();const i=o0e;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new S){if(this.type!==dt.DYNAMIC)return;const i=a0e,r=l0e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyForce(i,r)}applyTorque(e){this.type===dt.DYNAMIC&&(this.sleepState===dt.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new S){if(this.type!==dt.DYNAMIC)return;this.sleepState===dt.SLEEPING&&this.wakeUp();const i=t,r=c0e;r.copy(e),r.scale(this.invMass,r),this.velocity.vadd(r,this.velocity);const s=u0e;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new S){if(this.type!==dt.DYNAMIC)return;const i=d0e,r=h0e;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,r),this.applyImpulse(i,r)}updateMassProperties(){const e=f0e;this.invMass=this.mass>0?1/this.mass:0;const t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),aM.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){const i=new S;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==dt.DYNAMIC&&this.type!==dt.KINEMATIC||this.sleepState===dt.SLEEPING)return;const r=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,f=this.invInertiaWorld,p=this.linearFactor,g=this.invMass*e;r.x+=a.x*g*p.x,r.y+=a.y*g*p.y,r.z+=a.z*g*p.z;const _=f.elements,y=this.angularFactor,v=l.x*y.x,w=l.y*y.y,C=l.z*y.z;s.x+=e*(_[0]*v+_[1]*w+_[2]*C),s.y+=e*(_[3]*v+_[4]*w+_[5]*C),s.z+=e*(_[6]*v+_[7]*w+_[8]*C),o.x+=r.x*e,o.y+=r.y*e,o.z+=r.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}dt.idCounter=0,dt.COLLIDE_EVENT_NAME="collide",dt.DYNAMIC=1,dt.STATIC=2,dt.KINEMATIC=4,dt.AWAKE=0,dt.SLEEPY=1,dt.SLEEPING=2,dt.wakeupEvent={type:"wakeup"},dt.sleepyEvent={type:"sleepy"},dt.sleepEvent={type:"sleep"};const t0e=new S,n0e=new Rr,i0e=new Mi,r0e=new tu,s0e=new tu,o0e=new S,a0e=new S,l0e=new S,c0e=new S,u0e=new S,d0e=new S,h0e=new S,f0e=new S;new S,new S;class lM{constructor(){this.rayFromWorld=void 0,this.rayToWorld=void 0,this.hitNormalWorld=void 0,this.hitPointWorld=void 0,this.hasHit=void 0,this.shape=void 0,this.body=void 0,this.hitFaceIndex=void 0,this.distance=void 0,this.shouldStop=void 0,this.rayFromWorld=new S,this.rayToWorld=new S,this.hitNormalWorld=new S,this.hitPointWorld=new S,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(e,t,i,r,s,o,a){this.rayFromWorld.copy(e),this.rayToWorld.copy(t),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(r),this.shape=s,this.body=o,this.distance=a}}let j8,U8,z8,H8,$8,G8,W8;j8=ut.types.SPHERE,U8=ut.types.PLANE,z8=ut.types.BOX,H8=ut.types.CYLINDER,$8=ut.types.CONVEXPOLYHEDRON,G8=ut.types.HEIGHTFIELD,W8=ut.types.TRIMESH;class zr{get[j8](){return this._intersectSphere}get[U8](){return this._intersectPlane}get[z8](){return this._intersectBox}get[H8](){return this._intersectConvex}get[$8](){return this._intersectConvex}get[G8](){return this._intersectHeightfield}get[W8](){return this._intersectTrimesh}constructor(e=new S,t=new S){this.from=void 0,this.to=void 0,this.direction=void 0,this.precision=void 0,this.checkCollisionResponse=void 0,this.skipBackfaces=void 0,this.collisionFilterMask=void 0,this.collisionFilterGroup=void 0,this.mode=void 0,this.result=void 0,this.hasHit=void 0,this.callback=void 0,this.from=e.clone(),this.to=t.clone(),this.direction=new S,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=zr.ANY,this.result=new lM,this.hasHit=!1,this.callback=i=>{}}intersectWorld(e,t){return this.mode=t.mode||zr.ANY,this.result=t.result||new lM,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===t.checkCollisionResponse||t.checkCollisionResponse,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(q8),PR.length=0,e.broadphase.aabbQuery(e,q8,PR),this.intersectBodies(PR),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!e.collisionResponse||0==(this.collisionFilterGroup&e.collisionFilterMask)||0==(e.collisionFilterGroup&this.collisionFilterMask))return;const r=b0e,s=C0e;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;const a=this[e.type];a&&a.call(this,e,t,i,r,e)}_intersectBox(e,t,i,r,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,r,s)}_intersectPlane(e,t,i,r,s){const o=this.from,a=this.to,l=this.direction,c=new S(0,0,1);t.vmult(c,c);const d=new S;o.vsub(i,d);const f=d.dot(c);if(a.vsub(i,d),f*d.dot(c)>0||o.distanceTo(a)=0&&y<=1&&(o.lerp(a,y,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1)),this.result.shouldStop)return;v>=0&&v<=1&&(o.lerp(a,v,g),g.vsub(i,_),_.normalize(),this.reportIntersection(_,g,s,r,-1))}}_intersectConvex(e,t,i,r,s,o){const a=x0e,l=X8,c=o&&o.faceList||null,d=e.faces,f=e.vertices,p=e.faceNormals,g=this.direction,_=this.from,v=_.distanceTo(this.to),w=c?c.length:d.length,C=this.result;for(let x=0;!C.shouldStop&&xv||this.reportIntersection(a,na,s,r,L)}}}}_intersectTrimesh(e,t,i,r,s,o){const a=T0e,l=R0e,c=k0e,d=X8,f=A0e,p=D0e,g=O0e,_=P0e,y=I0e,v=e.indices,w=this.from,C=this.to,x=this.direction;c.position.copy(i),c.quaternion.copy(t),Qn.vectorToLocalFrame(i,t,x,f),Qn.pointToLocalFrame(i,t,w,p),Qn.pointToLocalFrame(i,t,C,g),g.x*=e.scale.x,g.y*=e.scale.y,g.z*=e.scale.z,p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,g.vsub(p,f),f.normalize();const L=p.distanceSquared(g);e.tree.rayQuery(this,c,l);for(let U=0,$=l.length;!this.result.shouldStop&&U!==$;U++){const ee=l[U];e.getNormal(ee,a),e.getVertex(v[3*ee],ac),ac.vsub(p,d);const fe=f.dot(a),pe=a.dot(d)/fe;if(pe<0)continue;f.scale(pe,na),na.vadd(p,na),e.getVertex(v[3*ee+1],iu),e.getVertex(v[3*ee+2],ru);const ve=na.distanceSquared(p);!zr.pointInTriangle(na,iu,ac,ru)&&!zr.pointInTriangle(na,ac,iu,ru)||ve>L||(Qn.vectorToWorldFrame(t,a,y),Qn.pointToWorldFrame(i,t,na,_),this.reportIntersection(y,_,s,r,ee))}l.length=0}reportIntersection(e,t,i,r,s){const o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=void 0!==s?s:-1,this.mode){case zr.ALL:this.hasHit=!0,c.set(o,a,e,t,i,r,l),c.hasHit=!0,this.callback(c);break;case zr.CLOSEST:(l=0&&(f=s*c-o*a)>=0&&d+fDate.now()-n}var su=Ve(517);function Bm(n,e,t){e||(e=new Lt(Lt.IDENTITY));const i=new Lt(Lt.IDENTITY);if(!n)return!0;if(n.matrix)i.copy(n.matrix);else{if(i.identity(),n.translation&&i.translate(n.translation),n.rotation){const s=new Lt(Lt.IDENTITY).fromQuaternion(n.rotation);i.multiplyRight(s)}n.scale&&i.scale(n.scale)}const r=new Lt(e).multiplyRight(i);if(!1===t(n,r,e))return!1;for(const s of n.nodes||n.children||[])if(!1===Bm(s,r,t))return!1;return!0}function j6(){W5([h8,km])}function U6(n,e){const t=e.nodes.find(i=>i.name===n);if(t){let i=!1;for(const r of e.scenes)i||Bm(r,new Lt(Lt.IDENTITY),(s,o)=>s!==t||(s.matrix=o,s.translation=void 0,s.rotation=void 0,s.scale=void 0,i=!0,!1));return e.scene={id:n,name:n,nodes:[t]},e.scenes=[e.scene],{scene:e.scene,scenes:e.scenes}}return e}function NR(n,e){return gl(this,void 0,void 0,function*(){const t=n.scenegraph;let i;i=e?e[t]||(e[t]=fetch(t).then(s=>s.blob())):fetch(t);const r=yield VS(i,km,{DracoLoader:aR,gltf:{decompressMeshes:!0,postProcess:!0}});return U6(n.scenegraphNode,r)})}function FEe(n,e){return gl(this,void 0,void 0,function*(){return U6(n,yield e)})}function LR(n,e,t){if(e&&0!==e.length)return new uye(Object.assign({id:n,pickable:!0,autoHighlight:!1,highlightColor:[30,136,229,255],coordinateSystem:Hn.CARTESIAN,data:e,mesh:new Gbe,wireframe:!1,getTransformMatrix:i=>i.transformMatrix,getColor:i=>i.color||[255,255,255,229.5]},t))}let LEe=(()=>{class n extends hge{initializeState(){const{data:t}=this.props;this.setState({data:null!=t?t:[],zoomOpacity:.8,doCollisions:!1}),j6()}renderLayers(){const t=this.state,i=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&l.unpickable),r=t.data.filter(l=>!l.scenegraph&&!l.wireframe&&!l.unpickable),s=t.data.filter(l=>!l.scenegraph&&l.wireframe),o=t.data.filter(l=>!!l.scenegraph);t.doCollisions&&function(n){gl(this,void 0,void 0,function*(){console.log("Starting Collisioning");const e=n.filter(o=>!o.scenegraph&&!o.wireframe).map(o=>{const a=new Lt(o.transformMatrix),l=a.transformAsPoint([-1,-1,-1],[]),c=a.transformAsPoint([1,1,1],[]);return{"@id":o["@id"],name:o.tooltip,entityId:o.entityId,bbox:new Mi({lowerBound:new S(...l.map((d,f)=>Math.min(d,c[f]))),upperBound:new S(...c.map((d,f)=>Math.max(d,l[f])))})}}),t=[];for(const o of n.filter(a=>!!a.scenegraph)){const a=yield jS(o.scenegraph,km,{DracoLoader:aR,decompress:!0,postProcess:!0});for(const l of a.scenes)Bm(l,new Lt(o.transformMatrix),(c,d)=>{if(c.mesh&&c.mesh.primitives&&c.mesh.primitives.length>0)for(const f of c.mesh.primitives)if(f.attributes.POSITION&&f.attributes.POSITION.min){const p=d.transformAsPoint(f.attributes.POSITION.min,[]),g=d.transformAsPoint(f.attributes.POSITION.max,[]);t.push({"@id":o["@id"],name:c.name,entityId:o.entityId,bbox:new Mi({lowerBound:new S(...p.map((_,y)=>Math.min(_,g[y]))),upperBound:new S(...g.map((_,y)=>Math.max(_,p[y])))}),gltf:a})}return!0})}const i=[],r=[];for(const o of e){const a=[];for(const l of t)o.bbox.overlaps(l.bbox)&&a.push({"@id":l["@id"],name:l.name});a.length>0?i.push({"@id":o.entityId,name:o.name,hits:a}):r.push(o)}console.log({sourceBoxes:e,targetBoxes:t,report:i,sad:r,maxHits:Math.max(...i.map(o=>o.hits.length))});const s=[];for(const o of i){s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":"","Hit Name":""});for(const a of o.hits)s.push({"Tissue ID":o["@id"],"Tissue Name":o.name,"Hit ID":a["@id"],"Hit Name":a.name})}return console.log(s),i})}(t.data);const a={};for(const l of o)l.scenegraph&&l.scenegraphNode&&!Object.prototype.hasOwnProperty.call(a,l.scenegraph)&&(a[l.scenegraph]=NR({scenegraph:l.scenegraph},n.gltfCache));return[LR("cubes",i,{wireframe:!1,pickable:!1}),LR("pickableCubes",r,{wireframe:!1,pickable:!0}),LR("wireframes",s,{wireframe:!0,pickable:!1}),...o.map(l=>{var c;return new Vbe({id:"models-"+l["@id"],opacity:l.zoomBasedOpacity?t.zoomOpacity:void 0!==l.opacity?l.opacity:1,pickable:!l.unpickable,coordinateSystem:Hn.CARTESIAN,data:[l],scenegraph:l.scenegraphNode?FEe(l.scenegraphNode,a[l.scenegraph]):l.scenegraph,_lighting:l._lighting,getTransformMatrix:l.transformMatrix,getColor:null!==(c=l.color)&&void 0!==c?c:[0,255,0,127.5],parameters:{depthMask:!l.zoomBasedOpacity&&(void 0===l.opacity||1===l.opacity)}})})].filter(l=>!!l)}getPickingInfo(t){return t.info}}return n.layerName="BodyUILayer",n.gltfCache={},n})();function z6(n,e=[]){for(const t of n.nodes||n.children||[])e.push(t.name),z6(t,e);return e}let VEe=(()=>{class n{constructor(t){var i,r,s,o,a;this.deckProps=t,this.bodyUILayer=new LEe({}),this.nodeClickSubject=new we,this.nodeHoverStartSubject=new we,this.nodeHoverStopSubject=new we,this.sceneRotationSubject=new sr([0,0]),this.nodeDragStartSubject=new we,this.nodeDragSubject=new we,this.nodeDragEndSubject=new we,this.nodeClick$=this.nodeClickSubject.pipe(Vs()),this.nodeHoverStart$=this.nodeHoverStartSubject.pipe(Vs()),this.nodeHoverStop$=this.nodeHoverStopSubject.pipe(Vs()),this.sceneRotation$=this.sceneRotationSubject.pipe(Vs()),this.nodeDragStart$=this.nodeDragStartSubject.pipe(Vs()),this.nodeDrag$=this.nodeDragSubject.pipe(Vs()),this.nodeDragEnd$=this.nodeDragEndSubject.pipe(Vs());const l=Object.assign(Object.assign({},t),{views:["orthographic"===t.camera?new Sge({flipY:!1,near:-1e3}):new Tge({orbitAxis:"Y"})],controller:void 0===t.interactive||t.interactive,layers:[this.bodyUILayer],onHover:this._onHover,onClick:this._onClick,onViewStateChange:this._onViewStateChange,onDragStart:this._onDragStart,onDrag:this._onDrag,onDragEnd:this._onDragEnd,getCursor:c=>{var d;return null!==(d=this.cursor)&&void 0!==d?d:c.isDragging?"grabbing":"grab"}});t.legacyLighting&&(l.effects=[new OP({ambientLight:new nH({color:[255,255,255],intensity:10})})]),this.deck=new ZS(l),this.deck.setProps({viewState:{orbitAxis:"Y",minRotationX:null!==(i=t.minRotationX)&&void 0!==i?i:-15,maxRotationX:null!==(r=t.maxRotationX)&&void 0!==r?r:15,target:null!==(s=t.target)&&void 0!==s?s:[.5,.5,0],rotationX:0,rotationOrbit:null!==(o=t.rotation)&&void 0!==o?o:0,zoom:null!==(a=t.zoom)&&void 0!==a?a:9.5,camera:t.camera}}),t.rotation&&this.sceneRotationSubject.next([t.rotation,0])}initialize(){return gl(this,void 0,void 0,function*(){for(;!this.bodyUILayer.state;)yield new Promise(t=>{setTimeout(t,200)})})}finalize(){this.deck.finalize()}setScene(t){if((null==t?void 0:t.length)>0){let i=this.bodyUILayer.state.zoomOpacity,r=!1;for(const s of t)s.zoomToOnLoad&&(this.zoomTo(s),r=!0);i=r?.05:i,this.deckProps.debugSceneNodeProcessing?this.debugSceneNodeProcessing(t,i):this.bodyUILayer.setState({data:t,zoomOpacity:i})}}debugSceneNodeProcessing(t,i){const r="https://hubmapconsortium.github.io/ccf-3d-reference-object-library/VH_Female/United/VHF_United_Color.glb",s=new Lt([.076,0,0,0,0,.076,16875389974302382e-33,0,0,-16875389974302382e-33,.076,0,.49,.034,.11,1]);(function(n,e,t){return gl(this,void 0,void 0,function*(){j6();const i=yield NR({scenegraph:n,scenegraphNode:"VHF_Kidney_L_Low1"}),r={},s=[];for(const o of i.scenes)Bm(o,e=new Lt(e||Lt.IDENTITY),(a,l)=>{const c={"@id":a.name||a.id,"@type":"ProcessedNode",transformMatrix:new Lt(l),wireframe:!0,node:a};if(s.push({"@id":`GLTF:${c["@id"]}`,"@type":"GLTFNode",scenegraph:n,scenegraphNode:c["@id"],transformMatrix:new Lt(e||Lt.IDENTITY),tooltip:a.name||a.id,color:[255,255,255,255],_lighting:"pbr",zoomBasedOpacity:!0,node:a}),a.mesh&&a.mesh.primitives&&a.mesh.primitives.length>0)for(const d of a.mesh.primitives)if(d.attributes.POSITION&&d.attributes.POSITION.min){const f=l.transformAsPoint(d.attributes.POSITION.min,[]),p=l.transformAsPoint(d.attributes.POSITION.max,[]);c.bbox=new Mi({lowerBound:new S(...f.map((g,_)=>Math.min(g,p[_]))),upperBound:new S(...p.map((g,_)=>Math.max(g,f[_])))})}return r[c["@id"]]=c,!0});for(const o of Object.values(r).filter(a=>!a.bbox)){for(const a of z6(o.node).map(l=>r[l]).filter(l=>l.bbox))o.bbox?o.bbox.extend(a.bbox):o.bbox=a.bbox.clone();o.bbox||delete r[o["@id"]]}for(const o of Object.values(r)){const a=o.bbox.lowerBound,d=(o.size=o.bbox.upperBound.clone().vsub(a)).clone().vmul(new S(.5,.5,.5)),f=o.center=a.clone().vadd(d);o.transformMatrix=new Lt(Lt.IDENTITY).translate(f.toArray()).scale(d.toArray())}for(const o of s)r[o["@id"]]=o;return r})})(r,s).then(o=>{console.log("results",o),console.log("data",t),(t=t.concat(Object.values(o))).push({"@id":"TEST","@type":"TEST",scenegraph:r,scenegraphNode:"VHF_Kidney_R_Low",transformMatrix:s,color:[255,255,255,200],_lighting:"pbr",zoomBasedOpacity:!1}),this.bodyUILayer.setState({data:t,zoomOpacity:i})})}zoomTo(t){const i=new Lt(t.transformMatrix);this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:i.getTranslation(),rotationX:0,rotationOrbit:0,zoom:11.5})})}setRotation(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationOrbit:t})})}setRotationX(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{rotationX:t})})}setZoom(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{zoom:t})})}setTarget(t){this.deck.setProps({viewState:Object.assign(Object.assign({},this.deck.props.viewState),{target:t})})}setInteractive(t){this.deck.setProps({controller:t})}_onHover(t){const{lastHovered:i}=this;this.cursor=t.picked?"pointer":void 0,t.picked&&t.object&&t.object["@id"]?i!==t.object&&(i&&this.nodeHoverStopSubject.next(i),this.lastHovered=t.object,this.nodeHoverStartSubject.next(t.object)):i&&(this.nodeHoverStopSubject.next(i),this.lastHovered=void 0)}_onClick(t,i){var r,s;t.picked&&t.object&&t.object["@id"]&&this.nodeClickSubject.next({node:t.object,ctrlClick:null!==(s=null===(r=null==i?void 0:i.srcEvent)||void 0===r?void 0:r.ctrlKey)&&void 0!==s?s:void 0})}_onViewStateChange(t){var i;if(null===(i=t.interactionState)||void 0===i?void 0:i.isZooming){const r=this.bodyUILayer.state,s=Math.min(Math.max(1-(t.viewState.zoom-8.9)/2,.05),1);r.zoomOpacity!==s&&this.bodyUILayer.setState({data:r.data,zoomOpacity:s})}this.deck.setProps({viewState:Object.assign({},t.viewState)}),this.sceneRotationSubject.next([t.viewState.rotationOrbit,t.viewState.rotationX])}_onDragStart(t,i){this._dragEvent(t,i,this.nodeDragStartSubject)}_onDrag(t,i){this._dragEvent(t,i,this.nodeDragSubject)}_onDragEnd(t,i){this._dragEvent(t,i,this.nodeDragEndSubject)}_dragEvent(t,i,r){var s;(null===(s=null==t?void 0:t.object)||void 0===s?void 0:s["@id"])&&r.next({node:t.object,info:t,e:i})}}return De([su.ZP],n.prototype,"_onHover",null),De([su.ZP],n.prototype,"_onClick",null),De([su.ZP],n.prototype,"_onViewStateChange",null),De([su.ZP],n.prototype,"_onDragStart",null),De([su.ZP],n.prototype,"_onDrag",null),De([su.ZP],n.prototype,"_onDragEnd",null),n})();function jEe(n,e){return n===e}function UEe(n,e,t){if(null===e||null===t||e.length!==t.length)return!1;const i=e.length;for(let r=0;r(i&&i.providers||[]).some(s=>s&&s.provide&&"MockNgModuleResolver"===s.provide.name||!1))});let BR=(()=>{class n{constructor(){this.bootstrap$=new Hg(1)}get appBootstrapped$(){return this.bootstrap$.asObservable()}bootstrap(){this.bootstrap$.next(!0),this.bootstrap$.complete()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const VR=new _e("INITIAL_STATE_TOKEN");let $Ee=(()=>{class n{static set(t){this.value=t}static pop(){const t=this.value;return this.value={},t}}return n.value={},n})();const $6=new _e("Internals.StateContextFactory"),G6=new _e("Internals.StateFactory");function W6(n,e){return e?t=>t.pipe(W6((i,r)=>li(n(i,r)).pipe(be((s,o)=>e(i,s,r,o))))):t=>t.lift(new GEe(n))}class GEe{constructor(e){this.project=e}call(e,t){return t.subscribe(new WEe(e,this.project))}}class WEe extends ei{constructor(e,t){super(e),this.project=t,this.hasSubscription=!1,this.hasCompleted=!1,this.index=0}_next(e){this.hasSubscription||this.tryNext(e)}tryNext(e){let t;const i=this.index++;try{t=this.project(e,i)}catch(r){return void this.destination.error(r)}this.hasSubscription=!0,this._innerSub(t)}_innerSub(e){const t=new $r(this),i=this.destination;i.add(t);const r=oo(e,t);r!==t&&i.add(r)}_complete(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()}notifyNext(e){this.destination.next(e)}notifyError(e){this.destination.error(e)}notifyComplete(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()}}function _M(n=null){return e=>e.lift(new qEe(n))}class qEe{constructor(e){this.defaultValue=e}call(e,t){return t.subscribe(new YEe(e,this.defaultValue))}}class YEe extends Rt{constructor(e,t){super(e),this.defaultValue=t,this.isEmpty=!0}_next(e){this.isEmpty=!1,this.destination.next(e)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}const Ia={STATE_NAME:n=>`${n} is not a valid state name. It needs to be a valid object property name.`,STATE_NAME_PROPERTY:()=>"States must register a 'name' property",STATE_UNIQUE:(n,e,t)=>`State name '${n}' from ${e} already exists in ${t}`,STATE_DECORATOR:()=>"States must be decorated with @State() decorator",INCORRECT_PRODUCTION:()=>"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",INCORRECT_DEVELOPMENT:()=>"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })",SELECT_FACTORY_NOT_CONNECTED:()=>"You have forgotten to import the NGXS module!",ACTION_DECORATOR:()=>"@Action() decorator cannot be used with static methods",SELECTOR_DECORATOR:()=>"Selectors only work on methods",ZONE_WARNING:()=>"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })",PATCHING_ARRAY:()=>"Patching arrays is not supported.",PATCHING_PRIMITIVE:()=>"Patching primitives is not supported.",UNDECORATED_STATE_IN_IVY:n=>`'${n}' class should be decorated with @Injectable() right after the @State() decorator`};let q6=(()=>{class n{constructor(t,i){this._ngZone=t,this._platformId=i,this.verifyZoneIsNotNooped(this._ngZone)}enter(t){return wD(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)}leave(t){return this.runInsideAngular(t)}runInsideAngular(t){return lt.isInAngularZone()?t():this._ngZone.run(t)}runOutsideAngular(t){return lt.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()}verifyZoneIsNotNooped(t){t instanceof lt||console.warn(Ia.ZONE_WARNING())}}return n.\u0275fac=function(t){return new(t||n)(I(lt),I(cl))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const Y6=new _e("ROOT_STATE_TOKEN"),X6=new _e("FEATURE_STATE_TOKEN"),jR=new _e("NGXS_PLUGINS"),K6=new _e("NG_TEST_MODE"),Z6=new _e("NG_DEV_MODE"),sd="NGXS_META",Q6="NGXS_OPTIONS_META",UR="NGXS_SELECTOR_META";let op=(()=>{class n{constructor(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=q6}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class XEe{constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}}const J6=new _e("NGXS_EXECUTION_STRATEGY");function ap(n){return n.constructor&&n.constructor.type?n.constructor.type:n.type}const zR=(n,e,t)=>{n=Object.assign({},n);const i=e.split("."),r=i.length-1;return i.reduce((s,o,a)=>(s[o]=a===r?t:Array.isArray(s[o])?s[o].slice():Object.assign({},s[o]),s&&s[o]),n),n},Vm=(n,e)=>e.split(".").reduce((t,i)=>t&&t[i],n),HR=n=>n&&"object"==typeof n&&!Array.isArray(n),$R=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(HR(n)&&HR(t))for(const i in t)HR(t[i])?(n[i]||Object.assign(n,{[i]:{}}),$R(n[i],t[i])):Object.assign(n,{[i]:t[i]});return $R(n,...e)};function Fb(n){return n[sd]}function qR(n){return n[UR]}function t$(n,e){const t=Vm(e.currentAppState,n.path),i=Vm(e.newAppState,n.path);return new XEe(t,i,!n.isInitialised)}function rSe(...n){return function(n,e,t=aSe){const i=function(n){return n.reduce((e,t)=>(e[ap(t)]=!0,e),{})}(n),r=e&&function(n){return n.reduce((e,t)=>(e[t]=!0,e),{})}(e);return function(s){return s.pipe(function(n,e){return Tn(t=>{const i=ap(t.action);return n[i]&&(!e||e[t.status])})}(i,r),t())}}(n,["DISPATCHED"])}function aSe(){return be(n=>n.action)}function yM(n){return e=>new oe(t=>e.subscribe({next(i){n.leave(()=>t.next(i))},error(i){n.leave(()=>t.error(i))},complete(){n.leave(()=>t.complete())}}))}let vM=(()=>{class n{constructor(t){this._executionStrategy=t}enter(t){return this._executionStrategy.enter(t)}leave(t){return this._executionStrategy.leave(t)}}return n.\u0275fac=function(t){return new(t||n)(I(J6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class uSe extends we{constructor(){super(...arguments),this._itemQueue=[],this._busyPushingNext=!1}next(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,super.next(e);this._itemQueue.length>0;){const t=this._itemQueue.pop();super.next(t)}this._busyPushingNext=!1}}}let bM=(()=>{class n extends uSe{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),dSe=(()=>{class n extends oe{constructor(t,i){super(r=>{const s=t.pipe(yM(i)).subscribe({next:o=>r.next(o),error:o=>r.error(o),complete:()=>r.complete()});r.add(s)})}}return n.\u0275fac=function(t){return new(t||n)(I(bM),I(vM))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const n$=n=>(...e)=>n.shift()(...e,(...i)=>n$(n)(...i));let CM=(()=>{class n extends sr{constructor(){super({})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),YR=(()=>{class n{constructor(t,i){this._parentManager=t,this._pluginHandlers=i,this.plugins=[],this.registerHandlers()}get rootPlugins(){return this._parentManager&&this._parentManager.plugins||this.plugins}registerHandlers(){const t=this.getPluginHandlers();this.rootPlugins.push(...t)}getPluginHandlers(){return(this._pluginHandlers||[]).map(i=>i.handle?i.handle.bind(i):i)}}return n.\u0275fac=function(t){return new(t||n)(I(n,12),I(jR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),XR=(()=>{class n extends we{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),i$=(()=>{class n{constructor(t,i,r,s,o,a){this._injector=t,this._actions=i,this._actionResults=r,this._pluginManager=s,this._stateStream=o,this._ngxsExecutionStrategy=a}dispatch(t){const i=this._ngxsExecutionStrategy.enter(()=>this.dispatchByEvents(t));return i.subscribe({error:r=>this._ngxsExecutionStrategy.leave(()=>{try{this._errorHandler=this._errorHandler||this._injector.get(Uo),this._errorHandler.handleError(r)}catch(s){}})}),i.pipe(yM(this._ngxsExecutionStrategy))}dispatchByEvents(t){return Array.isArray(t)?0===t.length?st(this._stateStream.getValue()):Bv(t.map(i=>this.dispatchSingle(i))):this.dispatchSingle(t)}dispatchSingle(t){if(!ap(t))return zg(new Error(`This action doesn't have a type property: ${t.constructor.name}`));const r=this._stateStream.getValue();return n$([...this._pluginManager.plugins,(o,a)=>{o!==r&&this._stateStream.next(o);const l=this.getActionResultStream(a);return l.subscribe(c=>this._actions.next(c)),this._actions.next({action:a,status:"DISPATCHED"}),this.createDispatchObservable(l)}])(r,t).pipe(Hc())}getActionResultStream(t){return this._actionResults.pipe(Tn(i=>i.action===t&&"DISPATCHED"!==i.status),_i(1),Hc())}createDispatchObservable(t){return t.pipe(W6(i=>{switch(i.status){case"SUCCESSFUL":return st(this._stateStream.getValue());case"ERRORED":return zg(i.error);default:return Ql}})).pipe(Hc())}}return n.\u0275fac=function(t){return new(t||n)(I(Tt),I(bM),I(XR),I(YR),I(CM),I(vM))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const r$=n=>{Object.freeze(n);const e="function"==typeof n,t=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(i){t.call(n,i)&&(!e||"caller"!==i&&"callee"!==i&&"arguments"!==i)&&null!==n[i]&&("object"==typeof n[i]||"function"==typeof n[i])&&!Object.isFrozen(n[i])&&r$(n[i])}),n};let s$=(()=>{class n{constructor(t,i){this.isDevMode=t,this.isTestMode=i}}return n.\u0275fac=function(t){return new(t||n)(I(Z6),I(K6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),o$=(()=>{class n{constructor(t,i){this._host=t,this._config=i}get isIncorrectProduction(){return!this._host.isDevMode()&&this._config.developmentMode}get isIncorrectDevelopment(){return this._host.isDevMode()&&!this._config.developmentMode}verifyDevMode(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(Ia.INCORRECT_PRODUCTION()):this.isIncorrectDevelopment&&console.warn(Ia.INCORRECT_DEVELOPMENT()))}}return n.\u0275fac=function(t){return new(t||n)(I(s$),I(op))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Um=(()=>{class n{constructor(t,i,r,s){this._stateStream=t,this._dispatcher=i,this._config=r,s.verifyDevMode()}getRootStateOperations(){const t={getState:()=>this._stateStream.getValue(),setState:i=>this._stateStream.next(i),dispatch:i=>this._dispatcher.dispatch(i)};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(t):t}ensureStateAndActionsAreImmutable(t){return{getState:()=>t.getState(),setState:i=>{const r=r$(i);return t.setState(r)},dispatch:i=>t.dispatch(i)}}setStateToTheCurrentWithNew(t){const i=this.getRootStateOperations(),r=i.getState();i.setState(Object.assign({},r,t.defaults))}}return n.\u0275fac=function(t){return new(t||n)(I(CM),I(i$),I(op),I(o$))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),wM=(()=>{class n{constructor(t){this._internalStateOperations=t}createStateContext(t){const i=this._internalStateOperations.getRootStateOperations();function r(l){return Vm(l,t.path)}function s(l,c){const d=zR(l,t.path,c),f=t.instance;if(f.ngxsOnChanges){const p=t$(t,{currentAppState:l,newAppState:d});f.ngxsOnChanges(p)}return i.setState(d),d}function o(l,c){return s(l,c(r(l)))}return{getState:()=>r(i.getState()),patchState:l=>o(i.getState(),function(n){return e=>{if(Array.isArray(n))throw new Error(Ia.PATCHING_ARRAY());if("object"!=typeof n)throw new Error(Ia.PATCHING_PRIMITIVE());const t=Object.assign({},e);for(const i in n)t[i]=n[i];return t}}(l)),setState(l){const c=i.getState();return function(l){return"function"==typeof l}(l)?o(c,l):s(c,l)},dispatch:l=>i.dispatch(l)}}}return n.\u0275fac=function(t){return new(t||n)(I(Um))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class EM{static stateNameErrorMessage(e){return Ia.STATE_NAME(e)}static checkCorrectStateName(e){if(!e)throw new Error(Ia.STATE_NAME_PROPERTY());if(!this.stateNameRegex.test(e))throw new Error(this.stateNameErrorMessage(e))}static checkStateNameIsUnique(e,t){const r=this.getValidStateMeta(e).name,s=t[r];if(s&&s!==e)throw new Error(Ia.STATE_UNIQUE(r,e.name,s.name));return r}static getValidStateMeta(e){const t=Fb(e);if(!t)throw new Error(Ia.STATE_DECORATOR());return t}}EM.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$");let zm=(()=>{class n{constructor(t,i,r,s,o,a,l){this._injector=t,this._config=i,this._parentFactory=r,this._actions=s,this._actionResults=o,this._stateContextFactory=a,this._initialState=l,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=H6(()=>{const c=this;function d(p){const g=c.statePaths[p];return g?function(n,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(n){const e=n.slice();return t=>e.reduce((i,r)=>i&&i[r],t)}(n):function(n){const e=n;let t="store."+e[0],i=0;const r=e.length;let s=t;for(;++i(g||(g=d(p)),g?g(..._):void 0))},getSelectorOptions:p=>Object.assign({},c._config.selectorOptions,p||{})}})}get states(){return this._parentFactory?this._parentFactory.states:this._states}get statesByName(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName}get statePaths(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths}static cloneDefaults(t){let i={};return i=Array.isArray(t)?t.slice():function(n){return"object"==typeof n&&null!==n||"function"==typeof n}(t)?Object.assign({},t):void 0===t?{}:t,i}static checkStatesAreValid(t){t.forEach(EM.getValidStateMeta)}ngOnDestroy(){this._actionsSubscription.unsubscribe()}add(t){n.checkStatesAreValid(t);const{newStates:i}=this.addToStatesMap(t);if(!i.length)return[];const r=function(n){const e=t=>{const i=n.find(r=>r===t);if(!i)throw new Error(`Child state not found: ${t}. \r\nYou may have forgotten to add states to module`);return i[sd].name};return n.reduce((t,i)=>{const{name:r,children:s}=i[sd];return t[r]=(s||[]).map(e),t},{})}(i),s=function(n){const e=[],t={},i=(r,s=[])=>{Array.isArray(s)||(s=[]),s.push(r),t[r]=!0,n[r].forEach(o=>{if(s.indexOf(o)>=0)throw new Error(`Circular dependency '${o}' is required by '${r}': ${s.join(" -> ")}`);t[o]||i(o,s.slice(0))}),e.indexOf(r)<0&&e.push(r)};return Object.keys(n).forEach(r=>i(r)),e.reverse()}(r),o=function(n,e={}){const t=(i,r)=>{for(const s in i)if(i.hasOwnProperty(s)&&i[s].indexOf(r)>=0){const o=t(i,s);return null!==o?`${o}.${s}`:s}return null};for(const i in n)if(n.hasOwnProperty(i)){const r=t(n,i);e[i]=r?`${r}.${i}`:i}return e}(r),a=function(n){return n.reduce((e,t)=>(e[t[sd].name]=t,e),{})}(i),l=[];for(const c of s){const d=a[c],f=o[c],p=d[sd];this.addRuntimeInfoToMeta(p,f);const g={name:c,path:f,isInitialised:!1,actions:p.actions,instance:this._injector.get(d),defaults:n.cloneDefaults(p.defaults)};this.hasBeenMountedAndBootstrapped(c,f)||l.push(g),this.states.push(g)}return l}addAndReturnDefaults(t){const r=this.add(t||[]);return{defaults:r.reduce((o,a)=>zR(o,a.path,a.defaults),{}),states:r}}connectActionHandlers(){null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(Tn(t=>"DISPATCHED"===t.status),ci(({action:t})=>this.invokeActions(this._actions,t).pipe(be(()=>({action:t,status:"SUCCESSFUL"})),_M({action:t,status:"CANCELED"}),Sa(i=>st({action:t,status:"ERRORED",error:i}))))).subscribe(t=>this._actionResults.next(t)))}invokeActions(t,i){const r=ap(i),s=[];for(const o of this.states){const a=o.actions[r];if(a)for(const l of a){const c=this._stateContextFactory.createStateContext(o);try{let d=o.instance[l.fn](c,i);d instanceof Promise&&(d=li(d)),d instanceof oe?(d=d.pipe(_M({})),l.options.cancelUncompleted&&(d=d.pipe(zn(t.pipe(rSe(i)))))):d=st({}).pipe(Hc()),s.push(d)}catch(d){s.push(zg(d))}}}return s.length||s.push(st({})),Bv(s)}addToStatesMap(t){const i=[],r=this.statesByName;for(const s of t){const o=EM.checkStateNameIsUnique(s,r);!r[o]&&(i.push(s),r[o]=s)}return{newStates:i}}addRuntimeInfoToMeta(t,i){this.statePaths[t.name]=i,t.path=i}hasBeenMountedAndBootstrapped(t,i){const r=void 0!==Vm(this._initialState,i);return this.statesByName[t]&&r}}return n.\u0275fac=function(t){return new(t||n)(I(Tt),I(op),I(n,12),I(bM),I(XR),I(wM),I(VR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),KR=(()=>{class n{constructor(t,i,r){this.internalStateOperations=t,this.stateContextFactory=i,this.bootstrapper=r}ngxsBootstrap(t,i){this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(Tn(()=>!!i),Di(()=>this.invokeInit(i.states)),ci(()=>this.bootstrapper.appBootstrapped$),Tn(r=>!!r)).subscribe(()=>this.invokeBootstrap(i.states))}invokeInit(t){for(const i of t){const r=i.instance;if(r.ngxsOnChanges){const a=t$(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});r.ngxsOnChanges(a)}r.ngxsOnInit&&r.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}invokeBootstrap(t){for(const i of t){const r=i.instance;r.ngxsAfterBootstrap&&r.ngxsAfterBootstrap(this.getStateContext(i))}}getStateContext(t){return this.stateContextFactory.createStateContext(t)}}return n.\u0275fac=function(t){return new(t||n)(I(Um),I(wM),I(BR))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();let ph=(()=>{class n{constructor(t,i,r,s,o,a){this._stateStream=t,this._internalStateOperations=i,this._config=r,this._internalExecutionStrategy=s,this._stateFactory=o,this.initStateStream(a)}dispatch(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)}select(t){const i=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(be(i),Sa(r=>{const{suppressErrors:s}=this._config.selectorOptions;return r instanceof TypeError&&s?st(void 0):zg(r)}),Xo(),yM(this._internalExecutionStrategy))}selectOnce(t){return this.select(t).pipe(_i(1))}selectSnapshot(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())}subscribe(t){return this._stateStream.pipe(yM(this._internalExecutionStrategy)).subscribe(t)}snapshot(){return this._internalStateOperations.getRootStateOperations().getState()}reset(t){return this._internalStateOperations.getRootStateOperations().setState(t)}getStoreBoundSelectorFn(t){return function(n){const e=qR(n)||Fb(n);return e&&e.makeRootSelector||(()=>n)}(t)(this._stateFactory.getRuntimeSelectorContext())}initStateStream(t){const i=this._stateStream.value;if(!i||0===Object.keys(i).length){const o=Object.keys(this._config.defaultsState).length>0?Object.assign({},this._config.defaultsState,t):t;this._stateStream.next(o)}}}return n.\u0275fac=function(t){return new(t||n)(I(CM),I(Um),I(op),I(vM),I(zm),I(VR,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),Nb=(()=>{class n{constructor(t,i){n.store=t,n.config=i}ngOnDestroy(){n.store=null,n.config=null}}return n.\u0275fac=function(t){return new(t||n)(I(ph),I(op))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n.store=null,n.config=null,n})();class c${static get type(){return"@@INIT"}}class u${constructor(e){this.addedStates=e}static get type(){return"@@UPDATE_STATE"}}const MM=new Hg(1);let vSe=(()=>{class n{constructor(t,i,r,s,o=[],a){!function(){try{const n=window.ng,t=!(n.probe&&n.coreTokens)&&wo();MM.next(t)}catch(n){MM.next(!1)}finally{MM.complete()}}();const l=t.addAndReturnDefaults(o);i.setStateToTheCurrentWithNew(l),t.connectActionHandlers(),a.ngxsBootstrap(new c$,l)}}return n.\u0275fac=function(t){return new(t||n)(I(zm),I(Um),I(ph),I(Nb),I(Y6,8),I(KR))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),bSe=(()=>{class n{constructor(t,i,r,s=[],o){const a=n.flattenStates(s),l=r.addAndReturnDefaults(a);l.states.length&&(i.setStateToTheCurrentWithNew(l),o.ngxsBootstrap(new u$(l.defaults),l))}static flattenStates(t=[]){return t.reduce((i,r)=>i.concat(r),[])}}return n.\u0275fac=function(t){return new(t||n)(I(ph),I(Um),I(zm),I(X6,8),I(KR))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();class ia{static forRoot(e=[],t={}){return{ngModule:vSe,providers:[zm,wM,dSe,bM,BR,o$,s$,KR,i$,XR,Um,vM,ph,CM,Nb,YR,...e,...ia.ngxsTokenProviders(e,t)]}}static forFeature(e=[]){return{ngModule:bSe,providers:[zm,YR,...e,{provide:X6,multi:!0,useValue:e}]}}static ngxsTokenProviders(e,t){return[{provide:K6,useValue:HEe},{provide:Z6,useValue:wo},{provide:J6,useClass:t.executionStrategy||q6},{provide:Y6,useValue:e},{provide:ia.ROOT_OPTIONS,useValue:t},{provide:op,useFactory:ia.ngxsConfigFactory,deps:[ia.ROOT_OPTIONS]},{provide:pv,useFactory:ia.appBootstrapListenerFactory,multi:!0,deps:[BR]},{provide:VR,useFactory:ia.getInitialState},{provide:$6,useExisting:wM},{provide:G6,useExisting:zm}]}static ngxsConfigFactory(e){return $R(new op,e)}static appBootstrapListenerFactory(e){return()=>e.bootstrap()}static getInitialState(){return $Ee.pop()}}function gh(n){return i=>{!function(n){MM.subscribe(e=>{e&&(n.\u0275prov||console.warn(Ia.UNDECORATED_STATE_IN_IVY(n.name)))})}(i);const r=i,s=function(n){if(!n.hasOwnProperty(sd)){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,sd,{value:e})}return Fb(n)}(r),o=Object.getPrototypeOf(r),a=function(i){return Object.assign({},i[Q6]||{},n)}(o);(function(i){const{meta:r,inheritedStateClass:s,optionsWithInheritance:o}=i,{children:a,defaults:l,name:c}=o,d="string"==typeof c?c:c&&c.getName()||null;EM.checkCorrectStateName(d),s.hasOwnProperty(sd)&&(r.actions=Object.assign({},r.actions,(s[sd]||{}).actions)),r.children=a,r.defaults=l,r.name=d})({meta:s,inheritedStateClass:o,optionsWithInheritance:a}),r[Q6]=a}}ia.\u0275fac=function(e){return new(e||ia)},ia.\u0275mod=xe({type:ia}),ia.\u0275inj=Ee({}),ia.ROOT_OPTIONS=new _e("ROOT_OPTIONS");let d$=(()=>{class n{constructor(t,i){this._renderer=t,this._elementRef=i,this.onChange=r=>{},this.onTouched=()=>{}}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return n.\u0275fac=function(t){return new(t||n)(E(Lc),E(nt))},n.\u0275dir=he({type:n}),n})(),lp=(()=>{class n extends d${}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,features:[ht]}),n})();const Ao=new _e("NgValueAccessor"),ASe={provide:Ao,useExisting:T(()=>Lb),multi:!0},OSe=new _e("CompositionEventMode");let Lb=(()=>{class n extends d${constructor(t,i,r){super(t,i),this._compositionMode=r,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const n=Vc()?Vc().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return n.\u0275fac=function(t){return new(t||n)(E(Lc),E(nt),E(OSe,8))},n.\u0275dir=he({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,i){1&t&&ye("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},features:[At([ASe]),ht]}),n})();function mh(n){return null==n||0===n.length}function f$(n){return null!=n&&"number"==typeof n.length}const ws=new _e("NgValidators"),_h=new _e("NgAsyncValidators"),ISe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class p${static min(e){return function(n){return e=>{if(mh(e.value)||mh(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t{if(mh(e.value)||mh(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}(e)}static required(e){return function(n){return mh(n.value)?{required:!0}:null}(e)}static requiredTrue(e){return function(n){return!0===n.value?null:{required:!0}}(e)}static email(e){return function(n){return mh(n.value)||ISe.test(n.value)?null:{email:!0}}(e)}static minLength(e){return function(n){return e=>mh(e.value)||!f$(e.value)?null:e.value.lengthf$(e.value)&&e.value.length>n?{maxlength:{requiredLength:n,actualLength:e.value.length}}:null}(e)}static pattern(e){return function(n){if(!n)return yh;let e,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),i=>{if(mh(i.value))return null;const r=i.value;return e.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}(e)}static nullValidator(e){return null}static compose(e){return A$(e)}static composeAsync(e){return D$(e)}}function yh(n){return null}function E$(n){return null!=n}function S$(n){const e=Wy(n)?li(n):n;return yw(e),e}function M$(n){let e={};return n.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function x$(n,e){return e.map(t=>t(n))}function T$(n){return n.map(e=>function(n){return!n.validate}(e)?e:t=>e.validate(t))}function A$(n){if(!n)return null;const e=n.filter(E$);return 0==e.length?null:function(t){return M$(x$(t,e))}}function ZR(n){return null!=n?A$(T$(n)):null}function D$(n){if(!n)return null;const e=n.filter(E$);return 0==e.length?null:function(t){return Bv(x$(t,e).map(S$)).pipe(be(M$))}}function QR(n){return null!=n?D$(T$(n)):null}function O$(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function I$(n){return n._rawValidators}function P$(n){return n._rawAsyncValidators}function JR(n){return n?Array.isArray(n)?n:[n]:[]}function xM(n,e){return Array.isArray(n)?n.includes(e):n===e}function R$(n,e){const t=JR(e);return JR(n).forEach(r=>{xM(t,r)||t.push(r)}),t}function k$(n,e){return JR(e).filter(t=>!xM(n,t))}let F$=(()=>{class n{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=ZR(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=QR(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,i){return!!this.control&&this.control.hasError(t,i)}getError(t,i){return this.control?this.control.getError(t,i):null}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n}),n})(),Do=(()=>{class n extends F${get formDirective(){return null}get path(){return null}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,features:[ht]}),n})();class lc extends F${constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let ek=(()=>{class n extends class{constructor(e){this._cd=e}is(e){var t,i,r;return"submitted"===e?!!(null===(t=this._cd)||void 0===t?void 0:t.submitted):!!(null===(r=null===(i=this._cd)||void 0===i?void 0:i.control)||void 0===r?void 0:r[e])}}{constructor(t){super(t)}}return n.\u0275fac=function(t){return new(t||n)(E(lc,2))},n.\u0275dir=he({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,i){2&t&&at("ng-untouched",i.is("untouched"))("ng-touched",i.is("touched"))("ng-pristine",i.is("pristine"))("ng-dirty",i.is("dirty"))("ng-valid",i.is("valid"))("ng-invalid",i.is("invalid"))("ng-pending",i.is("pending"))},features:[ht]}),n})();function Bb(n,e){ik(n,e),e.valueAccessor.writeValue(n.value),function(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&B$(n,e)})}(n,e),function(n,e){const t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&B$(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function(n,e){if(e.valueAccessor.setDisabledState){const t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function DM(n,e,t=!0){const i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),IM(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function OM(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function ik(n,e){const t=I$(n);null!==e.validator?n.setValidators(O$(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const i=P$(n);null!==e.asyncValidator?n.setAsyncValidators(O$(i,e.asyncValidator)):"function"==typeof i&&n.setAsyncValidators([i]);const r=()=>n.updateValueAndValidity();OM(e._rawValidators,r),OM(e._rawAsyncValidators,r)}function IM(n,e){let t=!1;if(null!==n){if(null!==e.validator){const r=I$(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.validator);s.length!==r.length&&(t=!0,n.setValidators(s))}}if(null!==e.asyncValidator){const r=P$(n);if(Array.isArray(r)&&r.length>0){const s=r.filter(o=>o!==e.asyncValidator);s.length!==r.length&&(t=!0,n.setAsyncValidators(s))}}}const i=()=>{};return OM(e._rawValidators,i),OM(e._rawAsyncValidators,i),t}function B$(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function V$(n,e){ik(n,e)}function rk(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}function j$(n,e){n._syncPendingControls(),e.forEach(t=>{const i=t.control;"submit"===i.updateOn&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function sk(n,e){if(!e)return null;let t,i,r;return Array.isArray(e),e.forEach(s=>{s.constructor===Lb?t=s:function(n){return Object.getPrototypeOf(n.constructor)===lp}(s)?i=s:r=s}),r||i||t||null}function PM(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const Vb="VALID",RM="INVALID",Hm="PENDING",jb="DISABLED";function ok(n){return(lk(n)?n.validators:n)||null}function U$(n){return Array.isArray(n)?ZR(n):n||null}function ak(n,e){return(lk(e)?e.asyncValidators:n)||null}function z$(n){return Array.isArray(n)?QR(n):n||null}function lk(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}class ck{constructor(e,t){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=e,this._rawAsyncValidators=t,this._composedValidatorFn=U$(this._rawValidators),this._composedAsyncValidatorFn=z$(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get valid(){return this.status===Vb}get invalid(){return this.status===RM}get pending(){return this.status==Hm}get disabled(){return this.status===jb}get enabled(){return this.status!==jb}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._rawValidators=e,this._composedValidatorFn=U$(e)}setAsyncValidators(e){this._rawAsyncValidators=e,this._composedAsyncValidatorFn=z$(e)}addValidators(e){this.setValidators(R$(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(R$(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(k$(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(k$(e,this._rawAsyncValidators))}hasValidator(e){return xM(this._rawValidators,e)}hasAsyncValidator(e){return xM(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status=Hm,!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=jb,this.errors=null,this._forEachChild(i=>{i.disable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(i=>i(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Vb,this._forEachChild(i=>{i.enable(Object.assign(Object.assign({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},e),{skipPristineCheck:t})),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Vb||this.status===Hm)&&this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?jb:Vb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status=Hm,this._hasOwnPendingAsyncValidator=!0;const t=S$(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(i=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(i,{emitEvent:e})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(n,e,t){if(null==e||(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length))return null;let i=n;return e.forEach(r=>{i=i instanceof uk?i.controls.hasOwnProperty(r)?i.controls[r]:null:i instanceof $Se&&i.at(r)||null}),i}(this,e)}getError(e,t){const i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new Pe,this.statusChanges=new Pe}_calculateStatus(){return this._allControlsDisabled()?jb:this.errors?RM:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Hm)?Hm:this._anyControlsHaveStatus(RM)?RM:Vb}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){lk(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class vh extends ck{constructor(e=null,t,i){super(ok(t),ak(i,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(i=>i(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){PM(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){PM(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class uk extends ck{constructor(e,t,i){super(ok(t),ak(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(i=>{this._throwIfControlMissing(i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(i=>{this.controls[i]&&this.controls[i].patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t instanceof vh?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>!!i._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error(`Cannot find form control with name: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const t of Object.keys(this.controls)){const i=this.controls[t];if(this.contains(t)&&e(i))return!0}return!1}_reduceValue(){return this._reduceChildren({},(e,t,i)=>((t.enabled||this.disabled)&&(e[i]=t.value),e))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control with name: '${i}'.`)})}}class $Se extends ck{constructor(e,t,i){super(ok(t),ak(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(e){return this.controls[e]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,i={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:i.emitEvent})}removeAt(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((i,r)=>{this._throwIfControlMissing(r),this.at(r).setValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((i,r)=>{i.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof vh?e.value:e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_syncPendingControls(){let e=this.controls.reduce((t,i)=>!!i._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error(`Cannot find form control at index ${e}`)}_forEachChild(e){this.controls.forEach((t,i)=>{e(t,i)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,i)=>{if(void 0===e[i])throw new Error(`Must supply a value for form control at index: ${i}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const GSe={provide:Do,useExisting:T(()=>cp)},Ub=(()=>Promise.resolve(null))();let cp=(()=>{class n extends Do{constructor(t,i){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new Pe,this.form=new uk({},ZR(t),QR(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){Ub.then(()=>{const i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),Bb(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){Ub.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name),PM(this._directives,t)})}addFormGroup(t){Ub.then(()=>{const i=this._findContainer(t.path),r=new uk({});V$(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){Ub.then(()=>{const i=this._findContainer(t.path);i&&i.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){Ub.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,j$(this.form,this._directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10))},n.\u0275dir=he({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,i){1&t&&ye("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[At([GSe]),ht]}),n})();const qSe={provide:lc,useExisting:T(()=>dk)},W$=(()=>Promise.resolve(null))();let dk=(()=>{class n extends lc{constructor(t,i,r,s){super(),this.control=new vh,this._registered=!1,this.update=new Pe,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=sk(0,s)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),rk(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?function(n,e){return[...e.path,n]}(this.name,this._parent):[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Bb(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){W$.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const i=t.isDisabled.currentValue,r=""===i||i&&"false"!==i;W$.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable()})}}return n.\u0275fac=function(t){return new(t||n)(E(Do,9),E(ws,10),E(_h,10),E(Ao,10))},n.\u0275dir=he({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[At([qSe]),ht,qn]}),n})(),X$=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const hk=new _e("NgModelWithFormControlWarning"),QSe={provide:lc,useExisting:T(()=>kM)};let kM=(()=>{class n extends lc{constructor(t,i,r,s){super(),this._ngModelWarningConfig=s,this.update=new Pe,this._ngModelWarningSent=!1,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=sk(0,r)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){const i=t.form.previousValue;i&&DM(i,this,!1),Bb(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})}rk(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&DM(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_isControlChanged(t){return t.hasOwnProperty("form")}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10),E(Ao,10),E(hk,8))},n.\u0275dir=he({type:n,selectors:[["","formControl",""]],inputs:{isDisabled:["disabled","isDisabled"],form:["formControl","form"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],features:[At([QSe]),ht,qn]}),n._ngModelWarningSentOnce=!1,n})();const JSe={provide:Do,useExisting:T(()=>$m)};let $m=(()=>{class n extends Do{constructor(t,i){super(),this.validators=t,this.asyncValidators=i,this.submitted=!1,this._onCollectionChange=()=>this._updateDomValue(),this.directives=[],this.form=null,this.ngSubmit=new Pe,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(IM(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const i=this.form.get(t.path);return Bb(i,t),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}removeControl(t){DM(t.control||null,t,!1),PM(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this.submitted=!0,j$(this.form,this.directives),this.ngSubmit.emit(t),!1}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_updateDomValue(){this.directives.forEach(t=>{const i=t.control,r=this.form.get(t.path);i!==r&&(DM(i||null,t),r instanceof vh&&(Bb(r,t),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const i=this.form.get(t.path);V$(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const i=this.form.get(t.path);i&&function(n,e){return IM(n,e)}(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){ik(this.form,this),this._oldForm&&IM(this._oldForm,this)}_checkFormPresent(){}}return n.\u0275fac=function(t){return new(t||n)(E(ws,10),E(_h,10))},n.\u0275dir=he({type:n,selectors:[["","formGroup",""]],hostBindings:function(t,i){1&t&&ye("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[At([JSe]),ht,qn]}),n})(),uG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[X$]]}),n})(),yk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[uG]}),n})(),vk=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:hk,useValue:t.warnOnNgModelWithFormControl}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[uG]}),n})();function zb(n){return new oe(e=>{let t;try{t=n()}catch(r){return void e.error(r)}return(t?li(t):fE()).subscribe(e)})}function bk(n,e=Tf){const i=function(n){return n instanceof Date&&!isNaN(+n)}(n)?+n-e.now():Math.abs(n);return r=>r.lift(new yMe(i,e))}class yMe{constructor(e,t){this.delay=e,this.scheduler=t}call(e,t){return t.subscribe(new Ck(e,this.delay,this.scheduler))}}class Ck extends Rt{constructor(e,t,i){super(e),this.delay=t,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}static dispatch(e){const t=e.source,i=t.queue,r=e.scheduler,s=e.destination;for(;i.length>0&&i[0].time-r.now()<=0;)i.shift().notification.observe(s);if(i.length>0){const o=Math.max(0,i[0].time-r.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1}_schedule(e){this.active=!0,this.destination.add(e.schedule(Ck.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))}scheduleNotification(e){if(!0===this.errored)return;const t=this.scheduler,i=new vMe(t.now()+this.delay,e);this.queue.push(i),!1===this.active&&this._schedule(t)}_next(e){this.scheduleNotification(qo.createNext(e))}_error(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()}_complete(){this.scheduleNotification(qo.createComplete()),this.unsubscribe()}}class vMe{constructor(e,t){this.time=e,this.notification=t}}const pG=Yg({passive:!0});let gG=(()=>{class n{constructor(t,i){this._platform=t,this._ngZone=i,this._monitoredElements=new Map}monitor(t){if(!this._platform.isBrowser)return Ql;const i=Hu(t),r=this._monitoredElements.get(i);if(r)return r.subject;const s=new we,o="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||i.classList.contains(o)?"cdk-text-field-autofill-end"===l.animationName&&i.classList.contains(o)&&(i.classList.remove(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!1}))):(i.classList.add(o),this._ngZone.run(()=>s.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{i.addEventListener("animationstart",a,pG),i.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(i,{subject:s,unlisten:()=>{i.removeEventListener("animationstart",a,pG)}}),s}stopMonitoring(t){const i=Hu(t),r=this._monitoredElements.get(i);r&&(r.unlisten(),r.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((t,i)=>this.stopMonitoring(i))}}return n.\u0275fac=function(t){return new(t||n)(I(ii),I(lt))},n.\u0275prov=ae({factory:function(){return new n(I(ii),I(lt))},token:n,providedIn:"root"}),n})(),mG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Av]]}),n})();const NMe=new _e("MAT_INPUT_VALUE_ACCESSOR"),LMe=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let BMe=0;const VMe=CO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let Hb=(()=>{class n extends VMe{constructor(t,i,r,s,o,a,l,c,d,f){super(a,s,o,r),this._elementRef=t,this._platform=i,this._autofillMonitor=c,this._formField=f,this._uid="mat-input-"+BMe++,this.focused=!1,this.stateChanges=new we,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._required=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(_=>Q3().has(_));const p=this._elementRef.nativeElement,g=p.nodeName.toLowerCase();this._inputValueAccessor=l||p,this._previousNativeValue=this.value,this.id=this.id,i.IOS&&d.runOutsideAngular(()=>{t.nativeElement.addEventListener("keyup",_=>{const y=_.target;!y.value&&0===y.selectionStart&&0===y.selectionEnd&&(y.setSelectionRange(1,1),y.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===g,this._isTextarea="textarea"===g,this._isInFormField=!!f,this._isNativeSelect&&(this.controlType=p.multiple?"mat-native-select-multiple":"mat-native-select")}get disabled(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Dt(t),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(t){this._id=t||this._uid}get required(){return this._required}set required(t){this._required=Dt(t)}get type(){return this._type}set type(t){this._type=t||"text",this._validateType(),!this._isTextarea&&Q3().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(t){t!==this.value&&(this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=Dt(t)}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}ngDoCheck(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}_focusChanged(t){t!==this.focused&&(this.focused=t,this.stateChanges.next())}_onInput(){}_dirtyCheckPlaceholder(){var t,i;const r=(null===(i=null===(t=this._formField)||void 0===t?void 0:t._hideControlPlaceholder)||void 0===i?void 0:i.call(t))?null:this.placeholder;if(r!==this._previousPlaceholder){const s=this._elementRef.nativeElement;this._previousPlaceholder=r,r?s.setAttribute("placeholder",r):s.removeAttribute("placeholder")}}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_validateType(){LMe.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const t=this._elementRef.nativeElement,i=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&i&&i.label)}return this.focused||!this.empty}setDescribedByIds(t){t.length?this._elementRef.nativeElement.setAttribute("aria-describedby",t.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(ii),E(lc,10),E(cp,8),E($m,8),E(kv),E(NMe,10),E(gG),E(lt),E(XE,8))},n.\u0275dir=he({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-input-element","mat-form-field-autofill-control"],hostVars:9,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&t&&(sl("disabled",i.disabled)("required",i.required),en("id",i.id)("data-placeholder",i.placeholder)("readonly",i.readonly&&!i._isNativeSelect||null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required),at("mat-input-server",i._isServer))},inputs:{id:"id",disabled:"disabled",required:"required",type:"type",value:"value",readonly:"readonly",placeholder:"placeholder",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:["aria-describedby","userAriaDescribedBy"]},exportAs:["matInput"],features:[At([{provide:Nv,useExisting:n}]),ht,qn]}),n})(),$b=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[kv],imports:[[mG,Lv,Nn],mG,Lv]}),n})();function lr(...n){const e=n.length;if(0===e)throw new Error("list of properties cannot be empty.");return t=>be(function(n,e){return i=>{let r=i;for(let s=0;si.lift(new $Me(n,e,t.leading,t.trailing))}class $Me{constructor(e,t,i,r){this.duration=e,this.scheduler=t,this.leading=i,this.trailing=r}call(e,t){return t.subscribe(new GMe(e,this.duration,this.scheduler,this.leading,this.trailing))}}class GMe extends Rt{constructor(e,t,i,r,s){super(e),this.duration=t,this.scheduler=i,this.leading=r,this.trailing=s,this._hasTrailingValue=!1,this._trailingValue=null}_next(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(WMe,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)}}function WMe(n){const{subscriber:e}=n;e.clearThrottle()}var vG=Ve(266);const qMe={tooltipState:Jl("state",[br("initial, void, hidden",Kn({opacity:0,transform:"scale(0)"})),br("visible",Kn({transform:"scale(1)"})),Qs("* => visible",Mo("200ms cubic-bezier(0, 0, 0.2, 1)",kne([Kn({opacity:0,transform:"scale(0)",offset:0}),Kn({opacity:.5,transform:"scale(0.99)",offset:.5}),Kn({opacity:1,transform:"scale(1)",offset:1})]))),Qs("* => hidden",Mo("100ms cubic-bezier(0, 0, 0.2, 1)",Kn({opacity:0})))])},bG="tooltip-panel",CG=Yg({passive:!0}),wG=new _e("mat-tooltip-scroll-strategy"),ZMe={provide:wG,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition({scrollThrottle:20})}},QMe=new _e("mat-tooltip-default-options",{providedIn:"root",factory:function(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}});let e1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d,f,p,g){this._overlay=t,this._elementRef=i,this._scrollDispatcher=r,this._viewContainerRef=s,this._ngZone=o,this._platform=a,this._ariaDescriber=l,this._focusMonitor=c,this._dir=f,this._defaultOptions=p,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this._viewportMargin=8,this._cssClassPrefix="mat",this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new we,this._handleKeydown=_=>{this._isTooltipVisible()&&27===_.keyCode&&!Yo(_)&&(_.preventDefault(),_.stopPropagation(),this._ngZone.run(()=>this.hide(0)))},this._scrollStrategy=d,this._document=g,p&&(p.position&&(this.position=p.position),p.touchGestures&&(this.touchGestures=p.touchGestures)),f.change.pipe(zn(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)}),o.runOutsideAngular(()=>{i.nativeElement.addEventListener("keydown",this._handleKeydown)})}get position(){return this._position}set position(t){var i;t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),null===(i=this._tooltipInstance)||void 0===i||i.show(0),this._overlayRef.updatePosition()))}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()}get message(){return this._message}set message(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular(()=>{Promise.resolve().then(()=>{this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")})}))}get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(zn(this._destroyed)).subscribe(t=>{t?"keyboard"===t&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const t=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),t.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach(([i,r])=>{t.removeEventListener(i,r,CG)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay){if(this.disabled||!this.message||this._isTooltipVisible()&&!this._tooltipInstance._showTimeoutId&&!this._tooltipInstance._hideTimeoutId)return;const i=this._createOverlay();this._detach(),this._portal=this._portal||new sm(this._tooltipComponent,this._viewContainerRef),this._tooltipInstance=i.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(zn(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}hide(t=this.hideDelay){this._tooltipInstance&&this._tooltipInstance.hide(t)}toggle(){this._isTooltipVisible()?this.hide():this.show()}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(){if(this._overlayRef)return this._overlayRef;const t=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),i=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(t);return i.positionChanges.pipe(zn(this._destroyed)).subscribe(r=>{this._updateCurrentPositionClass(r.connectionPair),this._tooltipInstance&&r.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:i,panelClass:`${this._cssClassPrefix}-${bG}`,scrollStrategy:this._scrollStrategy()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(zn(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(zn(this._destroyed)).subscribe(()=>{var r;return null===(r=this._tooltipInstance)||void 0===r?void 0:r._handleBodyInteraction()}),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const i=t.getConfig().positionStrategy,r=this._getOrigin(),s=this._getOverlayPosition();i.withPositions([this._addOffset(Object.assign(Object.assign({},r.main),s.main)),this._addOffset(Object.assign(Object.assign({},r.fallback),s.fallback))])}_addOffset(t){return t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i||"below"==i?r={originX:"center",originY:"above"==i?"top":"bottom"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={originX:"start",originY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={originX:"end",originY:"center"});const{x:s,y:o}=this._invertPosition(r.originX,r.originY);return{main:r,fallback:{originX:s,originY:o}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,i=this.position;let r;"above"==i?r={overlayX:"center",overlayY:"bottom"}:"below"==i?r={overlayX:"center",overlayY:"top"}:"before"==i||"left"==i&&t||"right"==i&&!t?r={overlayX:"end",overlayY:"center"}:("after"==i||"right"==i&&t||"left"==i&&!t)&&(r={overlayX:"start",overlayY:"center"});const{x:s,y:o}=this._invertPosition(r.overlayX,r.overlayY);return{main:r,fallback:{overlayX:s,overlayY:o}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(_i(1),zn(this._destroyed)).subscribe(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,i){return"above"===this.position||"below"===this.position?"top"===i?i="bottom":"bottom"===i&&(i="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:i}}_updateCurrentPositionClass(t){const{overlayY:i,originX:r,originY:s}=t;let o;if(o="center"===i?this._dir&&"rtl"===this._dir.value?"end"===r?"left":"right":"start"===r?"left":"right":"bottom"===i&&"top"===s?"above":"below",o!==this._currentPosition){const a=this._overlayRef;if(a){const l=`${this._cssClassPrefix}-${bG}-`;a.removePanelClass(l+this._currentPosition),a.addPanelClass(l+o)}this._currentPosition=o}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",()=>{this._setupPointerExitEventsIfNeeded(),this.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",()=>{this._setupPointerExitEventsIfNeeded(),clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>this.show(),500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",()=>this.hide()],["wheel",i=>this._wheelListener(i)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const i=()=>{clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions.touchendHideDelay)};t.push(["touchend",i],["touchcancel",i])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([i,r])=>{this._elementRef.nativeElement.addEventListener(i,r,CG)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const i=this._document.elementFromPoint(t.clientX,t.clientY),r=this._elementRef.nativeElement;i!==r&&!r.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const i=this._elementRef.nativeElement,r=i.style;("on"===t||"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName)&&(r.userSelect=r.msUserSelect=r.webkitUserSelect=r.MozUserSelect="none"),("on"===t||!i.draggable)&&(r.webkitUserDrag="none"),r.touchAction="none",r.webkitTapHighlightColor="transparent"}}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(nt),E(rm),E(es),E(lt),E(ii),E(iV),E(hl),E(void 0),E(Ko),E(void 0),E(rt))},n.\u0275dir=he({type:n,inputs:{showDelay:["matTooltipShowDelay","showDelay"],hideDelay:["matTooltipHideDelay","hideDelay"],touchGestures:["matTooltipTouchGestures","touchGestures"],position:["matTooltipPosition","position"],disabled:["matTooltipDisabled","disabled"],message:["matTooltip","message"],tooltipClass:["matTooltipClass","tooltipClass"]}}),n})(),cc=(()=>{class n extends e1e{constructor(t,i,r,s,o,a,l,c,d,f,p,g){super(t,i,r,s,o,a,l,c,d,f,p,g),this._tooltipComponent=n1e}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(nt),E(rm),E(es),E(lt),E(ii),E(iV),E(hl),E(wG),E(Ko,8),E(QMe,8),E(rt))},n.\u0275dir=he({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-tooltip-trigger"],exportAs:["matTooltip"],features:[ht]}),n})(),t1e=(()=>{class n{constructor(t){this._changeDetectorRef=t,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new we}show(t){clearTimeout(this._hideTimeoutId),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout(()=>{this._visibility="visible",this._showTimeoutId=void 0,this._onShow(),this._markForCheck()},t)}hide(t){clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._visibility="hidden",this._hideTimeoutId=void 0,this._markForCheck()},t)}afterHidden(){return this._onHide}isVisible(){return"visible"===this._visibility}ngOnDestroy(){clearTimeout(this._showTimeoutId),clearTimeout(this._hideTimeoutId),this._onHide.complete()}_animationStart(){this._closeOnInteraction=!1}_animationDone(t){const i=t.toState;"hidden"===i&&!this.isVisible()&&this._onHide.next(),("visible"===i||"hidden"===i)&&(this._closeOnInteraction=!0)}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_onShow(){}}return n.\u0275fac=function(t){return new(t||n)(E(Un))},n.\u0275dir=he({type:n}),n})(),n1e=(()=>{class n extends t1e{constructor(t,i){super(t),this._breakpointObserver=i,this._isHandset=this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)")}}return n.\u0275fac=function(t){return new(t||n)(E(Un),E(kO))},n.\u0275cmp=Le({type:n,selectors:[["mat-tooltip-component"]],hostAttrs:["aria-hidden","true"],hostVars:2,hostBindings:function(t,i){2&t&&gf("zoom","visible"===i._visibility?1:null)},features:[ht],decls:3,vars:7,consts:[[1,"mat-tooltip",3,"ngClass"]],template:function(t,i){if(1&t&&(F(0,"div",0),ye("@state.start",function(){return i._animationStart()})("@state.done",function(s){return i._animationDone(s)}),yn(1,"async"),Te(2),N()),2&t){let r;at("mat-tooltip-handset",null==(r=wn(1,5,i._isHandset))?null:r.matches),ie("ngClass",i.tooltipClass)("@state",i._visibility),Y(2),Ai(i.message)}},directives:[sE],pipes:[zu],styles:[".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"],encapsulation:2,data:{animation:[qMe.tooltipState]},changeDetection:0}),n})(),uc=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[ZMe],imports:[[Ine,bn,$v,Nn],Nn,zv]}),n})();const i1e=["sliderWrapper"],yl=Yg({passive:!1}),l1e={provide:Ao,useExisting:T(()=>wk),multi:!0};class c1e{}const u1e=Nf(kf(em(class{constructor(n){this._elementRef=n}}),"accent"));let wk=(()=>{class n extends u1e{constructor(t,i,r,s,o,a,l,c){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this._dir=s,this._ngZone=a,this._animationMode=c,this._invert=!1,this._max=100,this._min=0,this._step=1,this._thumbLabel=!1,this._tickInterval=0,this._value=null,this._vertical=!1,this.change=new Pe,this.input=new Pe,this.valueChange=new Pe,this.onTouched=()=>{},this._percent=0,this._isSliding=null,this._isActive=!1,this._tickIntervalPercent=0,this._sliderDimensions=null,this._controlValueAccessorChangeFn=()=>{},this._dirChangeSubscription=Ie.EMPTY,this._pointerDown=d=>{this.disabled||this._isSliding||!Gb(d)&&0!==d.button||this._ngZone.run(()=>{this._touchId=Gb(d)?function(n,e){for(let t=0;t{if("pointer"===this._isSliding){const f=EG(d,this._touchId);if(f){d.preventDefault();const p=this.value;this._lastPointerEvent=d,this._updateValueFromPosition(f),p!=this.value&&this._emitInputEvent()}}},this._pointerUp=d=>{"pointer"===this._isSliding&&(!Gb(d)||"number"!=typeof this._touchId||Ek(d.changedTouches,this._touchId))&&(d.preventDefault(),this._removeGlobalEvents(),this._isSliding=null,this._touchId=void 0,this._valueOnSlideStart!=this.value&&!this.disabled&&this._emitChangeEvent(),this._valueOnSlideStart=this._lastPointerEvent=null)},this._windowBlur=()=>{this._lastPointerEvent&&this._pointerUp(this._lastPointerEvent)},this._document=l,this.tabIndex=parseInt(o)||0,a.runOutsideAngular(()=>{const d=t.nativeElement;d.addEventListener("mousedown",this._pointerDown,yl),d.addEventListener("touchstart",this._pointerDown,yl)})}get invert(){return this._invert}set invert(t){this._invert=Dt(t)}get max(){return this._max}set max(t){this._max=So(t,this._max),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get min(){return this._min}set min(t){this._min=So(t,this._min),this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}get step(){return this._step}set step(t){this._step=So(t,this._step),this._step%1!=0&&(this._roundToDecimal=this._step.toString().split(".").pop().length),this._changeDetectorRef.markForCheck()}get thumbLabel(){return this._thumbLabel}set thumbLabel(t){this._thumbLabel=Dt(t)}get tickInterval(){return this._tickInterval}set tickInterval(t){this._tickInterval="auto"===t?"auto":"number"==typeof t||"string"==typeof t?So(t,this._tickInterval):0}get value(){return null===this._value&&(this.value=this._min),this._value}set value(t){if(t!==this._value){let i=So(t,0);this._roundToDecimal&&i!==this.min&&i!==this.max&&(i=parseFloat(i.toFixed(this._roundToDecimal))),this._value=i,this._percent=this._calculatePercentage(this._value),this._changeDetectorRef.markForCheck()}}get vertical(){return this._vertical}set vertical(t){this._vertical=Dt(t)}get displayValue(){return this.displayWith?this.displayWith(this.value):this._roundToDecimal&&this.value&&this.value%1!=0?this.value.toFixed(this._roundToDecimal):this.value||0}focus(t){this._focusHostElement(t)}blur(){this._blurHostElement()}get percent(){return this._clamp(this._percent)}_shouldInvertAxis(){return this.vertical?!this.invert:this.invert}_isMinValue(){return 0===this.percent}_getThumbGap(){return this.disabled?7:this._isMinValue()&&!this.thumbLabel?this._isActive?10:7:0}_getTrackBackgroundStyles(){const i=this.vertical?`1, ${1-this.percent}, 1`:1-this.percent+", 1, 1";return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"-":""}${this._getThumbGap()}px) scale3d(${i})`}}_getTrackFillStyles(){const t=this.percent,r=this.vertical?`1, ${t}, 1`:`${t}, 1, 1`;return{transform:`translate${this.vertical?"Y":"X"}(${this._shouldInvertMouseCoords()?"":"-"}${this._getThumbGap()}px) scale3d(${r})`,display:0===t?"none":""}}_getTicksContainerStyles(){return{transform:`translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"-":""}${this._tickIntervalPercent/2*100}%)`}}_getTicksStyles(){let t=100*this._tickIntervalPercent,a={backgroundSize:this.vertical?`2px ${t}%`:`${t}% 2px`,transform:`translateZ(0) translate${this.vertical?"Y":"X"}(${this.vertical||"rtl"!=this._getDirection()?"":"-"}${t/2}%)${this.vertical||"rtl"!=this._getDirection()?"":" rotate(180deg)"}`};if(this._isMinValue()&&this._getThumbGap()){const l=this._shouldInvertAxis();let c;c=this.vertical?l?"Bottom":"Top":l?"Right":"Left",a[`padding${c}`]=`${this._getThumbGap()}px`}return a}_getThumbContainerStyles(){const t=this._shouldInvertAxis();return{transform:`translate${this.vertical?"Y":"X"}(-${100*(("rtl"!=this._getDirection()||this.vertical?t:!t)?this.percent:1-this.percent)}%)`}}_shouldInvertMouseCoords(){const t=this._shouldInvertAxis();return"rtl"!=this._getDirection()||this.vertical?t:!t}_getDirection(){return this._dir&&"rtl"==this._dir.value?"rtl":"ltr"}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{this._isActive=!!t&&"keyboard"!==t,this._changeDetectorRef.detectChanges()}),this._dir&&(this._dirChangeSubscription=this._dir.change.subscribe(()=>{this._changeDetectorRef.markForCheck()}))}ngOnDestroy(){const t=this._elementRef.nativeElement;t.removeEventListener("mousedown",this._pointerDown,yl),t.removeEventListener("touchstart",this._pointerDown,yl),this._lastPointerEvent=null,this._removeGlobalEvents(),this._focusMonitor.stopMonitoring(this._elementRef),this._dirChangeSubscription.unsubscribe()}_onMouseenter(){this.disabled||(this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent())}_onFocus(){this._sliderDimensions=this._getSliderDimensions(),this._updateTickIntervalPercent()}_onBlur(){this.onTouched()}_onKeydown(t){if(this.disabled||Yo(t)||this._isSliding&&"keyboard"!==this._isSliding)return;const i=this.value;switch(t.keyCode){case 33:this._increment(10);break;case 34:this._increment(-10);break;case 35:this.value=this.max;break;case 36:this.value=this.min;break;case 37:this._increment("rtl"==this._getDirection()?1:-1);break;case 38:this._increment(1);break;case 39:this._increment("rtl"==this._getDirection()?-1:1);break;case 40:this._increment(-1);break;default:return}i!=this.value&&(this._emitInputEvent(),this._emitChangeEvent()),this._isSliding="keyboard",t.preventDefault()}_onKeyup(){"keyboard"===this._isSliding&&(this._isSliding=null)}_getWindow(){return this._document.defaultView||window}_bindGlobalEvents(t){const i=this._document,r=Gb(t),o=r?"touchend":"mouseup";i.addEventListener(r?"touchmove":"mousemove",this._pointerMove,yl),i.addEventListener(o,this._pointerUp,yl),r&&i.addEventListener("touchcancel",this._pointerUp,yl);const a=this._getWindow();void 0!==a&&a&&a.addEventListener("blur",this._windowBlur)}_removeGlobalEvents(){const t=this._document;t.removeEventListener("mousemove",this._pointerMove,yl),t.removeEventListener("mouseup",this._pointerUp,yl),t.removeEventListener("touchmove",this._pointerMove,yl),t.removeEventListener("touchend",this._pointerUp,yl),t.removeEventListener("touchcancel",this._pointerUp,yl);const i=this._getWindow();void 0!==i&&i&&i.removeEventListener("blur",this._windowBlur)}_increment(t){this.value=this._clamp((this.value||0)+this.step*t,this.min,this.max)}_updateValueFromPosition(t){if(!this._sliderDimensions)return;let o=this._clamp(((this.vertical?t.y:t.x)-(this.vertical?this._sliderDimensions.top:this._sliderDimensions.left))/(this.vertical?this._sliderDimensions.height:this._sliderDimensions.width));if(this._shouldInvertMouseCoords()&&(o=1-o),0===o)this.value=this.min;else if(1===o)this.value=this.max;else{const a=this._calculateValue(o),l=Math.round((a-this.min)/this.step)*this.step+this.min;this.value=this._clamp(l,this.min,this.max)}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.value),this.valueChange.emit(this.value),this.change.emit(this._createChangeEvent())}_emitInputEvent(){this.input.emit(this._createChangeEvent())}_updateTickIntervalPercent(){if(this.tickInterval&&this._sliderDimensions)if("auto"==this.tickInterval){let t=this.vertical?this._sliderDimensions.height:this._sliderDimensions.width,s=Math.ceil(30/(t*this.step/(this.max-this.min)))*this.step;this._tickIntervalPercent=s/t}else this._tickIntervalPercent=this.tickInterval*this.step/(this.max-this.min)}_createChangeEvent(t=this.value){let i=new c1e;return i.source=this,i.value=t,i}_calculatePercentage(t){return((t||0)-this.min)/(this.max-this.min)}_calculateValue(t){return this.min+t*(this.max-this.min)}_clamp(t,i=0,r=1){return Math.max(i,Math.min(t,r))}_getSliderDimensions(){return this._sliderWrapper?this._sliderWrapper.nativeElement.getBoundingClientRect():null}_focusHostElement(t){this._elementRef.nativeElement.focus(t)}_blurHostElement(){this._elementRef.nativeElement.blur()}writeValue(t){this.value=t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Un),E(Ko,8),fs("tabindex"),E(lt),E(rt),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-slider"]],viewQuery:function(t,i){if(1&t&&ni(i1e,5),2&t){let r;Mt(r=xt())&&(i._sliderWrapper=r.first)}},hostAttrs:["role","slider",1,"mat-slider","mat-focus-indicator"],hostVars:29,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()})("keydown",function(s){return i._onKeydown(s)})("keyup",function(){return i._onKeyup()})("mouseenter",function(){return i._onMouseenter()})("selectstart",function(s){return s.preventDefault()}),2&t&&(sl("tabIndex",i.tabIndex),en("aria-disabled",i.disabled)("aria-valuemax",i.max)("aria-valuemin",i.min)("aria-valuenow",i.value)("aria-valuetext",null==i.valueText?i.displayValue:i.valueText)("aria-orientation",i.vertical?"vertical":"horizontal"),at("mat-slider-disabled",i.disabled)("mat-slider-has-ticks",i.tickInterval)("mat-slider-horizontal",!i.vertical)("mat-slider-axis-inverted",i._shouldInvertAxis())("mat-slider-invert-mouse-coords",i._shouldInvertMouseCoords())("mat-slider-sliding",i._isSliding)("mat-slider-thumb-label-showing",i.thumbLabel)("mat-slider-vertical",i.vertical)("mat-slider-min-value",i._isMinValue())("mat-slider-hide-last-tick",i.disabled||i._isMinValue()&&i._getThumbGap()&&i._shouldInvertAxis())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{disabled:"disabled",color:"color",tabIndex:"tabIndex",invert:"invert",max:"max",min:"min",step:"step",thumbLabel:"thumbLabel",tickInterval:"tickInterval",value:"value",vertical:"vertical",displayWith:"displayWith",valueText:"valueText"},outputs:{change:"change",input:"input",valueChange:"valueChange"},exportAs:["matSlider"],features:[At([l1e]),ht],decls:13,vars:6,consts:[[1,"mat-slider-wrapper"],["sliderWrapper",""],[1,"mat-slider-track-wrapper"],[1,"mat-slider-track-background",3,"ngStyle"],[1,"mat-slider-track-fill",3,"ngStyle"],[1,"mat-slider-ticks-container",3,"ngStyle"],[1,"mat-slider-ticks",3,"ngStyle"],[1,"mat-slider-thumb-container",3,"ngStyle"],[1,"mat-slider-focus-ring"],[1,"mat-slider-thumb"],[1,"mat-slider-thumb-label"],[1,"mat-slider-thumb-label-text"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"div",2),et(3,"div",3),et(4,"div",4),N(),F(5,"div",5),et(6,"div",6),N(),F(7,"div",7),et(8,"div",8),et(9,"div",9),F(10,"div",10),F(11,"span",11),Te(12),N(),N(),N(),N()),2&t&&(Y(3),ie("ngStyle",i._getTrackBackgroundStyles()),Y(1),ie("ngStyle",i._getTrackFillStyles()),Y(1),ie("ngStyle",i._getTicksContainerStyles()),Y(1),ie("ngStyle",i._getTicksStyles()),Y(1),ie("ngStyle",i._getThumbContainerStyles()),Y(5),Ai(i.displayValue))},directives:[M3],styles:['.mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:"";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n'],encapsulation:2,changeDetection:0}),n})();function Gb(n){return"t"===n.type[0]}function EG(n,e){let t;return t=Gb(n)?"number"==typeof e?Ek(n.touches,e)||Ek(n.changedTouches,e):n.touches[0]||n.changedTouches[0]:n,t?{x:t.clientX,y:t.clientY}:void 0}function Ek(n,e){for(let t=0;t{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn],Nn]}),n})();function h1e(n,e){}class Sk{constructor(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.maxWidth="80vw",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.autoFocus=!0,this.restoreFocus=!0,this.closeOnNavigation=!0}}const f1e={dialogContainer:Jl("dialogContainer",[br("void, exit",Kn({opacity:0,transform:"scale(0.7)"})),br("enter",Kn({transform:"none"})),Qs("* => enter",Mo("150ms cubic-bezier(0, 0, 0.2, 1)",Kn({transform:"none",opacity:1}))),Qs("* => void, * => exit",Mo("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",Kn({opacity:0})))])};let p1e=(()=>{class n extends nS{constructor(t,i,r,s,o,a){super(),this._elementRef=t,this._focusTrapFactory=i,this._changeDetectorRef=r,this._config=o,this._focusMonitor=a,this._animationStateChanged=new Pe,this._elementFocusedBeforeDialogWasOpened=null,this._closeInteractionType=null,this.attachDomPortal=l=>(this._portalOutlet.hasAttached(),this._portalOutlet.attachDomPortal(l)),this._ariaLabelledBy=o.ariaLabelledBy||null,this._document=s}_initializeWithAttachedContent(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()}attachComponentPortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(t)}attachTemplatePortal(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(t)}_recaptureFocus(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()}_trapFocus(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()}_restoreFocus(){const t=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&t&&"function"==typeof t.focus){const i=vE(),r=this._elementRef.nativeElement;(!i||i===this._document.body||i===r||r.contains(i))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_setupFocusTrap(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)}_capturePreviouslyFocusedElement(){this._document&&(this._elementFocusedBeforeDialogWasOpened=vE())}_focusDialogContainer(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()}_containsFocus(){const t=this._elementRef.nativeElement,i=vE();return t===i||t.contains(i)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(dV),E(Un),E(rt,8),E(Sk),E(hl))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&ni(zf,7),2&t){let r;Mt(r=xt())&&(i._portalOutlet=r.first)}},features:[ht]}),n})(),g1e=(()=>{class n extends p1e{constructor(){super(...arguments),this._state="enter"}_onAnimationDone({toState:t,totalTime:i}){"enter"===t?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:i})):"exit"===t&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:i}))}_onAnimationStart({toState:t,totalTime:i}){"enter"===t?this._animationStateChanged.next({state:"opening",totalTime:i}):("exit"===t||"void"===t)&&this._animationStateChanged.next({state:"closing",totalTime:i})}_startExitAnimation(){this._state="exit",this._changeDetectorRef.markForCheck()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275cmp=Le({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1","aria-modal","true",1,"mat-dialog-container"],hostVars:6,hostBindings:function(t,i){1&t&&qy("@dialogContainer.start",function(s){return i._onAnimationStart(s)})("@dialogContainer.done",function(s){return i._onAnimationDone(s)}),2&t&&(sl("id",i._id),en("role",i._config.role)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledBy)("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null),Sg("@dialogContainer",i._state))},features:[ht],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){1&t&&Ct(0,h1e,0,0,"ng-template",0)},directives:[zf],styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[f1e.dialogContainer]}}),n})(),m1e=0;class Gm{constructor(e,t,i="mat-dialog-"+m1e++){this._overlayRef=e,this._containerInstance=t,this.id=i,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new we,this._afterClosed=new we,this._beforeClosed=new we,this._state=0,t._id=i,t._animationStateChanged.pipe(Tn(r=>"opened"===r.state),_i(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(Tn(r=>"closed"===r.state),_i(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),e.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._afterClosed.next(this._result),this._afterClosed.complete(),this.componentInstance=null,this._overlayRef.dispose()}),e.keydownEvents().pipe(Tn(r=>27===r.keyCode&&!this.disableClose&&!Yo(r))).subscribe(r=>{r.preventDefault(),Mk(this,"keyboard")}),e.backdropClick().subscribe(()=>{this.disableClose?this._containerInstance._recaptureFocus():Mk(this,"mouse")})}close(e){this._result=e,this._containerInstance._animationStateChanged.pipe(Tn(t=>"closing"===t.state),_i(1)).subscribe(t=>{this._beforeClosed.next(e),this._beforeClosed.complete(),this._overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.totalTime+100)}),this._state=1,this._containerInstance._startExitAnimation()}afterOpened(){return this._afterOpened}afterClosed(){return this._afterClosed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._overlayRef.backdropClick()}keydownEvents(){return this._overlayRef.keydownEvents()}updatePosition(e){let t=this._getPositionStrategy();return e&&(e.left||e.right)?e.left?t.left(e.left):t.right(e.right):t.centerHorizontally(),e&&(e.top||e.bottom)?e.top?t.top(e.top):t.bottom(e.bottom):t.centerVertically(),this._overlayRef.updatePosition(),this}updateSize(e="",t=""){return this._overlayRef.updateSize({width:e,height:t}),this._overlayRef.updatePosition(),this}addPanelClass(e){return this._overlayRef.addPanelClass(e),this}removePanelClass(e){return this._overlayRef.removePanelClass(e),this}getState(){return this._state}_finishDialogClose(){this._state=2,this._overlayRef.dispose()}_getPositionStrategy(){return this._overlayRef.getConfig().positionStrategy}}function Mk(n,e,t){return void 0!==n._containerInstance&&(n._containerInstance._closeInteractionType=e),n.close(t)}const xk=new _e("MatDialogData"),_1e=new _e("mat-dialog-default-options"),MG=new _e("mat-dialog-scroll-strategy"),v1e={provide:MG,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.block()}};let b1e=(()=>{class n{constructor(t,i,r,s,o,a,l,c,d){this._overlay=t,this._injector=i,this._defaultOptions=r,this._parentDialog=s,this._overlayContainer=o,this._dialogRefConstructor=l,this._dialogContainerType=c,this._dialogDataToken=d,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new we,this._afterOpenedAtThisLevel=new we,this._ariaHiddenElements=new Map,this.afterAllClosed=zb(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(ns(void 0))),this._scrollStrategy=a}get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){const t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel}open(t,i){(i=function(n,e){return Object.assign(Object.assign({},e),n)}(i,this._defaultOptions||new Sk)).id&&this.getDialogById(i.id);const r=this._createOverlay(i),s=this._attachDialogContainer(r,i),o=this._attachDialogContent(t,s,r,i);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(o),o.afterClosed().subscribe(()=>this._removeOpenDialog(o)),this.afterOpened.next(o),s._initializeWithAttachedContent(),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(t){return this.openDialogs.find(i=>i.id===t)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_createOverlay(t){const i=this._getOverlayConfig(t);return this._overlay.create(i)}_getOverlayConfig(t){const i=new Hv({positionStrategy:this._overlay.position().global(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,disposeOnNavigation:t.closeOnNavigation});return t.backdropClass&&(i.backdropClass=t.backdropClass),i}_attachDialogContainer(t,i){const s=Tt.create({parent:i&&i.viewContainerRef&&i.viewContainerRef.injector||this._injector,providers:[{provide:Sk,useValue:i}]}),o=new sm(this._dialogContainerType,i.viewContainerRef,s,i.componentFactoryResolver);return t.attach(o).instance}_attachDialogContent(t,i,r,s){const o=new this._dialogRefConstructor(r,i,s.id);if(t instanceof Xs)i.attachTemplatePortal(new Uf(t,null,{$implicit:s.data,dialogRef:o}));else{const a=this._createInjector(s,o,i),l=i.attachComponentPortal(new sm(t,s.viewContainerRef,a));o.componentInstance=l.instance}return o.updateSize(s.width,s.height).updatePosition(s.position),o}_createInjector(t,i,r){const s=t&&t.viewContainerRef&&t.viewContainerRef.injector,o=[{provide:this._dialogContainerType,useValue:r},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:i}];return t.direction&&(!s||!s.get(Ko,null,vt.Optional))&&o.push({provide:Ko,useValue:{value:t.direction,change:st()}}),Tt.create({parent:s||this._injector,providers:o})}_removeOpenDialog(t){const i=this.openDialogs.indexOf(t);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,s)=>{r?s.setAttribute("aria-hidden",r):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(){const t=this._overlayContainer.getContainerElement();if(t.parentElement){const i=t.parentElement.children;for(let r=i.length-1;r>-1;r--){let s=i[r];s!==t&&"SCRIPT"!==s.nodeName&&"STYLE"!==s.nodeName&&!s.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(s,s.getAttribute("aria-hidden")),s.setAttribute("aria-hidden","true"))}}}_closeDialogs(t){let i=t.length;for(;i--;)t[i].close()}}return n.\u0275fac=function(t){return new(t||n)(E(Jo),E(Tt),E(void 0),E(void 0),E(om),E(void 0),E(Su),E(Su),E(_e))},n.\u0275dir=he({type:n}),n})(),Wm=(()=>{class n extends b1e{constructor(t,i,r,s,o,a,l){super(t,i,s,a,l,o,Gm,g1e,xk)}}return n.\u0275fac=function(t){return new(t||n)(I(Jo),I(Tt),I(Ug,8),I(_1e,8),I(MG),I(n,12),I(om))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),w1e=0,xG=(()=>{class n{constructor(t,i,r){this._dialogRef=t,this._elementRef=i,this._dialog=r,this.id="mat-dialog-title-"+w1e++}ngOnInit(){this._dialogRef||(this._dialogRef=function(n,e){let t=n.nativeElement.parentElement;for(;t&&!t.classList.contains("mat-dialog-container");)t=t.parentElement;return t?e.find(i=>i.id===t.id):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{const t=this._dialogRef._containerInstance;t&&!t._ariaLabelledBy&&(t._ariaLabelledBy=this.id)})}}return n.\u0275fac=function(t){return new(t||n)(E(Gm,8),E(nt),E(Wm))},n.\u0275dir=he({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-dialog-title"],hostVars:1,hostBindings:function(t,i){2&t&&sl("id",i.id)},inputs:{id:"id"},exportAs:["matDialogTitle"]}),n})(),TG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-dialog-content"]}),n})();let Tk=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[Wm,v1e],imports:[[$v,iS,Nn],Nn]}),n})();const Ak=new _e("CdkAccordion");let M1e=0,T1e=(()=>{class n{constructor(t,i,r){this.accordion=t,this._changeDetectorRef=i,this._expansionDispatcher=r,this._openCloseAllSubscription=Ie.EMPTY,this.closed=new Pe,this.opened=new Pe,this.destroyed=new Pe,this.expandedChange=new Pe,this.id="cdk-accordion-child-"+M1e++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=r.listen((s,o)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===o&&this.id!==s&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=Dt(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}}return n.\u0275fac=function(t){return new(t||n)(E(Ak,12),E(Un),E(tS))},n.\u0275dir=he({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[At([{provide:Ak,useValue:void 0}])]}),n})(),A1e=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const D1e=["body"];function O1e(n,e){}const I1e=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],P1e=["mat-expansion-panel-header","*","mat-action-row"];function R1e(n,e){1&n&&et(0,"span",2),2&n&&ie("@indicatorRotate",bt()._getExpandedState())}const k1e=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],F1e=["mat-panel-title","mat-panel-description","*"],Dk=new _e("MAT_ACCORDION"),DG="225ms cubic-bezier(0.4,0.0,0.2,1)",OG={indicatorRotate:Jl("indicatorRotate",[br("collapsed, void",Kn({transform:"rotate(0deg)"})),br("expanded",Kn({transform:"rotate(180deg)"})),Qs("expanded <=> collapsed, void => collapsed",Mo(DG))]),bodyExpansion:Jl("bodyExpansion",[br("collapsed, void",Kn({height:"0px",visibility:"hidden"})),br("expanded",Kn({height:"*",visibility:"visible"})),Qs("expanded <=> collapsed, void => collapsed",Mo(DG))])};let N1e=(()=>{class n{constructor(t){this._template=t}}return n.\u0275fac=function(t){return new(t||n)(E(Xs))},n.\u0275dir=he({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]}),n})(),L1e=0;const IG=new _e("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let NM=(()=>{class n extends T1e{constructor(t,i,r,s,o,a,l){super(t,i,r),this._viewContainerRef=s,this._animationMode=a,this._hideToggle=!1,this.afterExpand=new Pe,this.afterCollapse=new Pe,this._inputChanges=new we,this._headerId="mat-expansion-panel-header-"+L1e++,this._bodyAnimationDone=new we,this.accordion=t,this._document=o,this._bodyAnimationDone.pipe(Xo((c,d)=>c.fromState===d.fromState&&c.toState===d.toState)).subscribe(c=>{"void"!==c.fromState&&("expanded"===c.toState?this.afterExpand.emit():"collapsed"===c.toState&&this.afterCollapse.emit())}),l&&(this.hideToggle=l.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=Dt(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe(ns(null),Tn(()=>this.expanded&&!this._portal),_i(1)).subscribe(()=>{this._portal=new Uf(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,i=this._body.nativeElement;return t===i||i.contains(t)}return!1}}return n.\u0275fac=function(t){return new(t||n)(E(Dk,12),E(Un),E(tS),E(es),E(rt),E(Zo,8),E(IG,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,N1e,5),2&t){let s;Mt(s=xt())&&(i._lazyContent=s.first)}},viewQuery:function(t,i){if(1&t&&ni(D1e,5),2&t){let r;Mt(r=xt())&&(i._body=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,i){2&t&&at("mat-expanded",i.expanded)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[At([{provide:Dk,useValue:void 0}]),ht,qn],ngContentSelectors:P1e,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,i){1&t&&(Dr(I1e),In(0),F(1,"div",0,1),ye("@bodyExpansion.done",function(s){return i._bodyAnimationDone.next(s)}),F(3,"div",2),In(4,1),Ct(5,O1e,0,0,"ng-template",3),N(),In(6,2),N()),2&t&&(Y(1),ie("@bodyExpansion",i._getExpandedState())("id",i.id),en("aria-labelledby",i._headerId),Y(4),ie("cdkPortalOutlet",i._portal))},directives:[zf],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[OG.bodyExpansion]},changeDetection:0}),n})();class V1e{}const j1e=Nf(V1e);let LM=(()=>{class n extends j1e{constructor(t,i,r,s,o,a,l){super(),this.panel=t,this._element=i,this._focusMonitor=r,this._changeDetectorRef=s,this._animationMode=a,this._parentChangeSubscription=Ie.EMPTY;const c=t.accordion?t.accordion._stateChanges.pipe(Tn(d=>!(!d.hideToggle&&!d.togglePosition))):Ql;this.tabIndex=parseInt(l||"")||0,this._parentChangeSubscription=ki(t.opened,t.closed,c,t._inputChanges.pipe(Tn(d=>!!(d.hideToggle||d.disabled||d.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Tn(()=>t._containsFocus())).subscribe(()=>r.focusVia(i,"program")),o&&(this.expandedHeight=o.expandedHeight,this.collapsedHeight=o.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case 32:case 13:Yo(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t,i){t?this._focusMonitor.focusVia(this._element,t,i):this._element.nativeElement.focus(i)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return n.\u0275fac=function(t){return new(t||n)(E(NM,1),E(nt),E(hl),E(Un),E(IG,8),E(Zo,8),fs("tabindex"))},n.\u0275cmp=Le({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,i){1&t&&ye("click",function(){return i._toggle()})("keydown",function(s){return i._keydown(s)}),2&t&&(en("id",i.panel._headerId)("tabindex",i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),gf("height",i._getHeaderHeight()),at("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after","after"===i._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===i._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{tabIndex:"tabIndex",expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},features:[ht],ngContentSelectors:F1e,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,i){1&t&&(Dr(k1e),F(0,"span",0),In(1),In(2,1),In(3,2),N(),Ct(4,R1e,1,1,"span",1)),2&t&&(Y(4),ie("ngIf",i._showToggle()))},directives:[Is],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-keyboard-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel .mat-expansion-panel-header.cdk-program-focused:not([aria-disabled=true])::before,.cdk-high-contrast-active .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true])::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;border:3px solid;border-radius:4px;content:""}\n'],encapsulation:2,data:{animation:[OG.indicatorRotate]},changeDetection:0}),n})(),PG=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=he({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),n})(),Ok=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Nn,A1e,iS]]}),n})();var RG=Ve(478);Object.create(Error.prototype);const $1e=["*"];var VM=(()=>(function(n){n.LineHighlight="line-highlight",n.LineNumbers="line-numbers"}(VM||(VM={})),VM))();class W1e{}const FG=new _e("SECURITY_CONTEXT");let Ik=(()=>{class n{constructor(t,i,r,s,o){this.platform=t,this.securityContext=i,this.http=r,this.sanitizer=o,this.initialMarkedOptions={renderer:new RG.Renderer},this.options=s}get options(){return this._options}set options(t){this._options=Object.assign(Object.assign({},this.initialMarkedOptions),t)}get renderer(){return this.options.renderer}set renderer(t){this.options.renderer=t}compile(t,i=!1,r=!1,s=this.options){const o=this.trimIndentation(t),a=i?this.decodeHtml(o):o,l=r?this.renderEmoji(a):a,c=RG.parse(l,s);return this.sanitizer.sanitize(this.securityContext,c)||""}getSource(t){if(!this.http)throw new Error("[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information");return this.http.get(t,{responseType:"text"}).pipe(be(i=>this.handleExtension(t,i)))}highlight(t){if(xf(this.platform)&&"undefined"!=typeof Prism){t||(t=document);const i=t.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,r=>r.classList.add("language-none")),Prism.highlightAllUnder(t)}}renderKatex(t,i){if(!xf(this.platform))return t;if("undefined"==typeof katex||void 0===katex.renderToString)throw new Error("[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information");return t.replace(/\$([^\s][^$]*?[^\s])\$/gm,(r,s)=>katex.renderToString(s,i))}decodeHtml(t){if(!xf(this.platform))return t;const i=document.createElement("textarea");return i.innerHTML=t,i.value}handleExtension(t,i){const r=t?t.split("?")[0].split(".").splice(-1).join():"";return"md"!==r?"```"+r+"\n"+i+"\n```":i}renderEmoji(t){if(!xf(this.platform))return t;if("undefined"==typeof joypixels||void 0===joypixels.shortnameToUnicode)throw new Error("[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information");return joypixels.shortnameToUnicode(t)}trimIndentation(t){if(!t)return"";let i;return t.split("\n").map(r=>{let s=i;return r.length>0&&(s=isNaN(s)?r.search(/\S|$/):Math.min(r.search(/\S|$/),s)),isNaN(i)&&(i=s),s?r.substring(s):r}).join("\n")}}return n.\u0275fac=function(t){return new(t||n)(I(cl),I(FG),I(im,8),I(W1e,8),I(Kd))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),NG=(()=>{class n{constructor(t,i){this.element=t,this.markdownService=i,this.error=new Pe,this.load=new Pe,this.ready=new Pe,this._emoji=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1}get emoji(){return this._emoji}set emoji(t){this._emoji=this.coerceBooleanProperty(t)}get katex(){return this._katex}set katex(t){this._katex=this.coerceBooleanProperty(t)}get lineHighlight(){return this._lineHighlight}set lineHighlight(t){this._lineHighlight=this.coerceBooleanProperty(t)}get lineNumbers(){return this._lineNumbers}set lineNumbers(t){this._lineNumbers=this.coerceBooleanProperty(t)}ngOnChanges(){null==this.data?null==this.src||this.handleSrc():this.handleData()}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion()}render(t,i=!1){let r=this.markdownService.compile(t,i,this.emoji);r=this.katex?this.markdownService.renderKatex(r,this.katexOptions):r,this.element.nativeElement.innerHTML=r,this.handlePlugins(),this.markdownService.highlight(this.element.nativeElement),this.ready.emit()}coerceBooleanProperty(t){return null!=t&&"false"!=`${String(t)}`}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe(t=>{this.render(t),this.load.emit(t)},t=>this.error.emit(t))}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,VM.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(t,i){const r=t.querySelectorAll("pre");for(let s=0;s{const a=i[o];if(a){const l=this.toLispCase(o);r.item(s).setAttribute(l,a.toString())}})}toLispCase(t){const i=t.match(/([A-Z])/g);if(!i)return t;let r=t.toString();for(let s=0,o=i.length;s{class n{static forRoot(t){return{ngModule:n,providers:[Ik,t&&t.loader||[],t&&t.markedOptions||[],{provide:FG,useValue:t&&null!=t.sanitize?t.sanitize:on.HTML}]}}static forChild(){return{ngModule:n}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function LG(n,e,t){return t?LG(n,e).pipe(be(i=>Fe(i)?t(...i):t(i))):new oe(i=>{const r=(...o)=>i.next(1===o.length?o[0]:o);let s;try{s=n(r)}catch(o){return void i.error(o)}if(ft(e))return()=>e(r,s)})}function jM(...n){return e=>{let t;return"function"==typeof n[n.length-1]&&(t=n.pop()),e.lift(new J1e(n,t))}}class J1e{constructor(e,t){this.observables=e,this.project=t}call(e,t){return t.subscribe(new exe(e,this.observables,this.project))}}class exe extends RU{constructor(e,t,i){super(e),this.observables=t,this.project=i,this.toRespond=[];const r=t.length;this.values=new Array(r);for(let s=0;s0){const s=r.indexOf(i);-1!==s&&r.splice(s,1)}}notifyComplete(){}_next(e){if(0===this.toRespond.length){const t=[e,...this.values];this.project?this._tryProject(t):this.destination.next(t)}}_tryProject(e){let t;try{t=this.project.apply(this,e)}catch(i){return void this.destination.error(i)}this.destination.next(t)}}class txe{constructor(e,t,i=!1){this.accumulator=e,this.seed=t,this.hasSeed=i}call(e,t){return t.subscribe(new nxe(e,this.accumulator,this.seed,this.hasSeed))}}class nxe extends Rt{constructor(e,t,i,r){super(e),this.accumulator=t,this._seed=i,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(e){this.hasSeed=!0,this._seed=e}_next(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)}_tryNext(e){const t=this.index++;let i;try{i=this.accumulator(this.seed,e,t)}catch(r){this.destination.error(r)}this.seed=i,this.destination.next(i)}}class sxe{constructor(e){this.predicate=e}call(e,t){return t.subscribe(new oxe(e,this.predicate))}}class oxe extends Rt{constructor(e,t){super(e),this.predicate=t,this.skipping=!0,this.index=0}_next(e){const t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)}tryCallPredicate(e){try{const t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(t){this.destination.error(t)}}}const axe=["youtubeContainer"];let jG=(()=>{class n{constructor(t,i){this._ngZone=t,this._youtubeContainer=new we,this._destroyed=new we,this._playerChanges=new sr(void 0),this._videoId=new sr(void 0),this._height=new sr(390),this._width=new sr(640),this._startSeconds=new sr(void 0),this._endSeconds=new sr(void 0),this._suggestedQuality=new sr(void 0),this._playerVars=new sr(void 0),this.ready=this._getLazyEmitter("onReady"),this.stateChange=this._getLazyEmitter("onStateChange"),this.error=this._getLazyEmitter("onError"),this.apiChange=this._getLazyEmitter("onApiChange"),this.playbackQualityChange=this._getLazyEmitter("onPlaybackQualityChange"),this.playbackRateChange=this._getLazyEmitter("onPlaybackRateChange"),this._isBrowser=xf(i)}get videoId(){return this._videoId.value}set videoId(t){this._videoId.next(t)}get height(){return this._height.value}set height(t){this._height.next(t||390)}get width(){return this._width.value}set width(t){this._width.next(t||640)}set startSeconds(t){this._startSeconds.next(t)}set endSeconds(t){this._endSeconds.next(t)}set suggestedQuality(t){this._suggestedQuality.next(t)}get playerVars(){return this._playerVars.value}set playerVars(t){this._playerVars.next(t)}ngOnInit(){if(!this._isBrowser)return;let t=st(!0);if(!window.YT||!window.YT.Player){const r=new we;this._existingApiReadyCallback=window.onYouTubeIframeAPIReady,window.onYouTubeIframeAPIReady=()=>{this._existingApiReadyCallback&&this._existingApiReadyCallback(),this._ngZone.run(()=>r.next(!0))},t=r.pipe(_i(1),ns(!1))}const i=function(n,e,t,i,r,s,o){const a=or([e,s]).pipe(jM(or([i,r])),be(([l,c])=>{const[d,f]=l,[p,g]=c;return d?{videoId:d,playerVars:f,width:p,height:g}:void 0}));return or([n,a,st(o)]).pipe(function(n){return Er(function(...n){let e=null;return"function"==typeof n[n.length-1]&&(e=n.pop()),1===n.length&&Fe(n[0])&&(n=n[0].slice()),t=>t.lift.call(li([t,...n]),new NU(e))}(n),function(n){return e=>e.lift(new sxe(n))}(([e,t])=>!t),be(([e])=>e))}(t),function(n,e){let t=!1;return arguments.length>=2&&(t=!0),function(r){return r.lift(new txe(n,e,t))}}(fxe,void 0),Xo())}(this._youtubeContainer,this._videoId,t,this._width,this._height,this._playerVars,this._ngZone).pipe(Di(r=>{this._playerChanges.next(r)}),ci(e=>e?UG(e)?st(e):new oe(t=>{let i=!1,r=!1;const s=o=>{r=!0,i||(o.target.removeEventListener("onReady",s),t.next(o.target))};return e.addEventListener("onReady",s),()=>{i=!0,r||(r=>{UG(r)||r.destroy()})(e)}}).pipe(_i(1),ns(void 0)):st(void 0)),zn(this._destroyed),pc(new we));i.subscribe(r=>{this._player=r,r&&this._pendingPlayerState&&this._initializePlayer(r,this._pendingPlayerState),this._pendingPlayerState=void 0}),function(n,e,t){or([n,e,t]).subscribe(([i,r,s])=>i&&i.setSize(r,s))}(i,this._width,this._height),function(n,e){or([n,e]).subscribe(([t,i])=>t&&i&&t.setPlaybackQuality(i))}(i,this._suggestedQuality),function(n,e,t,i,r,s){const o=or([t,i]).pipe(be(([d,f])=>({startSeconds:d,endSeconds:f}))),a=o.pipe(Rk(n,d=>!!d&&!function(n){const e=n.getPlayerState();return e!==YT.PlayerState.UNSTARTED&&e!==YT.PlayerState.CUED}(d))),l=e.pipe(Rk(n,(d,f)=>!!d&&d.videoId!==f));ki(n.pipe(Rk(or([e,o]),([d,f],p)=>!(!p||d==p.videoId&&!f.startSeconds&&!f.endSeconds))),l,a).pipe(jM(or([n,e,o,r])),be(([d,f])=>f),zn(s)).subscribe(([d,f,p,g])=>{!f||!d||(d.videoId=f,d.cueVideoById(Object.assign({videoId:f,suggestedQuality:g},p)))})}(i,this._videoId,this._startSeconds,this._endSeconds,this._suggestedQuality,this._destroyed),i.connect()}createEventsBoundInZone(){return{}}ngAfterViewInit(){this._youtubeContainer.next(this.youtubeContainer.nativeElement)}ngOnDestroy(){this._player&&(this._player.destroy(),window.onYouTubeIframeAPIReady=this._existingApiReadyCallback),this._playerChanges.complete(),this._videoId.complete(),this._height.complete(),this._width.complete(),this._startSeconds.complete(),this._endSeconds.complete(),this._suggestedQuality.complete(),this._youtubeContainer.complete(),this._playerVars.complete(),this._destroyed.next(),this._destroyed.complete()}playVideo(){this._player?this._player.playVideo():this._getPendingState().playbackState=YT.PlayerState.PLAYING}pauseVideo(){this._player?this._player.pauseVideo():this._getPendingState().playbackState=YT.PlayerState.PAUSED}stopVideo(){this._player?this._player.stopVideo():this._getPendingState().playbackState=YT.PlayerState.CUED}seekTo(t,i){this._player?this._player.seekTo(t,i):this._getPendingState().seek={seconds:t,allowSeekAhead:i}}mute(){this._player?this._player.mute():this._getPendingState().muted=!0}unMute(){this._player?this._player.unMute():this._getPendingState().muted=!1}isMuted(){return this._player?this._player.isMuted():!!this._pendingPlayerState&&!!this._pendingPlayerState.muted}setVolume(t){this._player?this._player.setVolume(t):this._getPendingState().volume=t}getVolume(){return this._player?this._player.getVolume():this._pendingPlayerState&&null!=this._pendingPlayerState.volume?this._pendingPlayerState.volume:0}setPlaybackRate(t){if(this._player)return this._player.setPlaybackRate(t);this._getPendingState().playbackRate=t}getPlaybackRate(){return this._player?this._player.getPlaybackRate():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackRate?this._pendingPlayerState.playbackRate:0}getAvailablePlaybackRates(){return this._player?this._player.getAvailablePlaybackRates():[]}getVideoLoadedFraction(){return this._player?this._player.getVideoLoadedFraction():0}getPlayerState(){if(this._isBrowser&&window.YT)return this._player?this._player.getPlayerState():this._pendingPlayerState&&null!=this._pendingPlayerState.playbackState?this._pendingPlayerState.playbackState:YT.PlayerState.UNSTARTED}getCurrentTime(){return this._player?this._player.getCurrentTime():this._pendingPlayerState&&this._pendingPlayerState.seek?this._pendingPlayerState.seek.seconds:0}getPlaybackQuality(){return this._player?this._player.getPlaybackQuality():"default"}getAvailableQualityLevels(){return this._player?this._player.getAvailableQualityLevels():[]}getDuration(){return this._player?this._player.getDuration():0}getVideoUrl(){return this._player?this._player.getVideoUrl():""}getVideoEmbedCode(){return this._player?this._player.getVideoEmbedCode():""}_getPendingState(){return this._pendingPlayerState||(this._pendingPlayerState={}),this._pendingPlayerState}_initializePlayer(t,i){const{playbackState:r,playbackRate:s,volume:o,muted:a,seek:l}=i;switch(r){case YT.PlayerState.PLAYING:t.playVideo();break;case YT.PlayerState.PAUSED:t.pauseVideo();break;case YT.PlayerState.CUED:t.stopVideo()}null!=s&&t.setPlaybackRate(s),null!=o&&t.setVolume(o),null!=a&&(a?t.mute():t.unMute()),null!=l&&t.seekTo(l.seconds,l.allowSeekAhead)}_getLazyEmitter(t){return this._playerChanges.pipe(Ir(i=>i?LG(r=>{i.addEventListener(t,r)},r=>{try{i.removeEventListener&&i.removeEventListener(t,r)}catch(s){}}):st()),i=>new oe(r=>i.subscribe({next:s=>this._ngZone.run(()=>r.next(s)),error:s=>r.error(s),complete:()=>r.complete()})),zn(this._destroyed))}}return n.\u0275fac=function(t){return new(t||n)(E(lt),E(cl))},n.\u0275cmp=Le({type:n,selectors:[["youtube-player"]],viewQuery:function(t,i){if(1&t&&ni(axe,5),2&t){let r;Mt(r=xt())&&(i.youtubeContainer=r.first)}},inputs:{videoId:"videoId",height:"height",width:"width",startSeconds:"startSeconds",endSeconds:"endSeconds",suggestedQuality:"suggestedQuality",playerVars:"playerVars",showBeforeIframeApiLoads:"showBeforeIframeApiLoads"},outputs:{ready:"ready",stateChange:"stateChange",error:"error",apiChange:"apiChange",playbackQualityChange:"playbackQualityChange",playbackRateChange:"playbackRateChange"},decls:2,vars:0,consts:[["youtubeContainer",""]],template:function(t,i){1&t&&et(0,"div",null,0)},encapsulation:2,changeDetection:0}),n})();function fxe(n,[e,t,i]){if(n&&t&&n.playerVars!==t.playerVars)n.destroy();else{if(!t)return void(n&&n.destroy());if(n)return n}const r=i.runOutsideAngular(()=>new YT.Player(e,t));return r.videoId=t.videoId,r.playerVars=t.playerVars,r}function UG(n){return"getPlayerStatus"in n}function Rk(n,e){return Er(jM(n),Tn(([t,i])=>e(i,t)),be(([t])=>t))}let mxe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function qb(n){return!0===n}function no(n){return null==n}function Pa(n){return!no(n)}function kk(n){return Boolean(n)}function $G(n){return no(n)?n:JSON.parse(JSON.stringify(n))}const zM=n=>{const t=n instanceof Date;if("object"!=typeof n||null===n||t)return n;Object.freeze(n);const r="function"==typeof n,s=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(o=>{s.call(n,o)&&(!r||"caller"!==o&&"callee"!==o&&"arguments"!==o)&&null!==n[o]&&("object"==typeof n[o]||"function"==typeof n[o])&&!Object.isFrozen(n[o])&&zM(n[o])}),n};function GG(n){return Pa(n)&&"object"==typeof n&&function(n){return"[object Object]"===Object.prototype.toString.call(n)}(n)}const YG="NGXS_DATA_META",Nk="NGXS_META",XG="NGXS_ARGUMENT_REGISTRY_META";let KG=(()=>{class n{constructor(t){this.sequence$=new sr(0),this.subscription=null,t&&(this.subscription=t.subscribe(()=>this.updateSequence()))}get sequenceValue(){return this.sequence$.getValue()}ngOnDestroy(){var t;this.sequence$.next(0),null===(t=this.subscription)||void 0===t||t.unsubscribe()}updateSequence(){this.sequence$.next(this.sequenceValue+1)}}return n.\u0275fac=function(t){return new(t||n)(I(ph,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();function Yb(n){return n[YG]}let Ra=(()=>{class n{constructor(t,i,r){n.store=t.get(ph),n.ngZone=t.get(lt),n.factory=i,n.context=r,n.computed=t.get(KG)}}return n.store=null,n.computed=null,n.context=null,n.factory=null,n.ngZone=null,n.\u0275fac=function(t){return new(t||n)(I(Tt),I(G6),I($6))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();class kr{constructor(){kr.statesCachedMeta.clear()}static createStateContext(e){return Ra.context.createStateContext(e)}static ensureMappedState(e){if(no(Ra.factory)||no(e))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return(Pa(e.name)?kr.statesCachedMeta.get(e.name):null)||kr.ensureMeta(e)}static getRepositoryByInstance(e){var t;const r=null!==(t=Yb(kr.getStateClassByInstance(e)))&&void 0!==t?t:null;if(no(r))throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return r}static getStateClassByInstance(e){return(null!=e?e:{}).constructor}static clearMetaByInstance(e){const t=kr.getRepositoryByInstance(e);t.stateMeta.actions={},t.operations={}}static createPayload(e,t){const i={},r=Array.from(e);for(let s=0;s0?i:null}static createAction(e,t,i){const r=kr.createPayload(t,i);return new(function(n){return class{constructor(t){t&&Object.keys(t).forEach(i=>{this[i]=t[i]})}static get type(){return n}}}(e.type))(r)}static ensureMeta(e){var t;const i=Pa(e.name)?null===(t=Ra.factory.states)||void 0===t?void 0:t.find(r=>r.name===e.name):null;return Pa(i)&&Pa(e.name)&&kr.statesCachedMeta.set(e.name,i),i}}kr.statesCachedMeta=new Map,kr.\u0275fac=function(e){return new(e||kr)},kr.\u0275prov=ae({token:kr,factory:kr.\u0275fac}),new Hg(1);class Vxe extends Error{constructor(e){super(`Child states can only be added to an object. Cannot convert ${Pa(null==e?void 0:e.constructor)?e.constructor.name:e} to PlainObject`)}}function ZG(n){var e;return null!==(e=n.NGXS_OPTIONS_META)&&void 0!==e?e:{name:""}}function QG(n){var e;const t=ZG(n),i=null!==(e=t.children)&&void 0!==e?e:[],s=$G(void 0===t.defaults?{}:t.defaults);if(i.length){if(GG(s))return function(n,e){return e.reduce((t,i)=>{const r=ZG(i);if(function(n){const e="string"==typeof n?n.trim():n;return[void 0,null,NaN,"",1/0].includes(e)}(r.name))throw new Error("State name not provided in class");return t[r.name.toString()]=QG(i),t},null!=n?n:{})}(s,i);throw new Vxe(s)}return s}function eW(n){var e;return null!==(e=n.__NGXS_COMPUTED_OPTION__)&&void 0!==e?e:null}function tW(){var n,e;return null!==(e=null===(n=null==Ra?void 0:Ra.computed)||void 0===n?void 0:n.sequenceValue)&&void 0!==e?e:0}function Hxe(n){let e=!1;return Uv(n)&&(e=!0),e}function Lk(n){return n[XG]}class $xe extends Error{constructor(e,t){super(`An argument with the name '${e}' already exists in the method '${t}'`)}}class Gxe{constructor(){this.payloadMap=new Map,this.argumentMap=new Map}getPayloadTypeByIndex(e){var t;return null!==(t=this.payloadMap.get(e))&&void 0!==t?t:null}getArgumentNameByIndex(e){var t;return null!==(t=this.argumentMap.get(e))&&void 0!==t?t:null}createPayloadType(e,t,i){this.checkDuplicateName(e,t),this.payloadMap.set(i,e),this.payloadMap.set(e,e)}createArgumentName(e,t,i){this.checkDuplicateName(e,t),this.argumentMap.set(i,e),this.argumentMap.set(e,e)}checkDuplicateName(e,t){if(kk(this.argumentMap.has(e))||kk(this.payloadMap.has(e)))throw new $xe(e,t)}}function Bk(n){return wo()?zM(n):n}function Kxe(n){return{enumerable:!0,configurable:!0,get(){const e=Yb(n),t=kr.ensureMappedState(e.stateMeta);return kr.createStateContext(t)}}}function Vk(n){if(!n)throw new Error("You forgot add decorator @StateRepository or initialize state!\nExample: NgxsModule.forRoot([ .. ]), or NgxsModule.forFeature([ .. ])");return Object.assign(Object.assign({},n),{getState:()=>wo()?zM(n.getState()):n.getState(),setState(e){n.setState(e)},patchState(e){n.patchState(e)}})}function ri(){return(n,e,t)=>{!function(n,e){if(!function(n,e){var t;let i=n,r=!1;if(GG(i))for(;null!==i;){if(qb(null==i?void 0:i.hasOwnProperty(e))){r=!!(null===(t=Object.getOwnPropertyDescriptor(i,e))||void 0===t?void 0:t.get);break}i=Object.getPrototypeOf(i)}return r}(n,null==e?void 0:e.toString()))throw new Error(`The method must be a getter for the computed decorator to work properly.\nExample: \n@Computed() get ${e.toString()}() { \n\t .. \n}`)}(n,e);const i=t.get;return t.get=function(...r){const s=function(n){return no(eW(n))&&Object.defineProperties(n,{__NGXS_COMPUTED_OPTION__:{enumerable:!0,configurable:!0,value:new WeakMap}}),eW(n)}(this),o=null==s?void 0:s.get(i);if(qb(null==o?void 0:o.isObservable))return null==o?void 0:o.value;if(no(o)||o.sequenceId!==tW()){s.delete(i);const l=i.apply(this,r);return s.set(i,{value:l,sequenceId:tW(),isObservable:Hxe(l)}),l}return o.value},t}}const tTe={cancelUncompleted:!0,insideZone:!1};function Xt(n=tTe){return(e,t,i)=>{!function(n,e){if(n.hasOwnProperty("prototype"))throw new Error("Cannot support static methods with @DataAction()");if(void 0===e)throw new Error("@DataAction() can only decorate a method implementation")}(e,i);const r=i.value,s=t.toString();return i.value=function(...o){const a=this;let l=null;const c=kr.getRepositoryByInstance(a),d=c.operations;let f=d[s];const p=c.stateMeta,g=Lk(r);if(no(f)){const C=function(n){var e,t,i;return null!==(i=null===(t=null===(e=(n+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1))||void 0===e?void 0:e[0])||void 0===t?void 0:t.replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean))&&void 0!==i?i:[]}(r),x=function(n){const{statePath:e,argumentsNames:t,methodName:i,argumentRegistry:r}=n;let s="";for(let o=0;o{var C;return qb(n.insideZone)?null===(C=Ra.ngZone)||void 0===C||C.run(()=>{l=r.apply(a,o)}):l=r.apply(a,o),Uv(l)?st(null).pipe(be(()=>l)):l};const v=kr.createAction(f,o,g),w=Ra.store.dispatch(v);return Uv(l)?function(n,e){return Bv([n,e]).pipe(be(t=>t.pop()))}(w,l):l},i}}function Es(n){return(e,t,i)=>{const r=n.trim();if(!r)throw new Error("Payload name should be initialized");(function(n,e){const t=n[e];return no(Lk(t))&&Object.defineProperties(t,{[XG]:{enumerable:!0,configurable:!0,value:new Gxe}}),Lk(t)})(e,t).createPayloadType(r,t,i)}}function Ch(){return n=>{const e=function(n){if(function(n){return!kk(n)}(n.hasOwnProperty(Nk))){const e={name:null,actions:{},defaults:{},path:null,makeRootSelector:t=>t.getStateGetter(e.name),children:[]};Object.defineProperty(n,Nk,{value:e})}return function(n){var e;return null===(e=n)||void 0===e?void 0:e[Nk]}(n)}(n);if(no(e.name))throw new Error("@StateRepository should be add before decorator @State");!function(n,e){(function(n){var e;const t=null!==(e=Yb(n))&&void 0!==e?e:null;return(no(t)||(null==t?void 0:t.stateClass)!==n)&&function(n){Object.defineProperty(n,YG,{writable:!0,configurable:!0,enumerable:!0,value:{stateMeta:null,operations:{},stateClass:n}})}(n),Yb(n)}(n)).stateMeta=e}(n,e),function(n,e,t){Object.defineProperties(n.prototype,{name:{enumerable:!0,configurable:!0,value:e.name},initialState:{enumerable:!0,configurable:!0,get:()=>$G(t)},context:Kxe(n)})}(n,e,QG(n)),function(n){var e,t;const i=Yb(n),r=null!==(t=null===(e=null==i?void 0:i.stateMeta)||void 0===e?void 0:e.name)&&void 0!==t?t:null;if(Pa(r)){const s=`__${r}__selector`;Object.defineProperties(n.prototype,{[s]:{writable:!0,enumerable:!1,configurable:!0},state$:{enumerable:!0,configurable:!0,get(){if(Pa(this[s]))return this[s];if(no(Ra.store))throw new Error("Metadata not created \n Maybe you forgot to import the NgxsDataPluginModule\n Also, you cannot use this.ctx.* until the application is fully rendered \n (use by default ngxsOnInit(ctx: StateContext), or ngxsAfterBootstrap(ctx: StateContext) !!!");return this[s]=Ra.store.select(n).pipe(be(o=>wo()?zM(o):o),Hc({refCount:!0,bufferSize:1})),this[s]}}})}}(n)}}var $M=(()=>(function(n){n.ID="id"}($M||($M={})),$M))(),Xb=(()=>(function(n){n.ASC="asc",n.DESC="desc"}(Xb||(Xb={})),Xb))();let jk=(()=>{class n{constructor(){this.browserStorageEvents$=new we,this.isInitialised=!1,this.isBootstrapped=!1,this._dirty=!0}get dirty(){return this._dirty}set dirty(t){this._dirty=t}ngxsOnChanges(t){var r;this.dirty&&this.isBootstrapped&&(this.dirty=!1,null===(r=this.ngxsDataDoCheck)||void 0===r||r.call(this))}ngxsOnInit(){this.isInitialised=!0}ngxsAfterBootstrap(){var i;this.isBootstrapped=!0,this.dirty&&(this.dirty=!1,null===(i=this.ngxsDataDoCheck)||void 0===i||i.call(this))}markAsDirtyAfterReset(){var i;this.dirty=!0,null===(i=this.ngxsDataAfterReset)||void 0===i||i.call(this)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),rTe=(()=>{class n extends jk{get snapshot(){return Bk(this.getState())}get ctx(){return Vk(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([Xt(),bs(0,Es("patchValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"patchState",null),De([Xt(),bs(0,Es("stateValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setState",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),n})(),sTe=(()=>{class n extends jk{constructor(){super(...arguments),this.primaryKey=$M.ID,this.comparator=null}get snapshot(){return Bk(this.getState())}get ids(){return this.snapshot.ids}get entities(){return this.snapshot.entities}get entitiesArray(){const t=this.snapshot;return t.ids.map(i=>t.entities[i])}get ids$(){return this.state$.pipe(be(t=>t.ids))}get entities$(){return this.state$.pipe(be(t=>t.entities))}get entitiesArray$(){return this.state$.pipe(be(t=>t.ids.map(i=>t.entities[i])))}get ctx(){return Vk(this.context)}setComparator(t){return this.comparator=t,this}dispatch(t){return this.ctx.dispatch(t)}getState(){return this.ctx.getState()}selectId(t){var i;return null===(i=t)||void 0===i?void 0:i[this.primaryKey]}selectOne(t){var i;return null!==(i=this.snapshot.entities[t])&&void 0!==i?i:null}selectAll(){const t=this.getState();return t.ids.map(i=>t.entities[i])}reset(){this.setEntitiesState(this.initialState),this.markAsDirtyAfterReset()}addOne(t){this.addEntityOne(t)}addMany(t){this.addEntitiesMany(t)}setOne(t){this.setEntityOne(t)}setMany(t){this.setEntitiesMany(t)}setAll(t){this.setEntitiesAll(t)}updateOne(t){this.updateEntitiesMany([t])}updateMany(t){this.updateEntitiesMany(t)}upsertOne(t){this.upsertEntitiesMany([t])}upsertMany(t){this.upsertEntitiesMany(t)}removeOne(t){this.removeEntitiesMany([t])}removeMany(t){this.removeEntitiesMany(t)}removeByEntity(t){const i=this.selectId(t);this.removeEntitiesMany([i])}removeByEntities(t){const i=[];for(const r of t){const s=this.selectId(r);i.push(s)}this.removeEntitiesMany(i)}removeAll(){this.setEntitiesState(this.initialState)}sort(t){this.comparator=null!=t?t:this.comparator,no(this.comparator)?console.warn("You must set the compare function before sorting."):this.setEntitiesState(this.getState())}addEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);r in i.entities||this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}addEntitiesMany(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities||a in r||(s.push(a),r[a]=o)}s.length&&this.setEntitiesState(Object.assign(Object.assign({},i),{ids:[...i.ids,...s],entities:Object.assign(Object.assign({},i.entities),r)}))}setEntitiesAll(t){const i=this.getState(),r={},s=[];for(const o of t){const a=this.selectIdValue(o);a in r||(s.push(a),r[a]=o)}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:s,entities:r}))}setEntityOne(t){const i=this.getState(),r=this.selectIdValue(t);this.setEntitiesState(Object.assign(Object.assign({},i),r in i.entities?{entities:Object.assign(Object.assign({},i.entities),{[r]:t})}:{ids:[...i.ids,r],entities:Object.assign(Object.assign({},i.entities),{[r]:t})}))}setEntitiesMany(t){for(const i of t)this.setEntityOne(i)}updateEntitiesMany(t){const i=this.getState(),r=t.filter(a=>a.id in i.entities);if(0===r.length)return;const s=this.generateKeyMap(i),o=Object.assign({},i.entities);for(const a of r){const l=this.updateOrigin(o,a),c=this.selectIdValue(l);c!==a.id&&(delete s[a.id],delete o[a.id]),s[a.id]=c,o[c]=l}this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.map(a=>{var l;return null!==(l=s[a])&&void 0!==l?l:a}),entities:o}))}upsertEntitiesMany(t){const i=this.getState(),r=[],s=[];for(const o of t){const a=this.selectIdValue(o);a in i.entities?r.push({id:a,changes:o}):s.push(o)}this.updateMany(r),this.addMany(s)}removeEntitiesMany(t){const i=this.getState(),r=this.generateKeyMap(i),s=Object.assign({},i.entities);for(const o of t)o in s&&(delete r[o],delete s[o]);this.setEntitiesState(Object.assign(Object.assign({},i),{ids:i.ids.filter(o=>o in r),entities:s}))}setEntitiesState(t){const i=this.sortKeysByComparator(t.ids,t.entities);this.ctx.setState(Object.assign(Object.assign({},t),{ids:i,entities:t.entities}))}sortKeysByComparator(t,i){if(no(this.comparator))return t;const r=t.slice(),s=this.comparator;return"function"==typeof s?r.sort((o,a)=>s(i[o],i[a])):this.sortByComparatorOptions(r,s,i)}sortByComparatorOptions(t,i,r){switch(null==i?void 0:i.sortByOrder){case Xb.ASC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?-1:0}(null==i?void 0:i.sortBy,r[s],r[o]));case Xb.DESC:return t.sort((s,o)=>function(n,e,t){return(null==e?void 0:e[n])>(null==t?void 0:t[n])?-1:(null==e?void 0:e[n])<(null==t?void 0:t[n])?1:0}(null==i?void 0:i.sortBy,r[s],r[o]));default:return wo()&&console.warn(`Invalid --\x3e { sortByOrder: "${null==i?void 0:i.sortByOrder}" } not supported!`),t}}generateKeyMap(t){return t.ids.reduce((i,r)=>(i[r]=r,i),{})}updateOrigin(t,i){return Object.assign(Object.assign({},t[i.id]),i.changes)}selectIdValue(t){const i=this.selectId(t);return no(i)&&wo()&&console.warn(`The entity passed to the 'selectId' implementation returned ${i}.`,"You should probably provide your own 'selectId' implementation.","The entity that was passed:",t,"The current `selectId` implementation: (entity: V): K => entity.id"),i}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([ri(),Ge("design:type",Array),Ge("design:paramtypes",[])],n.prototype,"ids",null),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"entities",null),De([ri(),Ge("design:type",Array),Ge("design:paramtypes",[])],n.prototype,"entitiesArray",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"ids$",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"entities$",null),De([ri(),Ge("design:type",oe),Ge("design:paramtypes",[])],n.prototype,"entitiesArray$",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"addOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"addMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"setMany",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"setAll",null),De([Xt(),bs(0,Es("update")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"updateOne",null),De([Xt(),bs(0,Es("updates")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"updateMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"upsertOne",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"upsertMany",null),De([Xt(),bs(0,Es("id")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"removeOne",null),De([Xt(),bs(0,Es("ids")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"removeMany",null),De([Xt(),bs(0,Es("entity")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"removeByEntity",null),De([Xt(),bs(0,Es("entities")),Ge("design:type",Function),Ge("design:paramtypes",[Array]),Ge("design:returntype",void 0)],n.prototype,"removeByEntities",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"removeAll",null),De([Xt(),bs(0,Es("comparator")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"sort",null),n})(),qm=(()=>{class n extends jk{get snapshot(){return Bk(this.getState())}get ctx(){return Vk(this.context)}getState(){return this.ctx.getState()}dispatch(t){return this.ctx.dispatch(t)}patchState(t){this.ctx.patchState(t)}setState(t){this.ctx.setState(t)}reset(){this.ctx.setState(this.initialState),this.markAsDirtyAfterReset()}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri(),Ge("design:type",Object),Ge("design:paramtypes",[])],n.prototype,"snapshot",null),De([Xt(),bs(0,Es("patchValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"patchState",null),De([Xt(),bs(0,Es("stateValue")),Ge("design:type",Function),Ge("design:paramtypes",[Object]),Ge("design:returntype",void 0)],n.prototype,"setState",null),De([Xt(),Ge("design:type",Function),Ge("design:paramtypes",[]),Ge("design:returntype",void 0)],n.prototype,"reset",null),n})();function Uk(){return Tn(n=>null!=n)}const oTe={};function zk(...n){const e=n[n.length-1];let t=n,i=oTe;return"object"==typeof e&&(i=e,t=t.slice(0,-1)),r=>r.pipe(lr(...t),Xo(i.compare),Hc(1))}const Jm=new _e("ngx-google-analytics-settings",{factory:()=>({trackingCode:"",enableTracing:!1})}),dF=new _e("ngx-window",{providedIn:"root",factory:()=>function(n){return xf(n)?window:null}(Ac(cl))}),_De=new _e("ngx-data-layer",{providedIn:"root",factory:()=>function(n){return n?n.dataLayer=n.dataLayer||[]:null}(Ac(dF))}),hF=new _e("ngx-gtag-fn",{providedIn:"root",factory:()=>function(n,e){return n?n.gtag=n.gtag||function(){e.push(arguments)}:null}(Ac(dF),Ac(_De))});let io=(()=>{class n{constructor(t,i,r){this.settings=t,this._document=i,this._gtag=r}get document(){return this._document}throw(t){(this.settings.enableTracing||wo())&&console&&console.error&&console.error(t)}toKeyValue(t){return t.size>0?Array.from(t).reduce((i,[r,s])=>Object.defineProperty(i,r,{value:s,enumerable:!0}),{}):void 0}gtag(...t){try{this._gtag(...t.filter(i=>void 0!==i))}catch(i){this.throw(i)}}event(t,i,r,s,o){try{const a=new Map;i&&a.set("event_category",i),r&&a.set("event_label",r),s&&a.set("value",s),void 0!==o&&a.set("interaction",o);const l=this.toKeyValue(a);l?this.gtag("event",t,l):this.gtag("event",t)}catch(a){this.throw(a)}}pageView(t,i,r,s){try{const o=new Map([["page_path",t]]);i&&o.set("page_title",i),(r||this.document)&&o.set("page_location",r||this.document.location.href),s&&Object.entries(s).map(([a,l])=>o.set(a,l)),this.gtag("config",this.settings.trackingCode,this.toKeyValue(o))}catch(o){this.throw(o)}}appView(t,i,r,s,o){try{const a=new Map([["screen_name",t],["app_name",i]]);r&&a.set("app_id",r),s&&a.set("app_version",s),o&&a.set("app_installer_id",o),this.gtag("event","screen_view",this.toKeyValue(a))}catch(a){this.throw(a)}}set(...t){try{this._gtag("set",...t)}catch(i){this.throw(i)}}exception(t,i){try{const r=new Map;t&&r.set("description",t),i&&r.set("fatal",i),this.toKeyValue(r)?this.gtag("event","exception",this.toKeyValue(r)):this.gtag("event","exception")}catch(r){this.throw(r)}}}return n.\u0275fac=function(t){return new(t||n)(I(Jm),I(rt),I(hF))},n.\u0275prov=ae({factory:function(){return new n(I(Jm),I(rt),I(hF))},token:n,providedIn:"root"}),n})();const bDe={provide:Cf,multi:!0,useFactory:function(n,e,t){return()=>gl(this,void 0,void 0,function*(){var i;if(!n.trackingCode)return void(wo()||console.error("Empty tracking code for Google Analytics. Make sure to provide one when initializing NgxGoogleAnalyticsModule."));if(!e)return void(wo()||console.error("Was not possible create or read gtag() fn. Make sure this module is running on a Browser w/ access to Window interface."));t||wo()||console.error("Was not possible to access Document interface. Make sure this module is running on a Browser w/ access do Document interface."),n.uri=n.uri||`https://www.googletagmanager.com/gtag/js?id=${n.trackingCode}`,n.initCommands=null!==(i=null==n?void 0:n.initCommands)&&void 0!==i?i:[],n.initCommands.find(o=>"config"===o.command)||n.initCommands.unshift({command:"config",values:[n.trackingCode]}),n.initCommands.find(o=>"js"===o.command)||n.initCommands.unshift({command:"js",values:[new Date]});for(const o of n.initCommands)e(o.command,...o.values);const r=t.createElement("script");r.async=!0,r.src=n.uri,n.nonce&&r.setAttribute("nonce",n.nonce),t.getElementsByTagName("head")[0].appendChild(r)})},deps:[Jm,hF,rt]};new _e("ngx-google-analytics-routing-settings",{factory:()=>({})});let fF=(()=>{class n{static forRoot(t,i=[],r,s,o){return{ngModule:n,providers:[{provide:Jm,useValue:{trackingCode:t,initCommands:i,uri:r,enableTracing:s,nonce:o}},bDe]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[]]}),n})(),o0=(()=>{class n{constructor(){this.consent="not-set",this.consentChange=new Hg(1),this.consentChange.next(this.consent)}ngOnDestroy(){this.consentChange.complete()}setConsent(t){this.consent!==t&&(this.consent=t,this.consentChange.next(t))}unsetConsent(){this.setConsent("not-set")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),SDe=(()=>{class n{constructor(t,i,{trackingCode:r}){this.window=i,this.subscriptions=new Ie,this.token=r,this.subscriptions.add(t.consentChange.subscribe(s=>this.toggleGoogleAnalytics("rescinded"===s)))}ngOnDestroy(){this.subscriptions.unsubscribe()}toggleGoogleAnalytics(t){this.window&&(this.window[`ga-disable-${this.token}`]=t)}}return n.\u0275fac=function(t){return new(t||n)(I(o0),I(dF),I(Jm))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const MDe=new _e("Key under which consent is stored",{providedIn:"root",factory:()=>"ALLOW_TELEMETRY"}),rq=[o0,SDe,(()=>{class n{constructor(t,i){this.key=i,this.subscriptions=new Ie;try{this.storage=localStorage}catch(r){}t.setConsent(this.loadConsent()),this.subscriptions.add(t.consentChange.subscribe(r=>this.saveConsent(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}loadConsent(){var t,i;const r=null===(i=null===(t=this.storage)||void 0===t?void 0:t.getItem)||void 0===i?void 0:i.call(t,this.key);if(null==r)return"not-set";const s=r.trim().toLowerCase();switch(s){case"given":case"rescinded":return s;default:return"not-set"}}saveConsent(t){var i,r;null===(r=null===(i=this.storage)||void 0===i?void 0:i.setItem)||void 0===r||r.call(i,this.key,t)}}return n.\u0275fac=function(t){return new(t||n)(I(o0),I(MDe))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})()];function TDe(n){return Object.entries(n).reduce((e,[t,i])=>(null!=i&&(e[t]=`${i}`),e),{})}let DDe=(()=>{class n{static forRoot(t){const{providers:i=[]}=fF.forRoot(t.gaToken,function(n){const{appName:e,projectName:t,developmentMode:i}=n;return[{command:"set",values:[TDe({appName:e,projectName:t,developmentMode:i})]}]}(t));return{ngModule:n,providers:i}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[...rq,{provide:Cf,multi:!0,useFactory:()=>()=>{},deps:rq}],imports:[[fF]]}),n})();const ODe=["bodyCanvas"];let IDe=(()=>{class n{constructor(){this.clsName="ccf-body-ui",this.rotationChange=new Pe,this.nodeDrag=new Pe,this.nodeClick=new Pe,this.nodeHoverStart=new Pe,this.nodeHoverStop=new Pe,this.initialized=new Pe,this._interactive=!0,this._rotation=0,this._rotationX=0,this._zoom=9.5,this._target=[0,0,0],this._scene=[],this.subscriptions=[]}get scene(){return this._scene}set scene(t){var i;this._scene=t,null===(i=this.bodyUI)||void 0===i||i.setScene(t)}get rotation(){return this._rotation}set rotation(t){var i;this._rotation=t,null===(i=this.bodyUI)||void 0===i||i.setRotation(t)}get rotationX(){return this._rotationX}set rotationX(t){var i;this._rotationX=t,null===(i=this.bodyUI)||void 0===i||i.setRotationX(t)}get zoom(){return this._zoom}set zoom(t){var i;this._zoom=t,null===(i=this.bodyUI)||void 0===i||i.setZoom(t)}get target(){return this._target}set target(t){var i;this._target=t,null===(i=this.bodyUI)||void 0===i||i.setTarget(t)}get bounds(){return this._bounds}set bounds(t){this._bounds=t,this.zoomToBounds(t)}get camera(){return this._camera}set camera(t){this._camera=t}get interactive(){return this._interactive}set interactive(t){this._interactive=t,this.bodyUI&&this.recreateBodyUI()}ngAfterViewInit(){this.setupBodyUI()}zoomToBounds(t,i={x:48,y:48}){if(this.bodyCanvas){const{width:r,height:s}=this.bodyCanvas.nativeElement,o=window.devicePixelRatio,a=Math.min(Math.log2((r-i.x)/o/t.x),Math.log2((s-i.y)/o/t.y));this.zoom=a}}setupBodyUI(){var t;return gl(this,void 0,void 0,function*(){const i=this.bodyCanvas.nativeElement,r=new VEe({id:"body-ui",canvas:i,zoom:this.zoom,target:[0,0,0],rotation:0,minRotationX:-75,maxRotationX:75,interactive:this.interactive,camera:this.camera});i.addEventListener("contextmenu",s=>s.preventDefault()),yield r.initialize(),this.bodyUI=r,window.bodyUI=r,(null===(t=this.scene)||void 0===t?void 0:t.length)>0&&this.bodyUI.setScene(this.scene),this.bounds&&this.zoomToBounds(this.bounds),this.subscriptions=[this.bodyUI.sceneRotation$.subscribe(s=>this.rotationChange.next(s)),this.bodyUI.nodeDrag$.subscribe(s=>this.nodeDrag.emit(s)),this.bodyUI.nodeClick$.subscribe(s=>this.nodeClick.emit(s)),this.bodyUI.nodeHoverStart$.subscribe(s=>this.nodeHoverStart.emit(s)),this.bodyUI.nodeHoverStop$.subscribe(s=>this.nodeHoverStop.emit(s))],this.initialized.emit()})}recreateBodyUI(){this.clearSubscriptions(),this.bodyUI.finalize(),this.setupBodyUI()}clearSubscriptions(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}ngOnDestroy(){this.clearSubscriptions()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-body-ui"]],viewQuery:function(t,i){if(1&t&&ni(ODe,5,nt),2&t){let r;Mt(r=xt())&&(i.bodyCanvas=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{scene:"scene",rotation:"rotation",rotationX:"rotationX",zoom:"zoom",target:"target",bounds:"bounds",camera:"camera",interactive:"interactive"},outputs:{rotationChange:"rotationChange",nodeDrag:"nodeDrag",nodeClick:"nodeClick",nodeHoverStart:"nodeHoverStart",nodeHoverStop:"nodeHoverStop",initialized:"initialized"},decls:2,vars:0,consts:[[1,"body-ui"],["bodyCanvas",""]],template:function(t,i){1&t&&et(0,"canvas",0,1)},styles:["[_nghost-%COMP%]{height:100%;display:block}[_nghost-%COMP%] .body-ui[_ngcontent-%COMP%]{position:relative!important;background-color:#000;border-radius:.5rem}"]}),n})(),PDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})();function LDe(n,e){if(1&n&&(F(0,"li",4),Te(1),yn(2,"json"),N()),2&n){const t=e.$implicit;Y(1),bw(" ",t[0],": ",wn(2,2,t[1])," ")}}function BDe(n,e){if(1&n&&(F(0,"div",1),F(1,"div"),Te(2),N(),F(3,"ul",2),Ct(4,LDe,3,4,"li",3),N(),N()),2&n){const t=e.$implicit;Y(2),Ai(t[0]),Y(2),ie("ngForOf",t[1])}}let VDe=(()=>{class n{constructor(t,i){this.clsName="ccf-store-debug",this.root={},this.subscriptions=new Ie;const r=t.subscribe(s=>{this.root=s,i.markForCheck()});this.subscriptions.add(r)}get data(){return Object.entries(this.root).map(([s,o])=>[s,Object.entries(o)]).filter(([s,o])=>o.length>0)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(ph),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-store-debug"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:1,vars:1,consts:[["class","state",4,"ngFor","ngForOf"],[1,"state"],[1,"kvlist"],["class","kvpair",4,"ngFor","ngForOf"],[1,"kvpair"]],template:function(t,i){1&t&&Ct(0,BDe,5,2,"div",0),2&t&&ie("ngForOf",i.data)},directives:[Xl],pipes:[T3],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),n})(),jDe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})();new _e("Maximum number of autocomplete options displayed",{providedIn:"root",factory:()=>10});const GDe=["carouselContainer"],WDe=["itemlist"],qDe=["itemcontainer"];function YDe(n,e){if(1&n&&(F(0,"div",14),Te(1),N()),2&n){const t=bt().$implicit,i=bt();Y(1),Ai(i.occurenceData[t.id]||0)}}function XDe(n,e){if(1&n){const t=Lr();F(0,"div",9),ye("click",function(){const s=Vn(t).$implicit;return bt().selectOrgan(s)}),et(1,"mat-icon",10),F(2,"div",11),F(3,"div",12),Te(4),N(),Ct(5,YDe,2,1,"div",13),N(),N()}if(2&n){const t=e.$implicit,i=bt();at("disabled",t.disabled)("selected",i.isSelected(t)),Y(1),Yy("svgIcon",t.src),Y(3),Ai(t.name),Y(1),ie("ngIf",void 0!==t.numResults)}}const a0=[{src:"app:skin",organ:"Skin",name:"Skin",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002097"},{src:"app:brain",organ:"Brain",name:"Brain",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000955"},{disabled:!0,src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000029"},{src:"app:lymph-nodes",organ:"Lymph Node",name:"Lymph Node",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002509"},{disabled:!0,src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000970"},{src:"app:eye",organ:"Eye",name:"Eye, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004548"},{src:"app:eye",organ:"Eye",name:"Eye, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_54449"},{disabled:!0,src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0003889"},{src:"app:fallopian-tube-left",organ:"Fallopian Tube",name:"Fallopian Tube, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001303"},{src:"app:fallopian-tube-right",organ:"Fallopian Tube",name:"Fallopian Tube, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0001302"},{src:"app:heart",organ:"Heart",name:"Heart",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000948"},{disabled:!0,src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002113"},{src:"app:kidney-left",organ:"Kidney",name:"Kidney, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004538"},{src:"app:kidney-right",organ:"Kidney",name:"Kidney, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004539"},{disabled:!0,src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001465"},{src:"app:knee",organ:"Knee",name:"Knee, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_24978"},{src:"app:knee",organ:"Knee",name:"Knee, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/FMA_24977"},{src:"app:liver",organ:"Liver",name:"Liver",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002107"},{disabled:!0,src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002048"},{src:"app:lung",organ:"Lung",name:"Lungs",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001004"},{disabled:!0,src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000992"},{src:"app:ovary-left",organ:"Ovary",name:"Ovary, L",side:"left",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/FMA_7214"},{src:"app:ovary-right",organ:"Ovary",name:"Ovary, R",side:"right",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/FMA_7213"},{src:"app:pancreas",organ:"Pancreas",name:"Pancreas",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001264"},{src:"app:pelvis-f",organ:"Pelvis",name:"Pelvis",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001270"},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0002367",disabled:!0},{src:"app:prostate",organ:"Prostate",name:"Prostate",hasSex:!1,sex:"male",id:"http://purl.obolibrary.org/obo/UBERON_0000079"},{src:"app:small-intestine",organ:"Small Intestine",name:"Small Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002108"},{src:"app:large-intestine",organ:"Large Intestine",name:"Large Intestine",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000059"},{src:"app:spleen",organ:"Spleen",name:"Spleen",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002106"},{src:"app:thymus",organ:"Thymus",name:"Thymus",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002370"},{disabled:!0,src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0000056"},{src:"app:ureter-left",organ:"Ureter",name:"Ureter, L",side:"left",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001223"},{src:"app:ureter-right",organ:"Ureter",name:"Ureter, R",side:"right",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001222"},{src:"app:bladder",organ:"Urinary Bladder",name:"Urinary Bladder",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0001255"},{src:"app:uterus",organ:"Uterus",name:"Uterus",hasSex:!1,sex:"female",id:"http://purl.obolibrary.org/obo/UBERON_0000995"},{src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0004537"},{disabled:!0,src:"app:vasculature-thick",organ:"Blood Vasculature",name:"Blood Vasculature",hasSex:!0,id:"http://purl.obolibrary.org/obo/UBERON_0002049"}].sort((n,e)=>n.name.localeCompare(e.name)).filter(n=>!0!==n.disabled);let oq=(()=>{class n{constructor(){this.clsName="ccf-organ-selector",this.multiselect=!1,this.displayErrors=!1,this.organList=a0,this.selectedOrgans=[],this.organsChanged=new Pe,this.onLeft=!0,this.onRight=!1,this.step=72}set occurenceData(t){this._occurenceData=t}get occurenceData(){return this._occurenceData}ngAfterViewInit(){const{carouselContainer:t}=this;this.sensor=new vG.ResizeSensor(t.nativeElement,()=>{this.set()})}ngOnChanges(t){"organList"in t&&this.set()}ngOnDestroy(){this.sensor.detach()}get error(){return!(!this.displayErrors||0===this.selectedOrgans.length)}shift(t){const{itemList:i}=this;let r=parseInt(i.nativeElement.style.left,10)||0;this.onLeft&&"left"===t||this.onRight&&"right"===t||(r="right"===t?r-this.step:r+this.step,i.nativeElement.style.left=r+"px",this.setLeftRight(r))}scroll(t){this.timeoutHandler=setInterval(()=>{this.shift(t)},200)}stopScroll(){this.timeoutHandler&&(clearInterval(this.timeoutHandler),this.timeoutHandler=void 0)}selectOrgan(t){this.selectedOrgans=this.multiselect?this.selectedOrgans.includes(t)?this.selectedOrgans.filter(i=>t!==i):this.selectedOrgans.concat([t]):[t],this.organsChanged.emit(this.selectedOrgans)}isSelected(t){return!!this.selectedOrgans.includes(t)}set(){const{itemList:t,itemContainer:i,carouselContainer:r}=this,s=parseInt(t.nativeElement.style.left,10)||0;if(t.nativeElement.offsetWidth>=this.organList.length*this.step)t.nativeElement.style.left="0px",this.onLeft=!0,this.onRight=!0;else{this.setLeftRight(s);const o=this.step*Math.floor(r.nativeElement.offsetWidth/this.step)-64;i.nativeElement.style.width=`${o}px`}}setWidth(){const{itemContainer:t,carouselContainer:i}=this,r=this.step*Math.floor(i.nativeElement.offsetWidth/this.step)-64;t.nativeElement.style.width=`${r}px`}setLeftRight(t){const{itemContainer:i}=this;this.onLeft=0===t,this.onRight=t<=i.nativeElement.offsetWidth-this.organList.length*this.step}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-organ-selector"]],viewQuery:function(t,i){if(1&t&&(ni(GDe,7),ni(WDe,7),ni(qDe,7)),2&t){let r;Mt(r=xt())&&(i.carouselContainer=r.first),Mt(r=xt())&&(i.itemList=r.first),Mt(r=xt())&&(i.itemContainer=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{multiselect:"multiselect",displayErrors:"displayErrors",organList:"organList",selectedOrgans:"selectedOrgans",occurenceData:"occurenceData"},outputs:{organsChanged:"organsChanged"},features:[qn],decls:11,vars:8,consts:[["matTooltip","Select the organ your tissue block is from.",1,"container",3,"matTooltipDisabled"],["carouselContainer",""],[1,"carousel-left-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item-container"],["itemcontainer",""],[1,"carousel-item-list"],["itemlist",""],["class","carousel-item",3,"disabled","selected","click",4,"ngFor","ngForOf"],[1,"carousel-right-icon",3,"touchstart","touchend","click","mousedown","mouseup"],[1,"carousel-item",3,"click"],[1,"carousel-icon",3,"svgIcon"],[1,"carousel-text-container"],[1,"carousel-text"],["class","num-results",4,"ngIf"],[1,"num-results"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"mat-icon",2),ye("touchstart",function(){return i.scroll("left")})("touchend",function(){return i.stopScroll()})("click",function(){return i.shift("left")})("mousedown",function(){return i.scroll("left")})("mouseup",function(){return i.stopScroll()}),Te(3,"chevron_left"),N(),F(4,"div",3,4),F(6,"div",5,6),Ct(8,XDe,6,7,"div",7),N(),N(),F(9,"mat-icon",8),ye("touchstart",function(){return i.scroll("right")})("touchend",function(){return i.stopScroll()})("click",function(){return i.shift("right")})("mousedown",function(){return i.scroll("right")})("mouseup",function(){return i.stopScroll()}),Te(10,"chevron_right"),N(),N()),2&t&&(at("error",i.error),ie("matTooltipDisabled",i.multiselect),Y(2),at("disabled",i.onLeft),Y(6),ie("ngForOf",i.organList),Y(1),at("disabled",i.onRight))},directives:[cc,Rs,Xl,Is],styles:["[_nghost-%COMP%] .container[_ngcontent-%COMP%]{display:flex;align-items:center;height:100%;justify-content:space-between}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{font-size:2rem;transform:scaleY(1.2);height:2rem;width:2rem;cursor:pointer}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon.disabled[_ngcontent-%COMP%], [_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon.disabled[_ngcontent-%COMP%]{cursor:not-allowed}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-left-icon[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-right-icon[_ngcontent-%COMP%]{text-align:left}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%]{overflow:hidden;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%]{position:relative;left:0rem;display:flex;transition:all .2s linear;height:100%}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer;padding:.25rem .5rem;height:100%;transition:.6s}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-icon[_ngcontent-%COMP%]{text-align:center;width:3.5rem;height:2rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:4rem;justify-content:center;text-align:center}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .carousel-text[_ngcontent-%COMP%]{display:flex;justify-content:center;font-size:.625rem;max-width:3.5rem;line-height:.8rem;min-height:1.6rem}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item[_ngcontent-%COMP%] .carousel-text-container[_ngcontent-%COMP%] .num-results[_ngcontent-%COMP%]{font-size:.6875rem;line-height:1.5}[_nghost-%COMP%] .container[_ngcontent-%COMP%] .carousel-item-container[_ngcontent-%COMP%] .carousel-item-list[_ngcontent-%COMP%] .carousel-item.disabled[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .error-message[_ngcontent-%COMP%]{color:red;height:1rem}[_nghost-%COMP%] .error-message.hidden[_ngcontent-%COMP%]{opacity:0}"]}),n})(),aq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,uc]]}),n})(),KDe=(()=>{class n{constructor(){this.clsName="ccf-opacity-slider",this.opacity=20,this.visible=!0,this.opacityChange=new Pe,this.visibilityToggle=new Pe,this.opacityReset=new Pe}ngOnInit(){this.prevOpacity=this.visible?0:20}reset(){this.prevOpacity=20}changeOpacity(t){this.opacity=parseInt(t,10),this.opacityChange.emit(this.opacity)}toggleVisibility(){const t=this.opacity;this.opacity=this.prevOpacity,this.prevOpacity=t,this.visibilityToggle.emit(),this.opacityChange.emit(this.opacity)}resetOpacity(){this.prevOpacity=0,this.opacityReset.emit()}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-opacity-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{opacity:"opacity",visible:"visible"},outputs:{opacityChange:"opacityChange",visibilityToggle:"visibilityToggle",opacityReset:"opacityReset"},decls:10,vars:17,consts:[[1,"slider-box"],[1,"slider-and-label"],[1,"slider",3,"step","min","max","value","input"],[1,"opacity-value"],[1,"icons"],["matRipple","","svgIcon","app:visibility_off",1,"visibility","icon","invisible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","","svgIcon","app:visibility_on",1,"visibility","icon","visible",3,"matRippleCentered","matRippleUnbounded","click"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"mat-slider",2),ye("input",function(s){return i.changeOpacity(s.value)}),N(),F(3,"span",3),Te(4),N(),N(),F(5,"div",4),F(6,"mat-icon",5),ye("click",function(){return i.toggleVisibility()}),N(),F(7,"mat-icon",6),ye("click",function(){return i.toggleVisibility()}),N(),F(8,"mat-icon",7),ye("click",function(){return i.resetOpacity()}),Te(9,"refresh"),N(),N(),N()),2&t&&(Y(2),at("disabled",!i.visible),ie("step",1)("min",0)("max",100)("value",i.opacity),Y(2),Os("",i.opacity,"%"),Y(2),at("hidden",i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(1),at("hidden",!i.visible),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(1),ie("matRippleCentered",!0)("matRippleUnbounded",!0))},directives:[wk,Rs,Qo],styles:["[_nghost-%COMP%]{height:2.25rem;display:flex;align-items:center;justify-content:space-between;border-radius:.1875rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;justify-content:space-between;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%]{width:60%;display:flex;align-items:center;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%] .mat-slider-wrapper{top:1.125rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .slider.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:not-allowed}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-and-label[_ngcontent-%COMP%] .opacity-value[_ngcontent-%COMP%]{width:1.5rem;margin-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%]{display:flex;cursor:pointer!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{margin-right:1rem;padding:.25rem;cursor:pointer;transition:.6s;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility[_ngcontent-%COMP%]{transition:.6s;cursor:pointer;padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .icons[_ngcontent-%COMP%] .visibility.hidden[_ngcontent-%COMP%]{display:none}"],changeDetection:0}),n})(),lq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,SG,ec]]}),n})();function ZDe(n,e){if(1&n&&(F(0,"div",15),et(1,"youtube-player",16),N()),2&n){const t=bt(3);Y(1),Yy("videoId",t.videoID)}}function QDe(n,e){if(1&n&&(F(0,"mat-expansion-panel",10),F(1,"mat-expansion-panel-header"),F(2,"h2",11),Te(3),N(),N(),F(4,"div",12),et(5,"markdown",13),Ct(6,ZDe,2,1,"div",14),N(),N()),2&n){const t=bt(),i=t.index,r=t.$implicit;ie("expanded",0===i),Y(3),Ai(r.title),Y(2),at("first",0===i),ie("data",r.content),Y(1),ie("ngIf",0===i)}}function JDe(n,e){if(1&n&&(F(0,"div",8),Ct(1,QDe,7,6,"mat-expansion-panel",9),N()),2&n){const t=e.$implicit;Y(1),ie("ngIf",t)}}let eOe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.documentationContents=i.content||[],this.infoTitle=i.title||"",this.videoID=i.videoID}ngOnInit(){const t=document.createElement("script");t.src="https://www.youtube.com/iframe_api",document.body.appendChild(t)}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return n.\u0275fac=function(t){return new(t||n)(E(Gm),E(xk))},n.\u0275cmp=Le({type:n,selectors:[["ccf-info-dialog"]],decls:10,vars:2,consts:[[1,"rui-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography","dialog-content"],["class","panel",4,"ngFor","ngForOf"],[1,"panel"],[3,"expanded",4,"ngIf"],[3,"expanded"],[1,"no-header-margin"],[1,"top-padding"],[1,"variable-binding",3,"data"],["class","video-player",4,"ngIf"],[1,"video-player"],[3,"videoId"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),F(3,"mat-icon",3),ye("click",function(){return i.close()}),Te(4,"clear"),N(),N(),F(5,"div",4),F(6,"h2",5),Te(7),N(),F(8,"mat-dialog-content",6),Ct(9,JDe,2,1,"div",7),N(),N(),N(),N()),2&t&&(Y(7),Ai(i.infoTitle),Y(2),ie("ngForOf",i.documentationContents))},directives:[Rs,xG,TG,Xl,Is,NM,LM,NG,jG],styles:[".mat-dialog-container{padding:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;text-align:left}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.5rem;margin-bottom:1rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;cursor:pointer}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:2.25rem;text-align:center}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{font-size:1rem;margin-top:0;margin-bottom:.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{margin-bottom:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .no-header-margin[_ngcontent-%COMP%]{font-weight:300;margin-bottom:0}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%]{display:flex}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%] .top-padding[_ngcontent-%COMP%] markdown[_ngcontent-%COMP%] ul{margin-top:0;padding-left:1.5rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{height:50rem;min-height:10rem}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding[_ngcontent-%COMP%]{font-weight:300}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .variable-binding.first[_ngcontent-%COMP%]{padding-right:3rem;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%]{position:relative;width:50%}.rui-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%] .video-player[_ngcontent-%COMP%] iframe{width:100%;height:100%;max-height:17.5rem}"]}),n})(),tOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,Ok,mxe,Z1e.forRoot({})]]}),n})(),iOe=(()=>{class n{constructor(t){this.http=t,this.markdownContent=new sr([])}readMarkdown(){this.http.get("assets/docs/README.md",{responseType:"text"}).subscribe(t=>{const i=this.parseMarkdown(t);this.markdownContent.next(i)})}parseMarkdown(t){const i=[],r=t.split("# ");for(const s of r)if(s.length){const o=s.split("\n\n");i.push({title:o[0],content:o.splice(1).join("\n\n")})}return i}}return n.\u0275fac=function(t){return new(t||n)(I(im))},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),rOe=(()=>{class n{constructor(t,i){this.dialog=t,this.infoButtonService=i,this.infoTitle="",this.subscriptions=new Ie,this.subscriptions.add(i.markdownContent.subscribe(r=>{r.length&&this.launchInfoDialog(r)}))}ngOnDestroy(){this.subscriptions.unsubscribe()}launchInfoDialog(t){this.dialog.open(eOe,{autoFocus:!1,panelClass:"modal-animated",width:"60rem",data:{title:this.infoTitle,content:t,videoID:this.videoID}})}onDialogButtonClick(){this.infoButtonService.readMarkdown()}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(iOe))},n.\u0275cmp=Le({type:n,selectors:[["ccf-info-button"]],inputs:{infoTitle:"infoTitle",videoID:"videoID"},decls:3,vars:0,consts:[[1,"info-button-wrapper"],["aria-hidden","false","aria-label","Page information",1,"ccf-info-button",3,"click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"mat-icon",1),ye("click",function(){return i.onDialogButtonClick()}),Te(2," info "),N(),N())},directives:[Rs],styles:[".info-button-wrapper[_ngcontent-%COMP%]{border-radius:.25rem;padding:.65rem;transition:.6s}.info-button-wrapper[_ngcontent-%COMP%] .ccf-info-button[_ngcontent-%COMP%]{cursor:pointer;transition:color .6s;font-size:1.5rem;vertical-align:sub}"]}),n})(),sOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,tOe,Pr,nU]]}),n})(),oOe=(()=>{class n{constructor(t){this.el=t}onInputChange(t){const i=this.el.nativeElement.value;this.el.nativeElement.value=i.replace(/[^0-9]*/g,""),i!==this.el.nativeElement.value&&t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(nt))},n.\u0275dir=he({type:n,selectors:[["input","ccfNumbersOnly",""]],hostBindings:function(t,i){1&t&&ye("input",function(s){return i.onInputChange(s)})}}),n})(),aOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),cq=(()=>{class n{get obj(){const t=this.findGlobalObject();return Object.defineProperties(this,{obj:{configurable:!1,writable:!1,value:t}}),t}has(t){const{obj:i}=this;return null!=i&&t in i}get(t,i){var r;const{obj:s}=this;return null!==(r=s&&s[t])&&void 0!==r?r:i}set(t,i){const{obj:r}=this;r&&(r[t]=i)}remove(t){const{obj:i}=this;i&&delete i[t]}findGlobalObject(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof window)return window;if("undefined"!=typeof self)return self;try{return new Function("return this;")()}catch(t){}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),Eh=(()=>{let n=class extends qm{constructor(){super(...arguments),this.optionCache=new Map}get config$(){return this.state$.pipe(Uk(),Hc(1))}setConfig(t){this.setState(t)}patchConfig(t){this.patchState(t)}getProperty(t){return this.config$.pipe(lr(...t),Xo(),Hc(1))}getOption(...t){const i=this.getPathKey(t);if(this.optionCache.has(i))return this.optionCache.get(i);const r=this.config$.pipe(lr(...t),Xo(),Hc(1));return this.optionCache.set(i,r),r}getPathKey(t){return`${t.length}:${t.join(".")}`}};return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275prov=ae({token:n,factory:n.\u0275fac}),De([ri()],n.prototype,"config$",null),n=De([Ch(),gh({name:"globalConfig",defaults:null})],n),n})();!function(){const n=localStorage.getItem("ALLOW_TELEMETRY");null===n||n.toLowerCase()}();let dOe=(()=>{class n{constructor(t,i){t&&function(n,e){zc(n,"mousemove").pipe(yG(1e3),be(r=>{const{clientWidth:s,clientHeight:o}=n,{clientX:a,clientY:l}=r;return[a,l,s,o].join("_")})).subscribe(r=>e.event("webpage","mousemove",r))}(t.body,i)}}return n.\u0275fac=function(t){return new(t||n)(I(rt),I(io))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();function hOe(n,e){if(1&n){const t=Lr();F(0,"button",1),ye("click",function(){return Vn(t),bt().submit(!0)}),Te(1),N()}if(2&n){const t=bt();Y(1),Os(" ","not-set"===t.allowTelemetry?"I understand":"Opt in","\n")}}function fOe(n,e){if(1&n){const t=Lr();F(0,"button",1),ye("click",function(){return Vn(t),bt().submit(!1)}),Te(1,"Opt out"),N()}}let pOe=(()=>{class n{constructor(t,i,r){this.consentService=i,this.data=r,this.clsName="ccf-tracking-popup",this.container=t.nativeElement}get allowTelemetry(){return this.consentService.consent}dismiss(){this.data.preClose()}submit(t){this.consentService.setConsent(t?"given":"rescinded"),this.dismiss()}showButton(t){const{allowTelemetry:i}=this;return"not-set"===i||("opt-in"===t?"rescinded"===i:"given"===i)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(o0),E(FO))},n.\u0275cmp=Le({type:n,selectors:[["ccf-tracking-popup"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:4,vars:2,consts:[["mat-button","","color","basic",3,"click",4,"ngIf"],["mat-button","","color","basic",3,"click"]],template:function(t,i){1&t&&(F(0,"p"),Te(1,"We log usage to improve this service."),N(),Ct(2,hOe,2,1,"button",0),Ct(3,fOe,2,0,"button",0)),2&t&&(Y(2),ie("ngIf",i.showButton("opt-in")),Y(1),ie("ngIf",i.showButton("opt-out")))},directives:[Is,$f],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:400px;color:#ffffffb3;background:#323232;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f;z-index:9999}[_nghost-%COMP%] p[_ngcontent-%COMP%]{margin:24px}[_nghost-%COMP%] button[_ngcontent-%COMP%]{margin:1rem;min-width:6rem;background-color:#007cbe;display:flex;justify-content:center}"],changeDetection:0}),n})(),gOe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf]]}),n})();function a1(n){return Array.isArray(n)?n.join(","):`${n}`}a1([1,110]),a1([13,83]),a1(["http://purl.obolibrary.org/obo/UBERON_0013702"]);const bOe={initialConfig:{},parse:{},rename:{}};class COe{constructor(e,t){this.configState=e,this.storedChanges={},this.options=Object.assign(Object.assign({},bOe),t)}addChanges(e){this.storedChanges=Object.assign(Object.assign({},this.storedChanges),e)}applyChanges(e,t={}){void 0===e&&(e=this.storedChanges,this.storedChanges={});const{configState:i,options:{initialConfig:r}}=this,s=i.snapshot,o=Object.assign(Object.assign(Object.assign({},r),s),t);for(const[a,l]of Object.entries(e))this.processChange(a,l,o);i.setConfig(o)}processChange(e,t,i){var r,s;const{options:{parse:o,rename:a}}=this,l=null!==(r=a[e])&&void 0!==r?r:e,c=t.currentValue,d=null!==(s=o[e])&&void 0!==s?s:o[l];if(null==c)delete i[l];else if(d)try{i[l]=d(c)}catch(f){console.warn(`Failed to parse ${e} = ${c}`,f.message)}else i[l]=c}}let wOe=(()=>{class n{constructor(t,i,r={}){this.configState=t,this.cdr=i,this.options=r,this.initialized=!1,this.configManager=new COe(this.configState,this.options)}ngOnInit(){var t;this._init=setTimeout(()=>this.initialize(),null!==(t=this.options.initialDelay)&&void 0!==t?t:0)}ngOnDestroy(){this._init&&clearTimeout(this._init)}ngOnChanges(t){this.configManager.addChanges(t),this.initialized&&this.configManager.applyChanges()}initialize(){this._init=void 0,!this.initialized&&(this.configManager.applyChanges(),this.initialized=!0,this.cdr.markForCheck())}}return n.\u0275fac=function(t){!function(){throw new Error("invalid")}()},n.\u0275dir=he({type:n,features:[qn]}),n})();const EOe={boolean:n=>"false"!=`${n}`,json:n=>"string"==typeof n?JSON.parse(n):n,function:n=>{if("function"!=typeof n)throw new Error("Expected a javascript function");return n}};var mF,SOe=Ve(815);class xOe{constructor(e){this.value=e}call(e,t){return t.subscribe(new TOe(e,this.value))}}class TOe extends Rt{constructor(e,t){super(e),this.value=t}_next(e){this.destination.next(this.value)}}class DOe{constructor(e){this.notifier=e}call(e,t){return t.subscribe(new OOe(e,this.notifier))}}class OOe extends ei{constructor(e,t){super(e),this.hasValue=!1;const i=new $r(this);this.add(i),this.innerSubscription=i;const r=oo(t,i);r!==i&&(this.add(r),this.innerSubscription=r)}_next(e){this.hasValue&&super._next(e)}notifyNext(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()}notifyComplete(){}}function pF(n){return"function"==typeof n}function hq(n){return void 0===n}function POe(n,e,t){return function(r){let s=!!n;return function(n){return"function"==typeof n}(n)&&(s=n(r)),function(n,e){return pF(n)?n(e):hq(n)?e:n}(s?e:t,r)}}function ROe(n,e){return function(i){if(function(n){return null===n||hq(n)}(n)&&i)return i;if(!Array.isArray(i))return[n];const r=i.slice();let s=0;return e>0&&(s=e),r.splice(s,0,n),r}}function l0(n){return function(t){let i=null;for(const r in n){const s=n[r],o=t[r],a=pF(s)?s(o):s;a!==o&&(i||(i=Object.assign({},t)),i[r]=a)}return i||t}}const Sh={production:!0,disableDbWorker:!0,dbOptions:{ccfOwlUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf.owl",ccfContextUrl:"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld",hubmapDataService:"search-api",hubmapPortalUrl:"https://portal.hubmapconsortium.org/",hubmapDataUrl:"",hubmapAssetsUrl:"https://assets.hubmapconsortium.org",hubmapToken:null!==(mF=localStorage.getItem("HUBMAP_TOKEN"))&&void 0!==mF?mF:""},skipUnsavedChangesConfirmation:!1,googleAnalyticsToken:"portal.hubmapconsortium.org"===window.location.hostname?"G-1WRJHN9FM6":"G-J9HWV9QPJ4"};let Ui=class extends qm{constructor(e){super(),this.globalConfig=e,this.user$=this.state$.pipe(lr("user")),this.registrationStarted$=this.state$.pipe(zk("registrationStarted")),this.useCancelRegistrationCallback$=this.state$.pipe(lr("useCancelRegistrationCallback")),this.registrationCallbackSet$=this.state$.pipe(lr("registrationCallbackSet"))}get skipConfirmation$(){return this.state$.pipe(zk("skipConfirmation"))}get globalSkipConfirmation$(){return this.globalConfig.getOption("skipUnsavedChangesConfirmation").pipe(be(e=>null!=e?e:Sh.skipUnsavedChangesConfirmation),Xo())}get hasChanges$(){return this.state$.pipe(zk("hasChanges"))}ngxsOnInit(){super.ngxsOnInit(),this.globalConfig.config$.pipe(_i(1),Di(e=>this.setState(l0({registrationCallbackSet:!!e.register,useCancelRegistrationCallback:!!e.cancelRegistration,user:POe(!!e.user,e.user),registrationStarted:!!e.user||void 0})))).subscribe(),this.initSkipConfirmationListeners()}cancelRegistration(){const{globalConfig:{snapshot:{cancelRegistration:e}},snapshot:{useCancelRegistrationCallback:t,skipConfirmation:i}}=this;t&&(i||confirm("Changes you made may not be saved."))&&(null==e||e())}setUseCancelRegistrationCallback(e){this.ctx.patchState({useCancelRegistrationCallback:e})}setUserName(e){this.ctx.setState(l0({user:l0(e)}))}registrationStarted(){this.ctx.setState(l0({registrationStarted:!0}))}setHasChanges(){const{snapshot:{registrationStarted:e,hasChanges:t}}=this;e&&!t&&this.ctx.patchState({hasChanges:!0})}clearHasChanges(){this.ctx.patchState({hasChanges:!1})}initSkipConfirmationListeners(){const e=i=>this.patchState({skipConfirmation:i});this.globalSkipConfirmation$.pipe(Tn(i=>i)).subscribe(e),this.hasChanges$.pipe(jM(this.globalSkipConfirmation$),be(([i,r])=>r||!i),Xo()).subscribe(e);const t=i=>(i.preventDefault(),i.returnValue="Changes you made may not be saved.",i.returnValue);this.skipConfirmation$.subscribe(i=>{i?removeEventListener("beforeunload",t):addEventListener("beforeunload",t)})}};Ui.\u0275fac=function(e){return new(e||Ui)(I(Eh))},Ui.\u0275prov=ae({token:Ui,factory:Ui.\u0275fac}),De([ri()],Ui.prototype,"skipConfirmation$",null),De([ri()],Ui.prototype,"globalSkipConfirmation$",null),De([ri()],Ui.prototype,"hasChanges$",null),De([Xt()],Ui.prototype,"setUseCancelRegistrationCallback",null),De([Xt()],Ui.prototype,"setUserName",null),De([Xt()],Ui.prototype,"registrationStarted",null),De([Xt()],Ui.prototype,"setHasChanges",null),De([Xt()],Ui.prototype,"clearHasChanges",null),Ui=De([Ch(),gh({name:"page",defaults:{user:{firstName:"",lastName:""},registrationStarted:!1,useCancelRegistrationCallback:!1,registrationCallbackSet:!1,skipConfirmation:!0,hasChanges:!1}})],Ui);let dc=class extends qm{constructor(e,t){super(),this.globals=e,this.globalConfig=t}ngxsOnInit(){super.ngxsOnInit(),this.getSourceDB().subscribe(e=>{this.setState(e),Sh.production||this.globals.set("db",e)})}getSourceDB(){return this.globalConfig.getOption("baseHref").pipe(be(e=>(null!=e?e:"")+"assets/reference-organ-data.json"),Ir(e=>li(fetch(e)).pipe(Ir(t=>t.json()),Sa(()=>Ql))))}normalizePlacement(e){const i=this.snapshot.placementPatches[null==e?void 0:e.target];if(i){const r=function(n,e){const t=e;let i;switch(t.translation_units){case"centimeter":i=.01;break;case"millimeter":i=.001;break;case"meter":default:i=1}const r=[t.x_translation,t.y_translation,t.z_translation].map(a=>a*i),s=[t.x_rotation,t.y_rotation,t.z_rotation].map(Jv),o=[t.x_scaling,t.y_scaling,t.z_scaling];return n.translate(r).rotateXYZ(s).scale(o)}(new Lt(Lt.IDENTITY),i),s={x:e.x_translation,y:e.y_translation,z:e.z_translation},[o,a,l]=r.transformAsPoint([s.x,s.y,s.z],[]),c=Object.assign(Object.assign({},e),{target:i.target});return c.x_translation=o,c.y_translation=a,c.z_translation=l,c}return e}getReferenceOrganIri(e,t,i,r){const s=this.snapshot;"KIDNEY"!==e.toUpperCase()&&(i=""),(null==r?void 0:r.sex)&&(t=r.sex);const o=[e,t,i||(null==r?void 0:r.side)].join("|").toUpperCase(),a=Object.keys(s.organIRILookup).find(l=>l.toUpperCase().endsWith(o));return a?s.organIRILookup[a]:void 0}getOrganData(e){var t,i,r;const o=this.snapshot.organSpatialEntities[e];if(!o)return;const a=null!==(t=o.label)&&void 0!==t?t:"",l=a0.find(c=>a.endsWith(c.organ));return l?{organ:l,sex:null===(i=o.sex)||void 0===i?void 0:i.toLowerCase(),side:null===(r=o.side)||void 0===r?void 0:r.toLowerCase()}:void 0}};dc.\u0275fac=function(e){return new(e||dc)(I(cq),I(Eh))},dc.\u0275prov=ae({token:dc,factory:dc.\u0275fac}),dc=De([Ch(),gh({name:"reference",defaults:{organIRILookup:{},organSpatialEntities:{},anatomicalStructures:{},extractionSets:{},sceneNodeLookup:{},simpleSceneNodeLookup:{},placementPatches:{}}})],dc);const _F=a0;let si=class extends qm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.id$=this.state$.pipe(lr("id")),this.blockSize$=this.state$.pipe(lr("blockSize")),this.rotation$=this.state$.pipe(lr("rotation")),this.position$=this.state$.pipe(lr("position")),this.slicesConfig$=this.state$.pipe(lr("slicesConfig")),this.viewType$=this.state$.pipe(lr("viewType")),this.viewSide$=this.state$.pipe(lr("viewSide")),this.organ$=this.state$.pipe(lr("organ")),this.organIri$=this.state$.pipe(lr("organIri")),this.organDimensions$=this.state$.pipe(lr("organDimensions")),this.sex$=this.state$.pipe(lr("sex")),this.side$=this.state$.pipe(lr("side")),this.showPrevious$=this.state$.pipe(lr("showPrevious")),this.extractionSites$=this.state$.pipe(lr("extractionSites")),this.anatomicalStructures$=this.state$.pipe(lr("anatomicalStructures")),this.extractionSets$=this.state$.pipe(lr("extractionSets"))}get modelChanged$(){const e=["viewType","viewSide","showPrevious"],t=Object.keys(this.initialState).filter(i=>!e.includes(i));return this.state$.pipe(yG(0,void 0,{leading:!1,trailing:!0}),Xo((i,r)=>{for(const s of t)if(i[s]!==r[s])return!1;return!0}),e=>e.lift(new xOe(void 0)))}ngxsOnInit(){super.ngxsOnInit(),this.referenceData=this.injector.get(dc),this.page=this.injector.get(Ui),this.globalConfig.getOption("organ").pipe(Uk(),Ir(e=>{var t,i;const r=e.name.toLowerCase(),s=e.side;let a=this.idMatches(e.ontologyId,s);return a||(a=this.nameMatches(r,s)),a?(this.ctx.patchState({organ:a,sex:null===(t=e.sex)||void 0===t?void 0:t.toLowerCase(),side:null===(i=null==a?void 0:a.side)||void 0===i?void 0:i.toLowerCase()}),this.referenceData.state$.pipe($g(100),_i(1),bk(200),Di(()=>this.onOrganIriChange()))):Ql})).subscribe(),this.modelChanged$.pipe(function(n){return e=>e.lift(new DOe(n))}(this.page.registrationStarted$.pipe(Tn(e=>e),bk(5)))).subscribe(()=>this.page.setHasChanges())}idMatches(e,t){return a0.find(i=>!(!e||i.id!==e||i.side&&i.side!==t))}nameMatches(e,t){return a0.find(i=>i.side?i.organ.toLowerCase()===e&&i.side===t:i.organ.toLowerCase()===e)}setBlockSize(e){this.ctx.patchState({blockSize:e})}setRotation(e){this.ctx.patchState({rotation:e})}setPosition(e){this.ctx.patchState({position:e})}setSlicesConfig(e){this.ctx.patchState({slicesConfig:e})}setViewType(e){this.ctx.patchState({viewType:e})}setViewSide(e){this.ctx.patchState({viewSide:e})}get defaultPosition(){const e=this.snapshot.organDimensions;return{x:e.x+2*this.snapshot.blockSize.x,y:e.y/2,z:e.z/2}}setOrgan(e){this.ctx.patchState({organ:e}),e.side&&this.ctx.patchState({side:e.side}),this.onOrganIriChange()}setSex(e){this.ctx.patchState({sex:e}),this.onOrganIriChange()}setSide(e){this.ctx.patchState({side:e}),this.onOrganIriChange()}setShowPrevious(e){this.ctx.patchState({showPrevious:e})}setExtractionSites(e){this.ctx.patchState({extractionSites:e})}setAnatomicalStructures(e){this.ctx.patchState({anatomicalStructures:e})}setExtractionSets(e){this.ctx.patchState({extractionSets:e})}toggleRegistrationBlocksVisibility(e,t){if(this.setShowPrevious(e),e){const i=t.map(r=>{var s;return Object.assign(Object.assign({},r),{opacity:Math.min(20,null!==(s=r.opacity)&&void 0!==s?s:20)})});this.setAnatomicalStructures(i)}else this.setAnatomicalStructures(t)}onOrganIriChange(){var e,t,i,r,s;const o=this.referenceData.getReferenceOrganIri((null===(e=this.snapshot.organ)||void 0===e?void 0:e.organ)||"",this.snapshot.sex,this.snapshot.side,this.snapshot.organ),a={x:100,y:100,z:100};if((null===(t=this.snapshot.organ)||void 0===t?void 0:t.sex)&&this.ctx.patchState({sex:null===(i=this.snapshot.organ)||void 0===i?void 0:i.sex}),o){const l=this.referenceData.snapshot,c={};for(const p of l.anatomicalStructures[o]||[]){const g=null!==(r=p.representation_of)&&void 0!==r?r:p["@id"];c[g]||(c[g]={id:null!==(s=p.representation_of)&&void 0!==s?s:p["@id"],name:p.label,visible:!0,opacity:20,tooltip:p.comment})}this.ctx.patchState({anatomicalStructures:Object.values(c)});const d=(l.extractionSets[o]||[]).map(p=>({name:p.label,sites:(0,SOe.sortBy)(p.extractionSites.map(g=>({id:g["@id"],name:g.label,visible:!1,opacity:0,tooltip:g.comment})),"name")}));this.ctx.patchState({extractionSets:d}),this.ctx.patchState({extractionSites:d.length>0?d[0].sites:[]});const f=l.organSpatialEntities[o];a.x=f.x_dimension,a.y=f.y_dimension,a.z=f.z_dimension}this.ctx.patchState({organIri:o,organDimensions:a}),this.ctx.patchState({position:this.defaultPosition})}};si.\u0275fac=function(e){return new(e||si)(I(Tt),I(Eh))},si.\u0275prov=ae({token:si,factory:si.\u0275fac}),De([ri()],si.prototype,"modelChanged$",null),De([Xt()],si.prototype,"setBlockSize",null),De([Xt()],si.prototype,"setRotation",null),De([Xt()],si.prototype,"setPosition",null),De([Xt()],si.prototype,"setSlicesConfig",null),De([Xt()],si.prototype,"setViewType",null),De([Xt()],si.prototype,"setViewSide",null),De([ri()],si.prototype,"defaultPosition",null),De([Xt()],si.prototype,"setOrgan",null),De([Xt()],si.prototype,"setSex",null),De([Xt()],si.prototype,"setSide",null),De([Xt()],si.prototype,"setShowPrevious",null),De([Xt()],si.prototype,"setExtractionSites",null),De([Xt()],si.prototype,"setAnatomicalStructures",null),De([Xt()],si.prototype,"setExtractionSets",null),si=De([Ch(),gh({name:"model",defaults:{id:"",label:"",organ:{src:"",name:""},organIri:"",organDimensions:{x:90,y:90,z:90},sex:"male",side:"left",blockSize:{x:10,y:10,z:10},rotation:{x:0,y:0,z:0},position:{x:0,y:0,z:0},slicesConfig:{thickness:NaN,numSlices:NaN},viewType:"register",viewSide:"anterior",showPrevious:!1,extractionSites:[],anatomicalStructures:[],extractionSets:[]}})],si);const mq=new _e("Default theme class");let yF=(()=>{class n{constructor(t){this.defaultTheme=this.theme=null!=t?t:""}static initialize(t){const{injector:i,location:r}=t;i.get(n).initialize(r,i)}getTheme(){return this.theme}setTheme(t){t!==this.theme&&(this.applyThemeClass(this.theme,"remove"),this.applyThemeClass(t),this.theme=t)}resetTheme(){this.setTheme(this.defaultTheme)}initialize(t,i){this.element=t,this.injector=i,this.applyThemeClass(this.getTheme())}applyThemeClass(t,i="add"){var r;const{element:s,injector:o}=this;if(!t||!s||!o)return;const a=o.get(Lc,null);if(!a)return;const l=s.nativeElement,c=null===(r=o.get(om,null))||void 0===r?void 0:r.getContainerElement(),d="add"===i?"addClass":"removeClass";a[d](l,t),c&&a[d](c,t)}}return n.\u0275fac=function(t){return new(t||n)(I(mq,8))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})(),FOe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-name-input",this.firstNameValidator=new vh("",[p$.required]),this.lastNameValidator=new vh("",[p$.required]),this._name={firstName:"",lastName:""},this.nameChange=new Pe}get name(){return this._name}set name(t){this._name=t,this.firstNameValidator.setValue((null==t?void 0:t.firstName)||""),this.lastNameValidator.setValue((null==t?void 0:t.lastName)||"")}updateName(t,i){const r=t.target;this.name=Object.assign(Object.assign({},this.name),{[i]:r.value}),this.ga.event("name_updated","name_input",i),this.nameChange.emit(this.name)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-name-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{name:"name"},outputs:{nameChange:"nameChange"},decls:8,vars:2,consts:[[1,"field"],[1,"text","label"],["matInput","","matTooltip","Add your first name.",1,"input",3,"value","input"],["matInput","","matTooltip","Add your last name.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"mat-form-field",0),F(1,"mat-label",1),Te(2,"First Name "),N(),F(3,"input",2),ye("input",function(s){return i.updateName(s,"firstName")}),N(),N(),F(4,"mat-form-field",0),F(5,"mat-label",1),Te(6,"Last Name "),N(),F(7,"input",3),ye("input",function(s){return i.updateName(s,"lastName")}),N(),N()),2&t&&(Y(3),ie("value",i.firstNameValidator.value),Y(4),ie("value",i.lastNameValidator.value))},directives:[tm,Bf,Hb,cc],styles:["[_nghost-%COMP%]{display:flex}[_nghost-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:left;width:100%}"],changeDetection:0}),n})();const NOe=["thumbContainer"],LOe=["toggleBar"],BOe=["input"],VOe=function(n){return{enterDuration:n}},jOe=["*"],UOe=new _e("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let zOe=0;const HOe={provide:Ao,useExisting:T(()=>_q),multi:!0};class $Oe{constructor(e,t){this.source=e,this.checked=t}}const GOe=Nf(kf(Ff(em(class{constructor(n){this._elementRef=n}}))));let _q=(()=>{class n extends GOe{constructor(t,i,r,s,o,a){super(t),this._focusMonitor=i,this._changeDetectorRef=r,this.defaults=o,this._onChange=l=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++zOe,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new Pe,this.toggleChange=new Pe,this.tabIndex=parseInt(s)||0,this.color=this.defaultColor=o.color||"accent",this._noopAnimations="NoopAnimations"===a}get required(){return this._required}set required(t){this._required=Dt(t)}get checked(){return this._checked}set checked(t){this._checked=Dt(t),this._changeDetectorRef.markForCheck()}get inputId(){return`${this.id||this._uniqueId}-input`}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new $Oe(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(hl),E(Un),fs("tabindex"),E(UOe),E(Zo,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(t,i){if(1&t&&(ni(NOe,5),ni(LOe,5),ni(BOe,5)),2&t){let r;Mt(r=xt())&&(i._thumbEl=r.first),Mt(r=xt())&&(i._thumbBarEl=r.first),Mt(r=xt())&&(i._inputElement=r.first)}},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,i){2&t&&(sl("id",i.id),en("tabindex",i.disabled?null:-1)("aria-label",null)("aria-labelledby",null),at("mat-checked",i.checked)("mat-disabled",i.disabled)("mat-slide-toggle-label-before","before"==i.labelPosition)("_mat-animation-noopable",i._noopAnimations))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked",ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[At([HOe]),ht],ngContentSelectors:jOe,decls:16,vars:20,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"div",2,3),F(4,"input",4,5),ye("change",function(s){return i._onChangeEvent(s)})("click",function(s){return i._onInputClick(s)}),N(),F(6,"div",6,7),et(8,"div",8),F(9,"div",9),et(10,"div",10),N(),N(),N(),F(11,"span",11,12),ye("cdkObserveContent",function(){return i._onLabelTextChange()}),F(13,"span",13),Te(14,"\xa0"),N(),In(15),N(),N()),2&t){const r=Ys(1),s=Ys(12);en("for",i.inputId),Y(2),at("mat-slide-toggle-bar-no-side-margin",!s.textContent||!s.textContent.trim()),Y(2),ie("id",i.inputId)("required",i.required)("tabIndex",i.tabIndex)("checked",i.checked)("disabled",i.disabled),en("name",i.name)("aria-checked",i.checked.toString())("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),Y(5),ie("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Fg(18,VOe,i._noopAnimations?0:150))}},directives:[Qo,kD],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),n})(),yq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),vq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[yq,ec,Nn,_E],yq,Nn]}),n})(),vF=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-labeled-slide-toggle",this.labels=["Left","Right"],this.value="Left",this.disabled=!1,this.valueChange=new Pe}get left(){const{value:t,labels:i}=this;return t!==i[1]}updateToggle(t){this.value=t?this.labels[0]:this.labels[1],this.ga.event("slide_toggle_toggled","slide_toggle",this.value),this.valueChange.emit(this.value)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-labeled-slide-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{labels:"labels",value:"value",disabled:"disabled"},outputs:{valueChange:"valueChange"},decls:6,vars:12,consts:[[1,"slide-label",3,"click"],[1,"slider",3,"disabled","checked","change"],["toggle",""]],template:function(t,i){if(1&t){const r=Lr();F(0,"span",0),ye("click",function(){Vn(r);const o=Ys(3);return i.left||o.toggle(),i.updateToggle(!0)}),Te(1),N(),F(2,"mat-slide-toggle",1,2),ye("change",function(o){return i.updateToggle(!o.checked)}),N(),F(4,"span",0),ye("click",function(){Vn(r);const o=Ys(3);return i.left&&o.toggle(),i.updateToggle(!1)}),Te(5),N()}2&t&&(at("disabled",i.disabled)("highlighted",i.left),Y(1),Ai(i.labels[0]),Y(1),ie("disabled",i.disabled)("checked",!i.left),Y(2),at("disabled",i.disabled)("highlighted",!i.left),Y(1),Ai(i.labels[1]))},directives:[_q],styles:["[_nghost-%COMP%] .slide-label[_ngcontent-%COMP%]{margin:0 1rem;transition:color .6s;cursor:pointer}[_nghost-%COMP%] .disabled[_ngcontent-%COMP%]{opacity:30%;cursor:not-allowed}"],changeDetection:0}),n})();const YOe=function(){return["Male","Female"]},XOe=function(n){return[n]};let KOe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.dialogRef=r,this.clsName="ccf-registration-content",this.sexByLabel$=this.model.sex$.pipe(be(s=>"female"===s?"Female":"Male")),this.organList=_F,r.disableClose=!0}setSexFromLabel(t){this.currentSex=t,this.sexSelected=!0}checkNameValid(t){this.nameValid=t.firstName.length>0&&t.lastName.length>0}organSelect(t){this.currentOrgan=t,this.organSelected=!0}registerButtonClick(t){t&&t.preventDefault(),this.organSelected&&this.nameValid&&this.closeDialog()}closeDialog(){this.model.setSex("Female"===this.currentSex?"female":"male"),this.model.setOrgan(this.currentOrgan),this.dialogRef.close(!0),this.page.registrationStarted()}}return n.\u0275fac=function(t){return new(t||n)(E(Ui),E(si),E(Gm))},n.\u0275cmp=Le({type:n,selectors:[["ccf-registration-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:17,vars:17,consts:[[1,"modal"],["mat-dialog-content",""],[3,"name","nameChange"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"labels","value","valueChange"],[1,"selector-label"],[1,"selector-container"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],["mat-button","",1,"registration-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"ccf-name-input",2),ye("nameChange",function(s){return i.page.setUserName(s),i.checkNameValid(s)}),yn(3,"async"),N(),F(4,"div",3),F(5,"div",4),Te(6,"Donor Sex:"),N(),F(7,"ccf-labeled-slide-toggle",5),ye("valueChange",function(s){return i.setSexFromLabel(s)}),yn(8,"async"),N(),N(),F(9,"div",6),Te(10,"Select an organ"),N(),F(11,"div",7),F(12,"ccf-organ-selector",8,9),ye("organsChanged",function(s){return i.organSelect(s[0])}),yn(14,"async"),N(),N(),N(),F(15,"button",10),ye("click",function(s){return i.registerButtonClick(s)}),Te(16,"START REGISTRATION"),N(),N()),2&t&&(Y(2),ie("name",wn(3,8,i.page.user$)),Y(5),ie("labels",lv(14,YOe))("value",wn(8,10,i.sexByLabel$)),Y(5),ie("organList",i.organList)("selectedOrgans",Fg(15,XOe,wn(14,12,i.model.organ$))),Y(3),at("disabled",!i.organSelected||!i.nameValid),ie("matTooltip",i.organSelected&&i.nameValid?"":"Required: Enter first and last name, and select an organ"))},directives:[FOe,cc,vF,oq,$f],pipes:[zu],styles:[".modal[_ngcontent-%COMP%]{padding:1rem;border-radius:4px;width:35rem;height:22rem}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}.modal[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}.modal[_ngcontent-%COMP%] .selector-label[_ngcontent-%COMP%]{font-weight:600;height:3rem;line-height:3rem}.modal[_ngcontent-%COMP%] .selector-container[_ngcontent-%COMP%]{height:4rem;width:31rem;margin:0 auto}.modal[_ngcontent-%COMP%] .registration-button[_ngcontent-%COMP%]{display:block;margin:2rem auto 0}"],changeDetection:0}),n})(),ZOe=(()=>{class n{constructor(t,i,r){this.dialog=t,this.page=i,this.model=r,this.clsName="ccf-registration-modal"}ngOnInit(){or([this.page.user$,this.model.organ$]).pipe($g(500),_i(1),Di(([t,i])=>{""!==t.firstName&&""!==t.lastName&&""!==i.src||this.openDialog()})).subscribe()}openDialog(){this.dialog.open(KOe,{autoFocus:!1})}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(Ui),E(si))},n.\u0275cmp=Le({type:n,selectors:[["ccf-registration-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:0,vars:0,template:function(t,i){},encapsulation:2}),n})();function QOe(n,e){1&n&&function(n,e,t){ff(n,e,t),pf()}(0)}function JOe(n,e){if(1&n){const t=Lr();F(0,"div",4),ye("click",function(){return Vn(t),bt().page.cancelRegistration()}),F(1,"mat-icon",5),Te(2,"chevron_left"),N(),F(3,"span",6),Te(4,"BACK"),N(),N()}}function eIe(n,e){1&n&&(F(0,"a",7),et(1,"mat-icon",8),N())}let tIe=(()=>{class n{constructor(t){this.page=t,this.clsName="ccf-header"}}return n.\u0275fac=function(t){return new(t||n)(E(Ui))},n.\u0275cmp=Le({type:n,selectors:[["ccf-header"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:7,vars:5,consts:[[4,"ngIf","ngIfThen","ngIfElse"],["backButton",""],["logo",""],[1,"filler"],["rel","noreferrer noopener",1,"link","home",3,"click"],[1,"icon","backbutton"],[1,"text"],["href","https://ingest.hubmapconsortium.org/","rel","noreferrer noopener","matTooltip","Human BioMolecular Atlas Project","matTooltipPosition","right",1,"link","hubmap"],["svgIcon","app:logo",1,"icon","logo"]],template:function(t,i){if(1&t&&(Ct(0,QOe,1,0,"ng-container",0),yn(1,"async"),Ct(2,JOe,5,0,"ng-template",null,1,Rw),Ct(4,eIe,2,0,"ng-template",null,2,Rw),et(6,"div",3)),2&t){const r=Ys(3),s=Ys(5);ie("ngIf",wn(1,3,i.page.useCancelRegistrationCallback$))("ngIfThen",r)("ngIfElse",s)}},directives:[Is,Rs,cc],pipes:[zu],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-height:4rem;padding:0 1.5rem;border-bottom-width:1px;border-bottom-style:solid}[_nghost-%COMP%] .text[_ngcontent-%COMP%]{padding:.25rem 0;height:2rem;display:flex;align-items:center;font-weight:lighter;font-size:1.5rem}[_nghost-%COMP%] .link[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;text-decoration:none;padding:.25rem 0}[_nghost-%COMP%] .home[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{transition:color .6s}[_nghost-%COMP%] .home[_ngcontent-%COMP%] .backbutton[_ngcontent-%COMP%]{font-size:2.25rem;width:2.25rem;height:2.25rem}[_nghost-%COMP%] .hubmap[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:100%;margin-right:1rem}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1;margin:0}"],changeDetection:0}),n})();const bq={isolated:!0},Cq=new _e("Message service configuration",{providedIn:"root",factory:()=>bq});let nIe=(()=>{class n{constructor(t,i,r){this.source=t,this.channel=i,this.messages=r}sendMessage(t){this.channel.next({id:this.nextMessageId(),source:this.source,payload:t})}getMessages(){return this.messages.pipe(Tn(t=>t.source!==this.source))}getMessagesFromSource(t){return this.getMessages().pipe(Tn(i=>i.source===t))}getMessagesFromSources(t){return this.getMessages().pipe(Tn(i=>t.includes(i.source)))}nextMessageId(){return n.counter++}}return n.counter=0,n})();const c0=(()=>{class n{constructor(t,i){this.config=t,this.parent=i,this.channel=new we,this.messages=t.isolated||!i?this.channel.asObservable():li([this.channel,i.messages.pipe(_U(()=>!this.channel.closed))]).pipe(ao())}ngOnDestroy(){this.channel.complete()}connect(t){return new nIe(t,this.channel,this.messages)}}return n.\u0275fac=function(t){return new(t||n)(I(Cq),I(n,12))},n.\u0275prov=ae({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),iIe=["*"];let l1=(()=>{class n{constructor(t,i){this.className="ccf-drawer-content",this.animationsEnabled=!1,this.leftMargin=0,this.rightMargin=0,this.faded=!1,this.drawers=[],this.subscriptions=new Ie;const r=t.connect(this).getMessages();this.subscriptions.add(r.subscribe(s=>{this.handleMessage(s)&&i.markForCheck()}))}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){switch(t.payload.type){case"drawer-containers-changed":return this.drawers=t.payload.drawers,this.updateFaded(),!0;case"drawer-initialized":return this.animationsEnabled=!0,!0;case"drawer-toggled":{const i=t.source.position,{opened:r,width:s,margin:o}=t.payload;return this.updateMargin(i,r,s,o),this.updateFaded(),!0}default:return!1}}updateMargin(t,i,r,s){const o=i?r+s:s;"start"===t?this.leftMargin=o:this.rightMargin=o}updateFaded(){const[t,i]=this.drawers;this.faded=!!((null==t?void 0:t.opened)&&(null==t?void 0:t.expanded)||(null==i?void 0:i.opened)&&(null==i?void 0:i.expanded))}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-content"]],hostVars:9,hostBindings:function(t,i){2&t&&(Sg("@fadeInOut",i.faded),Fn(i.className),gf("margin-left",i.leftMargin,"px")("margin-right",i.rightMargin,"px"),at("cff-drawer-content-animations",i.animationsEnabled))},ngContentSelectors:iIe,decls:1,vars:0,template:function(t,i){1&t&&(Dr(),In(0))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;z-index:2;overflow:auto}.cff-drawer-content-animations[_nghost-%COMP%]{transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:margin-left,margin-right}"],data:{animation:[Jl("fadeInOut",[br("false",Kn({opacity:1})),br("true",Kn({opacity:0})),Qs("false <=> true",Mo("1s"))])]},changeDetection:0}),n})();const rIe=["*"],bF={params:{width:0,margin:0,margin2:0}};class sIe{constructor(){this.initialized=!1,this.deferred=new Promise(e=>{this.resolve=e})}set(){this.initialized=!0,this.resolve()}wait(){return gl(this,void 0,void 0,function*(){return this.deferred})}valueOf(){return this.initialized}}let CF=(()=>{class n{constructor(t,i,r){this.element=r,this.className="ccf-drawer",this._position="start",this._opened=!1,this._expanded=!1,this.openedChange=new Pe(!0),this.expandedChange=new Pe(!0),this.stateChange=new Pe(!0),this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._measuredWidth=0,this.width=0,this._measuredMargin=0,this.margin2=0,this.initialized=new sIe,this.subscriptions=new Ie,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(s=>{this.handleMessage(s)&&i.markForCheck()}))}get classEnd(){return"end"===this.position}get position(){return this._position}set position(t){this._position=t||"start"}get opened(){return this._opened}set opened(t){this.toggle(Dt(t))}get expanded(){return this._expanded}set expanded(t){this.toggleExpanded(Dt(t))}get expandedStateObj(){return{value:this.expandedState2,params:{width:this.width,margin:this.measuredMargin,margin2:this.margin2}}}get measuredWidth(){if(this._measuredWidth>0)return this._measuredWidth;const t=this.element.nativeElement;if(!t)return 0;const i=t.getBoundingClientRect(),r=i.right-i.left;return 0===r?0:(this._measuredWidth=r,r)}get measuredMargin(){if(this._measuredMargin>0)return this._measuredMargin;const t=this.element.nativeElement;if(!t)return 0;const s=globalThis.getComputedStyle(t).getPropertyValue("start"===this.position?"margin-right":"margin-left"),o=Number(s.slice(0,-2));return this._measuredMargin=o,o}ngAfterViewInit(){this.initialized.set(),setTimeout(()=>this.channel.sendMessage({type:"drawer-initialized"}))}ngOnDestroy(){this.subscriptions.unsubscribe()}open(){this.toggle(!0)}close(){this.toggle(!1)}toggle(t=!this.opened){this.opened!==t&&(t?this.openedState=this.initialized.valueOf()?"open":"open-instant":(this.openedState="closed",this.expandedState="closed",this.expandedState2="collapsed",this._expanded=!1),this._opened=t,this.sendToggle())}openExpanded(){this.toggleExpanded(!0)}closeExpanded(){this.toggleExpanded(!1)}toggleExpanded(t=!this.expanded){this.expanded!==t&&(t?this.expandedState=this.initialized.valueOf()?"open":"open-instant":(this.expandedState="closed",this.expandedState2="collapsed"),this._expanded=t,this.sendToggle())}closeOpenDone(){this.openedChange.emit(this.opened)}expandCollapseDone(){this.expandedChange.emit(this.expanded)}sendToggle(){return gl(this,void 0,void 0,function*(){yield this.initialized.wait(),this.channel.sendMessage({type:"drawer-toggled",opened:this.opened,expanded:this.expanded,width:this.measuredWidth,margin:this.measuredMargin}),this.stateChange.emit()})}handleMessage(t){switch(t.payload.type){case"drawer-toggled":return this.syncExpanded(t.source),!0;default:return!1}}syncExpanded(t){(this.expanded||t.expanded)&&(this.expanded&&t.expanded?this.expandedState2=t.expandedState2="half":this.expanded?t.opened?(this.expandedState2="extended",this.width=t.measuredWidth+t.measuredMargin):(this.expandedState2="full",this.margin2=t.measuredMargin):this.opened?(t.expandedState2="extended",t.width=this.measuredWidth+this.measuredMargin):(t.expandedState2="full",t.margin2=this.measuredMargin))}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un),E(nt))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer"]],hostVars:10,hostBindings:function(t,i){1&t&&qy("@openClose.done",function(){return i.closeOpenDone()})("@expandCollapse.done",function(){return i.expandCollapseDone()}),2&t&&(Sg("@openClose",i.openedState)("@expandCollapse",i.expandedStateObj),Fn(i.className),at("ccf-drawer-end",i.classEnd)("ccf-drawer-opened",i.opened)("ccf-drawer-expanded",i.expanded))},inputs:{position:"position",opened:"opened",expanded:"expanded"},outputs:{openedChange:"openedChange",expandedChange:"expandedChange",stateChange:"stateChange"},exportAs:["ccfDrawer"],ngContentSelectors:rIe,decls:2,vars:0,consts:[[1,"cff-drawer-inner-container"]],template:function(t,i){1&t&&(Dr(),F(0,"div",0),In(1),N())},styles:["[_nghost-%COMP%]{display:block;position:absolute;top:0;bottom:0;z-index:2;outline:0;transform:translate(-100%)}.ccf-drawer-end[_nghost-%COMP%]{right:0;transform:translate(100%)}[_nghost-%COMP%] .cff-drawer-inner-container[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}"],data:{animation:[Jl("openClose",[br("open, open-instant",Kn({transform:"none"})),br("closed",Kn({})),Qs("closed => open-instant",Mo(0)),Qs("closed <=> open, open-instant => closed",Mo(".5s ease-in-out"))]),Jl("expandCollapse",[br("collapsed",Kn({})),br("half",Kn({width:"calc(50% - {{ margin }}px)"}),bF),br("extended",Kn({width:"calc(100% - {{ width }}px - {{ margin }}px)"}),bF),br("full",Kn({width:"calc(100% - {{ margin }}px - {{ margin2 }}px)"}),bF),Qs("* <=> *",Mo(".5s ease-in-out"))])]},changeDetection:0}),n})();function oIe(n,e){1&n&&(F(0,"ccf-drawer-content"),In(1,2),N())}const aIe=[[["ccf-drawer"]],[["ccf-drawer-content"]],"*"],lIe=["ccf-drawer","ccf-drawer-content","*"];function wq(n){throw new Error(`Multiple drawers in position ${n}`)}let cIe=(()=>{class n{constructor(t,i){this.cdr=i,this.className="ccf-drawer-container",this.subscriptions=new Ie,this.channel=t.connect(this),this.subscriptions.add(this.channel.getMessages().subscribe(r=>{this.handleMessage(r)&&i.markForCheck()}))}get content(){var t;return null!==(t=this.content1.first)&&void 0!==t?t:this.content2.first}get hasWrappedContent(){return 0!==this.content1.length}ngAfterViewInit(){this.drawers.changes.pipe(ns(null)).subscribe(()=>{const t=this.validateDrawers();this.channel.sendMessage({type:"drawer-containers-changed",drawers:t}),this.cdr.markForCheck()}),this.content1.changes.pipe(ns(null)).subscribe(()=>{this.channel.sendMessage({type:"content-container-changed",content:this.content}),this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return!0}validateDrawers(){const t=this.drawers.toArray(),i=t.filter(s=>"start"===s.position),r=t.filter(s=>"end"===s.position);return i.length>1&&wq("start"),r.length>1&&wq("end"),[i[0],r[0]]}}return n.\u0275fac=function(t){return new(t||n)(E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-container"]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,CF,5),Fi(r,l1,5)),2&t){let s;Mt(s=xt())&&(i.drawers=s),Mt(s=xt())&&(i.content1=s)}},viewQuery:function(t,i){if(1&t&&ni(l1,5),2&t){let r;Mt(r=xt())&&(i.content2=r)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.className)},exportAs:["ccfDrawerContainer"],features:[At([c0])],ngContentSelectors:lIe,decls:3,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&(Dr(aIe),In(0),In(1,1),Ct(2,oIe,2,0,"ccf-drawer-content",0)),2&t&&(Y(2),ie("ngIf",!i.hasWrappedContent))},directives:[Is,l1],styles:["[_nghost-%COMP%]{display:block;position:relative;z-index:1;overflow:hidden;-webkit-overflow-scrolling:touch}"],changeDetection:0}),n})();var c1,uIe=Ve(457),dIe=new Uint8Array(16);function hIe(){if(!c1&&!(c1="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c1(dIe)}const fIe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,gIe=function(n){return"string"==typeof n&&fIe.test(n)};for(var Ls=[],wF=0;wF<256;++wF)Ls.push((wF+256).toString(16).substr(1));const vIe=function(n,e,t){var i=(n=n||{}).random||(n.rng||hIe)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){t=t||0;for(var r=0;r<16;++r)e[t+r]=i[r];return e}return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(Ls[n[e+0]]+Ls[n[e+1]]+Ls[n[e+2]]+Ls[n[e+3]]+"-"+Ls[n[e+4]]+Ls[n[e+5]]+"-"+Ls[n[e+6]]+Ls[n[e+7]]+"-"+Ls[n[e+8]]+Ls[n[e+9]]+"-"+Ls[n[e+10]]+Ls[n[e+11]]+Ls[n[e+12]]+Ls[n[e+13]]+Ls[n[e+14]]+Ls[n[e+15]]).toLowerCase();if(!gIe(t))throw TypeError("Stringified UUID is invalid");return t}(i)};function Eq(n){const e=new Lt(n.transformMatrix),t=e.transformAsPoint([-1,-1,-1],[]),i=e.transformAsPoint([1,1,1],[]);return new Mi({lowerBound:new S(...t.map((r,s)=>Math.min(r,i[s]))),upperBound:new S(...i.map((r,s)=>Math.max(r,t[s])))})}let ss=class extends qm{constructor(e){super(),this.injector=e,this.gizmo$=st([{"@id":"http://purl.org/ccf/latest/ccf.owl#VHMaleOrgans_VHM_Spleen_Colic_Surface","@type":"SpatialSceneNode",scenegraph:"https://hubmapconsortium.github.io/ccf-3d-reference-object-library/Assets/body4Mesh_1338.glb",transformMatrix:new Lt(Lt.IDENTITY).scale([2,2,2]).rotateY(Jv(0)),tooltip:"Gizmo",unpickable:!0,_lighting:"pbr",zoomBasedOpacity:!1,color:[255,255,255,255],opacity:1}])}get nodes$(){return or([this.placementCube$,this.referenceOrganNodes$,this.previousRegistrationNodes$,this.nodeCollisions$]).pipe(be(([e,t,i,r])=>[...e,...i,...t,...this.snapshot.showCollisions?r:[]]))}get rotatedNodes$(){return or([this.rotation$,this.nodes$]).pipe(be(([e,t])=>0===e?t:t.map(i=>Object.assign(Object.assign({},i),{transformMatrix:new Lt(Lt.IDENTITY).rotateY(Jv(e)).multiplyRight(i.transformMatrix)}))))}get referenceOrganNodes$(){return or([this.model.anatomicalStructures$,this.model.extractionSites$,this.model.organIri$]).pipe($g(400),be(([e,t,i])=>this.createSceneNodes(i,[...e,...t])))}get referenceOrganSimpleNodes$(){return or([this.model.anatomicalStructures$,this.model.organIri$,this.referenceData.state$]).pipe(be(([e,t,i])=>e.map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.simpleSceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[t]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.simpleSceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])))}get nodeCollisions$(){return or([this.referenceOrganSimpleNodes$,this.placementCube$]).pipe(Tn(([e,t])=>t.length>0),be(([e,t])=>{const i=Eq(t[0]);return e.filter(r=>i.overlaps(Eq(r)))}))}get previousRegistrationNodes$(){return or([this.model.organIri$,this.model.showPrevious$,this.registration.previousRegistrations$]).pipe(be(([e,t,i])=>t?i.map(r=>{const s=Array.isArray(r.placement)?r.placement[0]:r.placement;if(s.target===e){const o=this.model.snapshot.organDimensions,a=[o.x,o.y,o.z].map(l=>-l/1e3/2);return{"@id":r["@id"],"@type":"SpatialSceneNode",transformMatrix:new Lt(Lt.IDENTITY).translate([s.x_translation,s.y_translation,s.z_translation].map((l,c)=>l/1e3+a[c])).rotateXYZ([s.x_rotation,s.y_rotation,s.z_rotation].map(Jv)).scale([r.x_dimension,r.y_dimension,r.z_dimension].map(l=>l/1e3/2)),color:[25,118,210,200],tooltip:r.label,unpickable:!0}}}).filter(r=>!!r):[]))}get placementCube$(){return or([this.model.viewType$,this.model.blockSize$,this.model.rotation$,this.model.position$,this.model.organ$]).pipe(be(([e,t,i,r,s])=>""===s.src?[]:[this.placementCube]))}get placementCube(){const{viewType:e,blockSize:t,rotation:i,position:r,organDimensions:s}=this.model.snapshot,o=[s.x,s.y,s.z].map(a=>-a/1e3/2);return{"@id":"#DraftPlacement","@type":"SpatialSceneNode",transformMatrix:new Lt(Lt.IDENTITY).translate([r.x,r.y,r.z].map((a,l)=>a/1e3+o[l])).rotateXYZ([i.x,i.y,i.z].map(Jv)).scale([t.x,t.y,t.z].map(a=>a/1e3/2)),color:[255,255,0,200],tooltip:"Draft Placement",unpickable:"3d"===e}}get rotation$(){return this.model.viewSide$.pipe(be(e=>{let t=0;switch(e){case"left":t=-90;break;case"right":t=90;break;case"posterior":t=180}return t}))}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(si),this.registration=this.injector.get(wr),this.referenceData=this.injector.get(dc)}createSceneNodes(e,t){const i=this.referenceData.snapshot;return t.filter(r=>r.visible&&r.opacity&&r.opacity>0).map(r=>{var s;return i.sceneNodeLookup[r.id]?[Object.assign(Object.assign({},i.sceneNodeLookup[r.id]),{opacity:(null!==(s=r.opacity)&&void 0!==s?s:100)/100,color:[255,255,255,255]})]:(i.anatomicalStructures[e]||[]).filter(o=>o.representation_of===r.id).map(o=>{var a;return Object.assign(Object.assign({},i.sceneNodeLookup[o["@id"]]),{opacity:(null!==(a=r.opacity)&&void 0!==a?a:100)/100,color:[255,255,255,255]})})}).reduce((r,s)=>r.concat(s),[])}};ss.\u0275fac=function(e){return new(e||ss)(I(Tt))},ss.\u0275prov=ae({token:ss,factory:ss.\u0275fac}),De([ri()],ss.prototype,"nodes$",null),De([ri()],ss.prototype,"rotatedNodes$",null),De([ri()],ss.prototype,"referenceOrganNodes$",null),De([ri()],ss.prototype,"referenceOrganSimpleNodes$",null),De([ri()],ss.prototype,"nodeCollisions$",null),De([ri()],ss.prototype,"previousRegistrationNodes$",null),De([ri()],ss.prototype,"placementCube$",null),De([ri()],ss.prototype,"placementCube",null),De([ri()],ss.prototype,"rotation$",null),ss=De([Ch(),gh({name:"scene",defaults:{showCollisions:!Sh.production}})],ss);let Io=class extends sTe{constructor(e){super(),this.injector=e,this._latestTags=[]}get tags$(){return or([this.entities$,this.scene.nodeCollisions$]).pipe(be(([e,t])=>{const i=[],r=new Set,s=new Set;Object.entries(e).forEach(([o,a])=>{"removed"===a.type?s.add(o):(r.add(o),i.push(a))});for(const o of t){const a=o.representation_of;a&&!s.has(a)&&!r.has(a)&&(r.add(a),i.push({id:a,label:o.tooltip,type:"assigned"}))}return i}))}get latestTags(){return this._latestTags}ngxsOnInit(){super.ngxsOnInit(),this.model=this.injector.get(si),this.scene=this.injector.get(ss),this.page=this.injector.get(Ui),this.tags$.subscribe(e=>{this._latestTags=e}),this.entities$.subscribe(()=>this.page.setHasChanges())}addTags(e){for(const t of e)this.addTagRaw(t)}addTag(e){this.addTagRaw(e)}removeTag(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"removed"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"removed"}))}searchExternal(e,t){const i=this.model.snapshot.anatomicalStructures.filter(r=>-1!==r.name.toLowerCase().indexOf(e.toLowerCase()));return[{totalCount:i.length,results:i.map(r=>({id:r.id,label:r.name,type:"added"})).slice(0,t)}]}addTagRaw(e){this.snapshot.entities[e.id]?this.updateEntitiesMany([{id:e.id,changes:{type:"added"}}]):this.addEntityOne(Object.assign(Object.assign({},e),{type:"added"}))}};Io.\u0275fac=function(e){return new(e||Io)(I(Tt))},Io.\u0275prov=ae({token:Io,factory:Io.\u0275fac}),De([ri()],Io.prototype,"tags$",null),De([Xt()],Io.prototype,"addTags",null),De([Xt()],Io.prototype,"addTag",null),De([Xt()],Io.prototype,"removeTag",null),De([su.ak],Io.prototype,"searchExternal",null),Io=De([Ch(),gh({name:"tags",defaults:Object.assign({},{ids:[],entities:{}})})],Io);let wr=class extends qm{constructor(e,t){super(),this.injector=e,this.globalConfig=t,this.displayErrors$=this.state$.pipe(lr("displayErrors"))}get metadata$(){return or([this.page.state$,this.model.state$,this.tags.tags$]).pipe(be(([e,t,i])=>this.buildMetadata(e,t,i)))}get jsonld$(){return or([this.page.state$,this.model.state$,this.tags.tags$]).pipe(be(([e,t,i])=>this.buildJsonLd(e,t,i)))}get valid$(){return or([this.page.state$,this.model.state$]).pipe(be(()=>this.isValid))}get previousRegistrations$(){const{globalConfig:e,state$:t}=this;return or([t.pipe(lr("registrations")),e.getOption("fetchPreviousRegistrations").pipe(Ir(s=>{var o;return null!==(o=null==s?void 0:s())&&void 0!==o?o:[[]]}),ns([]))]).pipe(be(([s,o])=>[...s,...o]))}get currentIdentifier(){return vIe()}get currentDate(){return(new Date).toISOString().split("T")[0]}ngxsOnInit(){super.ngxsOnInit(),this.page=this.injector.get(Ui),this.model=this.injector.get(si),this.tags=this.injector.get(Io),this.refData=this.injector.get(dc),this.globalConfig.config$.pipe(_i(1),Di(({useDownload:e,register:t})=>this.ctx.patchState({useRegistrationCallback:!(e||!t)}))).subscribe(),this.globalConfig.getOption("editRegistration").pipe(Uk(),Di(e=>this.editRegistration(e))).subscribe()}editRegistration(e){return gl(this,void 0,void 0,function*(){const t=this.refData.normalizePlacement(Array.isArray(e.placement)?e.placement[0]:e.placement),i=this.refData.getOrganData(t.target);this.page.setUserName({firstName:e.creator_first_name,lastName:e.creator_last_name}),i&&(this.model.setOrgan(i.organ),i.sex&&this.model.setSex(i.sex),i.side&&this.model.setSide(i.side)),this.model.setBlockSize({x:e.x_dimension,y:e.y_dimension,z:e.z_dimension}),this.model.setRotation({x:t.x_rotation,y:t.y_rotation,z:t.z_rotation}),this.model.setSlicesConfig({thickness:e.slice_thickness||NaN,numSlices:e.slice_count||NaN}),yield new Promise(s=>{setTimeout(s,1e3)}),this.model.setPosition({x:t.x_translation,y:t.y_translation,z:t.z_translation});const r=new Set(e.ccf_annotations);this.tags.addTags(this.model.snapshot.anatomicalStructures.filter(s=>r.has(s.id)).map(s=>({id:s.id,label:s.name,type:"added"}))),this.page.registrationStarted()})}setUseRegistrationCallback(e){this.ctx.patchState({useRegistrationCallback:e})}setDisplayErrors(e){this.ctx.patchState({displayErrors:e})}addRegistration(e){this.ctx.setState(l0({registrations:ROe(e)}))}isDataValid(e,t){return[e.user.firstName,e.user.lastName,t.organ.src,t.organ.name,t.organ.organ].every(r=>!!r)}get isValid(){return this.isDataValid(this.page.snapshot,this.model.snapshot)}register(e){if(!this.isValid)return;const{globalConfig:{snapshot:{register:t}},page:i,model:r,snapshot:s}=this,o=this.buildJsonLd(i.snapshot,r.snapshot,this.tags.latestTags),a=JSON.stringify(o,void 0,2);if(e||void 0===e&&s.useRegistrationCallback)null==t||t(a);else{const l=new Blob([a],{type:"application/json",endings:"native"});(0,uIe.saveAs)(l,"registration-data.json")}this.addRegistration(o),this.setDisplayErrors(!1),this.page.clearHasChanges()}buildMetadata(e,t,i){const r=[];return e.registrationCallbackSet||r.push({label:"First Name",value:e.user.firstName},{label:"Last Name",value:e.user.lastName}),r.push({label:"Reference Organ Name",value:t.organ.name},{label:"Tissue Block Dimensions (mm)",value:this.xyzTripletToString(t.blockSize)},{label:"Tissue Block Position (mm)",value:this.xyzTripletToString(t.position)},{label:"Tissue Block Rotation",value:this.xyzTripletToString(t.rotation)},{label:"Anatomical Structure Tags",value:i.map(s=>s.label).join(", ")},{label:"Time Stamp",value:this.currentDate},{label:"Alignment ID",value:this.currentIdentifier}),r}buildJsonLd(e,t,i){var r,s;return{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}`,"@type":"SpatialEntity",label:t.label||void 0,creator:`${e.user.firstName} ${e.user.lastName}`,creator_first_name:e.user.firstName,creator_last_name:e.user.lastName,creation_date:this.currentDate,ccf_annotations:i.map(o=>o.id),slice_thickness:(null===(r=t.slicesConfig)||void 0===r?void 0:r.thickness)||void 0,slice_count:(null===(s=t.slicesConfig)||void 0===s?void 0:s.numSlices)||void 0,x_dimension:+t.blockSize.x.toFixed(3),y_dimension:+t.blockSize.y.toFixed(3),z_dimension:+t.blockSize.z.toFixed(3),dimension_units:"millimeter",placement:{"@context":"https://hubmapconsortium.github.io/hubmap-ontology/ccf-context.jsonld","@id":`http://purl.org/ccf/1.5/${this.currentIdentifier}_placement`,"@type":"SpatialPlacement",target:t.organIri,placement_date:this.currentDate,x_scaling:1,y_scaling:1,z_scaling:1,scaling_units:"ratio",x_rotation:+t.rotation.x.toFixed(3),y_rotation:+t.rotation.y.toFixed(3),z_rotation:+t.rotation.z.toFixed(3),rotation_order:"XYZ",rotation_units:"degree",x_translation:+t.position.x.toFixed(3),y_translation:+t.position.y.toFixed(3),z_translation:+t.position.z.toFixed(3),translation_units:"millimeter"}}}xyzTripletToString(e){return`${Math.round(e.x)}, ${Math.round(e.y)}, ${Math.round(e.z)}`}};wr.\u0275fac=function(e){return new(e||wr)(I(Tt),I(Eh))},wr.\u0275prov=ae({token:wr,factory:wr.\u0275fac}),De([ri()],wr.prototype,"metadata$",null),De([ri()],wr.prototype,"jsonld$",null),De([ri()],wr.prototype,"valid$",null),De([ri()],wr.prototype,"previousRegistrations$",null),De([ri()],wr.prototype,"currentIdentifier",null),De([ri()],wr.prototype,"currentDate",null),De([Xt()],wr.prototype,"setUseRegistrationCallback",null),De([Xt()],wr.prototype,"setDisplayErrors",null),De([Xt()],wr.prototype,"addRegistration",null),De([ri()],wr.prototype,"isValid",null),wr=De([Ch(),gh({name:"registration",defaults:{useRegistrationCallback:!1,displayErrors:!1,registrations:[]}})],wr);let Sq=(()=>{class n{constructor(){this._vertical=!1,this._inset=!1}get vertical(){return this._vertical}set vertical(t){this._vertical=Dt(t)}get inset(){return this._inset}set inset(t){this._inset=Dt(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(t,i){2&t&&(en("aria-orientation",i.vertical?"vertical":"horizontal"),at("mat-divider-vertical",i.vertical)("mat-divider-horizontal",!i.vertical)("mat-divider-inset",i.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(t,i){},styles:[".mat-divider{display:block;margin:0;border-top-width:1px;border-top-style:solid}.mat-divider.mat-divider-vertical{border-top:0;border-right-width:1px;border-right-style:solid}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0}),n})(),EF=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[Nn],Nn]}),n})();function CIe(n,e){if(1&n){const t=Lr();F(0,"mat-icon",2),ye("click",function(){return Vn(t),bt().setAllOpacity(20)}),Te(1,"refresh"),N()}2&n&&ie("matRippleCentered",!0)("matRippleUnbounded",!0)}function wIe(n,e){if(1&n){const t=Lr();F(0,"div",3),ye("mouseenter",function(){const s=Vn(t).$implicit;return bt().mouseOver(s)})("mouseleave",function(){return Vn(t),bt().mouseOut()}),et(1,"mat-icon",4),F(2,"div",5),Te(3),N(),F(4,"div",6),F(5,"ccf-opacity-slider",7,8),ye("opacityChange",function(r){return Vn(t),bt().updateOpacity(r)})("opacityReset",function(){return Vn(t),bt().resetItem()})("visibilityToggle",function(){const s=Vn(t).$implicit;return bt().toggleVisibility(s)}),N(),N(),N()}if(2&n){const t=e.$implicit,i=bt();at("selected",!!i.selection&&i.getId(0,i.selection)===i.getId(0,t)),Y(1),at("fade",!t.visible),Y(1),at("hidden",t.id===(null==i.selection?null:i.selection.id)),Yy("title",t.name),Y(1),Ai(t.name),Y(1),at("hidden",t.id!==(null==i.selection?null:i.selection.id)),Y(1),ie("visible",t.visible)("opacity",i.selection?null==i.selection?null:i.selection.opacity:20)}}let EIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-menu",this.hover=new Pe,this.itemsChange=new Pe}toggleVisibility(t){t=Object.assign(Object.assign({},t),{visible:!t.visible}),this.selection&&t.id===this.selection.id&&(this.selection=Object.assign(Object.assign({},this.selection),{visible:t.visible})),this.ga.event("visibility_toggled","visibility_menu",""+t.id,+t.visible),this.updateOpacity(t.opacity)}mouseOver(t){this.selection=t===this.selection?void 0:t,this.hover.emit(t)}mouseOut(){this.selection=void 0,this.hover.emit(void 0)}updateOpacity(t){if(!this.selection)return;const i=Object.assign(Object.assign({},this.selection),{opacity:t});this.selection=i,this.items=this.items.map(r=>r.id===i.id?i:r),this.ga.event("opacity_update","visibility_menu",""+i.id,i.opacity),this.itemsChange.emit(this.items)}resetItem(){if(this.selection){const t=Object.assign(Object.assign({},this.selection),{opacity:20,visible:!0});this.selection=t,this.items=this.items.map(i=>i.id===t.id?t:i),this.ga.event("item_reset","visibility_menu",""+t.id),this.itemsChange.emit(this.items)}}setAllOpacity(t){this.items=this.items.map(i=>Object.assign(Object.assign({},i),{opacity:t,visible:!0})),this.ga.event("all_items_opacity_update","visibility_menu",void 0,t),this.itemsChange.emit(this.items)}getId(t,i){return i.id}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-visibility-menu"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{items:"items",selection:"selection"},outputs:{hover:"hover",itemsChange:"itemsChange"},decls:2,vars:3,consts:[["class","icon reset","matRipple","",3,"matRippleCentered","matRippleUnbounded","click",4,"ngIf"],["class","item-entry",3,"selected","mouseenter","mouseleave",4,"ngFor","ngForOf","ngForTrackBy"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"item-entry",3,"mouseenter","mouseleave"],["svgIcon","app:opacity",1,"opacity-icon"],[1,"item-name",3,"title"],[1,"slider"],[3,"visible","opacity","opacityChange","opacityReset","visibilityToggle"],["slider",""]],template:function(t,i){1&t&&(Ct(0,CIe,2,2,"mat-icon",0),Ct(1,wIe,7,12,"div",1)),2&t&&(ie("ngIf",i.items.length),Y(1),ie("ngForOf",i.items)("ngForTrackBy",i.getId))},directives:[Is,Xl,Rs,Qo,KDe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;margin-right:0;margin-left:0;max-height:18rem;overflow-y:auto;scrollbar-width:thin}[_nghost-%COMP%] .icon[_ngcontent-%COMP%]{padding:.25rem;border-radius:.25rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s;position:absolute;top:3rem}[_nghost-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%]{display:flex;height:2.25rem;align-items:center;flex-shrink:0;position:relative}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]{z-index:1;transition:.6s}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .opacity-icon[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:.5rem;opacity:1;transition-duration:.4s;transition-timing-function:ease-in-out;transition-property:opacity;max-width:calc(100% - 2.5rem)}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .item-name.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:calc(100% - 2rem);transition-duration:.3s;transition-timing-function:ease-in-out;transition-property:opacity;left:2rem;position:absolute;opacity:1}[_nghost-%COMP%] .item-entry[_ngcontent-%COMP%] .slider.hidden[_ngcontent-%COMP%]{opacity:0;transition-duration:.1s;transition-timing-function:ease-in-out;transition-property:opacity}"],changeDetection:0}),n})();const SIe=["*"],Mq=new _e("MatChipRemove"),xq=new _e("MatChipAvatar"),Tq=new _e("MatChipTrailingIcon");class MIe{constructor(e){this._elementRef=e}}const xIe=Nf(kf(Ff(MIe),"primary"),-1);let u0=(()=>{class n extends xIe{constructor(t,i,r,s,o,a,l,c){super(t),this._ngZone=i,this._changeDetectorRef=o,this._hasFocus=!1,this.chipListSelectable=!0,this._chipListMultiple=!1,this._chipListDisabled=!1,this._selected=!1,this._selectable=!0,this._disabled=!1,this._removable=!0,this._onFocus=new we,this._onBlur=new we,this.selectionChange=new Pe,this.destroyed=new Pe,this.removed=new Pe,this._addHostClassName(),this._chipRippleTarget=a.createElement("div"),this._chipRippleTarget.classList.add("mat-chip-ripple"),this._elementRef.nativeElement.appendChild(this._chipRippleTarget),this._chipRipple=new Oj(this,i,this._chipRippleTarget,r),this._chipRipple.setupTriggerEvents(t),this.rippleConfig=s||{},this._animationsDisabled="NoopAnimations"===l,this.tabIndex=null!=c&&parseInt(c)||-1}get rippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||!!this.rippleConfig.disabled}get selected(){return this._selected}set selected(t){const i=Dt(t);i!==this._selected&&(this._selected=i,this._dispatchSelectionChange())}get value(){return void 0!==this._value?this._value:this._elementRef.nativeElement.textContent}set value(t){this._value=t}get selectable(){return this._selectable&&this.chipListSelectable}set selectable(t){this._selectable=Dt(t)}get disabled(){return this._chipListDisabled||this._disabled}set disabled(t){this._disabled=Dt(t)}get removable(){return this._removable}set removable(t){this._removable=Dt(t)}get ariaSelected(){return this.selectable&&(this._chipListMultiple||this.selected)?this.selected.toString():null}_addHostClassName(){const t="mat-basic-chip",i=this._elementRef.nativeElement;i.hasAttribute(t)||i.tagName.toLowerCase()===t?i.classList.add(t):i.classList.add("mat-standard-chip")}ngOnDestroy(){this.destroyed.emit({chip:this}),this._chipRipple._removeTriggerEvents()}select(){this._selected||(this._selected=!0,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}deselect(){this._selected&&(this._selected=!1,this._dispatchSelectionChange(),this._changeDetectorRef.markForCheck())}selectViaInteraction(){this._selected||(this._selected=!0,this._dispatchSelectionChange(!0),this._changeDetectorRef.markForCheck())}toggleSelected(t=!1){return this._selected=!this.selected,this._dispatchSelectionChange(t),this._changeDetectorRef.markForCheck(),this.selected}focus(){this._hasFocus||(this._elementRef.nativeElement.focus(),this._onFocus.next({chip:this})),this._hasFocus=!0}remove(){this.removable&&this.removed.emit({chip:this})}_handleClick(t){this.disabled?t.preventDefault():t.stopPropagation()}_handleKeydown(t){if(!this.disabled)switch(t.keyCode){case 46:case 8:this.remove(),t.preventDefault();break;case 32:this.selectable&&this.toggleSelected(!0),t.preventDefault()}}_blur(){this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this._ngZone.run(()=>{this._hasFocus=!1,this._onBlur.next({chip:this})})})}_dispatchSelectionChange(t=!1){this.selectionChange.emit({source:this,isUserInput:t,selected:this._selected})}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(lt),E(ii),E(Ij,8),E(Un),E(rt),E(Zo,8),fs("tabindex"))},n.\u0275dir=he({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,xq,5),Fi(r,Tq,5),Fi(r,Mq,5)),2&t){let s;Mt(s=xt())&&(i.avatar=s.first),Mt(s=xt())&&(i.trailingIcon=s.first),Mt(s=xt())&&(i.removeIcon=s.first)}},hostAttrs:["role","option",1,"mat-chip","mat-focus-indicator"],hostVars:14,hostBindings:function(t,i){1&t&&ye("click",function(s){return i._handleClick(s)})("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i.focus()})("blur",function(){return i._blur()}),2&t&&(en("tabindex",i.disabled?null:i.tabIndex)("disabled",i.disabled||null)("aria-disabled",i.disabled.toString())("aria-selected",i.ariaSelected),at("mat-chip-selected",i.selected)("mat-chip-with-avatar",i.avatar)("mat-chip-with-trailing-icon",i.trailingIcon||i.removeIcon)("mat-chip-disabled",i.disabled)("_mat-animation-noopable",i._animationsDisabled))},inputs:{color:"color",disableRipple:"disableRipple",tabIndex:"tabIndex",selected:"selected",value:"value",selectable:"selectable",disabled:"disabled",removable:"removable"},outputs:{selectionChange:"selectionChange",destroyed:"destroyed",removed:"removed"},exportAs:["matChip"],features:[ht]}),n})(),Aq=(()=>{class n{constructor(t,i){this._parentChip=t,"BUTTON"===i.nativeElement.nodeName&&i.nativeElement.setAttribute("type","button")}_handleClick(t){const i=this._parentChip;i.removable&&!i.disabled&&i.remove(),t.stopPropagation()}}return n.\u0275fac=function(t){return new(t||n)(E(u0),E(nt))},n.\u0275dir=he({type:n,selectors:[["","matChipRemove",""]],hostAttrs:[1,"mat-chip-remove","mat-chip-trailing-icon"],hostBindings:function(t,i){1&t&&ye("click",function(s){return i._handleClick(s)})},features:[At([{provide:Mq,useExisting:n}])]}),n})();const Dq=new _e("mat-chips-default-options"),DIe=CO(class{constructor(n,e,t,i){this._defaultErrorStateMatcher=n,this._parentForm=e,this._parentFormGroup=t,this.ngControl=i}});let OIe=0;class IIe{constructor(e,t){this.source=e,this.value=t}}let Oq=(()=>{class n extends DIe{constructor(t,i,r,s,o,a,l){super(a,s,o,l),this._elementRef=t,this._changeDetectorRef=i,this._dir=r,this.controlType="mat-chip-list",this._lastDestroyedChipIndex=null,this._destroyed=new we,this._uid="mat-chip-list-"+OIe++,this._tabIndex=0,this._userTabIndex=null,this._onTouched=()=>{},this._onChange=()=>{},this._multiple=!1,this._compareWith=(c,d)=>c===d,this._required=!1,this._disabled=!1,this.ariaOrientation="horizontal",this._selectable=!0,this.change=new Pe,this.valueChange=new Pe,this.ngControl&&(this.ngControl.valueAccessor=this)}get selected(){var t,i;return this.multiple?(null===(t=this._selectionModel)||void 0===t?void 0:t.selected)||[]:null===(i=this._selectionModel)||void 0===i?void 0:i.selected[0]}get role(){return this.empty?null:"listbox"}get multiple(){return this._multiple}set multiple(t){this._multiple=Dt(t),this._syncChipsState()}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this.writeValue(t),this._value=t}get id(){return this._chipInput?this._chipInput.id:this._uid}get required(){return this._required}set required(t){this._required=Dt(t),this.stateChanges.next()}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get focused(){return this._chipInput&&this._chipInput.focused||this._hasFocusedChip()}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this.chips||0===this.chips.length)}get shouldLabelFloat(){return!this.empty||this.focused}get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=Dt(t),this._syncChipsState()}get selectable(){return this._selectable}set selectable(t){this._selectable=Dt(t),this.chips&&this.chips.forEach(i=>i.chipListSelectable=this._selectable)}set tabIndex(t){this._userTabIndex=t,this._tabIndex=t}get chipSelectionChanges(){return ki(...this.chips.map(t=>t.selectionChange))}get chipFocusChanges(){return ki(...this.chips.map(t=>t._onFocus))}get chipBlurChanges(){return ki(...this.chips.map(t=>t._onBlur))}get chipRemoveChanges(){return ki(...this.chips.map(t=>t.destroyed))}ngAfterContentInit(){this._keyManager=new aV(this.chips).withWrap().withVerticalOrientation().withHomeAndEnd().withHorizontalOrientation(this._dir?this._dir.value:"ltr"),this._dir&&this._dir.change.pipe(zn(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.tabOut.pipe(zn(this._destroyed)).subscribe(()=>{this._allowFocusEscape()}),this.chips.changes.pipe(ns(null),zn(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>{this._syncChipsState()}),this._resetChips(),this._initializeSelection(),this._updateTabIndex(),this._updateFocusForDestroyedChips(),this.stateChanges.next()})}ngOnInit(){this._selectionModel=new uU(this.multiple,void 0,!1),this.stateChanges.next()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==this._disabled&&(this.disabled=!!this.ngControl.disabled))}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this.stateChanges.complete(),this._dropSubscriptions()}registerInput(t){this._chipInput=t,this._elementRef.nativeElement.setAttribute("data-mat-chip-input",t.id)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}writeValue(t){this.chips&&this._setSelectionByValue(t,!1)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}onContainerClick(t){this._originatesFromChip(t)||this.focus()}focus(t){this.disabled||this._chipInput&&this._chipInput.focused||(this.chips.length>0?(this._keyManager.setFirstItemActive(),this.stateChanges.next()):(this._focusInput(t),this.stateChanges.next()))}_focusInput(t){this._chipInput&&this._chipInput.focus(t)}_keydown(t){const i=t.target;i&&i.classList.contains("mat-chip")&&(this._keyManager.onKeydown(t),this.stateChanges.next())}_updateTabIndex(){this._tabIndex=this._userTabIndex||(0===this.chips.length?-1:0)}_updateFocusForDestroyedChips(){if(null!=this._lastDestroyedChipIndex)if(this.chips.length){const t=Math.min(this._lastDestroyedChipIndex,this.chips.length-1);this._keyManager.setActiveItem(t)}else this.focus();this._lastDestroyedChipIndex=null}_isValidIndex(t){return t>=0&&tr.deselect()),Array.isArray(t))t.forEach(r=>this._selectValue(r,i)),this._sortValues();else{const r=this._selectValue(t,i);r&&i&&this._keyManager.setActiveItem(r)}}_selectValue(t,i=!0){const r=this.chips.find(s=>null!=s.value&&this._compareWith(s.value,t));return r&&(i?r.selectViaInteraction():r.select(),this._selectionModel.select(r)),r}_initializeSelection(){Promise.resolve().then(()=>{(this.ngControl||this._value)&&(this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value,!1),this.stateChanges.next())})}_clearSelection(t){this._selectionModel.clear(),this.chips.forEach(i=>{i!==t&&i.deselect()}),this.stateChanges.next()}_sortValues(){this._multiple&&(this._selectionModel.clear(),this.chips.forEach(t=>{t.selected&&this._selectionModel.select(t)}),this.stateChanges.next())}_propagateChanges(t){let i=null;i=Array.isArray(this.selected)?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.change.emit(new IIe(this,i)),this.valueChange.emit(i),this._onChange(i),this._changeDetectorRef.markForCheck()}_blur(){this._hasFocusedChip()||this._keyManager.setActiveItem(-1),this.disabled||(this._chipInput?setTimeout(()=>{this.focused||this._markAsTouched()}):this._markAsTouched())}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}_allowFocusEscape(){-1!==this._tabIndex&&(this._tabIndex=-1,setTimeout(()=>{this._tabIndex=this._userTabIndex||0,this._changeDetectorRef.markForCheck()}))}_resetChips(){this._dropSubscriptions(),this._listenToChipsFocus(),this._listenToChipsSelection(),this._listenToChipsRemoved()}_dropSubscriptions(){this._chipFocusSubscription&&(this._chipFocusSubscription.unsubscribe(),this._chipFocusSubscription=null),this._chipBlurSubscription&&(this._chipBlurSubscription.unsubscribe(),this._chipBlurSubscription=null),this._chipSelectionSubscription&&(this._chipSelectionSubscription.unsubscribe(),this._chipSelectionSubscription=null),this._chipRemoveSubscription&&(this._chipRemoveSubscription.unsubscribe(),this._chipRemoveSubscription=null)}_listenToChipsSelection(){this._chipSelectionSubscription=this.chipSelectionChanges.subscribe(t=>{t.source.selected?this._selectionModel.select(t.source):this._selectionModel.deselect(t.source),this.multiple||this.chips.forEach(i=>{!this._selectionModel.isSelected(i)&&i.selected&&i.deselect()}),t.isUserInput&&this._propagateChanges()})}_listenToChipsFocus(){this._chipFocusSubscription=this.chipFocusChanges.subscribe(t=>{let i=this.chips.toArray().indexOf(t.chip);this._isValidIndex(i)&&this._keyManager.updateActiveItem(i),this.stateChanges.next()}),this._chipBlurSubscription=this.chipBlurChanges.subscribe(()=>{this._blur(),this.stateChanges.next()})}_listenToChipsRemoved(){this._chipRemoveSubscription=this.chipRemoveChanges.subscribe(t=>{const i=t.chip,r=this.chips.toArray().indexOf(t.chip);this._isValidIndex(r)&&i._hasFocus&&(this._lastDestroyedChipIndex=r)})}_originatesFromChip(t){let i=t.target;for(;i&&i!==this._elementRef.nativeElement;){if(i.classList.contains("mat-chip"))return!0;i=i.parentElement}return!1}_hasFocusedChip(){return this.chips&&this.chips.some(t=>t._hasFocus)}_syncChipsState(){this.chips&&this.chips.forEach(t=>{t._chipListDisabled=this._disabled,t._chipListMultiple=this.multiple})}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(Ko,8),E(cp,8),E($m,8),E(kv),E(lc,10))},n.\u0275cmp=Le({type:n,selectors:[["mat-chip-list"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,u0,5),2&t){let s;Mt(s=xt())&&(i.chips=s)}},hostAttrs:[1,"mat-chip-list"],hostVars:15,hostBindings:function(t,i){1&t&&ye("focus",function(){return i.focus()})("blur",function(){return i._blur()})("keydown",function(s){return i._keydown(s)}),2&t&&(sl("id",i._uid),en("tabindex",i.disabled?null:i._tabIndex)("aria-describedby",i._ariaDescribedby||null)("aria-required",i.role?i.required:null)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-multiselectable",i.multiple)("role",i.role)("aria-orientation",i.ariaOrientation),at("mat-chip-list-disabled",i.disabled)("mat-chip-list-invalid",i.errorState)("mat-chip-list-required",i.required))},inputs:{ariaOrientation:["aria-orientation","ariaOrientation"],multiple:"multiple",compareWith:"compareWith",value:"value",required:"required",placeholder:"placeholder",disabled:"disabled",selectable:"selectable",tabIndex:"tabIndex",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},exportAs:["matChipList"],features:[At([{provide:Nv,useExisting:n}]),ht],ngContentSelectors:SIe,decls:2,vars:0,consts:[[1,"mat-chip-list-wrapper"]],template:function(t,i){1&t&&(Dr(),F(0,"div",0),In(1),N())},styles:['.mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove.mat-icon{width:18px;height:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:"";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n'],encapsulation:2,changeDetection:0}),n})();const kIe={separatorKeyCodes:[13]};let Iq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[kv,{provide:Dq,useValue:kIe}],imports:[[Nn]]}),n})(),FIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-visibility-toggle",this.visible=!1,this.toggleLabel="",this.disabled=!1,this.visibilityChanged=new Pe}toggleVisibility(){this.visible=!this.visible,this.ga.event("visibility_toggled","visibility_toggle",""+this.visible),this.visibilityChanged.emit(this.visible)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-visibility-toggle"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{visible:"visible",toggleLabel:"toggleLabel",disabled:"disabled"},outputs:{visibilityChanged:"visibilityChanged"},decls:8,vars:9,consts:[[1,"toggle-div"],[1,"toggle-wrapper",3,"click"],[1,"icon-background"],["svgIcon","app:visibility_off_cube",1,"icon","block"],[1,"icon","green"],[1,"toggle-label"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"mat-chip",1),ye("click",function(){return i.toggleVisibility()}),F(2,"div",2),et(3,"mat-icon",3),F(4,"mat-icon",4),Te(5,"done"),N(),N(),F(6,"div",5),Te(7),N(),N(),N()),2&t&&(Y(1),at("disabled",i.disabled),Y(1),at("disabled",i.disabled),Y(1),at("hidden",i.visible),Y(1),at("hidden",!i.visible),Y(3),Ai(i.toggleLabel))},directives:[u0,Rs],styles:["[_nghost-%COMP%]{height:3rem;display:flex;align-items:center}[_nghost-%COMP%] .mat-chip{padding:0!important}[_nghost-%COMP%] .mat-chip.disabled{cursor:not-allowed!important}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;padding-top:1.5rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%]{-webkit-user-select:none;-moz-user-select:none;display:flex;padding-left:.5rem;cursor:pointer;align-items:center;position:relative;border-width:.075rem;border-style:solid;height:2.25rem;border-radius:1.5rem;transition:background-color .2s ease-in-out}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%]{border-radius:1.5rem;height:2.06rem;width:2.06rem;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{transition:.6s;position:absolute}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.block[_ngcontent-%COMP%]{width:1.125rem}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .icon-background[_ngcontent-%COMP%] .icon.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .toggle-div[_ngcontent-%COMP%] .toggle-wrapper[_ngcontent-%COMP%] .toggle-label[_ngcontent-%COMP%]{font-weight:bold;margin-left:.5rem;padding-right:1.25rem;padding-left:.25rem}"],changeDetection:0}),n})();const NIe=["fileInput"];let LIe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-json-file-reader",this.label="Upload",this.parsedJson=new Pe}triggerFileInput(){this.fileInput.nativeElement.click()}handleFile(t){const i=t.target;if(!i.files)return;const r=i.files[0],s=new FileReader;s.onload=()=>{const o=JSON.parse(s.result);this.ga.event("json_file_load_end","json_file_reader"),this.parsedJson.emit(o)},this.ga.event("json_file_load_start","json_file_reader"),s.readAsText(r)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-json-file-reader"]],viewQuery:function(t,i){if(1&t&&ni(NIe,5),2&t){let r;Mt(r=xt())&&(i.fileInput=r.first)}},hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{label:"label"},outputs:{parsedJson:"parsedJson"},decls:4,vars:1,consts:[["mat-button","",1,"upload-button",3,"click"],["type","file","accept","application/JSON","name","fileInput","id","fileInput",2,"display","none",3,"change"],["fileInput",""]],template:function(t,i){1&t&&(F(0,"button",0),ye("click",function(){return i.triggerFileInput()}),Te(1),N(),F(2,"input",1,2),ye("change",function(s){return i.handleFile(s)}),N()),2&t&&(Y(1),Ai(i.label))},directives:[$f],styles:["[_nghost-%COMP%] .upload-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;cursor:pointer;font-weight:500}"]}),n})(),BIe=(()=>{class n{constructor(){this.clsName="ccf-details-label",this.details=[]}arrayToString(t){return t.join(", ")}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=Le({type:n,selectors:[["ccf-details-label"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{details:"details"},decls:1,vars:1,template:function(t,i){1&t&&Te(0),2&t&&Ai(i.arrayToString(i.details))},styles:["[_nghost-%COMP%]{display:block;height:2.25rem}"],changeDetection:0}),n})();const VIe=["trigger"],jIe=["panel"];function UIe(n,e){if(1&n&&(F(0,"span",8),Te(1),N()),2&n){const t=bt();Y(1),Ai(t.placeholder)}}function zIe(n,e){if(1&n&&(F(0,"span",12),Te(1),N()),2&n){const t=bt(2);Y(1),Ai(t.triggerValue)}}function HIe(n,e){1&n&&In(0,0,["*ngSwitchCase","true"])}function $Ie(n,e){1&n&&(F(0,"span",9),Ct(1,zIe,2,1,"span",10),Ct(2,HIe,1,0,"ng-content",11),N()),2&n&&(ie("ngSwitch",!!bt().customTrigger),Y(2),ie("ngSwitchCase",!0))}function GIe(n,e){if(1&n){const t=Lr();F(0,"div",13),F(1,"div",14,15),ye("@transformPanel.done",function(r){return Vn(t),bt()._panelDoneAnimatingStream.next(r.toState)})("keydown",function(r){return Vn(t),bt()._handleKeydown(r)}),In(3,1),N(),N()}if(2&n){const t=bt();ie("@transformPanelWrap",void 0),Y(1),function(n,e,t){zl(go,Nc,pg(Ce(),n,e,t),!0)}("mat-select-panel ",t._getPanelTheme(),""),gf("transform-origin",t._transformOrigin)("font-size",t._triggerFontSize,"px"),ie("ngClass",t.panelClass)("@transformPanel",t.multiple?"showing-multiple":"showing"),en("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}const WIe=[[["mat-select-trigger"]],"*"],qIe=["mat-select-trigger","*"],Pq={transformPanelWrap:Jl("transformPanelWrap",[Qs("* => void",Nne("@transformPanel",[Fne()],{optional:!0}))]),transformPanel:Jl("transformPanel",[br("void",Kn({transform:"scaleY(0.8)",minWidth:"100%",opacity:0})),br("showing",Kn({opacity:1,minWidth:"calc(100% + 32px)",transform:"scaleY(1)"})),br("showing-multiple",Kn({opacity:1,minWidth:"calc(100% + 64px)",transform:"scaleY(1)"})),Qs("void => *",Mo("120ms cubic-bezier(0, 0, 0.2, 1)")),Qs("* => void",Mo("100ms 25ms linear",Kn({opacity:0})))])};let Rq=0;const Fq=new _e("mat-select-scroll-strategy"),ZIe=new _e("MAT_SELECT_CONFIG"),QIe={provide:Fq,deps:[Jo],useFactory:function(n){return()=>n.scrollStrategies.reposition()}};class JIe{constructor(e,t){this.source=e,this.value=t}}const ePe=Ff(Nf(em(CO(class{constructor(n,e,t,i,r){this._elementRef=n,this._defaultErrorStateMatcher=e,this._parentForm=t,this._parentFormGroup=i,this.ngControl=r}})))),Nq=new _e("MatSelectTrigger");let tPe=(()=>{class n extends ePe{constructor(t,i,r,s,o,a,l,c,d,f,p,g,_,y){var v,w,C;super(o,s,l,c,f),this._viewportRuler=t,this._changeDetectorRef=i,this._ngZone=r,this._dir=a,this._parentFormField=d,this._liveAnnouncer=_,this._defaultOptions=y,this._panelOpen=!1,this._compareWith=(x,L)=>x===L,this._uid="mat-select-"+Rq++,this._triggerAriaLabelledBy=null,this._destroy=new we,this._onChange=()=>{},this._onTouched=()=>{},this._valueId="mat-select-value-"+Rq++,this._panelDoneAnimatingStream=new we,this._overlayPanelClass=(null===(v=this._defaultOptions)||void 0===v?void 0:v.overlayPanelClass)||"",this._focused=!1,this.controlType="mat-select",this._required=!1,this._multiple=!1,this._disableOptionCentering=null!==(C=null===(w=this._defaultOptions)||void 0===w?void 0:w.disableOptionCentering)&&void 0!==C&&C,this.ariaLabel="",this.optionSelectionChanges=zb(()=>{const x=this.options;return x?x.changes.pipe(ns(x),Ir(()=>ki(...x.map(L=>L.onSelectionChange)))):this._ngZone.onStable.pipe(_i(1),Ir(()=>this.optionSelectionChanges))}),this.openedChange=new Pe,this._openedStream=this.openedChange.pipe(Tn(x=>x),be(()=>{})),this._closedStream=this.openedChange.pipe(Tn(x=>!x),be(()=>{})),this.selectionChange=new Pe,this.valueChange=new Pe,this.ngControl&&(this.ngControl.valueAccessor=this),null!=(null==y?void 0:y.typeaheadDebounceInterval)&&(this._typeaheadDebounceInterval=y.typeaheadDebounceInterval),this._scrollStrategyFactory=g,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(p)||0,this.id=this.id}get focused(){return this._focused||this._panelOpen}get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}get required(){return this._required}set required(t){this._required=Dt(t),this.stateChanges.next()}get multiple(){return this._multiple}set multiple(t){this._multiple=Dt(t)}get disableOptionCentering(){return this._disableOptionCentering}set disableOptionCentering(t){this._disableOptionCentering=Dt(t)}get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){(t!==this._value||this._multiple&&Array.isArray(t))&&(this.options&&this._setSelectionByValue(t),this._value=t)}get typeaheadDebounceInterval(){return this._typeaheadDebounceInterval}set typeaheadDebounceInterval(t){this._typeaheadDebounceInterval=So(t)}get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}ngOnInit(){this._selectionModel=new uU(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(Xo(),zn(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen))}ngAfterContentInit(){this._initKeyManager(),this._selectionModel.changed.pipe(zn(this._destroy)).subscribe(t=>{t.added.forEach(i=>i.select()),t.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(ns(null),zn(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const t=this._getTriggerAriaLabelledby();if(t!==this._triggerAriaLabelledBy){const i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?i.setAttribute("aria-labelledby",t):i.removeAttribute("aria-labelledby")}this.ngControl&&this.updateErrorState()}ngOnChanges(t){t.disabled&&this.stateChanges.next(),t.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this._typeaheadDebounceInterval)}ngOnDestroy(){this._destroy.next(),this._destroy.complete(),this.stateChanges.complete()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck())}close(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched())}writeValue(t){this.value=t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel.selected:this._selectionModel.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){const t=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&t.reverse(),t.join(", ")}return this._selectionModel.selected[0].viewValue}_isRtl(){return!!this._dir&&"rtl"===this._dir.value}_handleKeydown(t){this.disabled||(this.panelOpen?this._handleOpenKeydown(t):this._handleClosedKeydown(t))}_handleClosedKeydown(t){const i=t.keyCode,r=40===i||38===i||37===i||39===i,s=13===i||32===i,o=this._keyManager;if(!o.isTyping()&&s&&!Yo(t)||(this.multiple||t.altKey)&&r)t.preventDefault(),this.open();else if(!this.multiple){const a=this.selected;o.onKeydown(t);const l=this.selected;l&&a!==l&&this._liveAnnouncer.announce(l.viewValue,1e4)}}_handleOpenKeydown(t){const i=this._keyManager,r=t.keyCode,s=40===r||38===r,o=i.isTyping();if(s&&t.altKey)t.preventDefault(),this.close();else if(o||13!==r&&32!==r||!i.activeItem||Yo(t))if(!o&&this._multiple&&65===r&&t.ctrlKey){t.preventDefault();const a=this.options.some(l=>!l.disabled&&!l.selected);this.options.forEach(l=>{l.disabled||(a?l.select():l.deselect())})}else{const a=i.activeItemIndex;i.onKeydown(t),this._multiple&&s&&t.shiftKey&&i.activeItem&&i.activeItemIndex!==a&&i.activeItem._selectViaInteraction()}else t.preventDefault(),i.activeItem._selectViaInteraction()}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_onAttached(){this._overlayDir.positionChange.pipe(_i(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()})}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this._setSelectionByValue(this.ngControl?this.ngControl.value:this._value),this.stateChanges.next()})}_setSelectionByValue(t){if(this._selectionModel.selected.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(i=>this._selectValue(i)),this._sortValues();else{const i=this._selectValue(t);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectValue(t){const i=this.options.find(r=>{if(this._selectionModel.isSelected(r))return!1;try{return null!=r.value&&this._compareWith(r.value,t)}catch(s){return!1}});return i&&this._selectionModel.select(i),i}_initKeyManager(){this._keyManager=new oV(this.options).withTypeAhead(this._typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withAllowedModifierKeys(["shiftKey"]),this._keyManager.tabOut.pipe(zn(this._destroy)).subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.pipe(zn(this._destroy)).subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){const t=ki(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(zn(t)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),ki(...this.options.map(i=>i._stateChanges)).pipe(zn(t)).subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}_onSelect(t,i){const r=this._selectionModel.isSelected(t);null!=t.value||this._multiple?(r!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),i&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),i&&this.focus())):(t.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(t.value)),r!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const t=this.options.toArray();this._selectionModel.sort((i,r)=>this.sortComparator?this.sortComparator(i,r,t):t.indexOf(i)-t.indexOf(r)),this.stateChanges.next()}}_propagateChanges(t){let i=null;i=this.multiple?this.selected.map(r=>r.value):this.selected?this.selected.value:t,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){this._keyManager&&(this.empty?this._keyManager.setFirstItemActive():this._keyManager.setActiveItem(this._selectionModel.selected[0]))}_canOpen(){var t;return!this._panelOpen&&!this.disabled&&(null===(t=this.options)||void 0===t?void 0:t.length)>0}focus(t){this._elementRef.nativeElement.focus(t)}_getPanelAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();return this.ariaLabelledby?(i?i+" ":"")+this.ariaLabelledby:i}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){var t;if(this.ariaLabel)return null;const i=null===(t=this._parentFormField)||void 0===t?void 0:t.getLabelId();let r=(i?i+" ":"")+this._valueId;return this.ariaLabelledby&&(r+=" "+this.ariaLabelledby),r}_panelDoneAnimating(t){this.openedChange.emit(t)}setDescribedByIds(t){this._ariaDescribedby=t.join(" ")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this._panelOpen||!this.empty||this._focused&&!!this._placeholder}}return n.\u0275fac=function(t){return new(t||n)(E(jf),E(Un),E(lt),E(kv),E(nt),E(Ko,8),E(cp,8),E($m,8),E(XE,8),E(lc,10),fs("tabindex"),E(Fq),E(wE),E(ZIe,8))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&(ni(VIe,5),ni(jIe,5),ni(DU,5)),2&t){let r;Mt(r=xt())&&(i.trigger=r.first),Mt(r=xt())&&(i.panel=r.first),Mt(r=xt())&&(i._overlayDir=r.first)}},inputs:{ariaLabel:["aria-label","ariaLabel"],id:"id",placeholder:"placeholder",required:"required",multiple:"multiple",disableOptionCentering:"disableOptionCentering",compareWith:"compareWith",value:"value",typeaheadDebounceInterval:"typeaheadDebounceInterval",panelClass:"panelClass",ariaLabelledby:["aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",sortComparator:"sortComparator"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},features:[ht,qn]}),n})(),nPe=(()=>{class n extends tPe{constructor(){super(...arguments),this._scrollTop=0,this._triggerFontSize=0,this._transformOrigin="top",this._offsetY=0,this._positions=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"}]}_calculateOverlayScroll(t,i,r){const s=this._getItemHeight();return Math.min(Math.max(0,s*t-i+s/2),r)}ngOnInit(){super.ngOnInit(),this._viewportRuler.change().pipe(zn(this._destroy)).subscribe(()=>{this.panelOpen&&(this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._changeDetectorRef.markForCheck())})}open(){super._canOpen()&&(super.open(),this._triggerRect=this.trigger.nativeElement.getBoundingClientRect(),this._triggerFontSize=parseInt(getComputedStyle(this.trigger.nativeElement).fontSize||"0"),this._calculateOverlayPosition(),this._ngZone.onStable.pipe(_i(1)).subscribe(()=>{this._triggerFontSize&&this._overlayDir.overlayRef&&this._overlayDir.overlayRef.overlayElement&&(this._overlayDir.overlayRef.overlayElement.style.fontSize=`${this._triggerFontSize}px`)}))}_scrollOptionIntoView(t){const i=EO(t,this.options,this.optionGroups),r=this._getItemHeight();this.panel.nativeElement.scrollTop=0===t&&1===i?0:function(n,e,t,i){return nt+i?Math.max(0,n-i+e):t}((t+i)*r,r,this.panel.nativeElement.scrollTop,256)}_positioningSettled(){this._calculateOverlayOffsetX(),this.panel.nativeElement.scrollTop=this._scrollTop}_panelDoneAnimating(t){this.panelOpen?this._scrollTop=0:(this._overlayDir.offsetX=0,this._changeDetectorRef.markForCheck()),super._panelDoneAnimating(t)}_getChangeEvent(t){return new JIe(this,t)}_calculateOverlayOffsetX(){const t=this._overlayDir.overlayRef.overlayElement.getBoundingClientRect(),i=this._viewportRuler.getViewportSize(),r=this._isRtl(),s=this.multiple?56:32;let o;if(this.multiple)o=40;else if(this.disableOptionCentering)o=16;else{let c=this._selectionModel.selected[0]||this.options.first;o=c&&c.group?32:16}r||(o*=-1);const a=0-(t.left+o-(r?s:0)),l=t.right+o-i.width+(r?0:s);a>0?o+=a+8:l>0&&(o-=l+8),this._overlayDir.offsetX=Math.round(o),this._overlayDir.overlayRef.updatePosition()}_calculateOverlayOffsetY(t,i,r){const s=this._getItemHeight(),o=(s-this._triggerRect.height)/2,a=Math.floor(256/s);let l;return this.disableOptionCentering?0:(l=0===this._scrollTop?t*s:this._scrollTop===r?(t-(this._getItemCount()-a))*s+(s-(this._getItemCount()*s-256)%s):i-s/2,Math.round(-1*l-o))}_checkOverlayWithinViewport(t){const i=this._getItemHeight(),r=this._viewportRuler.getViewportSize(),s=this._triggerRect.top-8,o=r.height-this._triggerRect.bottom-8,a=Math.abs(this._offsetY),c=Math.min(this._getItemCount()*i,256)-a-this._triggerRect.height;c>o?this._adjustPanelUp(c,o):a>s?this._adjustPanelDown(a,s,t):this._transformOrigin=this._getOriginBasedOnOption()}_adjustPanelUp(t,i){const r=Math.round(t-i);this._scrollTop-=r,this._offsetY-=r,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop<=0&&(this._scrollTop=0,this._offsetY=0,this._transformOrigin="50% bottom 0px")}_adjustPanelDown(t,i,r){const s=Math.round(t-i);if(this._scrollTop+=s,this._offsetY+=s,this._transformOrigin=this._getOriginBasedOnOption(),this._scrollTop>=r)return this._scrollTop=r,this._offsetY=0,void(this._transformOrigin="50% top 0px")}_calculateOverlayPosition(){const t=this._getItemHeight(),i=this._getItemCount(),r=Math.min(i*t,256),o=i*t-r;let a;a=this.empty?0:Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]),0),a+=EO(a,this.options,this.optionGroups);const l=r/2;this._scrollTop=this._calculateOverlayScroll(a,l,o),this._offsetY=this._calculateOverlayOffsetY(a,l,o),this._checkOverlayWithinViewport(o)}_getOriginBasedOnOption(){const t=this._getItemHeight(),i=(t-this._triggerRect.height)/2;return`50% ${Math.abs(this._offsetY)-i+t/2}px 0px`}_getItemHeight(){return 3*this._triggerFontSize}_getItemCount(){return this.options.length+this.optionGroups.length}}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275cmp=Le({type:n,selectors:[["mat-select"]],contentQueries:function(t,i,r){if(1&t&&(Fi(r,Nq,5),Fi(r,WE,5),Fi(r,GE,5)),2&t){let s;Mt(s=xt())&&(i.customTrigger=s.first),Mt(s=xt())&&(i.options=s),Mt(s=xt())&&(i.optionGroups=s)}},hostAttrs:["role","combobox","aria-autocomplete","none","aria-haspopup","true",1,"mat-select"],hostVars:20,hostBindings:function(t,i){1&t&&ye("keydown",function(s){return i._handleKeydown(s)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),2&t&&(en("id",i.id)("tabindex",i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-describedby",i._ariaDescribedby||null)("aria-activedescendant",i._getAriaActiveDescendant()),at("mat-select-disabled",i.disabled)("mat-select-invalid",i.errorState)("mat-select-required",i.required)("mat-select-empty",i.empty)("mat-select-multiple",i.multiple))},inputs:{disabled:"disabled",disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matSelect"],features:[At([{provide:Nv,useExisting:n},{provide:$E,useExisting:n}]),ht],ngContentSelectors:qIe,decls:9,vars:12,consts:[["cdk-overlay-origin","",1,"mat-select-trigger",3,"click"],["origin","cdkOverlayOrigin","trigger",""],[1,"mat-select-value",3,"ngSwitch"],["class","mat-select-placeholder mat-select-min-line",4,"ngSwitchCase"],["class","mat-select-value-text",3,"ngSwitch",4,"ngSwitchCase"],[1,"mat-select-arrow-wrapper"],[1,"mat-select-arrow"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOffsetY","backdropClick","attach","detach"],[1,"mat-select-placeholder","mat-select-min-line"],[1,"mat-select-value-text",3,"ngSwitch"],["class","mat-select-min-line",4,"ngSwitchDefault"],[4,"ngSwitchCase"],[1,"mat-select-min-line"],[1,"mat-select-panel-wrap"],["role","listbox","tabindex","-1",3,"ngClass","keydown"],["panel",""]],template:function(t,i){if(1&t&&(Dr(WIe),F(0,"div",0,1),ye("click",function(){return i.toggle()}),F(3,"div",2),Ct(4,UIe,2,1,"span",3),Ct(5,$Ie,3,2,"span",4),N(),F(6,"div",5),et(7,"div",6),N(),N(),Ct(8,GIe,4,14,"ng-template",7),ye("backdropClick",function(){return i.close()})("attach",function(){return i._onAttached()})("detach",function(){return i.close()})),2&t){const r=Ys(1);en("aria-owns",i.panelOpen?i.id+"-panel":null),Y(3),ie("ngSwitch",i.empty),en("id",i._valueId),Y(1),ie("ngSwitchCase",!0),Y(1),ie("ngSwitchCase",!1),Y(3),ie("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",r)("cdkConnectedOverlayOpen",i.panelOpen)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayMinWidth",null==i._triggerRect?null:i._triggerRect.width)("cdkConnectedOverlayOffsetY",i._offsetY)}},directives:[Doe,Cv,vD,DU,E3,sE],styles:['.mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;opacity:0}\n'],encapsulation:2,data:{animation:[Pq.transformPanelWrap,Pq.transformPanel]},changeDetection:0}),n})(),Lq=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[QIe],imports:[[bn,$v,qE,Nn],zv,Lv,qE,Nn]}),n})();function iPe(n,e){if(1&n&&(F(0,"mat-option",5),Te(1),N()),2&n){const t=e.$implicit;ie("value",t),Y(1),bw(" ",t.name," (",t.sites.length,") ")}}function rPe(n,e){if(1&n){const t=Lr();F(0,"mat-form-field",1),F(1,"mat-label",2),Te(2,"Landmark Set"),N(),F(3,"mat-select",3),ye("selectionChange",function(r){return Vn(t),bt().extractionSetChanged(r.value)}),Ct(4,iPe,2,3,"mat-option",4),N(),N()}if(2&n){const t=bt();Y(3),ie("value",t.sets[0]),Y(1),ie("ngForOf",t.sets)}}let sPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-extraction-set-dropdown",this.setChange=new Pe}extractionSetChanged(t){this.selected=t,this.ga.event("selected_extraction_set_change","extraction_set_dropdown",t.name),this.setChange.emit(t)}isMultiple(){return this.sets.length>1}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-extraction-set-dropdown"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{sets:"sets"},outputs:{setChange:"setChange"},decls:1,vars:1,consts:[["class","dropdown-form-field","appearance","fill",4,"ngIf"],["appearance","fill",1,"dropdown-form-field"],[1,"extraction-dropdown-label"],["disableOptionCentering","true","panelClass","extraction-set-panel",3,"value","selectionChange"],["class","extraction-set-options",3,"value",4,"ngFor","ngForOf"],[1,"extraction-set-options",3,"value"]],template:function(t,i){1&t&&Ct(0,rPe,5,2,"mat-form-field",0),2&t&&ie("ngIf",i.isMultiple())},directives:[Is,tm,Bf,nPe,Xl,WE],styles:[".extraction-set-panel{box-shadow:0 0 .3rem .1rem #9e9e9e;position:absolute;top:-1rem;left:1rem;width:10.5rem} .extraction-set-panel .extraction-set-options{height:2.5rem!important} .extraction-set-panel .extraction-set-options:first-child{margin-top:.5rem} .extraction-set-panel .extraction-set-options:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .mat-form-field{width:10.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper{padding-bottom:.5rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-flex{padding:0}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-form-field-underline{bottom:.75rem}[_nghost-%COMP%] .mat-form-field .mat-form-field-wrapper .mat-select-arrow-wrapper{transform:none} .cdk-overlay-pane{min-width:0rem!important}"],changeDetection:0}),n})();function oPe(n,e){if(1&n&&(ff(0),et(1,"ccf-details-label",19),yn(2,"async"),pf()),2&n){const t=bt();Y(1),ie("details",wn(2,1,t.detailsLabels$))}}function aPe(n,e){if(1&n){const t=Lr();F(0,"div",9),F(1,"ccf-extraction-set-dropdown",20,21),ye("setChange",function(r){return Vn(t),bt().model.setExtractionSites(r.sites)}),yn(3,"async"),N(),F(4,"ccf-visibility-menu",22),ye("itemsChange",function(r){return Vn(t),bt().model.setExtractionSites(r)})("hover",function(r){return Vn(t),bt().updateExtractionSiteTooltip(r)}),yn(5,"async"),N(),N()}if(2&n){const t=bt();Y(1),ie("sets",wn(3,2,t.model.extractionSets$)),Y(3),ie("items",wn(5,4,t.model.extractionSites$))}}function lPe(n,e){if(1&n&&(F(0,"div",23),Te(1),N()),2&n){const t=bt();Y(1),Os(" ",t.extractionSiteTooltip," ")}}const cPe=function(){return["Male","Female"]};let uPe=(()=>{class n{constructor(t,i,r){this.page=t,this.model=i,this.registration=r,this.clsName="ccf-left-sidebar",this.disableSlider=!1,this.modalClosed=!1,this.sexByLabel$=this.model.sex$.pipe(be(s=>"female"===s?"Female":"Male")),this.sideByLabel$=this.model.side$.pipe(be(s=>"left"===s?"L":"R")),this.organSelected$=this.model.organ$.pipe(be(s=>void 0!==s)),this.detailsLabels$=or([this.model.organ$,this.model.side$,this.model.sex$]).pipe(be(([s,o,a])=>[null==s?void 0:s.name,o,a])),this.extractionSiteTooltip="",this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures],this.organList=_F}updateExtractionSiteTooltip(t){this.extractionSiteTooltip=(null==t?void 0:t.tooltip)?t.tooltip:""}setSexFromLabel(t){this.model.setSex("Female"===t?"female":"male")}setSideFromLabel(t){this.model.setSide("L"===t?"left":"right")}togglePreviousRegistrationBlocks(t){t&&(this.previousVisibilityItems=[...this.model.snapshot.anatomicalStructures]),this.model.toggleRegistrationBlocksVisibility(t,this.previousVisibilityItems)}updateRegistration(t){this.registration.editRegistration(t)}}return n.\u0275fac=function(t){return new(t||n)(E(Ui),E(si),E(wr))},n.\u0275cmp=Le({type:n,selectors:[["ccf-left-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{disableSlider:"disableSlider",modalClosed:"modalClosed"},decls:31,vars:22,consts:[[1,"scroll-wrapper"],[1,"container"],[4,"ngIf"],["matTooltip","Select sex to filter organs.",1,"organ-sliders"],[1,"slider-label"],[1,"toggle","gender",3,"disabled","labels","value","valueChange"],[1,"anatomical-structures-menu",3,"expanded"],[1,"expansion-header"],["matTooltip","Use opacity icons to change visibility of anatomical structures",1,"expansion-title"],[1,"expansion-content"],[3,"items","itemsChange"],[1,"extraction-menu",3,"expanded"],["matTooltip","Some organs have predefined landmarks to guide manual tissue registration--you can turn these on/off.",1,"expansion-title"],["class","expansion-content",4,"ngIf"],["toggleLabel","Previously Registered Blocks","matTooltip","If you previously registered tissue blocks, you can turn their positions on/off.",3,"visible","disabled","visibilityChanged"],[1,"space"],["class","extraction-site-tooltip mat-elevation-z8",4,"ngIf"],[1,"filler"],["label","UPLOAD PREVIOUS REGISTRATION DATA",3,"parsedJson"],[3,"details"],[3,"sets","setChange"],["dropdown",""],[3,"items","itemsChange","hover"],[1,"extraction-site-tooltip","mat-elevation-z8"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),Ct(2,oPe,3,3,"ng-container",2),yn(3,"async"),F(4,"div",3),F(5,"div",4),Te(6,"Donor Sex:"),N(),F(7,"ccf-labeled-slide-toggle",5),ye("valueChange",function(s){return i.setSexFromLabel(s)}),yn(8,"async"),N(),N(),et(9,"mat-divider"),F(10,"mat-expansion-panel",6),F(11,"mat-expansion-panel-header",7),F(12,"mat-panel-title",8),Te(13,"Anatomical Structures"),N(),N(),F(14,"div",9),F(15,"ccf-visibility-menu",10),ye("itemsChange",function(s){return i.model.setAnatomicalStructures(s)}),yn(16,"async"),N(),N(),N(),et(17,"mat-divider"),F(18,"mat-expansion-panel",11),F(19,"mat-expansion-panel-header",7),F(20,"mat-panel-title",12),Te(21,"Landmarks"),N(),N(),Ct(22,aPe,6,6,"div",13),yn(23,"async"),N(),et(24,"mat-divider"),F(25,"ccf-visibility-toggle",14),ye("visibilityChanged",function(s){return i.togglePreviousRegistrationBlocks(s)}),yn(26,"async"),N(),et(27,"div",15),Ct(28,lPe,2,1,"div",16),et(29,"div",17),F(30,"ccf-json-file-reader",18),ye("parsedJson",function(s){return i.updateRegistration(s)}),N(),N(),N()),2&t&&(Y(2),ie("ngIf",wn(3,11,i.page.registrationCallbackSet$)),Y(5),ie("disabled",i.disableSlider)("labels",lv(21,cPe))("value",wn(8,13,i.sexByLabel$)),Y(3),ie("expanded",i.modalClosed),Y(5),ie("items",wn(16,15,i.model.anatomicalStructures$)),Y(3),ie("expanded",i.modalClosed),Y(4),ie("ngIf",wn(23,17,i.organSelected$)),Y(3),ie("visible",wn(26,19,i.model.showPrevious$))("disabled",i.disableSlider),Y(3),ie("ngIf",i.extractionSiteTooltip.length>0))},directives:[Is,cc,vF,Sq,NM,LM,PG,EIe,FIe,LIe,BIe,sPe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{overflow-y:scroll;height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-left:1.5rem;margin-right:.375rem;min-height:100%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .space[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .ccf-organ-selector[_ngcontent-%COMP%]{margin-top:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%]{display:flex;height:3rem;align-items:center}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .organ-sliders[_ngcontent-%COMP%] .slider-label[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%] .expansion-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:600}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header{-webkit-user-select:none;-moz-user-select:none;padding:0;font-weight:bold;height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator, [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-header .mat-expansion-indicator{display:flex;align-items:center;justify-content:center;height:24px;width:24px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%]{margin-bottom:.75rem;text-align:center;margin-top:2.25rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%], [_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .anatomical-structures-menu[_ngcontent-%COMP%] .expansion-content[_ngcontent-%COMP%] .expansion-placeholder[_ngcontent-%COMP%]{width:100%;font-size:.9rem;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .extraction-site-tooltip[_ngcontent-%COMP%]{position:absolute;top:4rem;left:27rem;width:21rem;padding:1rem;border-radius:.5rem;border:1px solid;z-index:2}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})(),dPe=(()=>{class n{constructor(t,i,r){this.drawer=t,this.cdr=r,this.className="ccf-drawer-toggle-button",this.position="start",this.opened=!1,this.subscriptions=new Ie;const s=i.connect(this);this.subscriptions.add(s.getMessagesFromSource(t).subscribe(o=>{this.handleMessage(o)&&r.markForCheck()}))}get classEnd(){return"end"===this.position}get icon(){let t="arrow_right",i="arrow_left";return"end"===this.position&&([t,i]=[i,t]),this.opened?i:t}ngAfterViewInit(){setTimeout(()=>{this.position=this.drawer.position,this.cdr.markForCheck()})}ngOnDestroy(){this.subscriptions.unsubscribe()}handleMessage(t){return"drawer-toggled"===t.payload.type&&(this.opened=t.payload.opened,!0)}toggle(){const t=this.drawer,{opened:i,expanded:r}=t;i?r?t.closeExpanded():t.close():t.open()}}return n.\u0275fac=function(t){return new(t||n)(E(CF),E(c0),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-drawer-toggle-button"]],hostVars:4,hostBindings:function(t,i){2&t&&(Fn(i.className),at("ccf-drawer-toggle-button-end",i.classEnd))},decls:4,vars:4,consts:[["aria-hidden","false","aria-label","Close side drawer",1,"expand-collapse-icon",3,"click"]],template:function(t,i){1&t&&(F(0,"mat-icon",0),ye("click",function(){return i.toggle()}),Te(1," arrow_right\n"),N(),F(2,"mat-icon",0),ye("click",function(){return i.toggle()}),Te(3," arrow_left\n"),N()),2&t&&(at("hidden","arrow_left"===i.icon),Y(2),at("hidden","arrow_right"===i.icon))},directives:[Rs],styles:["[_nghost-%COMP%]{position:absolute;top:calc(50% - 2.0625rem);right:-1.0625rem;width:1.0625rem;height:3rem;border-radius:0 .25rem .25rem 0;cursor:pointer;transition:.25s}.ccf-drawer-toggle-button-end[_nghost-%COMP%]{right:unset;left:calc(-1rem - 1px);border-radius:.25rem 0 0 .25rem}[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{position:absolute;right:0rem;transition:.6s;padding-left:.15rem}[_nghost-%COMP%] .expand-collapse-icon.hidden[_ngcontent-%COMP%]{opacity:0}.ccf-drawer-toggle-button-end[_nghost-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{right:unset;left:-.25rem}.mat-icon[_ngcontent-%COMP%]{right:.3rem;top:.675rem;padding-top:.05rem}"],changeDetection:0}),n})();const Bq={x:10,y:10,z:10};let hPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-block-size-input",this.blockSize=Bq,this.blockSizeChange=new Pe}updateBlockSizes(t,i){const r=t.target;this.blockSize=Object.assign(Object.assign({},this.blockSize),{[i]:+r.value}),this.ga.event("block_size_change","block_size_input",i,this.blockSize[i]),this.blockSizeChange.emit(this.blockSize)}refreshBlockSize(){this.blockSize=Bq,this.ga.event("block_size_reset","block_size_input"),this.blockSizeChange.emit(this.blockSize)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-block-size-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{blockSize:"blockSize"},outputs:{blockSizeChange:"blockSizeChange"},decls:19,vars:5,consts:[["matTooltip","Set the tissue block width, height and depth (dimensions)",1,"header"],[1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"size-inputs"],["floatLabel","always",1,"field"],[1,"text","label"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block width.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block height.",1,"input",3,"value","input"],["matInput","","type","number","placeholder","","matTooltip","Enter tissue block depth.",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Block Dimensions (mm)"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.refreshBlockSize()}),Te(5,"refresh"),N(),N(),F(6,"div",4),F(7,"mat-form-field",5),F(8,"mat-label",6),Te(9,"Width (X)"),N(),F(10,"input",7),ye("input",function(s){return i.updateBlockSizes(s,"x")}),N(),N(),F(11,"mat-form-field",5),F(12,"mat-label",6),Te(13,"Height (Y)"),N(),F(14,"input",8),ye("input",function(s){return i.updateBlockSizes(s,"y")}),N(),N(),F(15,"mat-form-field",5),F(16,"mat-label",6),Te(17,"Depth (Z)"),N(),F(18,"input",9),ye("input",function(s){return i.updateBlockSizes(s,"z")}),N(),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("value",i.blockSize.x),Y(4),ie("value",i.blockSize.y),Y(4),ie("value",i.blockSize.z))},directives:[cc,Rs,Qo,tm,Bf,Hb],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;height:1.5rem;align-items:center}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .size-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const Vq={thickness:NaN,numSlices:NaN};let fPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-slices-input",this.slicesConfig=Vq,this.slicesConfigChange=new Pe}get hasThicknessValue(){return!isNaN(this.slicesConfig.thickness)}updateSlicesData(t,i){const{value:r}=t.target;this.slicesConfig=Object.assign(Object.assign({},this.slicesConfig),{[i]:""!==r?+r:NaN}),this.ga.event("slice_config_update","slice_input",i,this.slicesConfig[i]),this.slicesConfigChange.emit(this.slicesConfig)}refreshSlices(){this.slicesConfig=Vq,this.ga.event("slice_config_reset","slice_input"),this.slicesConfigChange.emit(this.slicesConfig)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-slices-input"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{slicesConfig:"slicesConfig"},outputs:{slicesConfigChange:"slicesConfigChange"},decls:17,vars:6,consts:[[1,"header"],["matTooltip","\u201cAdd thickness of tissue sections and the total number of sections",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","refresh",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slices-inputs"],[1,"field"],[1,"text","label"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter thickness of tissue sections",1,"input",3,"value","input"],["matSuffix","",1,"suffix"],["matInput","","ccfNumbersOnly","","type","number","matTooltip","Enter total number of sections",1,"input",3,"value","input"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Sections"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.refreshSlices()}),Te(5," refresh "),N(),N(),F(6,"div",4),F(7,"mat-form-field",5),F(8,"mat-label",6),Te(9,"Thickness"),N(),F(10,"input",7),ye("input",function(s){return i.updateSlicesData(s,"thickness")}),N(),F(11,"div",8),Te(12,"\u03bcm"),N(),N(),F(13,"mat-form-field",5),F(14,"mat-label",6),Te(15,"# Sections"),N(),F(16,"input",9),ye("input",function(s){return i.updateSlicesData(s,"numSlices")}),N(),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("value",i.slicesConfig.thickness),Y(1),at("show",i.hasThicknessValue),Y(5),ie("value",i.slicesConfig.numSlices))},directives:[cc,Rs,Qo,tm,Bf,Hb,oOe,SO],styles:["[_nghost-%COMP%] input[type=number][_ngcontent-%COMP%]{-moz-appearance:textfield}[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .refresh[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{width:33.33%}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]:not(:last-child){padding-right:.75rem}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field.mat-focused[_ngcontent-%COMP%] .suffix[_ngcontent-%COMP%], [_nghost-%COMP%] .slices-inputs[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .suffix.show[_ngcontent-%COMP%]{display:initial}[_nghost-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();const jq={x:0,y:0,z:0};let pPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-rotation-slider",this.rotation=jq,this.rotationChange=new Pe}changeRotation(t,i){this.rotation=Object.assign(Object.assign({},this.rotation),{[i]:+t}),this.ga.event("rotation_update","rotation_slider",i,+t),this.rotationChange.emit(this.rotation)}resetRotation(){this.rotation=jq,this.ga.event("rotation_reset","rotation_slider"),this.rotationChange.emit(this.rotation)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-rotation-slider"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{rotation:"rotation"},outputs:{rotationChange:"rotationChange"},decls:27,vars:23,consts:[[1,"header"],["matTooltip","Use sliders below to rotate tissue block for registration",1,"text","title"],[1,"filler"],["matRipple","",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"slider-box","red"],[1,"text","label"],[1,"slider-container"],[1,"slider",3,"max","min","step","thumbLabel","tickInterval","value","input"],[1,"text","value"],[1,"slider-box","green"],[1,"slider-box","blue"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"span",1),Te(2,"Tissue Block Rotation"),N(),et(3,"div",2),F(4,"mat-icon",3),ye("click",function(){return i.resetRotation()}),Te(5,"refresh"),N(),N(),F(6,"div",4),F(7,"span",5),Te(8,"X"),N(),F(9,"div",6),F(10,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"x")}),N(),N(),F(11,"span",8),Te(12),N(),N(),F(13,"div",9),F(14,"span",5),Te(15,"Y"),N(),F(16,"div",6),F(17,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"y")}),N(),N(),F(18,"span",8),Te(19),N(),N(),F(20,"div",10),F(21,"span",5),Te(22,"Z"),N(),F(23,"div",6),F(24,"mat-slider",7),ye("input",function(s){return i.changeRotation(s.value,"z")}),N(),N(),F(25,"span",8),Te(26),N(),N()),2&t&&(Y(4),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(6),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.x),Y(2),Ai(i.rotation.x),Y(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.y),Y(2),Ai(i.rotation.y),Y(5),ie("max",180)("min",-180)("step",1)("thumbLabel",!0)("tickInterval",180)("value",i.rotation.z),Y(2),Ai(i.rotation.z))},directives:[cc,Rs,Qo,wk],styles:["[_nghost-%COMP%] .header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;height:1.5rem}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .header[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]:hover{border-radius:2px}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;height:4rem;padding-left:.5rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:1rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{width:2.75rem;text-align:center}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%]{width:100%;padding:1rem 2rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:not(.cdk-focused) .mat-slider-thumb{width:1.25rem;height:1.25rem;transform:none}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper{right:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-wrapper:after{margin-top:-.25rem;height:.625rem!important}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container{margin-top:-.25rem;height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .slider-container[_ngcontent-%COMP%] .mat-slider-horizontal .mat-slider-ticks-container .mat-slider-ticks{height:.625rem}[_nghost-%COMP%] .slider-box[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function mPe(n){const{subscriber:e,counter:t,period:i}=n;e.next(t),this.schedule({subscriber:e,counter:t+1,period:i},i)}const _Pe=["input"],yPe=function(n){return{enterDuration:n}},vPe=["*"],bPe=new _e("mat-checkbox-default-options",{providedIn:"root",factory:Uq});function Uq(){return{color:"accent",clickAction:"check-indeterminate"}}let CPe=0;const zq=Uq(),wPe={provide:Ao,useExisting:T(()=>Hq),multi:!0};class EPe{}const SPe=Nf(kf(Ff(em(class{constructor(n){this._elementRef=n}}))));let Hq=(()=>{class n extends SPe{constructor(t,i,r,s,o,a,l){super(t),this._changeDetectorRef=i,this._focusMonitor=r,this._ngZone=s,this._animationMode=a,this._options=l,this.ariaLabel="",this.ariaLabelledby=null,this._uniqueId="mat-checkbox-"+ ++CPe,this.id=this._uniqueId,this.labelPosition="after",this.name=null,this.change=new Pe,this.indeterminateChange=new Pe,this._onTouched=()=>{},this._currentAnimationClass="",this._currentCheckState=0,this._controlValueAccessorChangeFn=()=>{},this._checked=!1,this._disabled=!1,this._indeterminate=!1,this._options=this._options||zq,this.color=this.defaultColor=this._options.color||zq.color,this.tabIndex=parseInt(o)||0}get inputId(){return`${this.id||this._uniqueId}-input`}get required(){return this._required}set required(t){this._required=Dt(t)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{t||Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}),this._syncIndeterminate(this._indeterminate)}ngAfterViewChecked(){}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}get checked(){return this._checked}set checked(t){t!=this.checked&&(this._checked=t,this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){const i=Dt(t);i!==this.disabled&&(this._disabled=i,this._changeDetectorRef.markForCheck())}get indeterminate(){return this._indeterminate}set indeterminate(t){const i=t!=this._indeterminate;this._indeterminate=Dt(t),i&&(this._transitionCheckState(this._indeterminate?3:this.checked?1:2),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(t){this.checked=!!t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_getAriaChecked(){return this.checked?"true":this.indeterminate?"mixed":"false"}_transitionCheckState(t){let i=this._currentCheckState,r=this._elementRef.nativeElement;if(i!==t&&(this._currentAnimationClass.length>0&&r.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,t),this._currentCheckState=t,this._currentAnimationClass.length>0)){r.classList.add(this._currentAnimationClass);const s=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{r.classList.remove(s)},1e3)})}}_emitChangeEvent(){const t=new EPe;t.source=this,t.checked=this.checked,this._controlValueAccessorChangeFn(this.checked),this.change.emit(t),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked}_onInputClick(t){var i;const r=null===(i=this._options)||void 0===i?void 0:i.clickAction;t.stopPropagation(),this.disabled||"noop"===r?!this.disabled&&"noop"===r&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==r&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this.toggle(),this._transitionCheckState(this._checked?1:2),this._emitChangeEvent())}focus(t,i){t?this._focusMonitor.focusVia(this._inputElement,t,i):this._inputElement.nativeElement.focus(i)}_onInteractionEvent(t){t.stopPropagation()}_getAnimationClassForCheckStateTransition(t,i){if("NoopAnimations"===this._animationMode)return"";let r="";switch(t){case 0:if(1===i)r="unchecked-checked";else{if(3!=i)return"";r="unchecked-indeterminate"}break;case 2:r=1===i?"unchecked-checked":"unchecked-indeterminate";break;case 1:r=2===i?"checked-unchecked":"checked-indeterminate";break;case 3:r=1===i?"indeterminate-checked":"indeterminate-unchecked"}return`mat-checkbox-anim-${r}`}_syncIndeterminate(t){const i=this._inputElement;i&&(i.nativeElement.indeterminate=t)}}return n.\u0275fac=function(t){return new(t||n)(E(nt),E(Un),E(hl),E(lt),fs("tabindex"),E(Zo,8),E(bPe,8))},n.\u0275cmp=Le({type:n,selectors:[["mat-checkbox"]],viewQuery:function(t,i){if(1&t&&(ni(_Pe,5),ni(Qo,5)),2&t){let r;Mt(r=xt())&&(i._inputElement=r.first),Mt(r=xt())&&(i.ripple=r.first)}},hostAttrs:[1,"mat-checkbox"],hostVars:12,hostBindings:function(t,i){2&t&&(sl("id",i.id),en("tabindex",null),at("mat-checkbox-indeterminate",i.indeterminate)("mat-checkbox-checked",i.checked)("mat-checkbox-disabled",i.disabled)("mat-checkbox-label-before","before"==i.labelPosition)("_mat-animation-noopable","NoopAnimations"===i._animationMode))},inputs:{disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],id:"id",labelPosition:"labelPosition",name:"name",required:"required",checked:"checked",disabled:"disabled",indeterminate:"indeterminate",ariaDescribedby:["aria-describedby","ariaDescribedby"],value:"value"},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[At([wPe]),ht],ngContentSelectors:vPe,decls:17,vars:21,consts:[[1,"mat-checkbox-layout"],["label",""],[1,"mat-checkbox-inner-container"],["type","checkbox",1,"mat-checkbox-input","cdk-visually-hidden",3,"id","required","checked","disabled","tabIndex","change","click"],["input",""],["matRipple","",1,"mat-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleRadius","matRippleCentered","matRippleAnimation"],[1,"mat-ripple-element","mat-checkbox-persistent-ripple"],[1,"mat-checkbox-frame"],[1,"mat-checkbox-background"],["version","1.1","focusable","false","viewBox","0 0 24 24",0,"xml","space","preserve","aria-hidden","true",1,"mat-checkbox-checkmark"],["fill","none","stroke","white","d","M4.1,12.7 9,17.6 20.3,6.3",1,"mat-checkbox-checkmark-path"],[1,"mat-checkbox-mixedmark"],[1,"mat-checkbox-label",3,"cdkObserveContent"],["checkboxLabel",""],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"span",2),F(3,"input",3,4),ye("change",function(s){return i._onInteractionEvent(s)})("click",function(s){return i._onInputClick(s)}),N(),F(5,"span",5),et(6,"span",6),N(),et(7,"span",7),F(8,"span",8),Ut.lFrame.currentNamespace=Bn,F(9,"svg",9),et(10,"path",10),N(),Ut.lFrame.currentNamespace=null,et(11,"span",11),N(),N(),F(12,"span",12,13),ye("cdkObserveContent",function(){return i._onLabelTextChange()}),F(14,"span",14),Te(15,"\xa0"),N(),In(16),N(),N()),2&t){const r=Ys(1),s=Ys(13);en("for",i.inputId),Y(2),at("mat-checkbox-inner-container-no-side-margin",!s.textContent||!s.textContent.trim()),Y(1),ie("id",i.inputId)("required",i.required)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex),en("value",i.value)("name",i.name)("aria-label",i.ariaLabel||null)("aria-labelledby",i.ariaLabelledby)("aria-checked",i._getAriaChecked())("aria-describedby",i.ariaDescribedby),Y(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleRadius",20)("matRippleCentered",!0)("matRippleAnimation",Fg(19,yPe,"NoopAnimations"===i._animationMode?0:150))}},directives:[Qo,kD],styles:["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"],encapsulation:2,changeDetection:0}),n})(),$q=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})(),TPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn,_E,$q],Nn,$q]}),n})();const APe=["closeSearch"];function DPe(n,e){if(1&n){const t=Lr();F(0,"div",12),F(1,"mat-checkbox",13),ye("ngModelChange",function(r){const o=Vn(t).$implicit;return bt(2).checkedResults[o.id]=r}),Te(2),N(),N()}if(2&n){const t=e.$implicit,i=bt(2);Y(1),ie("ngModel",i.checkedResults[t.id]),Y(1),Os(" ",t.label," ")}}function OPe(n,e){if(1&n&&(F(0,"div",9),Ct(1,DPe,3,2,"div",10),F(2,"div",11),Te(3),yn(4,"i18nPlural"),N(),N()),2&n){const t=bt();Y(1),ie("ngForOf",t.searchResults.results)("ngForTrackBy",t.tagId),Y(2),Os(" ",QL(4,3,t.searchResults.totalCount,t.countMapping)," ")}}const Gq=5,d1={totalCount:0,results:[]};class gp{constructor(e,t,i){this.el=e,this.ga=t,this.clsName="ccf-tag-search",this.placeholder="Add Anatomical Structures ...",this.added=new Pe,this.countMapping={"=1":"1 result",other:"# results"},this.searchControl=new vh,this.searchResults=d1,this.checkedResults={},this.resultsVisible=!1,this.destroy$=new we,this.searchControl.valueChanges.pipe(zn(this.destroy$),function(n,e=_G){return t=>t.lift(new zMe(n,!!e.leading,!!e.trailing))}(()=>{var r;return function(n=0,e=Tf){return(!IO(n)||n<0)&&(n=0),(!e||"function"!=typeof e.schedule)&&(e=Tf),new oe(t=>(t.add(e.schedule(mPe,n,{subscriber:t,counter:0,period:n})),t))}(null!==(r=this.searchThrottle)&&void 0!==r?r:100)},{leading:!0,trailing:!0}),Ir(this.executeSearch)).subscribe(r=>{this.searchResults=r,this.checkedResults=this.getUpdatedCheckedResults(r),i.markForCheck()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}tagId(e,t){return t.id}hasCheckedTags(){return Object.values(this.checkedResults).some(e=>e)}addTags(){const{searchControl:e,searchResults:t,checkedResults:i}=this,r=t.results.filter(s=>i[s.id]);r.length>0&&(e.reset(),this.searchResults=d1,this.checkedResults={},this.ga.event("tags_added","tag_search",r.map(s=>s.label).join(",")),this.added.emit(r))}openResults(){this.resultsVisible||(this.resultsVisible=!0)}closeResults(e){const{closeSearch:t}=this;this.resultsVisible&&e.target instanceof Node&&(!this.el.nativeElement.contains(e.target)||t.nativeElement.contains(e.target))&&(this.resultsVisible=!1)}executeSearch(e){const{search:t,searchLimit:i=Gq}=this;return e&&t?li(t(e,i)).pipe(Sa(()=>[d1]),be(this.truncateResults)):[d1]}truncateResults(e){const{searchLimit:t=Gq}=this,i=e.results;return i.length>t?Object.assign(Object.assign({},e),{results:i.slice(0,t)}):e}getUpdatedCheckedResults(e){const t=this.checkedResults;return e.results.reduce((i,{id:r})=>{var s;return i[r]=null!==(s=t[r])&&void 0!==s&&s,i},{})}}function PPe(n,e){if(1&n&&(F(0,"div",11),F(1,"div",12),Te(2),N(),F(3,"div",13),Te(4),N(),N()),2&n){const t=e.$implicit;Y(2),Ai(t.label),Y(2),Ai(t.value)}}gp.\u0275fac=function(e){return new(e||gp)(E(nt),E(io),E(Un))},gp.\u0275cmp=Le({type:gp,selectors:[["ccf-tag-search"]],viewQuery:function(e,t){if(1&e&&ni(APe,5,nt),2&e){let i;Mt(i=xt())&&(t.closeSearch=i.first)}},hostVars:2,hostBindings:function(e,t){1&e&&ye("click",function(){return t.openResults()})("focusin",function(){return t.openResults()})("click",function(r){return t.closeResults(r)},!1,ny)("focusin",function(r){return t.closeResults(r)},!1,ny),2&e&&Fn(t.clsName)},inputs:{placeholder:"placeholder",search:"search",searchLimit:"searchLimit",searchThrottle:"searchThrottle"},outputs:{added:"added"},decls:10,vars:8,consts:[[1,"spacer"],["appearance","outline",1,"overlay"],[1,"search-box"],["matInput","","type","search",3,"placeholder","formControl"],["search",""],["matSuffix","",1,"add-button",3,"disabled","click"],["closeSearch",""],[1,"icon"],["class","results",4,"ngIf"],[1,"results"],["class","item",4,"ngFor","ngForOf","ngForTrackBy"],[1,"count"],[1,"item"],["labelPosition","after",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e){const i=Lr();et(0,"div",0),F(1,"mat-form-field",1),F(2,"div",2),et(3,"input",3,4),F(5,"button",5,6),ye("click",function(){Vn(i);const s=Ys(4);return t.addTags(),s.focus()}),F(7,"mat-icon",7),Te(8,"add"),N(),N(),N(),Ct(9,OPe,5,6,"div",8),N()}2&e&&(Y(1),at("expanded",t.resultsVisible),Y(2),ie("placeholder",t.placeholder)("formControl",t.searchControl),Y(2),at("active",t.hasCheckedTags()),ie("disabled",!t.hasCheckedTags()),Y(4),ie("ngIf",t.resultsVisible))},directives:[tm,Hb,Lb,ek,kM,SO,Rs,Is,Xl,Hq,dk],pipes:[x3],styles:["[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] .spacer[_ngcontent-%COMP%]{height:3.25rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;z-index:10}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%]{display:flex;width:100%;align-items:center;height:3rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .search-box[_ngcontent-%COMP%] .add-button[_ngcontent-%COMP%]{border-radius:.25rem;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;height:100%}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%]{margin-top:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .results[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-top:.5rem;font-size:.75rem;text-align:end}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:0;border-radius:.5rem}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-wrapper .mat-form-field-flex{padding-right:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline{opacity:1!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-outline-thick{opacity:0!important}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%] .mat-form-field-infix{padding:.313rem .063rem .063rem;border:0}[_nghost-%COMP%] .overlay.expanded[_ngcontent-%COMP%] .mat-form-field-wrapper{box-shadow:0 0 .3rem .1rem #9e9e9e5e}"],changeDetection:0}),De([su.ak],gp.prototype,"executeSearch",null),De([su.ak],gp.prototype,"truncateResults",null);let RPe=(()=>{class n{constructor(t,i){this.dialogRef=t,this.data=i,this.clsName="ccf-review-modal",this.metaData=i.metaData,this.registrationCallbackSet=i.registrationCallbackSet}close(){var t;null===(t=document.getElementsByClassName("modal-animated")[0])||void 0===t||t.classList.add("modal-animate-fade-out"),setTimeout(()=>{this.dialogRef.close()},250)}}return n.\u0275fac=function(t){return new(t||n)(E(Gm),E(xk))},n.\u0275cmp=Le({type:n,selectors:[["ccf-review-modal"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:14,vars:2,consts:[[1,"ccf-about","wrapper"],[1,"container"],[1,"close"],[1,"material-icons","close-icon",3,"click"],[1,"content"],["mat-dialog-title","",1,"title"],[1,"mat-typography"],[1,"display-fields"],["class","field",4,"ngFor","ngForOf"],[1,"footer"],["mat-button","",1,"download-button",3,"click"],[1,"field"],[1,"label"],[1,"data"]],template:function(t,i){1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),F(3,"mat-icon",3),ye("click",function(){return i.close()}),Te(4,"clear"),N(),N(),F(5,"div",4),F(6,"h2",5),Te(7,"Registration Review"),N(),F(8,"mat-dialog-content",6),F(9,"div",7),Ct(10,PPe,5,2,"div",8),N(),N(),F(11,"div",9),F(12,"button",10),ye("click",function(){return i.dialogRef.close(!0)}),Te(13),N(),N(),N(),N(),N()),2&t&&(Y(10),ie("ngForOf",i.metaData),Y(3),Ai(i.registrationCallbackSet?"REGISTER":"DOWNLOAD REGISTRATION DATA"))},directives:[Rs,xG,TG,Xl,$f],styles:[".mat-dialog-container{padding:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:3rem;background-color:#fff}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{text-align:center;font-size:1.5rem;margin-bottom:0}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%]{justify-content:space-around;display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%]{margin-top:2rem;margin-bottom:2rem;width:100%}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{width:50%;text-align:right;padding-right:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .mat-typography[_ngcontent-%COMP%] .display-fields[_ngcontent-%COMP%] .field[_ngcontent-%COMP%] .data[_ngcontent-%COMP%]{width:50%;text-align:left;padding-left:1rem}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%] .close-icon[_ngcontent-%COMP%]{float:right;margin-top:1rem;margin-right:1rem;cursor:pointer}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{padding-top:1.5rem;display:flex;justify-content:space-around}[_nghost-%COMP%] .ccf-about.wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .review-button[_ngcontent-%COMP%]{height:3rem}"]}),n})(),kPe=(()=>{class n{constructor(t,i){this.dialog=t,this.ga=i,this.clsName="ccf-review-button",this.registrationCallbackSet=!0,this.metaData=[],this.displayErrors=!0,this.registrationIsValid=!1,this.registerData=new Pe,this.enterErrorMode=new Pe}ngOnChanges(){this.registrationIsValid=this.metaData.length>=3&&this.metaData.slice(0,3).every(t=>t.value)}get disabled(){return!this.registrationIsValid}registerButtonClick(t){return t&&t.preventDefault(),this.enterErrorMode.emit(),this.registrationIsValid&&(this.ga.event("review_start","review_button"),this.launchReviewModal()),!1}launchReviewModal(){this.dialog.open(RPe,{panelClass:"modal-animated",width:"60rem",data:{registrationCallbackSet:this.registrationCallbackSet,metaData:this.metaData}}).afterClosed().subscribe(i=>{i&&(this.ga.event("register","review_button"),this.registerData.emit())})}}return n.\u0275fac=function(t){return new(t||n)(E(Wm),E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-review-button"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{registrationCallbackSet:"registrationCallbackSet",metaData:"metaData",displayErrors:"displayErrors",registrationIsValid:"registrationIsValid"},outputs:{registerData:"registerData",enterErrorMode:"enterErrorMode"},features:[qn],decls:2,vars:4,consts:[["mat-button","",1,"review-button",3,"matTooltip","click"]],template:function(t,i){1&t&&(F(0,"button",0),ye("click",function(s){return i.registerButtonClick(s)}),Te(1),N()),2&t&&(at("disabled",i.disabled),ie("matTooltip",i.disabled?"Required: Select an organ and position tissue block inside organ.":"Review registration and submit/download."),Y(1),Os(" ",i.registrationCallbackSet?"REVIEW AND REGISTER":"REVIEW AND DOWNLOAD","\n"))},directives:[$f,cc],styles:[".review-button[_ngcontent-%COMP%]{width:100%;height:2.25rem;transition:.6s;font-weight:500}.review-button.disabled[_ngcontent-%COMP%]{cursor:not-allowed}"]}),n})();function FPe(n,e){if(1&n){const t=Lr();F(0,"mat-chip",2),ye("removed",function(){const s=Vn(t).$implicit;return bt().removeTag(s)}),Te(1),F(2,"mat-icon",3),Te(3,"cancel"),N(),N()}if(2&n){const t=e.$implicit;Fn(bt().tagClasses(t)),Y(1),Os(" ",t.label," ")}}let NPe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-tag-list",this.tagRemoved=new Pe,this.tagsChange=new Pe}tagId(t,i){return i.id}tagClasses(t){return"added"===t.type?["added"]:["assigned"]}removeTag(t){this.tags=this.tags.filter(i=>i!==t),this.ga.event("tag_removed","tag_list",t.label),this.tagRemoved.emit(t),this.tagsChange.emit(this.tags)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-tag-list"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{tags:"tags"},outputs:{tagRemoved:"tagRemoved",tagsChange:"tagsChange"},decls:2,vars:2,consts:[["selectable","false"],["removable","","disableRipple","",3,"class","removed",4,"ngFor","ngForOf","ngForTrackBy"],["removable","","disableRipple","",3,"removed"],["matChipRemove","",1,"icon","remove"]],template:function(t,i){1&t&&(F(0,"mat-chip-list",0),Ct(1,FPe,4,3,"mat-chip",1),N()),2&t&&(Y(1),ie("ngForOf",i.tags)("ngForTrackBy",i.tagId))},directives:[Oq,Xl,u0,Rs,Aq],styles:["[_nghost-%COMP%]{display:block;overflow-x:hidden;overflow-y:auto}[_nghost-%COMP%] .mat-chip-list-wrapper{margin:0}"],changeDetection:0}),n})();function LPe(n,e){if(1&n){const t=Lr();F(0,"ccf-tag-list",20),ye("tagRemoved",function(r){return Vn(t),bt().astags.removeTag(r)}),yn(1,"async"),N()}2&n&&ie("tags",wn(1,1,bt().astags.tags$))}function BPe(n,e){}const VPe=function(){return[]};let jPe=(()=>{class n{constructor(t,i,r,s){this.model=t,this.registration=i,this.page=r,this.astags=s,this.clsName="ccf-right-sidebar",this.modalClosed=!1}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(wr),E(Ui),E(Io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-right-sidebar"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},inputs:{modalClosed:"modalClosed"},decls:34,vars:28,consts:[[1,"scroll-wrapper"],[1,"container"],[1,"info-button-container"],["videoID","gY3_-LIoKaU","infoTitle","HuBMAP CCF Registration User Interface"],[3,"blockSize","blockSizeChange"],[3,"slicesConfig","slicesConfigChange"],[3,"rotation","rotationChange"],[1,"tags-container",3,"expanded"],[1,"header"],["matTooltip","Review tags generated via collision detection. Add or delete tags as needed."],[3,"search","added"],["class","tag-list",3,"tags","tagRemoved",4,"ngIf","ngIfElse"],["tagListPlaceholder",""],[1,"legend"],[1,"dot","assigned"],[1,"text","assigned"],[1,"dot","added"],[1,"text","added"],[1,"filler"],[3,"registrationCallbackSet","displayErrors","registrationIsValid","metaData","registerData","enterErrorMode"],[1,"tag-list",3,"tags","tagRemoved"]],template:function(t,i){if(1&t&&(F(0,"div",0),F(1,"div",1),F(2,"div",2),et(3,"ccf-info-button",3),N(),F(4,"ccf-block-size-input",4),ye("blockSizeChange",function(s){return i.model.setBlockSize(s)}),yn(5,"async"),N(),F(6,"ccf-slices-input",5),ye("slicesConfigChange",function(s){return i.model.setSlicesConfig(s)}),yn(7,"async"),N(),F(8,"ccf-rotation-slider",6),ye("rotationChange",function(s){return i.model.setRotation(s)}),yn(9,"async"),N(),et(10,"mat-divider"),F(11,"mat-expansion-panel",7),F(12,"mat-expansion-panel-header",8),F(13,"mat-panel-title",9),Te(14,"Anatomical Structure Tags"),N(),N(),F(15,"ccf-tag-search",10),ye("added",function(s){return i.astags.addTags(s)}),N(),Ct(16,LPe,2,3,"ccf-tag-list",11),yn(17,"async"),Ct(18,BPe,0,0,"ng-template",null,12,Rw),F(20,"div",13),et(21,"span",14),F(22,"span",15),Te(23,"Assigned"),N(),et(24,"span",16),F(25,"span",17),Te(26,"Added"),N(),N(),N(),et(27,"mat-divider"),et(28,"div",18),F(29,"ccf-review-button",19),ye("registerData",function(){return i.registration.register()})("enterErrorMode",function(){return i.registration.setDisplayErrors(!i.registration.isValid)}),yn(30,"async"),yn(31,"async"),yn(32,"async"),yn(33,"async"),N(),N(),N()),2&t){const r=Ys(19);let s,o;Y(4),ie("blockSize",wn(5,11,i.model.blockSize$)),Y(2),ie("slicesConfig",wn(7,13,i.model.slicesConfig$)),Y(2),ie("rotation",wn(9,15,i.model.rotation$)),Y(3),ie("expanded",i.modalClosed),Y(4),ie("search",i.astags.searchExternal),Y(1),ie("ngIf",null==(s=wn(17,17,i.model.organ$))?null:s.name)("ngIfElse",r),Y(13),ie("registrationCallbackSet",wn(30,19,i.page.registrationCallbackSet$))("displayErrors",wn(31,21,i.registration.displayErrors$))("registrationIsValid",wn(32,23,i.registration.valid$))("metaData",null!==(o=wn(33,25,i.registration.metadata$))&&void 0!==o?o:lv(27,VPe))}},directives:[rOe,hPe,fPe,pPe,Sq,NM,LM,PG,cc,gp,Is,kPe,NPe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;height:calc(100% - 3rem);margin-top:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]{height:100%;margin-right:.375rem;scrollbar-width:thin}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{width:.75rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100%;margin-left:1.5rem;margin-right:.375rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .info-button-container[_ngcontent-%COMP%]{height:3.75rem;display:flex;justify-content:flex-end}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{border-top-width:3px}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 .5rem 0 0;font-weight:bold;-webkit-user-select:none;-moz-user-select:none;font-size:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%]{overflow:visible}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .mat-expansion-panel-body{padding-left:0;padding-right:0}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{height:3rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%]{margin-top:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .search[_ngcontent-%COMP%] .icon.add[_ngcontent-%COMP%]{position:absolute;width:3.625rem;height:3.625rem;font-size:3.625rem;top:-1.9375rem;right:-1.1875rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list[_ngcontent-%COMP%]{max-height:32rem;margin-left:-1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .tag-list-placeholder[_ngcontent-%COMP%]{display:flex;height:4rem;align-items:center;justify-content:center;font-weight:400}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%]{display:flex;width:100%;margin-top:1.5rem;align-items:center;font-size:.9rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{display:inline-block;width:1rem;height:1rem;border-radius:50%}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.assigned[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .dot.added[_ngcontent-%COMP%]{margin-left:1rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .tags-container[_ngcontent-%COMP%] .legend[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{margin-left:.5rem}[_nghost-%COMP%] .scroll-wrapper[_ngcontent-%COMP%] .container[_ngcontent-%COMP%] .filler[_ngcontent-%COMP%]{flex-grow:1}"],changeDetection:0}),n})();function Wq(n,e){return Xo((t,i)=>e?e(t[n],i[n]):t[n]===i[n])}const UPe=["input"],zPe=function(n){return{enterDuration:n}},HPe=["*"],$Pe=new _e("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let qq=0;const WPe={provide:Ao,useExisting:T(()=>Zq),multi:!0};class Yq{constructor(e,t){this.source=e,this.value=t}}const Xq=new _e("MatRadioGroup");let Kq=(()=>{class n{constructor(t){this._changeDetector=t,this._value=null,this._name="mat-radio-group-"+qq++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new Pe}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(t){this._labelPosition="before"===t?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=Dt(t),this._markRadiosForCheck()}get required(){return this._required}set required(t){this._required=Dt(t),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(t=>{t.name=this.name,t._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(i=>{i.checked=this.value===i.value,i.checked&&(this._selected=i)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new Yq(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(t=>t._markForCheck())}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetector.markForCheck()}}return n.\u0275fac=function(t){return new(t||n)(E(Un))},n.\u0275dir=he({type:n,inputs:{name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:"disabled",required:"required",color:"color"},outputs:{change:"change"}}),n})(),Zq=(()=>{class n extends Kq{}return n.\u0275fac=function(){let e;return function(i){return(e||(e=jn(n)))(i||n)}}(),n.\u0275dir=he({type:n,selectors:[["mat-radio-group"]],contentQueries:function(t,i,r){if(1&t&&Fi(r,Qq,5),2&t){let s;Mt(s=xt())&&(i._radios=s)}},hostAttrs:["role","radiogroup",1,"mat-radio-group"],exportAs:["matRadioGroup"],features:[At([WPe,{provide:Xq,useExisting:n}]),ht]}),n})();class qPe{constructor(e){this._elementRef=e}}const YPe=Ff(Nf(qPe));let XPe=(()=>{class n extends YPe{constructor(t,i,r,s,o,a,l,c){super(i),this._changeDetector=r,this._focusMonitor=s,this._radioDispatcher=o,this._providerOverride=l,this._uniqueId="mat-radio-"+ ++qq,this.id=this._uniqueId,this.change=new Pe,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=t,this._noopAnimations="NoopAnimations"===a,c&&(this.tabIndex=So(c,0)),this._removeUniqueSelectionListener=o.listen((d,f)=>{d!==this.id&&f===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(t){const i=Dt(t);this._checked!==i&&(this._checked=i,i&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!i&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),i&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(t){this._labelPosition=t}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(t){this._setDisabled(Dt(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=Dt(t)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(t){this._color=t}get inputId(){return`${this.id||this._uniqueId}-input`}focus(t,i){i?this._focusMonitor.focusVia(this._inputElement,i,t):this._inputElement.nativeElement.focus(t)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{!t&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new Yq(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(t){t.stopPropagation()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){const i=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),i&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}}return n.\u0275fac=function(t){return new(t||n)(E(Kq),E(nt),E(Un),E(hl),E(tS),E(String),E(void 0),E(String))},n.\u0275dir=he({type:n,viewQuery:function(t,i){if(1&t&&ni(UPe,5),2&t){let r;Mt(r=xt())&&(i._inputElement=r.first)}},inputs:{id:"id",checked:"checked",value:"value",labelPosition:"labelPosition",disabled:"disabled",required:"required",color:"color",name:"name",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],ariaDescribedby:["aria-describedby","ariaDescribedby"]},outputs:{change:"change"},features:[ht]}),n})(),Qq=(()=>{class n extends XPe{constructor(t,i,r,s,o,a,l,c){super(t,i,r,s,o,a,l,c)}}return n.\u0275fac=function(t){return new(t||n)(E(Xq,8),E(nt),E(Un),E(hl),E(tS),E(Zo,8),E($Pe,8),fs("tabindex"))},n.\u0275cmp=Le({type:n,selectors:[["mat-radio-button"]],hostAttrs:[1,"mat-radio-button"],hostVars:17,hostBindings:function(t,i){1&t&&ye("focus",function(){return i._inputElement.nativeElement.focus()}),2&t&&(en("tabindex",null)("id",i.id)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),at("mat-radio-checked",i.checked)("mat-radio-disabled",i.disabled)("_mat-animation-noopable",i._noopAnimations)("mat-primary","primary"===i.color)("mat-accent","accent"===i.color)("mat-warn","warn"===i.color))},inputs:{disableRipple:"disableRipple",tabIndex:"tabIndex"},exportAs:["matRadioButton"],features:[ht],ngContentSelectors:HPe,decls:13,vars:20,consts:[[1,"mat-radio-label"],["label",""],[1,"mat-radio-container"],[1,"mat-radio-outer-circle"],[1,"mat-radio-inner-circle"],["type","radio",1,"mat-radio-input","cdk-visually-hidden",3,"id","checked","disabled","tabIndex","required","change","click"],["input",""],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mat-radio-label-content"],[2,"display","none"]],template:function(t,i){if(1&t&&(Dr(),F(0,"label",0,1),F(2,"span",2),et(3,"span",3),et(4,"span",4),F(5,"input",5,6),ye("change",function(s){return i._onInputInteraction(s)})("click",function(s){return i._onInputClick(s)}),N(),F(7,"span",7),et(8,"span",8),N(),N(),F(9,"span",9),F(10,"span",10),Te(11,"\xa0"),N(),In(12),N(),N()),2&t){const r=Ys(1);en("for",i.inputId),Y(5),ie("id",i.inputId)("checked",i.checked)("disabled",i.disabled)("tabIndex",i.tabIndex)("required",i.required),en("name",i.name)("value",i.value)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),Y(2),ie("matRippleTrigger",r)("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",Fg(18,zPe,i._noopAnimations?0:150)),Y(2),at("mat-radio-label-before","before"==i.labelPosition)}},directives:[Qo],styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}\n"],encapsulation:2,changeDetection:0}),n})(),KPe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[ec,Nn],Nn]}),n})();const ZPe=["label"],QPe=["options"],JPe=function(){return["Register","3D\xa0Preview"]};let eRe=(()=>{class n{constructor(t){this.ga=t,this.clsName="ccf-stage-nav",this.side="anterior",this.view3D=!1,this.sideChange=new Pe,this.view3DChange=new Pe,this.isDropdownActive=!1,this.isDropdownHidden=!0}set useDropdownMenu(t){this.isDropdownActive=t,this.isDropdownHidden=!0}get labelEl(){return this.labelRef.nativeElement}get optionsEl(){return this.optionsRef.nativeElement}handleClick(t){const{isDropdownHidden:i,labelEl:r,optionsEl:s}=this;r.contains(t)?this.isDropdownHidden=!i:s.contains(t)||(this.isDropdownHidden=!0)}updateSide(t){this.ga.event("side_update","stage_nav",t),"3D"===t?this.updateView(!0):(this.updateView(!1),this.side=t,this.sideChange.emit(this.side))}updateView(t){this.view3D=t,this.ga.event("view_update","stage_nav",t?"3D":"Register"),this.view3DChange.emit(this.view3D)}}return n.\u0275fac=function(t){return new(t||n)(E(io))},n.\u0275cmp=Le({type:n,selectors:[["ccf-stage-nav"]],viewQuery:function(t,i){if(1&t&&(ni(ZPe,7),ni(QPe,7)),2&t){let r;Mt(r=xt())&&(i.labelRef=r.first),Mt(r=xt())&&(i.optionsRef=r.first)}},hostVars:2,hostBindings:function(t,i){1&t&&ye("click",function(s){return i.handleClick(s.target)},!1,Qp),2&t&&Fn(i.clsName)},inputs:{useDropdownMenu:"useDropdownMenu",side:"side",view3D:"view3D"},outputs:{sideChange:"sideChange",view3DChange:"view3DChange"},decls:18,vars:10,consts:[[1,"dropdown-label"],["label",""],[1,"stage-options"],["options",""],[1,"input-group",3,"value","change"],["value","left",1,"nav-input"],["value","right",1,"nav-input"],["value","anterior","checked","",1,"nav-input"],["value","posterior",1,"nav-input"],["matTooltip","Change view.",1,"view-slider",3,"labels","value","valueChange"]],template:function(t,i){1&t&&(F(0,"div",0,1),F(2,"mat-label"),Te(3,"Options"),N(),F(4,"mat-icon"),Te(5,"arrow_drop_down"),N(),N(),F(6,"div",2,3),F(8,"mat-radio-group",4),ye("change",function(s){return i.updateSide(s.value)}),F(9,"mat-radio-button",5),Te(10,"Left"),N(),F(11,"mat-radio-button",6),Te(12,"Right"),N(),F(13,"mat-radio-button",7),Te(14,"Anterior"),N(),F(15,"mat-radio-button",8),Te(16,"Posterior"),N(),N(),F(17,"ccf-labeled-slide-toggle",9),ye("valueChange",function(s){return i.updateView("Register"!==s)}),N(),N()),2&t&&(at("dropdown",i.isDropdownActive),Y(6),at("dropdowncontainer",i.isDropdownActive)("hidden",i.isDropdownActive&&i.isDropdownHidden),Y(2),ie("value",i.side),Y(9),ie("labels",lv(9,JPe))("value",i.view3D?"3D\xa0Preview":"Register"))},directives:[Bf,Rs,Zq,Qq,vF,cc],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%]{display:none;align-items:center}[_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-label[_ngcontent-%COMP%], [_nghost-%COMP%] .dropdown-label[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{line-height:1.5rem}[_nghost-%COMP%] .dropdown-label.dropdown[_ngcontent-%COMP%]{display:flex;cursor:pointer;align-items:start}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{margin-right:1.5rem;margin-bottom:1.5rem}[_nghost-%COMP%] .stage-options[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{margin-left:-1rem;margin-bottom:1.5rem;white-space:nowrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-radius:.25rem;width:16.5rem;position:absolute;top:3.5rem;z-index:1;transition:opacity .25s}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{margin-left:1.5rem;margin-right:0;display:flex;flex-wrap:wrap}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .nav-input[_ngcontent-%COMP%]{display:flex;margin:0 1.5rem 0 0;height:2.5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] .view-slider[_ngcontent-%COMP%]{display:flex;align-items:center;height:3rem;margin:0 .5rem}[_nghost-%COMP%] .stage-options.dropdowncontainer[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:visible;border-top:2px solid}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%]{visibility:hidden;opacity:0;transition:visibility .25s,opacity .25s}[_nghost-%COMP%] .stage-options.hidden[_ngcontent-%COMP%] mat-divider[_ngcontent-%COMP%]{visibility:hidden}"],changeDetection:0}),n})();function tRe(n,e){if(1&n){const t=Lr();F(0,"ccf-body-ui",16),ye("rotationChange",function(r){Vn(t),bt();const s=Ys(24);return s.rotation=r[0],s.rotationX=r[1]}),yn(1,"async"),yn(2,"async"),yn(3,"async"),N()}if(2&n){const t=bt();ie("scene",wn(1,5,t.scene.nodes$))("rotation",wn(2,7,t.scene.rotation$))("bounds",wn(3,9,t.bounds$))("zoom",11.5)("interactive",!0)}}function nRe(n,e){if(1&n){const t=Lr();F(0,"ccf-body-ui",17),ye("nodeDrag",function(r){return Vn(t),bt().handleNodeDrag(r)}),yn(1,"async"),yn(2,"async"),N()}if(2&n){const t=bt();ie("scene",wn(1,4,t.scene.rotatedNodes$))("interactive",!1)("bounds",wn(2,6,t.bounds$))("zoom",11.5)}}function iRe(n,e){1&n&&et(0,"ccf-store-debug",18)}function rRe(n,e){if(1&n){const t=Lr();F(0,"div",19),F(1,"button",20),ye("click",function(){Vn(t);const r=bt();return r.debugMode=!r.debugMode}),Te(2,"State"),N(),F(3,"button",21),ye("click",function(){return Vn(t),bt().registration.setUseRegistrationCallback(!0)}),Te(4,"Use callback"),N(),F(5,"button",21),ye("click",function(){return Vn(t),bt().registration.setUseRegistrationCallback(!1)}),Te(6,"Use download"),N(),N()}}let sRe=(()=>{class n{constructor(t,i,r,s,o,a){this.model=t,this.page=i,this.registration=r,this.scene=s,this.rootRef=o,this.cdr=a,this.clsName="ccf-content",this.position$=this.model.position$.pipe(be(l=>({x:Math.floor(l.x),y:Math.floor(l.y),z:Math.floor(l.z)}))),this.is3DView$=this.model.viewType$.pipe(be(l=>"3d"===l)),this.bounds$=this.model.organDimensions$.pipe(be(l=>({x:Math.max(l.x,this.model.defaultPosition.x+40)/1e3,y:Math.max(l.y,this.model.defaultPosition.y+40)/1e3,z:Math.max(l.z,this.model.defaultPosition.z+40)/1e3})),Wq("x"),Wq("y")),this.isNarrowView=!1,this.debugMode=!1,this.showDebugButtons=!Sh.production}ngOnInit(){this.sensor=new vG.ResizeSensor(this.rootRef.nativeElement,({width:t})=>{const i=t<440;this.isNarrowView!==i&&(this.isNarrowView=i,this.cdr.markForCheck())})}ngOnDestroy(){this.sensor.detach()}setViewType(t){this.model.setViewType(t?"3d":"register")}resetStage(){this.model.setPosition(this.model.defaultPosition),this.model.setViewSide("anterior"),this.model.setViewType("register")}handleNodeDrag(t){if("#DraftPlacement"===t.node["@id"]&&t.info.coordinate){const[i,r]=t.info.coordinate.map(d=>1e3*d),{position:s,viewSide:o,organDimensions:a}=this.model.snapshot,l=[a.x,a.y,a.z].map(d=>d/2);let c=s;switch(o){case"anterior":c={x:i+l[0],y:r+l[1],z:s.z};break;case"posterior":c={x:-i+l[0],y:r+l[1],z:s.z};break;case"left":c={x:s.x,y:r+l[1],z:-i+l[2]};break;case"right":c={x:s.x,y:r+l[1],z:i+l[2]}}this.model.setPosition(c)}}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(Ui),E(wr),E(ss),E(nt),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-content"]],hostVars:2,hostBindings:function(t,i){2&t&&Fn(i.clsName)},decls:29,vars:34,consts:[[1,"top-bar"],[3,"useDropdownMenu","view3D","side","view3DChange","sideChange"],["matRipple","","matRippleColor","rgba(204, 204, 204, 0.25)",1,"icon","reset",3,"matRippleCentered","matRippleUnbounded","click"],[1,"main-content"],["class","body-ui","camera","perspective",3,"scene","rotation","bounds","zoom","interactive","rotationChange",4,"ngIf"],["class","body-ui","camera","orthographic",3,"scene","interactive","bounds","zoom","nodeDrag",4,"ngIf"],[1,"gizmo-area"],[1,"position-display"],[1,"position"],[1,"x"],[1,"y"],[1,"z"],[1,"gizmo",3,"scene","rotation","interactive","zoom"],["gizmo",""],["class","debug",4,"ngIf"],["style","position: absolute; bottom: 1rem; display: flex; flex-direction: row; justify-content: space-between; width: 7rem;",4,"ngIf"],["camera","perspective",1,"body-ui",3,"scene","rotation","bounds","zoom","interactive","rotationChange"],["camera","orthographic",1,"body-ui",3,"scene","interactive","bounds","zoom","nodeDrag"],[1,"debug"],[2,"position","absolute","bottom","1rem","display","flex","flex-direction","row","justify-content","space-between","width","7rem"],[2,"width","3rem","font-size",".7rem",3,"click"],[3,"click"]],template:function(t,i){if(1&t&&(F(0,"div",0),F(1,"ccf-stage-nav",1),ye("view3DChange",function(s){return i.setViewType(s)})("sideChange",function(s){return i.model.setViewSide(s)}),yn(2,"async"),yn(3,"async"),N(),F(4,"mat-icon",2),ye("click",function(){return i.resetStage()}),Te(5,"refresh"),N(),N(),F(6,"div",3),Ct(7,tRe,4,11,"ccf-body-ui",4),yn(8,"async"),Ct(9,nRe,3,8,"ccf-body-ui",5),yn(10,"async"),F(11,"div",6),F(12,"div",7),F(13,"div",8),F(14,"div",9),Te(15),yn(16,"async"),N(),F(17,"div",10),Te(18),yn(19,"async"),N(),F(20,"div",11),Te(21),yn(22,"async"),N(),N(),N(),et(23,"ccf-body-ui",12,13),yn(25,"async"),yn(26,"async"),N(),N(),Ct(27,iRe,1,0,"ccf-store-debug",14),Ct(28,rRe,7,0,"div",15)),2&t){let r,s,o;Y(1),ie("useDropdownMenu",i.isNarrowView)("view3D",wn(2,16,i.is3DView$))("side",wn(3,18,i.model.viewSide$)),Y(3),ie("matRippleCentered",!0)("matRippleUnbounded",!0),Y(3),ie("ngIf","3d"===wn(8,20,i.model.viewType$)),Y(2),ie("ngIf","register"===wn(10,22,i.model.viewType$)),Y(6),Os("X: ",null==(r=wn(16,24,i.position$))?null:r.x,""),Y(3),Os("Y: ",null==(s=wn(19,26,i.position$))?null:s.y,""),Y(3),Os("Z: ",null==(o=wn(22,28,i.position$))?null:o.z,""),Y(2),ie("scene",wn(25,30,i.scene.gizmo$))("rotation",wn(26,32,i.scene.rotation$))("interactive",!1)("zoom",9.5),Y(4),ie("ngIf",i.showDebugButtons&&i.debugMode),Y(1),ie("ngIf",i.showDebugButtons)}},directives:[eRe,Rs,Qo,Is,IDe,VDe],pipes:[zu],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;padding:1.5rem;overflow:hidden}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%]{display:flex;justify-content:space-between}[_nghost-%COMP%] .top-bar[_ngcontent-%COMP%] .reset[_ngcontent-%COMP%]{transform:scaleX(-1);cursor:pointer;transition:.6s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%]{display:flex;height:calc(100% - 1rem)}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .body-ui[_ngcontent-%COMP%]{flex:auto;transition:opacity 1s}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%]{width:4rem;margin-top:1.5rem;margin-left:1.5rem;z-index:10}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .position-display[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:1.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%]{height:5.5rem}[_nghost-%COMP%] .main-content[_ngcontent-%COMP%] .gizmo-area[_ngcontent-%COMP%] .gizmo[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{opacity:0;z-index:0}[_nghost-%COMP%] .ccf-store-debug[_ngcontent-%COMP%]{color:#fff;position:absolute;top:.5rem;max-width:55rem}"],changeDetection:0}),n})();const oRe=function(n){return[n]};let aRe=(()=>{class n{constructor(t,i,r,s,o,a,l,c){this.model=t,this.page=i,this.consentService=r,this.snackbar=s,this.theming=o,this.globalConfig=c,this.organList=_F,this.open=!0,this.registrationStarted=!1,this.disablePositionChange=!1,this.subscriptions=new Ie,o.initialize(a,l),this.subscriptions.add(i.registrationCallbackSet$.subscribe(d=>{this.open=!d})),this.subscriptions.add(i.registrationStarted$.subscribe(d=>{this.registrationStarted=d}))}ngOnInit(){const t=this.snackbar.openFromComponent(pOe,{data:{preClose:()=>{t.dismiss()}},duration:"not-set"===this.consentService.consent?1/0:3e3})}handleKey(t){const i=this.model.snapshot.position;if(this.disablePositionChange||!this.registrationStarted)return;t.preventDefault();const r=t.repeat?1:.5;let s=i;switch(t.key){case"q":s=Object.assign(Object.assign({},i),{z:i.z+r});break;case"e":s=Object.assign(Object.assign({},i),{z:i.z-r});break;case"w":s=Object.assign(Object.assign({},i),{y:i.y+r});break;case"s":s=Object.assign(Object.assign({},i),{y:i.y-r});break;case"a":s=Object.assign(Object.assign({},i),{x:i.x-r});break;case"d":s=Object.assign(Object.assign({},i),{x:i.x+r})}this.model.setPosition(s)}handleClick(t){this.disablePositionChange="INPUT"===t.nodeName}ngOnDestroy(){this.subscriptions.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(E(si),E(Ui),E(o0),E(Woe),E(yF),E(nt),E(Tt),E(Eh))},n.\u0275cmp=Le({type:n,selectors:[["ccf-root"]],hostBindings:function(t,i){1&t&&ye("keydown",function(s){return i.handleKey(s)},!1,Qp)("click",function(s){return i.handleClick(s.target)},!1,Qp)},decls:18,vars:16,consts:[["opened",""],[3,"modalClosed","disableSlider"],["position","end","opened",""],[3,"modalClosed"],[1,"selector-drawer"],[3,"organList","selectedOrgans","organsChanged"],["organSelector",""],[1,"expand-collapse-icon"],["aria-hidden","false","aria-label","Close carousel drawer",3,"click"],[1,"stage-content"]],template:function(t,i){if(1&t&&(et(0,"ccf-registration-modal"),et(1,"ccf-header"),F(2,"ccf-drawer-container"),F(3,"ccf-drawer",0),et(4,"ccf-left-sidebar",1),et(5,"ccf-drawer-toggle-button"),N(),F(6,"ccf-drawer",2),et(7,"ccf-right-sidebar",3),et(8,"ccf-drawer-toggle-button"),N(),F(9,"ccf-drawer-content"),F(10,"div",4),F(11,"ccf-organ-selector",5,6),ye("organsChanged",function(s){return i.model.setOrgan(s[0])}),yn(13,"async"),N(),F(14,"div",7),F(15,"mat-icon",8),ye("click",function(){return i.open=!i.open}),Te(16),N(),N(),N(),et(17,"ccf-content",9),N(),N()),2&t){const r=Ys(12);Y(4),ie("modalClosed",i.registrationStarted)("disableSlider",!(null!=r.selectedOrgans[0]&&r.selectedOrgans[0].hasSex)),Y(3),ie("modalClosed",i.registrationStarted),Y(3),at("closed",!i.open),Y(1),at("closed",!i.open),ie("organList",i.organList)("selectedOrgans",Fg(14,oRe,wn(13,12,i.model.organ$))),Y(5),Os(" ",i.open?"arrow_drop_up":"arrow_drop_down"," "),Y(1),at("expanded-stage",!i.open)}},directives:[ZOe,tIe,cIe,CF,uPe,dPe,jPe,l1,oq,Rs,sRe],pipes:[zu],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;font-size:1rem;color:#000}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer[_ngcontent-%COMP%]{width:25.5rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%]{position:relative;z-index:1}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-organ-selector[_ngcontent-%COMP%]{height:100%;padding-top:.5rem;transition:all .5s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] ccf-organ-selector.closed[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%]{top:0rem;display:flex;flex-direction:column;position:relative;justify-content:center;height:5.688rem;transition:all .5s ease-in-out}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]{width:3rem;height:1.2rem;position:absolute;bottom:0;right:calc(50% - 1.5rem);margin-bottom:-1.2rem;z-index:99;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:#fff;border-bottom-left-radius:.2rem;border-bottom-right-radius:.2rem;transition:.6s}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer[_ngcontent-%COMP%] .expand-collapse-icon[_ngcontent-%COMP%]:hover{background-color:#ececec}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .selector-drawer.closed[_ngcontent-%COMP%]{height:3rem;top:-2.9rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .stage-content[_ngcontent-%COMP%]{border-radius:.5rem!important;height:calc(100% - 2.688rem - 3rem - 1.5rem)}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-drawer-content[_ngcontent-%COMP%] .expanded-stage[_ngcontent-%COMP%]{height:calc(100% - 1.5rem);padding-bottom:1rem}[_nghost-%COMP%] ccf-drawer-container[_ngcontent-%COMP%] ccf-content[_ngcontent-%COMP%]{position:absolute;transition-duration:.5s;transition-timing-function:ease-in-out;transition-property:all;bottom:1.5rem;z-index:1}"],changeDetection:0}),n})();function lRe(n,e){1&n&&et(0,"ccf-root")}let cRe=(()=>{class n extends wOe{constructor(t,i){var r;super(t,i,{initialDelay:500,initialConfig:null!==(r=globalThis.ruiConfig)&&void 0!==r?r:{},parse:{useDownload:EOe.boolean,user:EOe.json,organ:EOe.json,editRegistration:EOe.json,register:EOe.function,cancelRegistration:EOe.function,fetchPreviousRegistrations:EOe.function,skipUnsavedChangesConfirmation:EOe.boolean}})}}return n.\u0275fac=function(t){return new(t||n)(E(Eh),E(Un))},n.\u0275cmp=Le({type:n,selectors:[["ccf-root-wc"]],inputs:{baseHref:"baseHref",useDownload:"useDownload",user:"user",organ:"organ",editRegistration:"editRegistration",register:"register",cancelRegistration:"cancelRegistration",fetchPreviousRegistrations:"fetchPreviousRegistrations",skipUnsavedChangesConfirmation:"skipUnsavedChangesConfirmation"},features:[ht],decls:1,vars:1,consts:[[4,"ngIf"]],template:function(t,i){1&t&&Ct(0,lRe,1,0,"ccf-root",0),2&t&&ie("ngIf",i.initialized)},directives:[Is,aRe],encapsulation:2,changeDetection:0}),n})();const uRe=new _e("Global configuration object");function dRe(n){return n.get("ruiConfig",{user:{firstName:"",lastName:""}})}let hRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:uRe,useFactory:dRe,deps:[cq]}]}),n})(),fRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:pv,useValue:yF.initialize,multi:!0},yF]}),n})(),pRe=(()=>{class n{constructor(t,i){this.accessor=t,this.injector=i}static forRoot(t=[]){return{ngModule:n,providers:[kr,Ra,KG,...t]}}}return n.\u0275fac=function(t){return new(t||n)(I(kr,2),I(Ra,2))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const h1=(n,e)=>((n,e)=>new Array(e+1).join("0"))(0,e-n.toString().length)+n;class _Re{constructor(e,t,i){this.action=e,this.store=t,this.logWriter=i}dispatched(e){const t=ap(this.action),i=function(n){return h1(n.getHours(),2)+":"+h1(n.getMinutes(),2)+":"+h1(n.getSeconds(),2)+"."+h1(n.getMilliseconds(),3)}(new Date);this.logWriter.startGroup(`action ${t} @ ${i}`),this._hasPayload(this.action)&&this.logWriter.logGrey("payload",Object.assign({},this.action)),this.logWriter.logGrey("prev state",e)}completed(e){this.logWriter.logGreen("next state",e),this.logWriter.endGroup()}errored(e){this.logWriter.logRedish("next state after error",this.store.snapshot()),this.logWriter.logRedish("error",e),this.logWriter.endGroup()}_hasPayload(e){return this._getNonEmptyProperties(e).length>0}_getNonEmptyProperties(e){return Object.keys(e).map(r=>e[r]).filter(r=>void 0!==r)}}class yRe{constructor(e){this.options=e,this.options=this.options||{},this.logger=e.logger||console}startGroup(e){const t=this.options.collapsed?this.logger.groupCollapsed:this.logger.group;try{t.call(this.logger,e)}catch(i){console.log(e)}}endGroup(){try{this.logger.groupEnd()}catch(e){this.logger.log("\u2014\u2014 log end \u2014\u2014")}}logGrey(e,t){this.log(e,"color: #9E9E9E; font-weight: bold",t)}logGreen(e,t){this.log(e,"color: #4CAF50; font-weight: bold",t)}logRedish(e,t){this.log(e,"color: #FD8182; font-weight: bold",t)}log(e,t,i){this.isIE()?this.logger.log(e,i):this.logger.log("%c "+e,t,i)}isIE(){const e="undefined"!=typeof window&&window.navigator.userAgent?window.navigator.userAgent:"";let t=!1;const i=e.indexOf("MSIE "),r=e.indexOf("Trident/");return(i>-1||r>-1)&&(t=!0),t}}const Jq=new _e("NGXS_LOGGER_PLUGIN_OPTIONS");let vRe=(()=>{class n{constructor(t,i){this._options=t,this._injector=i}handle(t,i,r){if(this._options.disabled||!this._options.filter(i,t))return r(t,i);this._logWriter=this._logWriter||new yRe(this._options),this._store=this._store||this._injector.get(ph);const s=new _Re(i,this._store,this._logWriter);return s.dispatched(t),r(t,i).pipe(Di(o=>{s.completed(o)}),Sa(o=>{throw s.errored(o),o}))}}return n.\u0275fac=function(t){return new(t||n)(I(Jq),I(Tt))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const e9=new _e("LOGGER_USER_OPTIONS");function bRe(n){return Object.assign({},{logger:console,collapsed:!1,disabled:!1,filter:()=>!0},n)}let CRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:jR,useClass:vRe,multi:!0},{provide:e9,useValue:t},{provide:Jq,useFactory:bRe,deps:[e9]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const SF=new _e("NGXS_STORAGE_PLUGIN_OPTION"),t9=new _e("STORAGE_ENGINE"),MF="@@STATE",n9="NGXS_OPTIONS_META";function wRe(n){return Array.isArray(n)||(n=[n]),n.map(e=>(e.hasOwnProperty(n9)&&(e=e[n9].name),e instanceof class{constructor(e){this.name=e,(function(n){return n.hasOwnProperty(UR)||Object.defineProperty(n,UR,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:()=>({})}}),qR(n)}(this)).makeRootSelector=i=>i.getStateGetter(this.name)}getName(){return this.name}toString(){return`StateToken[${this.name}]`}}?e.getName():e))}function ERe(n){return void 0!==n&&n.key&&(n.key=wRe(n.key)),Object.assign({key:[MF],storage:0,serialize:JSON.stringify,deserialize:JSON.parse,beforeSerialize:e=>e,afterDeserialize:e=>e},n)}function SRe(n,e){return wD(e)?null:0===n.storage?localStorage:1===n.storage?sessionStorage:null}let MRe=(()=>{class n{constructor(t,i,r){this._options=t,this._engine=i,this._platformId=r}handle(t,i,r){if(wD(this._platformId)&&null===this._engine)return r(t,i);const s=this._options.key,o=function(n){const e=ap(n);return function(t){return e===ap(t)}}(i),a=o(c$)||o(u$);let l=!1;if(a)for(const c of s){const d=c===MF;let f=this._engine.getItem(c);if("undefined"!==f&&null!=f){try{const p=this._options.deserialize(f);f=this._options.afterDeserialize(p,c)}catch(p){console.error("Error ocurred while deserializing the store value, falling back to empty object."),f={}}this._options.migrations&&this._options.migrations.forEach(p=>{p.version===Vm(f,p.versionKey||"version")&&(!p.key&&d||p.key===c)&&(f=p.migrate(f),l=!0)}),t=d?Object.assign({},t,f):zR(t,c,f)}}return r(t,i).pipe(Di(c=>{if(!a||a&&l)for(const d of s){let f=c;d!==MF&&(f=Vm(c,d));try{const p=this._options.beforeSerialize(f,d);this._engine.setItem(d,this._options.serialize(p))}catch(p){console.error("Error ocurred while serializing the store value, value not updated.")}}}))}}return n.\u0275fac=function(t){return new(t||n)(I(SF),I(t9),I(cl))},n.\u0275prov=ae({token:n,factory:n.\u0275fac}),n})();const i9=new _e("USER_OPTIONS");let xRe=(()=>{class n{static forRoot(t){return{ngModule:n,providers:[{provide:jR,useClass:MRe,multi:!0},{provide:i9,useValue:t},{provide:SF,useFactory:ERe,deps:[i9]},{provide:t9,useFactory:SRe,deps:[SF,cl]}]}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({}),n})();const r9=[{name:"logo",namespace:"app",url:"assets/icons/logo-rui.svg"},{name:"bladder",namespace:"app",url:"assets/icons/organs/ico-organs-bladder.svg"},{name:"blood",namespace:"app",url:"assets/icons/organs/ico-organs-blood.svg"},{name:"bone-marrow",namespace:"app",url:"assets/icons/organs/ico-organs-bone-marrow.svg"},{name:"brain",namespace:"app",url:"assets/icons/organs/ico-organs-brain.svg"},{name:"eye",namespace:"app",url:"assets/icons/organs/ico-organs-eye.svg"},{name:"fallopian-tube-left",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-left.svg"},{name:"fallopian-tube-right",namespace:"app",url:"assets/icons/organs/ico-organs-fallopian-tube-right.svg"},{name:"heart",namespace:"app",url:"assets/icons/organs/ico-organs-heart.svg"},{name:"kidney-left",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-left.svg"},{name:"kidney-right",namespace:"app",url:"assets/icons/organs/ico-organs-kidney-right.svg"},{name:"kidney",namespace:"app",url:"assets/icons/organs/ico-organs-kidney.svg"},{name:"knee",namespace:"app",url:"assets/icons/organs/ico-organs-knee.svg"},{name:"large-intestine",namespace:"app",url:"assets/icons/organs/ico-organs-large-intestine.svg"},{name:"liver",namespace:"app",url:"assets/icons/organs/ico-organs-liver.svg"},{name:"lung-left",namespace:"app",url:"assets/icons/organs/ico-organs-lung-left.svg"},{name:"lung-right",namespace:"app",url:"assets/icons/organs/ico-organs-lung-right.svg"},{name:"lung",namespace:"app",url:"assets/icons/organs/ico-organs-lung.svg"},{name:"lymph-nodes",namespace:"app",url:"assets/icons/organs/ico-organs-lymph-nodes.svg"},{name:"neuron",namespace:"app",url:"assets/icons/organs/ico-organs-neuron.svg"},{name:"ovaries",namespace:"app",url:"assets/icons/organs/ico-organs-ovaries.svg"},{name:"ovary-left",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-left.svg"},{name:"ovary-right",namespace:"app",url:"assets/icons/organs/ico-organs-ovary-right.svg"},{name:"pancreas",namespace:"app",url:"assets/icons/organs/ico-organs-pancreas.svg"},{name:"pelvis-f",namespace:"app",url:"assets/icons/organs/ico-organs-pelvis-f.svg"},{name:"prostate",namespace:"app",url:"assets/icons/organs/ico-organs-prostate.svg"},{name:"skin",namespace:"app",url:"assets/icons/organs/ico-organs-skin.svg"},{name:"small-intestine",namespace:"app",url:"assets/icons/organs/ico-organs-small intestine.svg"},{name:"spleen",namespace:"app",url:"assets/icons/organs/ico-organs-spleen.svg"},{name:"stomach",namespace:"app",url:"assets/icons/organs/ico-organs-stomach.svg"},{name:"thymus",namespace:"app",url:"assets/icons/organs/ico-organs-thymus.svg"},{name:"ureter-left",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-left.svg"},{name:"ureter-right",namespace:"app",url:"assets/icons/organs/ico-organs-ureter-right.svg"},{name:"uterus",namespace:"app",url:"assets/icons/organs/ico-organs-uterus.svg"},{name:"vasculature-thick",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thick.svg"},{name:"vasculature-thin",namespace:"app",url:"assets/icons/organs/ico-organs-vasculature-thin.svg"},{name:"opacity",namespace:"app",url:"assets/icons/opacity-24px.svg"},{name:"visibility_on",namespace:"app",url:"assets/icons/visibility-on-24px.svg"},{name:"visibility_off",namespace:"app",url:"assets/icons/visibility-off-24px.svg"},{name:"visibility_off_cube",namespace:"app",url:"assets/icons/ico-cube.svg"}];let ld=class extends rTe{constructor(e,t,i){super(),this.registry=e,this.sanitizer=t,this.globalConfig=i}ngxsOnInit(){var e;r9.filter(t=>void 0!==t.html).map(t=>Object.assign(Object.assign({},t),{html:this.sanitizer.bypassSecurityTrustHtml(t.html)})).forEach(t=>this.registerIconImpl(t)),null===(e=this.registry)||void 0===e||e.addSvgIconResolver((t,i)=>{var r;const s=r9.find(a=>{var l,c;return(null!==(l=a.name)&&void 0!==l?l:"")===t&&(null!==(c=a.namespace)&&void 0!==c?c:"")===i});if(void 0===s||void 0===s.url)return null;const o=null!==(r=this.globalConfig.snapshot.baseHref)&&void 0!==r?r:"";return this.sanitizer.bypassSecurityTrustResourceUrl(o+s.url)})}registerIcon(e){return this.registerIconImpl(e)}registerIconImpl(e){if(!this.registry||!e.url&&!e.html)return!1;const t=this.registry,r=t[this.getMethodName(e)],s=this.getArguments(e);if(!r)return!1;try{return r.apply(t,s),!0}catch(o){return!1}}getMethodName({name:e,namespace:t,url:i}){const r=["addSvgIcon"];return e||r.push("Set"),i||r.push("Literal"),t&&r.push("InNamespace"),r.join("")}getArguments({name:e,namespace:t,url:i,html:r}){return[t,e,null!=i?i:r].filter(o=>!!o)}};ld.\u0275fac=function(e){return new(e||ld)(I(jv,8),I(Kd),I(Eh))},ld.\u0275prov=ae({token:ld,factory:ld.\u0275fac}),De([Xt()],ld.prototype,"registerIcon",null),ld=De([Ch(),gh({name:"iconRegistry"})],ld);const TRe=[Eh,ld,Ui,si,Io,dc,wr,ss];let ARe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[pRe.forRoot(),ia.forRoot(TRe,{developmentMode:!Sh.production}),xRe.forRoot({key:["registration.registrations"]}),CRe.forRoot({disabled:Sh.production})]]}),n})(),DRe=(()=>{class n{constructor(t){if(t)throw new Error("The core module should only be imported once in the root module")}}return n.\u0275fac=function(t){return new(t||n)(I(n,12))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[nU,DDe.forRoot({gaToken:Sh.googleAnalyticsToken,appName:"rui"}),dOe,hRe,ARe,fRe]]}),n})(),xF=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,vq]]}),n})(),ORe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,KPe,Lq,Pr,EF,xF,uc]]}),n})(),IRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr]]}),n})(),PRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,ORe,Pr,jDe,IRe,ec,PDe]]}),n})(),RRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,uc]]}),n})(),kRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn]]}),n})(),FRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Lq]]}),n})(),s9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,vq,$b,yk,vk,uc]]}),n})(),NRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,ec,lq]]}),n})(),o9=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,Iq]]}),n})(),LRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf]]}),n})(),BRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Ok,Pr,uc,EF,kRe,xF,s9,o9,FRe,lq,NRe,o9,LRe]]}),n})(),VRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Gf,uc,s9,xF,aq]]}),n})(),jRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,VRe]]}),n})(),URe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,$b,Pr,ec,uc]]}),n})(),zRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Pr,SG,ec,uc]]}),n})(),HRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,$b,Pr,ec,uc,aOe]]}),n})(),$Re=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Iq,Pr]]}),n})(),GRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,yk,vk,Gf,TPe,Lv,Pr,$b]]}),n})(),WRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Tk,Pr,Gf]]}),n})(),qRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,WRe,Gf,uc]]}),n})(),YRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({imports:[[bn,Ok,EF,Pr,bO,uc,URe,qRe,zRe,HRe,$Re,GRe,sOe]]}),n})(),XRe=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:Cq,useValue:bq}],imports:[[dE,bO,Pr]]}),n})(),KRe=(()=>{class n{constructor(t){this.injector=t}ngDoBootstrap(){const t=function(n,e){const t=function(n,e){return e.get(ol).resolveComponentFactory(n).inputs}(n,e.injector),i=e.strategyFactory||new Ote(n,e.injector),r=function(n){const e={};return n.forEach(({propName:t,templateName:i})=>{e[function(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}(i)]=t}),e}(t);class s extends Pte{constructor(a){super(),this.injector=a}get ngElementStrategy(){if(!this._ngElementStrategy){const a=this._ngElementStrategy=i.create(this.injector||e.injector);t.forEach(({propName:l})=>{if(!this.hasOwnProperty(l))return;const c=this[l];delete this[l],a.setInputValue(l,c)})}return this._ngElementStrategy}attributeChangedCallback(a,l,c,d){this.ngElementStrategy.setInputValue(r[a],c)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{const l=function(n,e,t){if("function"!=typeof CustomEvent){const s=n.createEvent("CustomEvent");return s.initCustomEvent(e,!1,!1,t),s}return new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t})}(this.ownerDocument,a.name,a.value);this.dispatchEvent(l)})}}return s.observedAttributes=Object.keys(r),t.forEach(({propName:o})=>{Object.defineProperty(s.prototype,o,{get(){return this.ngElementStrategy.getInputValue(o)},set(a){this.ngElementStrategy.setInputValue(o,a)},configurable:!0,enumerable:!0})}),s}(cRe,{injector:this.injector});customElements.define("ccf-rui",t)}}return n.\u0275fac=function(t){return new(t||n)(I(Tt))},n.\u0275mod=xe({type:n}),n.\u0275inj=Ee({providers:[{provide:mq,useValue:"light-theme"},{provide:zj,useValue:{appearance:"standard",floatLabel:!1,hideRequiredMarker:!0}}],imports:[[dE,bO,DRe,Pr,XRe,RRe,PRe,BRe,YRe,aq,jRe,gOe,UU]]}),n})();Sh.production&&function(){if(DB)throw new Error("Cannot enable prod mode after platform setup.");AB=!1}(),Jee().bootstrapModule(KRe).catch(n=>console.error(n))},948:pt=>{pt.exports=function(Ve){return Ve&&Ve.__esModule?Ve:{default:Ve}},pt.exports.default=pt.exports,pt.exports.__esModule=!0},321:pt=>{function We(Ve){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(pt.exports=We=function(k){return typeof k},pt.exports.default=pt.exports,pt.exports.__esModule=!0):(pt.exports=We=function(k){return k&&"function"==typeof Symbol&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},pt.exports.default=pt.exports,pt.exports.__esModule=!0),We(Ve)}pt.exports=We,pt.exports.default=pt.exports,pt.exports.__esModule=!0},833:pt=>{function We(Ve){return Promise.resolve().then(()=>{var _t=new Error("Cannot find module '"+Ve+"'");throw _t.code="MODULE_NOT_FOUND",_t})}We.keys=()=>[],We.resolve=We,We.id=833,pt.exports=We},521:()=>{},125:()=>{},307:()=>{}},pt=>{pt(pt.s=473)}]); \ No newline at end of file